Who? The Programmer's Version

I've been getting a lot of email from recruiters lately. The short answer is that I'm really happy where I am. But if you're really interested in my help, let's talk. One of my other hats is Co-Director of Business Development and in addition to hiring me, you could also get the benefit of a really gifted team to back me up on your project. The rest of this post is an annotated collection of links to the most popular code I've posted on this site in case you or your technical people want to use the source to learn more about me and how I solve problems.

This story includes a few short code examples in python, perl, and java. It will also give a flavor for how I communicate in writing about technical subjects.

This is a longer code sample using perl to create a specialized state machine for scraping HTML, kind of a poor man's web services trick. ;-) I was on a State Machine kick for a while and this was the first post with my own code.

Here's a story about a trend I see in the programming industry with a lot of links to other resources and a lot of java open source name dropping.

Here are a couple posts about perspective and vanishing points and an SVG animation. You'll probably need Adobe's SVG plugin() to look at it. The first illustrates some terms used in describing perspective. The provides and animated illustration of a vanishing point. You can look at the source for the animation (third link below) to see my experiment in using closures to create something like a specialized animation scripting language. Very much in the functional style of programming with just a little bit of object stuff in there too.

Fri 7 July 2006 05:26 PM
Power Shift -- a daydream of an ad hoc network

I sent this message on an email thread about the Apple vs. ThinkSecret lawsuit. The conversation took a conspiratorial turn and I dropped in this little dose creative and cynical optimism.

Couple things on this thread...

First thing is that intellectual property is very slippery stuff. Knowledge doesn't have the same attributes as matter and there are all sorts of convulsions happening out there trying to force rules that make sense for things but don't really make sense for knowledge. Apple and ThinkSecret are just another episode in the ongoing wrestling match. The 'Net is a hugh power shifter and power never shifts gracefully. We can expect to see this kind of fight for a long time to come.

Someone else wrote:

There are governments, as well as large corporations in this World, that would just as soon see the internet shut down, or censored and filtered beyond what we would recognize as the net now. The internet is the only form of media they do not yet control.

Second, I think there's good cause to be concerned about Government or massive corporations abusing their respective power. Even so, I think you're really underestimating the ability of the 'Net and its citizens to route around damage. In some ways this is an inherent property of knowledge and information. You can't really build walls to contain it.

Imagine a worst case scenario -- the government and the 500 joined forces. GovCorp started by trying to protect children from pornographic spam and over a few years grew the Decency Consortium into full scale censorship and information control.

Over the same few years, the Greybeard Programmers remembered how it used to be in the early days of the net, long before it had been commercialized. Even universities were connected to each other over dial-up lines. There weren't permanent connections between places and there really weren't central points of control. The protocols that were used in those days were still out there, lying dormant on most computers. They dug out the old code and polished it a little bit to work over wireless networks and to exploit the recent advancements in peer-to-peer file sharing. It was a bit slower than the dedicated lines, kinda like the good-ol-days. But wireless cafes and wireless laptops and almost forgotten protocols enabled a network to emerge that didn't use any ground lines, cell towers, nor satellites.

Some open source projects quickly emerged to assemble packages which make it easy for anyone to install the new-and-improved old-school tools. Just as GovCorp was sealing the last nodes of the network, the Software Pirate Syndicates learned about the work of the Greybeards. Their distribution swarms spread the tools as far and wide as they could. Within a few days the FreeNets sprung up all over the world, well out of reach of any single political jurisdiction.

Anyway, while it's important to pay attention and to hold government and corporate powers in check, there are far more important issues. Human minds are at their creative best when they are at peace and uncluttered by fear.

Tue 5 April 2005 10:52 PM
Creating islands of peace in a terrified world

The world in which we live is full of unnecessary suffering. While homo sapiens have created many beautiful things, many extraordinary things, far too much of our collective work is destructive rather than creative. In general our ingenuity and energies often lead thoughtlessly toward suffering and destruction, rather than understanding, compassion, or beauty.

I have a collection of practices that have reduced my own suffering enormously. I share them here with the hope that you may also benefit from them, reduce your own suffering, and increase your constructive contributions to the world. I have no particular need for you to accept what I offer here. But I hope some among you will find value in these practices and reshape your own corner of the world around values of peace, acceptance, compassion, and beauty.

The Really Big Picture

There is a purpose to our existence: to experience Love and Joy.

