Another Pedantic Idiot

Now with Virtue Signalling

Democratized Energy

Please join me in an illustrative example of Dunning-Kruger as I propose a solution for the looming threats of climate change and wealth inequality as it relates to electricity generation in the United States.

In the age of automation the only just system is one in which energy distribution is democratized.  Energy is the new vote and voice of the people.

What does that mean — democratized energy? In short, it suggests a system where energy required to power the automation, robots and computation is distributed based on the will of the people.  In this way the labor efficiencies gained from these technologies can be more reasonably returned to the people.  That is the entire point of technology,  to make people’s lives better.  Ideally this would be everyone, not just a small percentage at the top of the economic hierarchy.

Climate change and wealth inequality are arguably the two largest issues of our time, and I believe they are closely related. Wealthy corporations employ technology and automation powered by  cheap and dirty carbon emitting energy.  Generally their profits are reinvested back into the company, to develop greater technologies or to scale into new markets, thus demanding a greater amount of energy.  This pursuit is fueled by a debt based currency that demands continuous growth.

Taken as a whole it is hard not to see it as dystopian nightmare, where the wealthy pilfer and enslave most of humanity while simultaneously destroying the planet.  One would have a difficult time concocting a more insidious plan.

Whoever controls energy, controls productivity, quality of life, and the fate of future generations.  Technocrats are placing a large gamble on a future breakthrough saving us from having to pay the mountain of carbon debt. I for one love the Kurzweil Kool-Aid, but I believe there are some strategies we can consider for making the world a more equitable place in the meantime.

An Overview of Energy in the United States

For this discussion we will consider two modes of carbon emission: first, electricity generation and second, as a byproduct of industry.   For brevity, let us accept the Carbon Tax put forth by over 3000 economists as a solution for industry emissions, and focus on electricity generation emissions only.

The Lawrencee Livermore National Laboratory flowchart gives us a clear way to visualize the distribution of energy in the United States and illustrates how  the 97.7 Quads of energy are consumed annually in the US during 2017. 97.7 Quads converted to a more familiar unit is 28.6 trillion kWh.  From that 3.67 trillion kWh was converted into useful energy and residential customers consuming on average 10,399 kWh in 2017.  Following from that according to the U.S. Energy Information Administration, the per capita is around 4,478 kWh.

Energy_US_2017

In 2018 the U.S. Energy Administration listed the following energy distribution:

Fossil fuels 63.5%
Nuclear 19.3%
Renewables 17.1%

Energy as Currency

High Level Proposal

  1. State governments account for energy production from each source
  2. Government earmarks energy required for its function, preferring green energy sources, this includes education, healthcare, transportation and all other social programs.
  3. Remaining energy  is distributed to citizens, cost is paid for by government, with price controls instituted
  4. Excess energy after citizen distribution may be purchased by private entities which will pay a carbon tax
  5. Private entities compete for citizens delegation of energy via bids
  6. Private entities may  build and develop green energy, a percentage of energy produced from these goes to government pool for: (2) and (3)

Carbon Energy Consumption Tax

Our society requires electricity to function so we must not impose limits on electricity generation.  Instead, consuming electricity from carbon emitting sources should be accompanied with a tax paid for by the consumer. A portion of the revenue from this tax should contribute to developing green energy solutions.  In this way consuming green energy becomes an economic incentive to avoid the tax.  Charging the consumer for carbon emitting energy is an important distinction from charging the energy producer as we will see below.

Green energy producers may increase their rates to be comparable to the taxed price of carbon energy producers.  With this larger profit margin, green energy would have access to greater opportunities for growth.

Energy Universal Basic Income

Energy is a unit of democracy.

Citizens should not buried under a mountain of energy debt during a transition to an energy currency. To protect all citizens, especially the most vulnerable, an energy basic income (UBI) is recommended.  Energy UBI empowers citizens by democratizing how energy is distributed.  This is accomplished by granting each citizen a 1,000 kWh stipend per month.   The stipend is a use it or lose it resource (as it is energy). Initially, this energy will be sourced from both green and carbon energy.  An important note is that this stipend is not a ration or a cap.  Energy consumers would still be able to obtain energy beyond this point, but may be subject to the carbon tax.

The citizen’s energy stipend is a continuous supply, and cannot be accumulated or formulated to draw interest, it is not a fiat currency. As a result inflation of the U.S. Dollar may occur during the transition to energy credits. In order to protect citizens from such an inflation, a set of material commodities will be use to supplement the energy UBI.  The commodities used to supplement the energy stipend are economic pegs, and include means to achieve basic nutrition with a low carbon footprint.

Pegs might be milk and potatoes.  In today’s prices this may account for $200 USD/Month.  So the total allocation per individual would be 1000kWh + $200.  These pegs would likely represent average or a percentile cost in order to encourage citizens to live closer to food production and further decrease carbon footprint of food transportation.  The true dollar cost of the peg can be can be calculated using a simple formula accounting for the energy required to produce the good or service plus the carbon footprint plus wages in human labor.  Pegs would be simply instituted by paying the producers of the peg in energy credits from the government’s pool of energy.

Over time companies and institutions will encounter increasing carbon energy taxes, and there will be a limited supply of green energy initially.   Energy UBI recipients may choose to lease a portion of their energy stipends to companies.  Citizens choose where energy may be allocated, and they set the price of that energy.  This capability allows them to form powerful unions and blocs to direct energy towards institutions and efforts that have their best interest in mind.

Infrastructure

As a result of this transition it may be the case that energy brokers will form to deal in the bundling of individual energy leases to sell to private entities.  This will create another private sector similar to today’s home loan businesses.  To prevent corruption and protect the citizens, it is advisable that a government agency be created to act in the broker role.

Critical infrastructure would not be subject to carbon energy surcharges.  These would need to be defined more completely, but would likely include most government agencies, hospitals schools etc.  To maximize green energy consumption these institutions should prefer to consume green energy first.

Practical Example

NOTE: The current average cost of electrical energy in the US is around $.02/kWh

energy-ubi

Simple illustration of energy distribution.  Note: the private company is receiving 5,000 kWh as they are getting energy from multiple citizens and purchasing directly from the plant.

The government has set a price control on carbon emitting energy at $.05/kWh,  and instituted a carbon emitting energy consumption tax of $2.50, ultimately costing $2.55/kWh.  Consequentially, green energy producers can set their price below this price and sell to companies or they can direct their green energy to their partners at a reduced rate to encourage growth.

Meanwhile, Bob Everyman does his best to conserve energy and has estimated he has 200kWh to spare.  So he notifies an energy broker that he is willing to lease 200kWh with a minimum bid of $2.00/kWh.  Companies can then bid on this 200kWh block that will likely be consolidated by the broker as a larger package.  Bob secures a price of $2.20/kWh and is paid $440/month while his energy lease is active.  Alternatively, Bob could sell his energy shares directly to a company, another individual, or donate them to a charity or non-profit.

Tax revenues are directed to providing the UBI commodity pegs to citizens and expanding the green energy infrastructure, thereby reducing the overall energy cost.  As more green energy comes online that electricity will be first directed towards the citizens UBI, and public needs.  Ultimately the citizens’ decisions  regarding the energy distribution will determine which institutions and businesses are successful.

Conclusion

The U.S. Dollar as a fiat currency is insufficient for tackling today’s growing problems of wealth inequality and climate change.  It is based on an obsolete and dangerous philosophy of infinite growth.  Energy on the electric grid is finite, objectively measurable, and a requirement for today’s automation and technology to function.  It is clear that energy should be directed by the will of the people, and not consumed indiscriminately by the powerful if we are to live in a sustainable and just world.

The Happiness Reaction

Thermodynamic Utilitarianism

Happiness Requires energy in that it is required to reduce the entropy of internal systems.  This is not to say we ought to value happiness, only that if we do so we should understand and recognize happiness as a physical phenomenon and how it relates to energy and the physical world.

The underlying thought of this ethics is to provide a physical description of hedonistic utilitarianism using thermodynamics, specifically  by describing the relationship between happiness and Gibbs free energy.  Many utilitarian philosophies focus entirely on defining the value of happiness, following in the tradition of Mill when he initially wrote about Utilitarianism and the virtue of actions in that system. Rather than wade down that familiar path, we will navigate towards a more quantitative analysis of energy and its relationship with happiness in conscious agents and assign value to actions only insofar as the agents experience happiness as a result. In this regard we stay rooted to the underlying concept of consequentialism in this discussion.

This is not an attempt to to define an objective morality. I believe this is a pitfall that humans often fall into, and requires placing axiomatic flags in the ground that have difficulty standing on empirical science. Sam Harris attempts this with the Moral Landscape. We share the same values for a moral philosophy, but I will steer clear of making specific claims on what is a good versus an evil action.  Instead this discussion attempts to describe the physical properties of a utilitarian ethics, specifically by outlining happiness’s place in  thermodynamic systems.

The primary goal of this is to work towards a more fair and equitable world that enables more people to be happy. We already understand that knowledge represented as culture and technology contribute to our ability to enable more people to be happy simultaneously. The complexity of these systems is inextricably dependent on the energy requirements of those systems. This fact already begins to elude to some of the properties of this physical system of happiness – namely the role information and entropy play in scaling out the happiness potential in an environment.

The first task will be to show that happiness in individual agents is a endergonic reaction.  In conjunction with showing how energy is transformed into happiness within agents we will also discuss how increasing the total number of happy agents within the world also increases happiness, as well as requires additional energy.

Assumptions