We are individuals who live in groups. This creates the most basic tension between our own needs and the needs of our family and our community. At our best, this tension creates the most profound experiences of love and joy. At our worst, this tension creates our deepest suffering.

Balance is a key part of the big picture. The universe at every level works toward a balanced state. The suffering in human experience is an effect of our own imbalance.

"I understand about indecision
but I don't care if I get behind.
People livin' in competition.
All I want is to have my peace of mind."

What is needed individually and collectively to maintain the balance is peace of mind. When our minds are at peace we act creatively in the world, and we experience and expand love and joy. When our minds are not at peace we act destructively. All of the suffering in the world are effects of our collective imbalance and the destruction which emerges from our imbalance.

The most promising path away from destruction and suffering and toward love and joy is to create peace first in our own hearts and minds. We must trust the magic of emergence to create solutions to the big, global problems. As we gain our own balance we can help those in our immediate group to regain their balance. We can create islands of peace in this terrified world. We can create networks between our respective islands so that we may know that we are not alone in this effort to restore the balance.

The practices I offer help to create and sustain individual peace of mind.

The Root of the Problem

Vanishingly few of us are raised with the unconditional love of our parents. Vanishingly few of our parents were raised with the unconditional love of their parents. And so on. We grow into our understanding of the world with the distorted notion that love is somehow scarce and uncommon, that we must prove ourselves worthy of love, that we aren't naturally acceptable. The lack of unconditional love undermines our belief-in-self. At the critical foundation of our lives, we learn to doubt and second-guess ourselves. We learn to guard our own love and joy cautiously, and to cling to what shreds of love and joy we find in the world. We learn to hoard the love instead of sharing in it. In so doing we create the very scarcity we fear.

These distortions become ingrained in our perception of the world, ingrained in our understanding. In a sense the distortions are cemented into our own minds. It turns out to be quite difficult to change your mind. A change of mind is exactly what's needed.

A Picture of the Mind

Know that I am not a neurologist, nor cognitive scientist, nor psychologist. I have no credentials to claim my picture of the mind is in any way authoritative nor measurable. I offer a metaphor. I am a geek, so you may notice a striking similarity to a computer.

The mind very simply responds to incoming stimuli with information relevant to the stimuli.

Stimuli are just information that enters the mind via our senses. The mind responds to one bit of information with another bit of relevant information drawn from memory or intuition. The secret sauce that sets our minds apart from a computer is that the mind responds with relevant information. The relevancy filter makes all the difference. What's important to notice is the positive feedback loop. The positive feedback loop causes the mind to run in vicious or virtuous cycles depending on the character of the information stream.

The Missing Manual

We all live with our minds but mostly not in any intentional way. We swim around in a stream of consciousness as the mind sifts our memories and experience through the relevancy filter. We have implicit knowledge of the mind but not explicit knowledge.

All of my practices rely on the same trick: intentionally inserting thoughts into the feedback loop to effect the character of the cycle. I insert thoughts which strengthen balance and peace of mind, intentionally seeding the feedback loop to steer towards virtuous cycles and away from vicious cycles.

The trick is to trust the relevancy filter and specifically ask the mind for what you want in the way of information.

State of Mind

The mind wanders a continuum between peace and fear. A peaceful mind creates virtuous cycles of information which foster creative and constructive actions. A fearful mind causes vicious cycles of information which foster our destructive behaviors.

Consider again how the mind works. It simply responds to stimuli with relevant information. If we respond to a stimulus with fear, the information will be relevant to the stimulus, but it will also be relevant to the fear. Those bits of information stimulate another cycle of information that is also relevant to the fear. Our minds can become consumed by fear. Our usual tools for dealing with fear are destructive.

If we can respond to the stimulus without fear, we will get a stream of relevant information. From this stream we act creatively.

These vicious and virtuous cycles in individuals are magnified geometrically in groups. The effects of peace and fear in individuals feed off one another. Our destructive behaviors create fear in others who then create their own destructive behaviors. By contrast, our creative behaviors may solve problems for others freeing them to address other challenges.

Instinctive Responses to Fear

Our instincts offer only limited responses to fear. In immediate life-threatening situations we will fight, flee, freeze or faint. None of these responses are creative, nor particularly effective. They have served the species well enough to get us where we are today, but very few of us face situations which are immediately life-threatening. Nevertheless, we live in fear and even non-threatening social situations can provoke the same bodily responses -- increased pulse, sweat, shortness of breath, heightened awareness, hyper-sensitivity, and edginess.