There are a few working assumptions to begin with.

  1. Reject the panpsychism.  Consciousness does not exist at all levels of matter and energy, instead it is an emergent phenomenon in complex information systems.
  2. Consciousness requires the formation and persistence of historical records i.e. memories.
  3. Happiness requires consciousness.
  4. Conscious agents can report their true happiness/suffering (no deception).
  5. It is a fact that conscious agents have at least one subjective conscious experience, an ontological claim. Ignore solipsism and the concept of p-zombies.  We will assume that conscious agents in this world are actually conscious and not just reporting to be conscious.
  6. It is a fact that individual subjective experiences are to some degree either pleasant or unpleasant (even on the most minuscule level).
  7. Causal determinism is true, given the same initial conditions the world will play out exactly the same in any number of replays.

A Brief Review

Gibbs Free Energy

Gibbs free energy is the change in enthalpy (heat) minus the temperature times the change in entropy:

ΔG = ΔH – TΔS

To illustrate this we can see the chart below, illustrating how energy is stored in products of endergonic reactions and energy is released in exorgonic reactions.

d5b999fb65f5902a61d25e1c466060c35e8db6da

Example of Endergonic reactions (ΔG is positive)

  1. Photosynthesis.  Energy is input into the system as electromagnetic radiation and one product is glucose, energy stored within the molecule.
  2. Metabolism of ATP energy used by our bodies to power mechanical work of our muscles and other functions.

Example of Exergonic (ΔG is negative)

  1. Nuclear fusion of elements lighter than iron (Fe).  The high temperature causes energy to be released when atoms lighter than iron undergo nuclear fusion.  (High temperature results in larger kinetic energies that allow fusion to occur; the fusion of two atoms into a single one decreasing entropy)
  2. A ball rolling down a hill.  The ball has potential kinetic energy, afterwards the ball has converted this to kinetic energy through gravitational force by rolling down the hill.  The ball at the end of the reaction is in a lower energy state.

Mills Utilitarianism

We should discuss briefly some major points from Mills philosophy of Utility in defining the quality of pleasures based on preference. Specifically I’ll respond to a set of ideas from his defining chapter in Utilitarianism.

The comparison of the Epicurean life to that of beasts is felt as degrading, precisely because a beast’s pleasures do not satisfy a human being’s conceptions of happiness. Human beings have faculties more elevated than the animal appetites and, when once made conscious of them, do not regard anything as happiness which does not include their gratification.

He later goes on to continue these thoughts.

Now it is an unquestionable fact that those who are equally acquainted with and equally capable of appreciating and enjoying both [types of pleasures] do give a most marked preference to the manner of existence which employs their higher facilities.

Mill sets up a framework for explaining how the ‘higher’ pleasures should be preferred.  Further along in that chapter he stresses the importance of cultivating ‘nobleness of character’ in nearly in altruistic sense such that only happiness could be achieve from the noble actions from others and the self awareness that one would have of being noble.

Finally Mill defines the ultimate goal of the philosophy:

…the ultimate end…is an existence exempt as far as possible from pain, and as rich as possible in enjoyments, both in point of quantity and quality; the test of quality and the rule of measuring it against quantity being the preference felt by those who, in their opportunities of experience, to which must be added their habits of self-consciousness and self -observation, are best furnished with the means of comparison.

I’ll briefly use a some characters from contemporary fiction to illustrate hypothetical scenarios that begin to define some alternative views of this rule Mill outlines.  Before that however, we must challenge the idea that people can be ‘equally capable’ and ‘equally acquainted’ with understanding the subjective experience of another person.

Consider for a moment Forrest Gump, and Hannibal Lecter.  One is capable of enjoying the highest pleasures possible, the other is a simple minded man.  However they work that they each produce on their respective environments is profoundly different – that is to say the manner in which they dissipate heat and decrease modify entropy within their environment results in significantly different happiness deltas within the system.  However, the manner in which they experience these actions, one would imagine, varies significantly.  From Mill’s qualification of pleasures outlined above, the greatest Utility would lie with Hannibal insofar as “no intelligent human being would consent to become a fool, no instructed person would be an ignoramus”.  Someone familiar with these characters would also recognize that Mr. Gump is much more noble in his selflessness so it appears these characters would represent a conundrum.

The Happiness Reaction

Happiness requires energy because conscious agents require energy. This is an intuitive claim and an easily demonstrable fact.  After all you need food (i.e. energy) to live, you need to live to be conscious and you need to be conscious to be happy.

happinessscale

An increase in happiness requires energy – this is also a fact.  The Gibbs free energy equation illustrates this process.  A system with a single living agent requires energy to become a system with two living agents.   The energy is required because the internal entropy in the system must be decreased, assuming constant temperature and pressure this means we would need to add energy to the system.  Per utilitarianism and the Greatest Happiness Principle, a world with two happy agents is preferable to a world with a single happy agent.  Therefore it follows that happiness requires energy.

Consciousness itself also requires energy.  Consciousness is dependent on the formation of memories. Memories requires storing information, and again this is a process which reduces the entropy in the system (in the form of structured information).  The animation below roughly illustrates this reaction.  Ultimately it is our local star’s exorgonic process of nuclear fusion that provides the necessary driving free energy for our system which allows consciousness to produce happiness.

Here we see entropy in some portion of the internal system decrease, as well as heat dissipated into the environment through work that is done.  Total energy here represents all energy that has entered into the system (this illustrates that there is an energy input into the system from an external source, not that we are violating the conservation of energy).

reaction

Contemporary Thoughts on Energy and Happiness

First let’s establish what a living agent looks like from an energy perspective.  This is a concept that has already been explored by biochemists and physicists, and recently gained more mainstream popularity with Jeremy England’s work at MIT [7].  Essentially a living agent takes in energy from its environment, uses the energy to reconfigure itself and outputs energy into its environment in the form of heat dissipation e.g. kinetic work etc.  Professor England suggests an interesting possibility,  specifically that more effective use of energy and reconfiguration subsequent reconfiguration towards that goal are the underlying driving mechanism for natural selection.

Following England’s thesis to its ultimate conclusion I believe we would arrive at a living system similar to one of Bostrom’s runaway AI [2].  A system with the primary goal of expanding its ability to expand its ability, in effect the ‘computronium’ generating AI.  Simply this super organism would use all energy and matter at its disposal to create an ever increasing amount of computational power, and with that additional power unlock new ways of efficiently organizing and acquiring said matter in energy.  A system that scales with both the amount of material and energy available to it and also with the complexity of the system.

I believe as a model this is a good view of how scientific progress is made in a maximally efficient way.  It somewhat illustrates how technological development has occurred in the past and the doors it opens for future technological development suggesting Kurzweil’s exponential technology theories.  What it misses is any description of subjectively happy qualia which is central to the utilitarian ethics we are discussing here.  This super-AI may not even be conscious, let alone happy.

Bostrom again touches on this when he discusses ‘hedonium’.  He borrows from the language of utilitarianism when he imagines an AI whose sole purpose is to create agents that are in the greatest happiness.  He calls this material hedonium.  Imagine the state of first time opioid use, or the joy of holding a newborn, or having a transcendent spiritual experience etc. The hedonium super AI creates agents in this perpetual state. This takes us one step closer towards a system capable of the greatest happiness, and perhaps by simply combining the two: computronium focused on progress, and hedonium focused on pleasant qualia, we arrive an energy ethics that is closer to describing an ideal utilitarianism from an energy perspective.

Conscious Agents and the Qualia Reaction

The central unit of our quantitative analysis of energy ethics is the novel notion of a Qualia Reaction (Q).  We can model it using the diagram below.  In additional to the thermodynamic reaction that occurs between two states in a living agent we now have the notion of qualia production.  The qualia is the phenomenological experience of this thermodynamic reaction within the conscious agent.  With causal determinism we can say a specific thermodynamic reaction within an agent will always produce exactly the same qualia. That is to say if we replay the reaction an infinite number of times it will always produce the same qualia.  As an important aside, we should not attempt to qualify these qualia as good or bad objectively, only label them based on how the agent reports them. This is an important distinction that allows us to circumvent many of the rat-holes that accompany moral absolutism as far as qualia is concerned.

Consider the illustration below.  Energy enters the system and transforms the agent from configuration state C1 to configuration state C2.  As a result some energy is output in the from of mechanical work/heat and the agent experiences a subjective qualia.  Over the course of this reaction some portion of the agent will decrease in entropy with the formation of memories.

qualiareaction

Qualia Reaction

The qualia space would be specific to each agent based on their preferences.  The set of qualia can be ordered on a line ordered from most suffering to most happy. Along this line exists a point where the qualia changes from a little suffering to a little happy, we can call this point Q0.  We can now say we prefer worlds where at all times all agents have qualia reactions greater than Q0.

qualiaspace

Qualia Space

Sample Qualia for Bob Sample Qualia for Alice
QA) Burning within the Brazen Bull
QB) Experiencing the Flu
QC) Inheriting fortune from deceased relative
QD) Helping old lady across the street
QE) Paying his taxes
QA) Paying her taxes
QB) Walking in the sunlight
QC) Cleaning the curtains
QD) Murdering Bob by Brazen Bull
QE) Stealing candy from baby

A quick check will show us we have not projected our own personal moral biases onto these qualia. You may have already begun down the road of casting these imaginary characters into good or evil roles.  Consider the qualia of a psychopathic killer, Alice as she is murdering her victim.  We can imagine this is a pleasant and happy qualia for our murderess (QD). This instance would fall in the good spectrum of qualia reactions.  However the consequences of the ‘work’ energy output into the environment will also play a role as we will see below.  In this case it is likely this work energy would result in a decrease in the rate of happy qualia reactions as Bob would not longer be able to experience the incredible joy of paying his taxes.

One important aside is necessary to elucidate the granularity of these qualia.  They may be very small moments in time.  For example Bob could have a very pleasant transcendent spiritual experience at some point while being cooked alive in the bull.