Variations on these instinctive reactions to fear manifest in non-life-threatening situations. A fearful mind responding to stimuli will first deny the fear. When the fear remains the mind will respond with ways to cope with the fear. When coping fails, the mind will compromise with the fear. When compromise fails, the mind will defend the fear. When defending the fear fails we descend into a generally self-destructive pattern which allows us to survive with the fear.

Some survival patterns include drugs, alcohol, or other addictions which aim to dull the pain of surviving with fear. We may also try to control or manipulate those around us to ward off our fear. My survival pattern is perfectionism and avoidance. I try to get something exactly right or I try to avoid it altogether. I also end up with a lot of self-directed anger and condemnation when I fall short of perfection or get bitten by a problem I was avoiding. Other patterns include depression, anxiety, jealousy, gluttony, sloth, and various other destructive behaviors.

Survival patterns are where we suffer with our fear. As our own suffering eats away at us we often share the suffering by lashing out at those around us or deceiving them or even just by whining.

How it should be

Children who are raised with unconditional love grow into the world with an incredibly powerful belief-in-self. This belief-in-self is like a strong immune system which prevents fear from taking hold of the mind.

When faced with a scary situation, those with a strong belief-in-self will assume they can rise to the challenge and find a creative solution. Their minds are not consumed by the fear and the destructive responses to fear. So their mind will be filled with a stream of relevant information, uncluttered by fear. They can think clearly under the pressure and gradually the steps that need to be taken become clear.

It is strong belief-in-self that allows people to trust their own minds, to trust their own resourcefulness. Fear cannot find a hold in their minds.

Few people enjoy such profound belief-in-self because few people were raised with unconditional love. It is very, very difficult to bootstrap belief-in-self. Creating belief-in-self is the key to creating a balanced and peaceful mind. But changing our minds is much more difficult than we are led to believe.

The Practices

We can break our own vicious cycles by practicing more constructive responses to fear. The basic trick is to intentionally and repeatedly insert thoughts into the feedback loop. These are instructions to the relevancy filter to tune the kind of information that the mind digs up for us.

"Release my fear"

Filter out the fear, please. Request information that is only relevant to the situation at hand, not information that is relevant to the fear. This is the most direct way of responding constructively to fear. Just tell your mind to let it go.

"Peace of mind"

Asking for peace of mind is the same as releasing fear, but with a positive spin. Instruct the filter to favor information that will calm the mind and maintain the balance.


Ask your mind for information which reinforces your belief-in-self. This is a longer term investment. Building belief-in-self helps reduce the need for actively releasing fear or asking for peace of mind. Specifically asking for belief-in-self can help summon courage when faced with scary news.

"Needs be met"

"You can't always get what you want.
But if you try sometimes
you might find
you get what you need."
-Rolling Stones

Ask for help with a leap of faith. This is an intentional adjustment in perspective. Whatever may appear to be looming on the horizon, creating fear in your life, you are still alive and breathing. Many times before there have been things looming on the horizon creating fear. But in all previous cases, your essential needs have been met or you wouldn't be here alive and breathing. Ask your mind to remind you of the times when you have narrowly succeeded against the odds. Ask to be reminded of the times when your failures turned out to be less disastrous than you had imagined. Ask to be reminded of the times when you have recovered from failure with unexpected follow-up successes. There's plenty of evidence in your experience that things work out in the end. Needs are met.

"Practice acceptance"

This is the hardest of the practices for me.

As we ask our minds for specific information about a problem, a pattern emerges. Who do I need to talk to? Where do I have to go? What exactly do I do next? When to I break the news? More often than not we just don't know. We may know most of our answers, but some key piece eludes us. So we analyze the hell out of the situation and try to force or coerce that last ingredient out of our own head. But the simple fact of the matter, it isn't in there and no amount of re-hashing the same collection of facts can change it.

Practicing acceptance is closely related to asking that needs be met. In my own experience I eventually discover that key information in time to prevent catastrophe or to recover from my mistakes. Even the need for information has been met. Practicing acceptance is also a leap of faith. It is accepting that I don't know the answers now, but I will. I will know the answers when I need to know them. Accepting that I don't know those answers now frees my mind to work on other problems.