The second important aspect is how we distinguish the set of work that is output into the environment from these qualia reactions.  For simplicity this set can be divided into two groups.  The first group is that work that arranges the environment in a way that produces these happy qualia reactions at a higher rate.  The second group is the inverse, where the work organizes the environment that decreases the rate of happiness reactions.

This is where we can present a challenge to Mill’s argument for the quality of pleasures.  From an act utilitarian perspective the preferred qualia reactions will be those that perform work on the environment that increase the rate of reactions that are greater than Q0 within the environment as well as producing an internal qualia with value greater than Q0.  In simpler terms ‘feel good while doing good’.

Applications

How can this abstract model be applied to the real world? There are a few functions this ethics would provide within our society.  Simply providing visibility into this happy qualia rate would be a good start.  Knowledge of where we are would provide a direction we could drive towards, in one analogy this may be the geological survey to Harris’s Moral Landscape.  It would provide us a means to engineer society into a more happy one without being biased towards our own cultural, historical or personal moral prejudices and biases.

Central to this application is the recognition in the importance of energy equity.  The concept of energy equity is not a new one and was discussed at length in “The Ethics of Energy: A Framework for Action” [10]. That report also goes into detail in explaining the pivotal role technology plays in determining how effectively and efficiently we act on available free energy.

 

spcialprogressindexvsenerginoilperday2

Source:[11],[12]

The Ethics of Energy report makes a poignant statement that fits into our observations that energy is tied closely to human prosperity and ultimately happiness.  One which we can observe from empirical data today in the figure above [10].

…the number one priority in sustainable energy development today for decision-makers in all countries is to extend access to commercial energy services to the people who do not now have it and to those who will come into the world in the next two decades, largely in developing countries.  Otherwise, their opportunity for education, good health and individual dignity will be in doubt.  Meeting the requirements of these people well be the first test of the sustainability of the world’s energy development path.

Final Thoughts

I’d like to briefly return to the primary claim made by Sam Harris in The Moral Landscape.

My claim is that there are right and wrong answers to moral questions, just as there are right and wrong answers to questions of physics and such answers may fall within the reach of the maturing sciences of the mind.

My own personal set of subjective preferences agrees with this line of reasoning,  however it seems to me science does not provide right and wrong answers inasmuch as it provides a means of describing the world.  Is there a distinction?  I believe so.  Scientific statements are not immutable and therefore cannot be right or wrong, but merely provide models that comport to the available facts to a lesser or more degree.  So it seems a better goal of science’s role in morality would be to describe moral systems physically and not make value judgments of those systems or the interactions within those systems.  In this way we again avoid stating how we ought to behave, and instead simply describe the worlds current happiness state and predict future states based on physical phenomenon, similar to how we would plan a rocket trajectory for a moon approach or any other physically understood endeavor.

If you are still not convinced of the relationship between energy and happiness let me present you with a hypothetical scenario.  Imagine a very capable and effective, for lack of a better word, ‘super villain’ who decides to make claim to 99% of the sun’s energy.  He sets about creating an array of satellites at a distance between the earth and the sun which will effectively capture and block the sun’s energy.  Consider now the impact this would have on anyone who wasn’t willing to pay the price he set on solar energy.  Sure for awhile many people could rely on available free energy sources and the small amount of non-solar energy such as wind, geothermal and tidal as well as previously captured sun energy in the form of fossil fuels.  Disrupting the flow of the sun’s energy to the planet would likely disrupt these other means of capturing energy as well.  The earth would freeze, flora and fauna across the globe would go extinct, billions of people would die, most would suffer.  Obviously this is an extreme example, but I would invite you to think of an alternative outcome given that set of circumstances. This hypothetical drives to the central point of a utilitarianism based on thermodynamics, that free energy cannot be claimed by any one party or individual. An efficient and optimal arrangement of happy conscious beings likely requires a system of energy equity.

References

[1] Formalizing Preference Utilitariansism in Physcical World Models. Caspar Oesterheld. Springlink.com 2015

[2] Superintelligence. Nick Bostrom.

[3] Infinity Ethics. Nick Bostrom.

[4] Utilitarianism. John Stuart Mill.

[5] The Moral Landscape. Sam Harris.

[6] A New Physics Theory of Life. Natalie Wolchover, 2014. quantamagazine.org

[7] Statistical Physics of Self-Replication. Jeremy England, 2013.

[8] Social Thermodynamics, Social Hydrodynamics and Some Mathematical Applications in Social Sciences.  Yi-Fang Chang. 2013.

[9] Ethical Aspects of Access to and Use of Energy

[10] The Ethics of Energy: A Framework for Action.  James Peter Kimmins UNESCO. 2001

[11] World Development Indicators. The World Bank 2016

[12] Energy Use Per Capita. The World Bank 2016

What’s Killing You?

CDC Mortality Analysis (2013)

The data below is compiled from the CDC Wonder database on mortality rates for 2013.  The two charts immediately below show how our population is distributed across age groups in the measurement, as well as how death rate percentage increases exponentially as the population grows older.  Please keep this in mind when reviewing the graphs below.

The exponential increase in death rate means that the causes of death that occur in the older ages account for a higher number of total deaths.

The ‘Other’ group on the chart below consists of a collection of individually low rate causes, that are not included in the other categories.  The largest portion of this group is Septicaemia, bacterial infection in the blood.  This group also accounts for congenital birth defects, which explains is high measurement in the infants age group.

deathpercentagepopulation

What is Killing Us?

stackeddeath

What is killing us as infants?

deathinfant

Specific deaths categorized as ‘other’ during first year

otherinfant

What is killing us as children?

deathchild

Specific deaths categorized as ‘other’ during childhood

otherchild

What is killing us as young adults?

deathyoung

Specific deaths categorized as ‘other’ during young adult

otheryoung

What is killing us in our prime?

deathprime

Specific deaths categorized as ‘other’ during prime

otherprime

What is killing us in middle age?

deathmiddleage

Specific deaths categorized as ‘other’ during middle age

othermiddle

What is killing us in our golden years?

deathgolden

Specific deaths categorized as ‘other’ during golden years

othergolden

What is dying of ‘old age’?

deathelder

Specific deaths categorized as ‘other’ during old age

otherold

Murder and Suicide

intentional

Gun Violence

gun

Top Ranked Specific Deaths

top15

Impact for the Future

The data above suggests there are a few areas where we can make a big impact to improving the lives of American citizens.  First, one of our main concerns should be making vehicles more safe as it is the top ranking cause of death across age groups.  Second we should consider the mental health our youth which appear to be susceptible to high rates of suicide and drug overdoses. Additionally the gun violence issue should be addressed, as this is a primary means of suicide or homicide.

Medical research and development can continue to increase life expectancy and quality of life.  One major area for improvement is reducing the deaths caused by treatable and well understood illnesses and diseases, such as Septicaemia.  This may be done with more cost effective and accessible means of diagnosis and affordable treatments.

 

Teleportation and Resurrection

Is bodily resurrection possible?  Surely a strong atheist cannot entertain such an outlandish and wishful thought such as life after death.  Read below to follow me through the maze of existential crisis as I wrestle with this possibility, and the unforeseen consequences of a teleportation and our consciousness.

Assumptions

I typically like to begin with a few assumptions I’m making.  That way you can check out early or continue on with an open mind.

Our Identity is a stream of Consciousness. I am making an assumption that our stream of subjective consciousness is what makes us, well us.  It is not the in individual atoms but rather an information pattern over time.  Hypothetically if we snapshot that pattern at a given time we have effectively captured ourselves in that moment in an eternal timeless frame.

No Mind Body Dualism.  I do not believe in a soul or that the conscious mind is separate from the physical body i.e. the brain.  I believe consciousness is a process of the brain, remove the brain and remove consciousness.

Limits to subjective conscious experience. There are limits on the time fidelity to which we can consciously experience.  Phenomena which fall below this subjective threshold are equivalent to the individual as them not have occurring at all within the world.  E.g. the tree that falls in the wood, never happened from the subjective viewpoint of the conscious observer if they did not sense it.  An extreme example involves the impact a super nova in another galaxy that is happening right now has zero impact on my subjective experience in the present moment.  I’m willing to concede there may be some quantum entanglement with my consciousness with that far away phenomenon but will dismiss that idea for the sake of this discussion.

Limits of Consciousness

To begin let’s discuss the nature of the limits of consciousness.  Originally when I began this thought experiment I was making an assumption that we experience the world subconsciously in chunks, which would comport with my conclusions even more.  In spite of some scientific studies theorizing discrete chunked time processing (imagine our brain processing sensory data in 20ms intervals), I now believe there is no specific mechanism preventing us from experiencing time in a continuous fashion. With that said it is observed that we have limits to our conscious experience of the world.  Specifically this is noted here http://plato.stanford.edu/entries/consciousness-temporal/empirical-findings.html with distinction of successive events being observed at 30ms.  To give some breathing room for subconscious experience I will estimate this to be two orders of magnitude lower at 0.3ms.  That is to say if two trees fell before you in an identical fashion within .3ms you would consciously observe them as a single tree falling.

Meet Bob, Our Test Subject

TelportationProcess

Throughout the rest of this discussion I’d like to focus on one thought experiment. Bob goes to sleep via a drug that renders him completely unconscious, no dreams, no conscious or subconscious thoughts – nothing.  The only part of his bran that is active is that which is required to execute bodily function i.e. heart, lungs etc.  The effect of the drug last one hour.  Inside the room next to his bed is a teleportation device.  The device can teleport any amount of matter at the speed of light and maintain the original properties of the matter (Estimated round trip of material is one billionth of a second).  We can send a small part of Bob through the device e.g. an atom, cell or organ, or we could send Bob in his entirety.

Theseus’ Ship

Theseus’s ship is an ancient paradox. We can use it today to illustrate how we in fact should not identify ourselves with some particular matter, rather it is the arrangement of matter that  is important.   The paradox is introduced by asking whether the ship may still be called Theseus’ ship if throughout the journey planks and boards are replaced on the ship such that by the end of the journey no original pieces of the ship remain.  Most of us would agree that it is still the same ship.

We observe the same phenomenon in our bodies.  The material in our bodies are certainly not the same as ten years ago, or even yesterday.  In fact current scientific models estimate that all cells in our bodies cycle within seven years.  We are constantly ingesting, breathing, and absorbing new material from our environment and excrementing, sweating and urinating other material.   Us humans however do not experience any conscious boundary as this change is occurring. Organic multicellular life is very akin to the problem introduced by Theseus’ ship.This is the foundation that will lay the groundwork for the consciousness teleportation thought experiments discussed below.

 Progressive Teleportation

TelportationProcess2

Now let us do a series of experiments on Bob while he is in his unconscious state.  To begin we simply teleport a single atom through our device.  We can likely agree Bob is still Bob in the morning. What about a single cell?  Is Bob still Bob?  I believe so, I believe ramping up to Bob’s entire Body would still make Bob the same person.  But for the sake of argument let’s say teleporting anything over one milligram (mg) at a time compromises an individual’s identity.  To solve this dilemma we would just need to create a teleportation stream of one mg chunks.  If we sent one milligram of Bob round trip through the teleportation device every microsecond it would take around 70 seconds if Bob weighed 154lbs (70Kg).  Now we can increase the rate at which these chunks are streamed such that the total time for the teleportation is below the subjective consciousness threshold (.3ms) and Bob would experience (if he were conscious) instantaneous teleportation.

Hopefully by now we are on the same page and agree Bob did not die in the process and is still the same person.  The next question that presents itself is what happens if we introduce a delay during the teleportation process.  Instead of completing the round trip the information is stored in an intermediate buffer for an indeterminate amount of time 1 second or 100 years and then the teleportation is completed.  In many ways we can think of this as time-travelling into the future, at least from a subjective consciousness point of view.

The Big Leap – Teleportation Clones

TeleportationTimeOnly

Teleportation through time only

TeleportSpaceAndTime

Teleportation through time and space

So far Bob has only been teleporting a short distance through time.  We have been conducting our experiments by sending Bob in a round trip through the teleportation device to establish that he does not die in the process and in fact maintains his stream of consciousness and identity throughout the ordeal.  We can now begin to explore teleportation through four-dimensional space-time.  This shouldn’t change anything, instead of teleporting Bob back to his same bed, let’s teleport him to a bed next to the original bed, or a bed located on another planet.  From Bob’s perspective when he awakes it would be as if someone had transported him while he was unconscious, as a conscious observer it would be similar to being transported during blinking your eyes.

Now let’s consider the possibility that the teleportation device teleports Bob to two separate space-time coordinates.  From the perspective of Bob (1) and (2) he would have a continuous and identical stream of consciousness leading up to the completion of the teleportation.  However, after the teleportation is complete Bob (1) and (2) become separate and distinct individuals because they now represent two separate streams of consciousness.  They are receiving sensory data from two separate environments and those stimulus are building a separate stream of consciousness from each of their subjective experiences.

TeleportationClones

Teleportation clones

Here is where it starts to get hairy…  We create an experiment that teleports the unconscious Bob to two separate rooms. Creating Bob clones (1) and (2).  Immediately after the teleportation is complete we kill Bob (1).  We must conclude that Bob never died.  Bob (1) never had an opportunity to materialize as a conscious being and Bob (2) is a continuation of the original Bob consciousness.  And here we begin to reframe what death means.  It is one possible end to a stream of consciousness .

Endpoints in an individual’s stream of consciousness are not just limited to death.  Drugs, sleep, sudden head trauma can all lead to a state of unconsciousness.  Anyone who has been knocked out can attest to the sudden disorientation and memory loss that accompanies coming to after such an event.  Humans have given very special attention to death because from what we can observe it is the final end of consciousness .  Interesting things begin to happen though when we define death as simply an endpoint in a stream of consciousness , equivalent to being knocked out or in an unconscious state.

The first interesting conclusion we can make is the teleportation device now has more appeal as a save device for our consciousness.  Consider a new thought experiment with the device in that capacity.  Bob is driving to work one day and is in a car accident in which he loses consciousness.  He awakes in the hospital and can’t remember anything that happened after the morning of the crash.  The doctor informs him it is due to the head trauma he has suffered Bob has short-term memory loss.  In a second scenario, Bob uploads his consciousness to the teleportation device in the morning and heads to work, on his way to work he is in a similar crash and dies.  The following day his body and consciousness is restored.  An argument can easily be made that these two scenarios are identical.

Possible Brain Configurations

Brains

What about resurrection and the people who have not scanned their consciousness prior to death?  This is more a question of being able to quantify the total number of possible streams of human consciousness and then creating continuations of those streams.  Consider a breakdown of the diagram on the right.

A. All possible configurations of 1.4 Kg (weight of human brain) of material

1. 1.4 Kg  Rock

2. 1.4 Kg of Ocean Water

B. Set of all possible 1.4 Kg human brain configurations

3. Alice’s Brain at age 24

4. Jim’s Brain at age 98

C. Set of all of Bob’s brain configurations during his lifetime

5. Bob’s final brain configuration before death

We never delved to deep into the fact that consciousness likely only resides in a subset of the brain.  It is likely that the set of brain configuration necessary to provide a continuous stream of consciousness is a subset of the 1.4 Kg brain set.  For this discussion let’s just continue with the belief the entire brain is required.  The one thing we can say for certain is the set is finite.

With this finite set it is not difficult to imagine that a super intelligent being in the future could reconstruct these consciousness streams from their death points.  And thus we finally arrive at resurrection. This super intelligent entity does not appear to exist today and would likely be some natural evolution of our current species.  Naturally we would want this super intelligent entity to value human values so that we don’t find our consciousness reconstituted into some hellish nightmare.

So I guess that’s it.  Time to get to work on building a super intelligence so that I can be bodily resurrected sometime in the future.

Basic Income and Energy Value Theory

A basic income of what? One of the largest problems with the adoption of this type of policy is that the popular conception of a basic income centralizes on money. Instead we should ask ourselves – what is the minimum resources an individual requires to be healthy and be given all of the opportunities to contribute productivity and innovation back into society? This should be an endeavor of scientific inquiry based on empirical evidence.

Why are you a Commie Bastard?

The purpose of this document is to help socialize the idea of basic income. There will be no claims made that basic income is a miracle solution to every problem facing society today. Rather it will explore the concept of basic income in the language of Energy Value Theory. First we will see how basic income as an economic model stands up rationally and scientifically. Afterwards a proposed simple architecture will demonstrate how this may be implemented and some of the pitfalls to avoid. Finally, we will establish a moral and ethical foundation that places this system on much more solid foundation than the one we so clumsily cling to today.

My Bias

My primary motivation for pursuing a system of basic income is one of morale grounds, each of us is entitled to share in the wealth of the rich technological processes that have been developed by great and hardworking men and women of our past. These improvements have yielded exponential and cascading productivity gains over time. Humanity should be the benefactors of their work, not individuals, corporations, or governments.

In 1953 Morgenstern and von Neuman published a paper outlining the mathematical underpinning of how rational agents make decisions while attempting to maximize some utility function, characterizing the Morgenstern von Neuman utility function (MVN). This formulates the cornerstone of the branch of mathematics called game theory and drives many systems in modern day economics and finance. In today’s culture many of us evaluate our MVN utility function as a pure measure of monetary wealth, something that is poignantly demonstrated by the walls that go up whenever a discussion regarding basic income is broached. Perhaps it is time we reevaluate our utility functions and instead attempt to maximize the society in which we live – and through that benefit ourselves.

Technocracy fairly accurately describes my current belief system.  This ideology outlines the necessity of abandoning our price-based system in favor of an abundance system focused on delivering basic goods to everyone, and rewarding producers and innovators with exclusive and expedited commodities and resources.  As a societies productivity increases we would expect to see that prosperity shared across all income groups within a society as was illustrated in the post WWII era. What we observe in the United States as illustrated by the chart below is that the United States GDP per capita is increasing healthily, while the median income is stagnating indicating the additional productivity yields are being funneled to a small set of individuals [26]. There is a name for such a system – it is called indentured serfdom or in more severe circumstances slavery.

What is Basic Income?

In order to begin a conversation about this topic we should first make sure we are standing on the same ground. To facilitate this, it is necessary to first agree on a Basic Income definition and then provide a few examples of what Basic Income is, and what it is not. Wikipedia defines Basic Income in a way in which we will understand it within this scope as:

“…all citizens or residents of a country regularly receive an unconditional sum of money…”

The core concept being rooted in a system first outlined in the 18th century called Georgism, and popularized in the United States with Thomas Paine’s Agarian Justice. Goergism being an economic model that more closely describes a resource based economy. The key difference, is that a basic income should be based on the means to produce i.e. energy ,and not the raw natural resources available to a society. Therefore basic income becomes:

“economic model where the government assures a certain minimum amount of energy is to be distributed evenly to all citizens”

What Basic Income Is Not

Basic income is not communism.  Communism states that all productivity yields should be distributed evenly among the citizens within a society. While I must admit my bias leads me to believe this is the noblest and most egalitarian dream, it is unobtainable with the inherent nature of the human selfishness. The basic income model outlined here insures the spirit of  innovation is kept alive with proper incentives and creates a marriage with the altruistic goals of communism.