"Solution in progress"

Insert a belief into the feedback loop that needs are met and that there is a solution in progress which will resolve whatever issue is creating fear. I've found this one to be a powerful compliment to practicing acceptance. It helps me get over my overgrown sense of responsibility for the world. I did not personally create the war in Iraq, for example. I sure haven't been able to extend any influence over our continued imperialism. This is a problem that is considerably out of my reach. By inserting the belief that there is a solution in progress I can free my mind to attend to things that I can actually influence. (Like, oh, say, finally publishing these practices for creating peace of mind).

...to be continued

Wed 10 November 2004 03:06 PM
Overconsumption and Terrorism

Here's how I think we have come to inspire so much hatred in the rest of the world. Sometime soon I'll share a few things that I'm trying to do about it.

The United States' produce over 20% of the world economy [1] with less than 5% of the world's population. [2] That suggests astounding leverage. Unfortunately we consume 30% of the word's oil. [3] The USA is a machine that consumes 30% of the oil to produce 20% of the GDP. The 10% difference is friction or profit depending on how you look at it.

Usually those numbers are thrown around by zealous environmentalists warning of impending ecological catastrophe. I, however, will take those numbers down a different path of impending doom. :-) In order to consume 30% of the world's oil, we must control 30% of the world's oil. If you want to understand the hatred of the US, look no further than the way we control and consume that 30% of the oil.

Like all effective forms of control we use a carrot and a stick. The carrot is the money we are willing to pay for oil. The stick is how we use our military to "protect" the world's oil supplies.

The major oil producers in the world can't afford to anger their biggest customer. They're stuck pretending to enjoy the dance with us even as we step on their toes or kick them in the shins. We don't really have to be a good dancer because they can't afford to say no to us. That kind of imbalance breeds deep resentment.

Our "protection" of the world's oil supplies is mafia protection.

You say, there's a 'dangerous element' threatening your pipelines and oil wells. Of course we'll protect you. How could we not? Welcome to the family. We can count on your undying loyalty, yes?

That claim goes completely against our national self-image. Aren't we the beacon of Freedom, a nation of the people, by the people, and for the people, a more perfect union?

When I get this cynical in conversations with my friend Jeff, he reminds me that we are the most giving nation on Earth. Actually, no. In absolute dollars, Japan is the most giving nation on Earth and we are second. [4] And we're way down on the list relative to GDP [5] or population. [6] Our generosity pales in contrast to our military spending. Ours is 37% of global military spending. China is a distant second with 8%. [7] That's a very big stick. What's more, we've shown a historical willingness to use it.

Peter Hartcher says the Congressional Research Service notes 200 US military interventions abroad since our independence. Unfortunately he failed to name the source of that figure so I went digging. The most likely candidate: CRS Report RL30172 -- Instances of Use of United States Armed Forces Abroad, 1798-2001 (160K pdf)

I count 299 instances of varying scale. Did Peter filter the list according to his own notion of military intervention, or draw from a different source? Regardless, the United States is only 228 years old and by our own reckoning we have conducted 299 military interventions abroad. As I've said before, the rhythm of our war machine is disturbing for its incredible consistency. It's like we're a geo-political vampire craving a bloody fix every few years regardless of who is in the White House. (How's that for cynical?)

Let me be clear. I love this country. God bless America. I wouldn't live anywhere else. I am completely blessed to have been born here. (No sarcasm nor cynicism in that sentiment whatsoever -- just in case my tone of voice in unclear in this written form.) Nevertheless, in our behavior abroad we fall very short of our own high standards. We talk a good game about freedom, but the walk we walk is enormously intimidating. Our global posture is why the country I love is the target of such widespread hatred.

We are at the center of a gross imbalance in the world. Oil is the foundation of the global economy. It's not that terrorism is directly about controlling oil. Rather, the imbalance in oil consumption reflects a broader imbalance of power and wealth in the world. It is the power imbalance which feeds the terrorism. Oil happens to be a useful way to measure the imbalance. Specifically, 5% of the world's population controls 30% of the oil.

Nature abhors imbalance. When things are out of balance, they fall. In human nature this rule often presents itself in bloody revolution. Those with little power become desperate enough to risk and even sacrifice their lives to oppose the imbalance. Throughout history the mighty have grown and grown only to fall at the hands of desperately oppressed people determined to reclaim their own power.