Basic income is not guaranteed income. Guaranteed income loosely models what our current welfare and entitlement systems present.  Guaranteed income makes a promise that one’s income or entitlements will meet some minimum bar, in the US this is the poverty line. For example if you are a single parent with two children and you make under $2600 per month the government will give you food stamps (Washington State [27]) and you will likely qualify for medicaid and HUD housing. If that individual exceeds that income some or all of those entitlements are taken away. In such a system it is easy to imagine how guaranteed income removes incentives to work and creates poverty traps. A basic income system would simply implement: in addition to one’s normal earnings they receive an additional $2000 every month, regardless of their income.

Lets Get our Units Straight

NoCash-Energy When you perform a transaction exchanging US dollars for some commodity you are not really consuming those dollar bills – the dollar is a fiat currency, at best representing a future or virtual commodity. Instead, you are exchanging your productivity yields for that commodity you desire. In the event the transaction is for a service you are exchanging productivity yields directly. At the root of the transaction is an energy transfer.  Yes, energy as in a physical, objective, measurable unit.  This is the most fundamental idea we should collectively recognize. On one end of the transaction is the fraction of energy you exerted via labor in delivering commodities and services to others to meet the energy requirement of the commodity you desire an on the other hand is the energy requirement of that desired commodity.  Where the commodity’s total energy requirements is the aggregate energy which is required to produce and deliver that entity through natural and artificial processes.

The preceding discussion should begin to reveal the illusory nature of our fiat dollars. I suspect many of us know money – especially US Dollars have very little utility value, yet we all subscribe to their social contract. It is an ancient arrangement invented  at the end of the iron age. If anyone can demonstrate money’s value I would be happy to change my opinion on the matter. For now we will move forward with this discussion on the premise that our fiat dollars today are insufficient for describing a basic income as they have no objective utility value other than paper or metal coin. Instead we will focus on a natural unit for describing basic income, the Kilowatt-hour (kWh).

For a brief moment lets put all of our negative (and often unfounded) predispositions towards Marxism on hold and discuss one of the basic concepts outlined in Karl Marx’s first volume of Capital, A Critique of Political Economy. In that document Marx describes the use value of commodities and outlines the process of establishing money simply as a unit of conversion of that value. The use value which was defined by the material (matter) and labor (energy) required to produce the good. Marx goes on to describe how this value becomes corrupted by subjective human beliefs, which he describes as Fetishism [11].

Whence, then, arises the enigmatical character of the product of labour, so soon as it assumes the form of commodities? Clearly from this form itself. The equality of all sorts of human labour is expressed objectively by their products all being equally values; the measure of the expenditure of labour power by the duration of that expenditure, takes the form of the quantity of value of the products of labour; and finally the mutual relations of the producers, within which the social character of their labour affirms itself, take the form of a social relation between the products.

A commodity is therefore a mysterious thing, simply because in it the social character of men‘s labour appears to them as an objective character stamped upon the product of that labour; because the relation of the producers to the sum total of their own labour is presented to them as a social relation, existing not between themselves, but between the products of their labour. […] In that world the productions of the human brain appear as independent beings endowed with life, and entering into relation both with one another and the human race. So it is in the world of commodities with the products of men‘s hands. This I call the Fetishism which attaches itself to the products of labour, so soon as they are produced as commodities, and which is therefore inseparable from the production of commodities.

Measuring commodities in energy allows us to circumvent the conundrum of Marx’s Fetishism, and also allows us to divorce ourselves from the other pitfalls of labeling those commodities based on subjective dimensions. Energy is an objective measure, that constructs a layer of transparency between consumers, laborers and businesses safeguarding against corruption and subterfuge by its nature.  Charles Hall’s summary of Energy Value theory goes more in depth in comparing this system with classical and neoclassical models of economics [17].

 

EnergyTransfer3

To illustrate the power of energy as a unit of exchange let’s consider a scenario of delivering a basic good to an individual.This example shows that a commodity is the aggregate of energy from a variety of sources.  First, the sun provides the majority of energy in the form of sunlight to produce a crop of rice.  Second the potential chemical energy stored in the nutrients of the soil help develop the crop, as well as the plant organism as a resource, representing a pattern in nature that can store and process energy effectively.  The third aspect of this system is the human labor that harvests the crop, here we can see energy being fed back into the system via food calories powering the laborers.  The final energy expenditure is delivering the commodity to the end consumer, the train image represents this stage of the process.  Finally the refined commodity is delivered to our bellies to be consumed as precious kilo calories to fuel these biological automatons.

So, this process defines a commodity’s value as a the sum energy of chemical processes required to deliver a product to a consumer. Robert Constanza’s [14] research illustrates this  process in an more rigorous manner. Furthermore that paper contrasts energy based systems against modern day’s marginal utility theory driving our subjective ‘fetish’ economy.

 

Energy Based Economy and Basic Goods

 

replicator-i

 

Lets imagine a society that has developed the ability to convert energy into a consumable form that meets all of an individual’s basic needs.   For simplicity we’ll focus on the nutrition dimension.  As a starting point we will use the current price of energy at $0.10/kWh [10] (note I’m using $ here for cost as an illustration, as it is likely what most people are familiar with, one could just as easily use 1 human daily operational calorie unit)  Converting $.10/kWh  to food calories at 2500/calories day we arrive at 2.9075 kWh [13]  costing $0.29.  The calculation assumes we have the ability to convert energy to the necessary food calories with perfect efficiency.  This is not the case today but we’ve successfully planted a flag in the ground – our goal.

Now we have at least two dimensions by which we can improve the simple system outlined above. First we can improve the ‘cost’ of the kWh, in the event our energy source is a solar panel we can improve the efficiency by which it captures sunlight (current efficiency is around 17% [16]).   Another way of decreasing ‘cost’ is to increase the efficiency in producing the commodity, examples of this could be more efficient transportation, or mechanizing the labor workforce.  The second dimension is the total energy the economic system is capable of processing and delivering to its consumers.  In the solar panel example this is increased by adding new solar panels to the array.

Relative Energy Measures

Energy Measure Energy Value (kWh)
2500 Food Calories 2.91
1 Gallon Gasoline 36.42
1 m² earth surface solar energy peak (noon) [20] 1.00
1 m² earth surface solar energy (average over 24 hours) [20] 0.21
1 Ear of Corn [4] 0.09
1 Acre (4046.9m²) of Corn Harvest [4] 1119.39
Average Daily US Household Energy Consumption [19] 33.07
US Annual 2010 Food Wasted (food calories) [23] 163,983,000,000 (164.0 billion)
Energy to feed 7 billion people for 1 year (2500 cal/day) 7,435,050,000,000 (7.4 trillion)
Approximate World Energy Production 2012 [25] 146,734,000,000,000 (146.7 trillion)

Using the above calculations, if we achieve 100% efficiency of solar panels, and had the ability to convert energy into necessary food calories we would simply need to cover 97,848 square kilometers of the earth with solar panels to provide 7 billion people with a comfortable food supply. This would require 0.02% of the Earth’s surface; that figure becomes 0.1% of the Earth’s surface at 17% solar panel efficiency.  To put this in perspective the current total surface of the earth (including water) that is devoted to farmland is approximately 2.53% [21] or 12,903,000 km² [22].

Clothing our society with this new economic model is not an easy task.  We would likely need to begin to think about wealth in a radically different and transient way.  Individuals in such a system would accumulate wealth not based on luxury goods or personal property but on the energy they had at their disposal at any given time. Such a system would be naturally transparent, and self correcting as one’s discretionary energy would flow towards those individuals or collective groups that produced the best results for society.  With that being said, it is not to say that those luxury goods and low energy value commodities could not exist within a pseudo economy operating on top of the energy based one. In  such a system those goods would not provide the social motility and ability to quickly and effectively liquidate into energy.  I imagine such items would be valued as cultural and artistic touchstones, and eventually installed in public places or shared in personal spaces among the citizenry – but never produced in excess or waste.

We will not digress into a discussion on what defines a basic good in an objective manner.  Instead I will offer my simple and humble opinion on the matter.  I believe a basic good and service would fall under one of four areas: nutrition, shelter, education and medicine. These I accept as inalienable human rights in an abundance society that open the gates of liberty and equality. Equality in the proposed energy based economy provides opportunity to compete.  Equality allows accessibility to choose how energy will be invested which ultimately allows one to influence which projects and policies will be developed.  This makes energy not only a unit of currency but also a unit of democracy.

A Tale of Two Assholes

  I knew it, I’m surrounded by Assholes. [Closes helmet] Keep firing, Assholes!– Dark Helmet, Spaceballs

The dichotomy of the two assholes plays a central role in the class warfare rhetoric of the United States.  On one hand we have the unmotivated, disillusioned welfare drawing bottom feeder.  On the other hand we have the sycophantic, exploitative corrupt pseudo mobster.  Both are constructed, not by individuals, but by a preexisting system of energy distribution in order to maintain the status-quo of that system through an engineered narrative.  Let’s get to know these assholes so that we can understand them within the scope of our new energy based system.

Lazy Stupid Asshole

This icon is typically the soft target of news bits and politicians aiming to reduce entitlement and welfare programs. The stupid asshole sits at home and watches Maury Povich all day slowly degrading their health through a steady diet of Cheetos and Top Ramen paired with a sedentary life until their morbid obesity reaches critical mass and they further burden the rest of society with medical expenses. This asshole is constructed to illustrate that without incentive – namely monetary, people will not be productive and contribute no labor energy back into society.

Greedy Asshole

The greedy asshole on the other hand is a high functioning power addict that goes through whores and cocaine faster than four finger Furby dolls in 1998. He is the often young inheritor of vast wealth or the old decrepit villain that has buried his competition through misdeeds and broken dreams.  This asshole more typically rears his head in left leaning documentaries about corporate corruption and bankers that operate outside the boundaries of the law.  The greedy asshole is constructed to illustrate that individuals are always selfish, and that power and money necessarily corrupt those that have it.

The Problem

One thing I am sensitive to is that many people refuse to recognize these as caricatures of extreme points within the spectrum.  Both are clearly unhealthy behaviors to assume within society, as both represent complete ignorance towards the notion of cooperation.  Apathy, ignorance and indifference are all unhealthy psychological patterns for the individual and society and should be viewed along the same lines as other socially stigmatizing behavior e.g. uncontrollable flatulence, tourettes, general psychopathy etc.  They should be treated clinically with medicine developed through scientific rigor. It is the society’s responsibility to identify these conditions and treat them – a moral precedent in reducing suffering.  I would argue the majority of the risk for these uncooperative behaviors would be mitigated by the free universal education that would be provided as a basic service.

 

What about the Toilet Cleaners?

Surely if no one has to work to have their basic needs met, there would be no one to do any of the undesirable jobs.  Many of these jobs are in the services industries – and many of us (Americans) have worked in at least one sometime during our lives. People willing to do this type of job for your company would be able to set their own energy price, or they may believe in the product/service you are delivering and wish to contribute their volunteer labor to help you succeed.  In the circumstance their wasn’t enough individuals to meet the demands of a particular job e.g. toilet cleaner, then the people using those toilets would have a few options.

1. Clean their own toilets, devoting their personal labor to enjoy a clean environment.

2. Do not clean the toilet, live in squalor.

3. Build an automated toilet cleaner and include the energy requirements of said machine in energy operating costs.

To illustrate I will present the simple scenario.  Jack want’s to help contribute to finding a cure for cancer.  He contacts a local research center that is conducting research on a new cancer drug.  Jack asks if he can help with their research.  The lead scientist tells Jack their research staff is filled at capacity with highly skilled contributors, but if he’d really like to help them he can come clean the toilets so they don’t have to spend additional productive hours out of their day doing that task.  Disappointed, Jack thanks the scientist for his consideration and states he’ll be in the following day to clean the bathroom.  Jack spends an hour each day cleaning the toilets, and begins constructing a autonomous toilet cleaning robot in his spare time.  Two years later the scientist calls Jack to inform him  that a position has opened on his team and to thank him for how thoroughly clean  the restrooms have been.  Jack sadly declines this position, and states that his automated robot has been cleaning their bathroom for the past six months and his robots are saving others around the globe millions of hours in toilet cleaning labor.

How the hell did Jack learn how to build and program a robot?  Well, Jack has access to free education so he spent the majority of his early days as a janitor studying before building the robot (Remember he only worked one hour each day).  His discretionary energy income was enough to acquire the resources to build the prototypes.  After presenting his concept to a manufacturing company they decided to allocate mechanized energy in their plant towards the production of his robots to meet the toilet cleaning demands of several of their partners.  Soon many companies were diverting a portion of their energy towards his robot manufacturing.

Goals of an Energy Value Technocrat

There are four measures we can use to assess progression in development of our energy based society.  Humanity working together can develop a system of maximum power, and continue that trend to unlocking the secrets of nature along the way and ultimately increasing our quality of life.  Individuals will ultimately become free of often tedious tasks such as store attendant, fast food chef, trash disposal etc.  They will be free to contribute to the cultural golden age that would flourish as they abandon the shackles of consumerism and debt to develop their individual talents and pursue their dreams with the certainty that the will have what they need provided for them at the end of the day.

1. Percentage of population with access to the set of basic goods.

2. Total energy produced by the society

3. Percentage of necessary labor that is automated/mechanized.

4. Efficiency of produced energy.

Now that we have a set of measures by which we can objectively improve society and thereby our lives, we will need a set of steps to set us on that path.  First, it is unlikely any of these values are easily accessible or verifiable in our current system.  A first step is opening up the visibility into our energy production systems.  How amazing would it be to pick up a commodity at the store and see the exact energy cost required to deliver that item there – as well as a detailed breakdown of where each individual energy requirement came from?  Additionally these measures allow us to easily measure the success of our leaders.  Their success would be evaluated based on how much they improved those four measures. But before any of that can happen we need to more awareness of this system, and most importantly to push on our governments to deliver these metrics and hold them accountable to them.

Sources

Population Growth

[1] http://en.wikipedia.org/wiki/Projections_of_population_growth

United States Crop Yields Over Time

[2] http://ahundredyearsago.com/2011/10/14/us-crop-yields-and-production-1911-and-2011/

[3] http://www.ers.usda.gov/data-products/feed-grains-database/feed-grains-yearbook-tables.aspx#26761

Sweet Corn Production

[4] http://www.ces.ncsu.edu/hil/hil-13.html

Universal Basic Income: A brief overview of a support for intelligent economies, quality of life and a caring society

[5] http://www.feasta.org/2013/04/17/universal-basic-income-a-support-for-intelligent-economies-quality-of-life-and-a-caring-society/

An Energy Systems View of Karl Marx’s Concepts of Production and Labor Value

[6] http://www.cep.ees.ufl.edu/emergy/documents/conferences/ERC03_2004/ERC03_2004_Chapter_02.pdf Metabolism, energy, and entropy in Marx’s critique of political economy:Beyond the Podolinsky myth

[7] http://sociology.uoregon.edu/faculty/foster/theory%20and%20society-2006-burkett%20and%20foster-metabolism%20energy%20entropy.pdf

Iran Rice Study on Mechanized vs Traditional Farming Productivity Yields

[8] http://maxwellsci.com/print/rjaset/v4-2666-2671.pdf [9] http://cdn.intechopen.com/pdfs-wm/44389.pdf

Price of Electricity Per State

[10] http://www.npr.org/blogs/money/2011/10/27/141766341/the-price-of-electricity-in-your-state

Karl Marx’s Das Kapital

[11] https://www.marxists.org/archive/marx/works/download/pdf/Capital-Volume-I.pdf

How To Liberate America from the poverty trap

[12] http://www.forbes.com/sites/peterferrara/2014/04/13/how-to-liberate-america-from-the-poverty-trap-that-is-enslaving-us/

U.S Energy Conversion

[13] http://www.eia.gov/energyexplained/index.cfm?page=about_energy_conversion_calculator#foodenergy

Slow Death of Democracy

[14] http://www.salon.com/2014/05/17/is_democracy_doomed_and_was_it_ever_real/

Value Theory of Energy. Robert Costanza, University of Vermont

[15] https://www.pdx.edu/sites/www.pdx.edu.sustainability/files/Value_and_Energy.pdf

Solar Panel Efficiency

[16] http://sroeco.com/solar/most-efficient-solar-panels

[17] http://www.eoearth.org/view/article/156825/

Solar Energy from Acre of Land

[18] http://www.energymanagertoday.com/it-takes-2-8-acres-of-land-to-generate-1gwh-of-solar-energy-per-year-says-nrel-094185 Home Electricity Use -1,375 billion KWh in US homes in 2012, 12,069 kWh per home

[19] http://www.epa.gov/cleanenergy/energy-resources/refs.html

Actual Solar Energy at Earth’s Surface

[20] http://ded.mo.gov/division-of-energy/renewables/missouri-s-solar-energy-resource/how-much-solar-energy-is-available- http://www.pmodwrc.ch/pmod.php?topic=tsi/composite/SolarConstant

Percentage of Land used for Crops

[21] https://www-pls.llnl.gov/?url=science_and_technology-earth_sciences-agriculture

[22] http://data.worldbank.org/indicator/AG.LND.AGRI.K2

Food Waste in US 2010 430 billion pounds at approximately 141 trillion calories

[23] http://www.ers.usda.gov/publications/eib-economic-information-bulletin/eib121/report-summary.aspx#.U5hmb_ldV8F

Eurelectric – Efficiency in electricity generation

[24] http://www.eurelectric.org/Download/Download.aspx?DocumentID=13549

World Energy Production

[25] http://data.worldbank.org/indicator/EG.ELC.PROD.KH?order=wbapi_data_value_2011+wbapi_data_value&sort=asc

Economic Distribution

[26] http://www.gpo.gov/fdsys/browse/collection.action?collectionCode=ERP&browsePath=2014&isCollapsed=true&leafLevelBrowse=false&isDocumentResults=true&ycord=0

Washington State Basic Food Program

[27]http://www.dshs.wa.gov/pdf/food/BFQAs.pdf

Median Income United States – US Census

Table H-5 Race and Hispanic Origin of Householder — Households by Median and Mean Income

[28]   https://www.census.gov/hhes/www/income/data/historical/household/2012/H05_2012.xls

Bureau of Economic Analysis

[29] http://www.bea.gov/iTable/iTable.cfm?reqid=70&step=1&isuri=1&acrdn=1#reqid=70&step=10&isuri=1&7003=200&7035=-1&7004=sic&7005=-1&7006=00000&7036=-1&7001=1200&7002=1&7090=70&7007=-1&7093=index

Data Mining Web Feeds Using .NET and MSSQL

Why Measure RSS?

Many libraries and services are available to obtain data through other social online services such as Facebook, Twitter, and Google, but no such structure exists for arbitrary RSS.  By associating data with a context (the RSS feed) analysts and machine learning algorithms can infer correlations between extracted metrics and external variables.

This article will discuss the  solution that enables developers to datamine arbitrary RSS web feeds using objects provided by the .NET framework.  Within the application the data is stored to a Microsoft SQL Express database, although any form of data storage could be used.

The Feed Acquisition Service

Diagram 1 shows how data is collected from the internet and stored on the FeedMiner MSSQL database.

Diagram 1. Feed Parser Data Flow

Loading RSS XML