Here's what I mean by gross imbalance. Measuring wealth and power by oil consumption, if power were divided equally in the world, each person would get a bit less than a half-gallon per day. [8] But power is not divided equally and the US controls 30% of the oil. Pretending each US citizen gets an equal share of that 30%, I get just less than three gallons/day. [9] In order to redress the imbalance I would have to give up two-and-a-half gallons of oil per day or 86% of my current share of global resources. That is gross imbalance and that is the heart of the problem. However idealistic I may be, I cannot imagine how I could reduce my consumption by 86%. And so I contribute to the demand for oil. That contributes to the power imbalance.

Sarah added another dimension to the mix. The US is so powerful that there's no immediate need for us to listen to what the rest of the world might think. We mess around in the matters of other countries throughout the world either financially or militarily to protect our interests in their part of the world. We don't give much consideration to what's in the best interest of the other countries. If we were less powerful we wouldn't be able to behave so selfishly in the global theater. The imbalance of power enables our government to run roughshod over the needs of the rest of the world. It is an important dimension to the way the imbalance of power fuels international resentment.

The problem is our very way of life. It's not about our freedom. It is about our gluttony. The protection of our global interests supports our gluttonous lifestyle. It's fast-food, SUVs, shopping malls, televisions, movies, air conditioning, air planes, and clothing. It's our music, our computers, our American-dream single-family-homes, our two-car garages, our eight-lane highways, our parking lots, and our CostCos and WalMarts. It's the paper cup and plastic spoon we throw away each time we order a drink at Starbucks or McDonnald's. It's the extra helping of fries, and the quarter-gallon of carmel-colored corn syrup we drink to chase down a mediocre four-dollar hamburger.

In so many areas of our holy way-of-life we abuse our wealth and power in thoughtless waste and excess. Our military defends the world's oil supplies so we don't have to think about the stuff we throw away or the energy that went into its creation. As we sit in the line at the drive-thru, radio and air-conditioning blasting, we give no thought to the money and power we're burning idly away. As we throw the cup out the window, we give no thought to the energy that went into its creation, nor to the diesel fuel that delivered it from the factory to our favorite food joint. Unfortunately our thoughtlessness "trickles down" into international hatred.

[1] US GDP is $10.45 trillion, of the total $48.51 trillion globally. http://www.nationmaster.com/graph-T/eco_gdp

[2] US population is 290 million of 6.1 billion globally. http://www.nationmaster.com/graph-T/peo_pop

[3] The US consumes 19.7 million barrels of oil per day of 64.81 million barrels per day globally. http://www.nationmaster.com/graph-T/ene_oil_con

[4] The US gives $6.9 billion of $48.62 billion globally. http://www.nationmaster.com/graph-T/eco_eco_aid_don

[5] http://www.nationmaster.com/graph-T/eco_eco_aid_don_gdp

[6] http://www.nationmaster.com/graph-T/eco_eco_aid_don_cap

[7] US spends $276.7 billion and China $55.91 billion of $738.04 billion spent globally on military. http://www.nationmaster.com/graph-T/mil_exp_dol_fig

[8] (64.81 million barrels per day * 42 gallons/barrel) / 6.1 billion people = .446 gallons/day/person

[9] (19.7 million barrels per day * 42 gallons/barrel) / 290 million people = 2.85 gallons/day/person

Sun 12 September 2004 11:11 PM
Political parties follow population

This just completely amazes me. I've been focusing so much on Colorado that I somehow missed the national pattern. I've been peeking at www.electoral-vote.com rather often lately. Polls don't tell me much when I hear them on the radio or read them in print. Watching them in a graphic adjusted according to electoral votes has been interesting.

Today they posted a new map of the 2000 election with voting breakdowns by county. Take a look at that map. There's a pretty compelling correllation between population density and political party. Seeing it on a map really hit me.

Until recently, I did not understand why rural Colorado generally votes for republican leaders despite consistent favoritism toward big corporations and the super-rich. My roots run three generations deep into rural Colorado soil, but I've been voting democrat for years now. I'm finally starting to understand the descrepancy. The republican intelligentsia talk a good game about small government but their power-grabbing actions speak louder.

I hope some of you folks who aren't living in cities or suburbs will reconsider your support for the Bush administration. They are not who they pretend to be.

Wed 14 July 2004 11:32 PM