The Feed Service process for collecting RSS feed metrics acts as an observer that monitors a list of feeds for newly published content, downloads the content, parses it and stores metrics within the database.  The Feed Service begins by querying the FeedMiner database for a list of feed items (see below for a description of the database).  Using the .NET SyndicationFeed object the service then attempts to load the RSS XML.  If the process is able to load the syndication feed, the website links (newly published content) can be accessed with the SyndicationFeed.Links property.

using System.ServiceModel.Syndication;

public static bool TryGetFeed(string url, out SyndicationFeed feed)
{
	feed = null;
	try
	{
		using (XmlReader reader = XmlReader.Create(url))
		{
			feed = SyndicationFeed.Load(reader);
		}
	}
	catch (Exception ex)
	{
		return false;
	}
	return true;
}

Loading Website HTML

After collecting a list of links from the the feed the program will check the database to see if it has already visited that URL. If the URL has not been processed the program attempts to get the HTML data from the associated URL. Obtaining the HTML string from the websites themselves is a little more tricky.  First, the Visual Studio project runtime must be changed from the .NET client profile to the generic .NET profile, this is so we can use the System.Net libraries. With that change the program will be able to use the System.Net.Webclient object to perform an HTTP GET on the specified web URL.

using System.Net;
using System.Text.RegularExpressions;

public static readonly string URLPattern = @"((https?):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)";

public static bool TryGetHTML(string url, out string html)
{
	html = "";
	if (!Regex.IsMatch(url, URLPattern))
		return false;
	try
	{
		using (WebClient client = new WebClient())
		{
			using (StreamReader reader = new StreamReader(client.OpenRead(url)))
			{
				html = reader.ReadToEnd();
			}
		}
	}
	catch (Exception ex)
	{
		return false;
	}
	return true;
}

Parsing and Measuring HTML

If the HTML is received without error, the program then parses it.  The Feed Service uses the HTML Agility Pack (available on codeplex here) to load the HTML document in order to parse it properly. Parsing occurs by first selecting only relevant nodes.  The following HTML nodes are considered.

  • p
  • div
  • span
  • td
  • li
  • table
  • tr

The text is extracted from the HTML nodes  using the “/text()” xpath expression.  After the text is extracted from each node it is sent to a token parser, which breaks tokens up based on whitespace and certain punctuation.  New tokens are noted and added to the Token table within the database.  After the Token table is updated, the token counts for each visited website are added to the database.

Diagram 2 shows the classes that are used to measure feeds on the internet and store the metrics in the database.  Inside the Feed Service application a timer object ticks at some interval rate at which time the Webmeasure instance within the application calls the MeasureFeeds() method.

Diagram 2. Class Diagram

FeedMiner Database

The FeedMiner database is described by the following diagram.

Diagram 3. FeedMiner Database Diagram

Scripts to create this database  and insert all of the initial RSS feed URLs are available here:

Initialize FeedMiner Database Script

Initialize Feeds Table Script

Obtaining the Feed URLs

Initially the database will have no data in it, and the way in which the Feed Miner process gets data is by enumerating a list of RSS URLS and fetching the HTML for each link in the RSS feed. Any number of methods could be used to acquire RSS URLs, including manual entry and web crawling. The feeds in the scripts came from http://finance.yahoo.com/rssindex.  Glancing at the HTML of that page you will notice the RSS URL is in a particular div class, “rss”.  I used a Python script to extract all the RSS URLs from the HTML of that webpage. The following HTML shows the Yahoo Finance RSS feed index for “Mergers and Acquisitions”.

<ul>
<li><dl class="clear">
<dt>Mergers &amp; Acquisitions</dt>
<dd>
	<a class="my" href="http://add.my.yahoo.com/rss?url=http://finance.yahoo.com/rss/mergersaquisitions">Add to My Yahoo!</a>
	<a class="rss" href="http://finance.yahoo.com/rss/mergersaquisitions">RSS</a>
</dd>
</dl></li></ul>

Exploring the Data

This section reviews a small subsection of the data collected from the Feed Miner application.  The application measured website HTML for over 240 RSS Feeds, over the course of two months between March and May of 2011.  The following data comes from a single RSS feed, http://finance.yahoo.com/rss/headline?s=amzn over that time span.

To begin let us observe two high level metrics, the number of measured websites, and the total number of tokens observed as functions of  the date.

Diagram 4. Websites Measured with AMZN Headlines

Diagram 5. Total Measured Tokens for AMZN Websites

From this data it is easy to observe the obvious correlation between the total number of tokens and the number of websites, i.e. more websites means more words.  Next we can look at individual token metrics that occur within the RSS feed.  In the graphs below the tokens ‘the’ and ‘kindle’ are measured.  ‘the’ was chosen because it was the most used token as Diagram 8 illustrates. ‘kindle’ is used because it is a product that might be sensitive to the Amazon.com business, and thus exhibit behavior independent of the number of websites.  Diagram 6 shows that ‘the’ like the overall total number of tokens, is highly correlated with the number of websites.

Diagram 6. Frequency of the token "the" in AMZN websites

Diagram 7. Frequency of the token 'kindle' AMZN headline websites

Diagram 8. Total Token Sums 3/15/11 - 5/2/11 for AMZN headline websites

An exciting observation can be made in Diagram 7 which suggests that the token ‘kindle’ is much less correlated with the number of websites measured (in particular around  mid April).  Observe the spike at 4/11/2011 in Diagram 7.  Now we can take this data and begin to apply it to forecast models.  For example Diagram 9 shows the AMZN stock prices over the same time period.  Diagram 9 shows that in the days following the ‘kindle’ token  anomaly the AMZN stock values fell significantly below the trend line.

Diagram 9. AMZN end of day stock values

The Feed Miner Future

It is entirely possible that these figures have little to no significance, but due to the large data sets statistical or machine learning techniques would need to be employed in order to determine any underlying patterns.  The main purpose of this application is to provided an interface and data storage system for measuring RSS feeds as well as the ability to employ that data to whatever means.  The database model could (and probably should) be expanded to measure data contexts rather than simply RSS.  That is to say a context might be a single RSS feed, Facebook Query, Twitter Search etc. or any set of the aforementioned.

I will be continuing my work on this project primarily as a Stock Market forecast tool.  Stay in touch for another post concerning my efforts along that line.  If you would like the source code or any other resources contact me via email.

Generic Genetic Algorithm in C#

Introduction

Source Code  ( VS 2008)

Recently I was looking for any generic libraries for AI available in C#.  I was just curious as to whether anyone had developed any libraries for AI geared to solving problems other than path-finding.  With nothing standing out as immediately accessible I began developing a simple solution that would address the needs of a developer wanting a robust generic genetic algorithm class. Yum…. generic genetic algortihm. ( I imagine Homer Simpson saying that).

The actual generic class is the GeneticPopulation class, which members are defined by the IGeneticIndividual interface.  The GeneticPopulation class has generic methods for generating new generations, creating initial populations, as well as properties defining the nature of the population, such as crossover and mutation rates.  The class diagram outlines this class, where T is an object that implementss IGeneticIndividual interface.

What is a Genetic Algorithm?

Before going over the code implementation I will briefly outline what a genetic algorithm is.  In spite of how technical it might sound it is actually very simple concept to program, which gives bonus pedanticity points -sounds fancy but in actuality is very simple.  In short it allows solutions to be explored over a large unknown often highly stochastic environment.  Generally types of problems that are addressed by this type of algorithm are those which involve many local maximum and a single global maximum. In these types of problems where other hill based climbing algorithms will fail to find the global maximum.



The Fitness Function

The goal of the algorithm is to find a ‘fit’ individual over some fitness landscape.  Fitness for an individual is a function of the individual’s chromosome and the environment.  For simplicity a fitness function will return a real number between 0 and 1, where 0 is the least fit and 1 is the most fit.  As an example of a fitness function for olympic sprinters would be a function of speed; a 0 fitness would be a sprinter that stayed at the start line until the end of the universe and a sprinter with 1 fitness would be and individual that could teleport to the finish line instantaneously, keep in mind the function does not need to be linear.

Genetic Operators

To create a new generation of  more fit individuals, a series of operators must be applied to the current generation of individuals.  These operators mirror functions in biological sexual reproduction.  For a detailed explanation of the genetic operators check out wikipedia.org or one of the thousand peer reviewed publications on the topic (a few are listed at the bottom).

Selection

This library uses roulette or fitness proportionate selection for selecting individuals that will be given the opportunity to reproduce.  As a simple example consider a genetic population with three individuals A, B, and C with fitness scores of .2, .8, and .5 respectively.  The total fitness score of the three individuals is 1.5, so their proportional scores for A,B, and C are    0.13, 0.53, and 0.33 respectively, note these new scores sum to 1.0.  Each individual is given an interval in the range 0.0 to 1.0 that is equal to the proportionate score.  A random number is chosen between 0.0 and 1.0 if the number falls in that individual’s interval then the corresponding individual is chosen to reproduce with another similarly chosen individual.

Elitism

I know, I know its not fair those rich people get free passes, well sorry to say this extends into the machine world as well, at least when using elitism as a selection operator.  With this operator the top x% of fit individuals are given a free pass to propagate their unchanged chromosome into the next generation.  Ahh, the sweet smell of immortality… yes it smells only immortals are aware of it though (I offer you my condolences if you are unfamiliar with this odor).

Crossover

Crossover exchanges sections of the chromosomes between two selected individuals.  In the circles world example below, this would involve exchanging one of the real numbers that represent the X, Y, or radius values.  The crossover event is determined by a probability.  If no crossover occurs the individuals propagate their unchanged chromosomes into the next genetic operator, mutation.

Mutation

Mutation operates on the offspring of two individuals, and the likelihood of occurring is based on some probability between 0 and 1. Generally this is a small change in the chromosome.  In the circle world mutation is a small heterogeneous scaling of each of the three real numbers within the chromosome X,Y, and radius.

The IGeneticIndividual Interface

This interface allows developers to use the generic GeneticPopulation class.  Any class that derives this interface must define the genetic operators of crossover, mutation, and fitness for that individual.  The derived class can then be used with the generic GeneticPopulation class to evolve solutions based on the fitness function.

An Example Application: Circle World

The circle world surface is  a two dimensional continuous rectangle defined by the following points (0,0), (0,MaxY),(MaxX,0), (MaxX,MaxY).  Within the rectangle exists a set of of blue circles, each traveling traveling with some velocity (remember, velocity has a magnitude and direction components).  A genetic individual is a stationary circle, with a chromosome consisting of an X.Y coordinate within the rectangle space, and a radius all real numbers. The fitness function in this world is measured in two steps, first it finds if the individual is intersecting any of the moving circles, if it does not it computes fitness based on the size of individual’s radius.  The goal is to find the largest circle that does not intersect any of the traveling circles.  In the video below the black circle is the most fit individual, and the green circles are the other members of the population.  An excerpt from the fitness function is shown below.

Circle World: Fitness Function

        public double Fitness(object world)
        {
            //if it goes off the screen give fitness of close to zero
            if ((m_Genome.Rad + m_Genome.X > maxX) ||
                (m_Genome.Rad + m_Genome.Y > maxY) ||
                (m_Genome.X - m_Genome.Rad < 0) ||
                (m_Genome.Y - m_Genome.Rad < 0))
            {
                fitness = .001;
                return fitness;
            }

            //i.e. How far away the outer boundary is from the other circles outer boundary
            double intersect_val = 0;

            double dist;
            //Ensure world object is set correctly
            if (world.GetType() == typeof(TestWorld))
            {

                TestWorld theWorld = (TestWorld)world;
                int count = theWorld.circles.Count;
                double offDist;
                double total = 0;

                //Intersections with world circles causes lower fitness
                foreach (Circle circle in theWorld.circles)
                {
                    dist = Math.Sqrt(Math.Pow(m_Genome.X - circle.X, 2.0) + Math.Pow(m_Genome.Y - circle.Y, 2.0));
                    offDist = (dist - (circle.Rad + m_Genome.Rad));

                    if (offDist < 0)                     {                         offDist = Math.Abs(offDist);                         if (offDist > circle.Rad)
                            offDist = circle.Rad;
                        intersect_val += offDist;
                        total += circle.Rad;
                    }
                }

                //If intersections with world circles exist,fitness range is .001 to .5 based on magnitued of intersections
                if (total != 0)
                {
                    intersect_val /= total;
                    intersect_val = 1.0 - intersect_val;
                    fitness = ClampDouble(intersect_val * .5,.001,.5);
                    return fitness;
                }

                //No intersections with world circles, fitness range .5 to 1.0 based on radius

                double radVal = m_Genome.Rad / 250.0;
                radVal = ClampDouble(radVal,.001,1.0);
                fitness =  radVal * .5 + .5;
                return fitness;
            }
            fitness = .001;
            return fitness;
        }

Circle World: Cross over


        public IGeneticIndividual CrossOver(IGeneticIndividual mate)
        {
            TestIndividual ind = new TestIndividual();
            Circle mateGenome = (Circle)mate.EncodeGenome();

            Random rand = new Random((int)DateTime.Now.Ticks);
            double rRad = rand.NextDouble();
            double rX = rand.NextDouble();
            double rY = rand.NextDouble();

            double nRad;
            double nX;
            double nY;

            #region Radius
            if (mateGenome.Rad < m_Genome.Rad)
            {nRad = CrossOverDouble(mateGenome.Rad, m_Genome.Rad, rRad, .1); }
            else
            {nRad = CrossOverDouble(m_Genome.Rad, mateGenome.Rad, rRad, .1); }
            #endregion

            #region X
            if (mateGenome.X < m_Genome.X)
            { nX = CrossOverDouble(mateGenome.X, m_Genome.X, rX, .1); }
            else
            { nX = CrossOverDouble(m_Genome.X, mateGenome.X, rX, .1); }
            #endregion

            #region Y
            if (mateGenome.Y < m_Genome.Y)
            { nY = CrossOverDouble(mateGenome.Y, m_Genome.Y, rY, .1); }
            else
            { nY = CrossOverDouble(m_Genome.Y, mateGenome.Y, rY, .1); }
            #endregion

            TestIndividual ti = new TestIndividual();
            ti.m_Genome.Rad = ClampDouble(nRad,minRad,maxRad);
            ti.m_Genome.X = ClampDouble(nX, 0, maxX);
            ti.m_Genome.Y = ClampDouble(nY,0,maxY);

            return ti;

        }

Circle World: Mutation

        public IGeneticIndividual Mutate()
        {
            double randVal = NumberGenerator.Instance.RandomDouble();

            //random individual
            if(randVal < .05)
                return new TestIndividual();

            TestIndividual newInd = new TestIndividual();
            //Random r = new Random((int)DateTime.Now.Ticks);
            //range .75 to 1.25
            double randVal1 = NumberGenerator.Instance.RandomDouble() / 2.0 + .75;
            double randVal2 = NumberGenerator.Instance.RandomDouble() / 2.0 + .75;
            double randVal3 = NumberGenerator.Instance.RandomDouble() / 2.0 + .75;
            int v = NumberGenerator.Instance.RandomInt(0, 2);

            double r = m_Genome.Rad;
            double x = m_Genome.X;
            double y = m_Genome.Y;

            r *= randVal1;
            x *= randVal2;
            y *= randVal3;

            newInd.m_Genome.Rad = ClampDouble(r, minRad, maxRad);
            newInd.m_Genome.X = ClampDouble(x, 0, maxX);
            newInd.m_Genome.Y = ClampDouble(y, 0, maxY);

            return newInd;
        }

Further Thoughts

Based on the continuous temporal nature of this environment, a further application would be to ‘evolve’ the best probabilities and attributes of this genetic population that would yield the highest average fitness or highest average most fit individual.  This could be easily done by using the GeneticPopulation properties as an individual chromosome.  The fitness function might involve allowing each genetic population evolution for 100 generations.  With that it is easy to see the wide application domain this algorithm has, and how easy it can be implemented using generics and a single interface.

Genetic algorithm publications:

A Genetic Algorithm Tutorial

Training Feedforward Neural Networks Using Genetic Algorithms

Debugging Nuke Plugins

Introduction

This post is going to explain how to build a Nuke 6.0v6 plugin in Visual Studio 2008, launch the plugin in Nuke, and attach the Visual Studio debugger to Nuke in order to step through the plugin code.
One of my friends spiked my interest in Nuke, so I thought I’d take a look at their plugin architecture. Although sample plugins are provided in neat cookie cutter fashion, getting to the point where you can start testing within the application might be tricky for someone not familiar with Visual Studio.
To begin open the Visual Studio solution located in the NDK directory within the Nuke install path. The path should be something like this:
C:\Program Files\Nuke6.0v6\Documentation\NDK\vc8

The default plugin within the solution is the Mirror plugin, I choose to test with the Blocky plugin, because I was curious about how filters work, but any of the plugins contained in the Example directory should work.  If you would like to follow along delete the Mirror.cpp file from the project and add the existing Blocky.cpp file the ‘Examples’ directory.

Pre-Build

At this point it is important to note that I am developing on Windows 7 32 bit so I have 32 bit binaries installed for Nuke.  Within Visual Studio ensure that the solution configuration is set to “Release” and the solution platform is set to “Win32”.
Begin editing the Blocky.cpp code file.  At the top of the .cpp file enter this line:
#define _SECURE_SCL 0
This is outlined in the readme.txt file that is part of the solution. Read it only if you care.
Also the node description will need to be changed.
const Iop::Description Blocky::d(CLASS, "Test/BlockyTest", Blocky_c);
Next find where the CLASS variable is defined and rename it. This will be the node name that shows up within Nuke, and it must match the name of the .dll file. I chose to rename my class “BlockyTest” so that I could distinguish it from the existing “Blocky” node.
static const char* const CLASS = "BlockyTest";
Because the class name has to match the .dll go ahead and change that now too. Right click on the project node in the visual studio solution explorer and select “Properties”. In the Property Pages window select “Configuration Properties” > “General” and change the output directory to the .nuke directory found in your Users folder. This is probably different on XP and Vista but will work on Windows 7.
Figure 1. Output Directory
Select Linker within the project properties next. In the output directory field enter the name of the binary output. This should be the same as the class name specified earlier.

Figure 2. Output File
Now you should be ready to build. Within Visual Studio press F6 or select “Build” > “Build Solution”.

Post-Build

Now the plugin is ready for Nuke, so launch Nuke6.0v6. The plugin should be recognized automatically due to the output directory. Test that Nuke is able to find the plugin by pressing “X” on the keyboard to bring up a TCL command window. Enter the name of the .dll file into the text field.
Figure 3. TCL Command
A node should pop up within the graph editor. Create any additional nodes within the graph editor that the newly developed plugin requires and wire them up.
It is important to remember that the Nuke rendering architecture is multi-threaded, so stepping through the code can get a little crazy. I’m just a novice Nuke user so I have no idea how to limit the application to a single core within the application. But I do know how to use windows task manager! I win again!
Figure 4. Limit Nuke Process to Single Core

Attaching the Debugger to Nuke Process

Finally everything is prepared for the magic moment, attaching the debugger to the process. Within Visual Studio select “Debug” > “Attach to Process” select the Nuke6.0.exe process and press the “Attach” button.
Figure 5. Attach to Process

Back in Nuke adjust any knob controls or perform any action that causes the plugin to become invalidated, and view the glory of your breakpoints in Visual Studio.