Wednesday, December 4, 2013

Book Review: How Buildings Learn

How Buildings Learn discusses how inhabitation and changing environment and demands shape a building while it is being lived in and used, how that learning process works, and how the style and structure of the building and the different parties involved can help or hinder this process.

The first helpful mental model How Buildings Learn introduces is the shearing layers of change: Site, Structure, Skin, Services, Space, Stuff (and a half-joking 7th layer, Souls).  These are the slow and quickly adapting layers of buildings; they range from the nearly-eternal site (a citys street grid can survive centuries, fire and earthquakes) to the ephemeral space and stuff plans, which are subject to constant activity (at the whim of that pesky Souls layer inhabiting the building).  Freezing a mistaken decision in an immutable slower-changing layer (like structural elements that inhibit Space adaptation) creates pain for the buildings users forced to live in the poor and inflexible fit.

Another broad and convenient framework the book introduces is Low Road and High Road architecture.  Low Road buildings occur when people take over a space, often inexpensive, that allows them to improvise and get to work.  These included converted factories, warehouses, garages, barns, boats, storage containers, and churches.  These buildings learn because the building is not a precious item and so the inhabitantrs can work with it loosely and as they see fit.

High Road architecture learns instead over generations of patient care.  Stewart Brand draws the analogy to r-selected amd k-selected species.  The book shows as examples the best cared-for country houses of England and the manors of America's founding fathers.  High Road buildings last long enough to turn passing styles into history; doing one right is a labor of love measured in lifetimes.  A humbler example given was the home of poets Una & Robinson Jeffers in Carmel.  Built mostly by Robinson in local stone, he wrote in the mornings and worked on the home in the afternoon.  The home included a stone tower with a quiet chamber for his wife and a playroom and secret inner staircase for their boys.

One later chapter that I'd do well to learn the value of is Brand's paean to maintenance as a form of learning.  In a cute phrase: "If you would ensure a building's longevity, protect it from markets and water, and feed it money, but not too much and not too little.". A basic idea from this chapter is that too much work and money usually go into the initial construction and not enough into gentle maintenance which allows the progressive correction of earlier missteps.  Need buildings he suggests are especially dangerous because they initially hold together, delaying the formation of good maintenance habits.

This chapter contains a helpful inventory of roof and construction materials from an aging and adaptability perspective.  I hadn't realized the great difference in wear between wood stud framing and brick.  Light wood construction is a very adaptable and easy to work with medium but it must be carefully sheltered from moisture and the elements.  Brick, among others, has a completely different life cycle, but can last hundreds of years and stand up to much greater neglect and exposure.  I'm not used to thinking of buildings as systems of materials instead of definitions of light and space.

Another chapter with a fresh perspective was that on vernacular architecture; everything not designed by professional architects.  There is an especially interesting section on American residential vernacular that discusses Cape Cods & ranch homes, bungalows, and mobile homes.  I live now in an modest but unique apartment that is a really special space.  Paying rent is a pure loss however, and we do sometimes miss a garden to grow in, a yard to stretch our legs, and patio to rest on.  I hadn't considered some of the virtues of a small, modest, and flexible home; one that could find a spot in a real community, and be capable of growing and adapting with us.  Brand in this chapter was very enthusiastic describing the vitality of these housing forms.  It made me curious to wonder how much space is in one of the (quite nice) mobile home plots near Mountain View, given how much rents there are and the population of hackers and developers there who would appreciate inexpensive housing and flexibility.  Another option to consider!  One a bit off the path for my urban mind.

An author Brand quotes frequently is Chris Alexander, another thinker and builder who has considered how buildings can adjust to house flourishing human lives and how those flourishing lives can come together in a way that graces their surroundings.  I want to read his A Pattern Language: Towns, Buildings, Construction.  It introduces the idea of design patterns; general patterns of solutions to archetypes of problems, and the format for presenting them.  An exposition of similar patterns in the smaller realm of software design is Design Patterns: Elements of Reusable Object-Oriented Software.

How Buildings Learn struck a strong contrast to what I'd learned about Modern & Postmodern architecture.  I took a single course on modern architectural history, and one aspect I always found a bit odd about the way it was taught is that it focused on a few select buildings which set and typify style, forming a microscopic fraction of the world's construction, and not the rules and patterns according to which most building are actually built.  Based on Brand's references to many of the same figures, movements and exemplars, (proto-modrrn works like the Eiffel tower, the International style and its later adherents like Im Pei, and its manifestation in commercial and institutional buildings, and then Robert Venturi and later Postmodern adventures) this was not a deficiency of this particular course, but a fair sampling of the evolution of thought in high architecture.

Viewed less as an artform, the profession of architecture is structured in several ways that hurt clients.  The architect has little incentive in many contracts to make sure the building serves and adapts into its first years of occupancy.  Architects' contracts are also not always structured to encourage minimizing and meeting costs and producing buildings that will be simple and joyful to maintain.  Facilities management & construction management that Brand mentions which have sprung up to fill this gap.

One small kinship I had with the author is that he lived and wrote from Sausalito, so the book is rife with Bay Area references.  He mentions houseboats in Sausalito, converted garages in San Francisco, homesteads in Campbell & Point Reyes factories, converted to office space in Emoryville, and surplus military sheds in Mountain View.  The geographic immediacy enriched the book for me.

Monday, November 25, 2013

Networks, Crowds, and Markets Review: Parts I-IV

Full Book Text Available Here

Parts I-IV of this text cover graphs and networks, game theory, markets and auctions, and touch on information networks, search techniques, and advertising markets.

This book was interesting in that it introduced me to some new ideas, bordering on concepts I was familiar with, with a very basic level of mathematical understanding required.  I'm familiar with graphs from an algorithms point-of-view, so the sociological viewpoint in Part I was fresh to me, even though the material was not too advanced.  I had also never been exposed to the ideas in game theory or evolutionary game theory, so I thought they were valuable fresh conceptual tools.

Part I introduced a number of sociological concepts in networks to me.  Homophily is the tendency to befriend, bond with, and be associated with, people similar to yourself.  Triadic closure is the idea that 'triangular' relationships between 3 people are likely; if people A and B have bonds to a common C, it is likely that A and B will be associated.  Triadic closure can be extended by adding a notion of tie strength.  The Strong Triadic Closure property says that if A and B have strong ties to a common C, A and B are almost certainly associated.

An interesting global property that falls out of this local one is that 'local bridge' connections between cliques in networks are usually weak ties, because otherwise the Strong Triadic Closure property would mean that more people in the clique would be associated, and the bridge would no longer be a bridge.  The common-life corollary to this is that new job offers and opportunities often come from weak associations.

Structural balance is another (somewhat dangerous/unfortunate) idea that adds support and antagonism to networks, 'signing' them.  All edges between nodes in the network are labeled either with + for positive or supportive relationships or - for opposing, antagonistic relationships.  Structure balance looks at triangles of edges between nodes and says that +,+,+ triangles and +,-,- triangles are 'stable'.  +,+,- is unstable because it corresponds to the situation in which 2 mutual friends of a third-party dislike each other.  The third-party will pressure his friends to get past their grievances because it stresses the relationships.  -,-,- is unstable because the incentives are strong for 2 nodes in the triangle to 'team up' against the third.

Structure balance then states that global network properties occur if these structural balance properties hold locally.  In particular, if the network is fully-connected and all nodes have a positive/negative relationship with every other node, and the structural balance properties hold everywhere, the network will be divided into 2 opposing camps.  This can be applied towards explaining some of the vexing consequences of alliances in international relations.  The authors also generalize this in 2 dimensions, by removing the requirement that the graph be fully-connected and removing the requirement that the structure balance property hold locally everywhere.

The chapters on game theory were also useful to me, especially in terms of understanding how rational behavior can lead to socially stupid outcomes.  I feel like I have a better eye for incentives now, how they drive behavior, and how they could be adjusted for better overall outcomes.  The section on auctions was particularly helpful for the later sections on markets in a network context; the book built well off its foundational concepts there.

A book I am considering as a follow-on to Networks, Crowds, and Markets is Algorithmic Game Theory [], which includes sections on mechanism design; the design of markets, auctions, and other mechanisms that try to make rational behavior of individual actors work for the social goals.  This book also has chapters on reputation systems, peer-to-peer systems, routing and allocation and prediction markets.

Parts III and IV are less foundational, and more focused on applying the earlier ideas in network contexts.  I'm not sure many of these ideas will be code-applicable for me yet, but I would feel more confident reasoning about the behavior of entities like Amazon, Google, and SaaS companies. After reading this I'd be in interested in looking at algorithms for determining prices and matchings, like balanced outcomes in the surplus-splitting game, or VCG prices for multi-buyer, multi-seller options, and how one would prove properties like balance, stability, and equilibria.  I'd be especially interested in algorithms over larger, non-trivial networks, results that take information asymmetry more into account.  Algorithmic Game Theory may address some of the former, and the later parts of Networks, Crowds and Markets the latter.

I'm not sure I'd recommend this book yet overall, the conceptual punch per page quotient doesn't seem too high.  The initial chapters make good expositions to networks and game theory in their own right.  I'll report up on final thoughts and the later parts of the book once I finish them.

Thursday, October 31, 2013

Book Review: Ishmael

Ishmael Full Text Link

Modern man's original sin, which nettles me each time I fly home, or drive further than is essentially necessary:
"You’re captives of a civilizational system that more or less compels you to go on destroying the world in order to live."
This book held sadness for me but some wise lessons and hope.
   It asks what myths our culture has.  A myth doesn't have to be completely fantastical to be a myth, just a story of the world that captures culture's beliefs and values.  Some civilized myths I see are a tidy linear notion of progress, a belief in the exceptionalism, superiority, and unity of any nation, and the idea that we all have access to the same opportunities and gifts in life.  The core myth that Ishmael examines is the evil human conception that the world is made for us; that the natural world has value solely as its useful or enjoyable to people.  As Ishmael points out, this belief has had severe consequences in an ecological instant.  Like any belief or model that diverges too far from reality, it must eventually and painfully deflate.

I think the implicit belief that the world exists for our use and convenience does seem to be reflected in many of our actions, and we may be heading towards a point when that belief could collapse.  Human Appropriation of the Products of Photosynthesis estimates that our species is consuming or displacing 40% of the biomass of the planet.  This is such a large percentage where we can no longer count on the rest of the system to stabilize itself and our contributions to the load; we can easily throw the entire system out of balance.

Another critical message of Ishmael is that our window of time of recorded history is a minuscule slice of time on evolutionary, planetary, and cosmic scope.  Events we think of as ancient history are a few hundreds of generations ago; stories enacted by creatures so genetically near to us as to be indistinguishable.  Our few thousand years of experience of abjuring our place in nature and trying to chart our own history weigh against the few million years of stability achieved by mankind prior to that, and the hundreds of millions of years organized life has survived and thrived prior to that.  If that stability seems threatened now, our lack of perspective, alienation and self-centered values are to blame.

Many of creation myths we are familiar the place man somewhere between gods and animals, showing our powerful tendencies to place ourselves above the herd.  Accepting that instead we are short-lived conscious animals produced after epochs of selection and made of the same cosmic muck as the rest of the world actually feels pretty liberating.

It's not too late to redeem ourselves, though the world is churning forward recklessly fast.  We can accept our place in natural life as a fascinating and unusually social twig on the great evolutionary tree of life hundreds of millions of years old, and recognize that though we live and die in a few score trips around the sun, this planet or others can play host to thriving life for a few billion years.  We are not the final culmination of natural or intelligent life (nor is evolution the kind of optimization process that produces a final culmination) but we are clever, powerful and perhaps wise enough to act as stewards, not masters, of this bequeathment of life, for a time.

In terms of what forms our society might take to meet such ends I'm not sure.
How can we undo the hateful parts of the future we are barreling towards?  Still on my reading list,
Whole Earth Discipline proposes nuclear power and dense urbanism.  Population-wise we are likely already over our planets sustainable carrying capacity, so I think slowing or reversing that growth is essential.  I think much of the work to be done is social and spiritual as Gary Snyder suggests (; we need to undo fearful and compulsive thinking, both individually and collectively, to enable us to live in the world compassionately and without avarice.  Goal is that we may be able to demand less from the ecological web we are begrudgingly part of, without abandoning the knowledge, technology, or connectivity we have gained to date, so that we and untold generations to follow may live peaceful, prosperous, meaningful and fulfilled lives that our ancestors, foragers or farmers, would be proud of.

Ishmael spends a fair bit of time discussing the conflict between "Leavers" & "Takers", low-population foraging people and sedentary, domination-oriented agriculturalists.  One recent take I read about this conflict and transition (Coevolution of farming and private property during the early Holocene) which is discussed here: talks about how the development of agriculture is closely tied to property rights; a farmer can gather in times of plenty and then not be compelled to share that surplus in times of famine.  Agriculture and property rights are a bit of a chicken-and-egg phenomenon, but they compose an evolutionarily stable strategy in simulation, which may, for moral and ecological better or worse, explain their dominating spread.

Saturday, October 26, 2013

Book Review: Topiary

Full text link:

What a disturbing book!  Not a great classic, but a potentially powerful tale in our time.  Contrary to some reviewers I found this non-traditional parable readable, and what I understood I found disturbing.  Topiary is set in a nightmarish version of our own world and New York City in particular, where the technocratic engines of society (reduced from their familiar branding to singular titular entities: The Nation, The City, The University, Big Media, Tree of Knowledge Incorporated, The Network, The Infocracy) churn forward like a monstrous machine with no organic life left in them at all.

The identity of the protagonist resonated with me.  He is a younger man (and a bit of a hack in school, not a true artist) who worked at an ad agency (rather The Ad Agency!) producing pure talk and false images to incite desire. Lost and disillusioned by this work, he quits become Plantman, the maintainer of corporate flora.  His travels then take him through the offices and personalities of this nightmarish world, maintaining the few spots of life still found among the high rises where only money lives.  Though I have more hope for its value, I feel a bit lost and disillusioned in corporate knowledge work myself.  It sometimes runs contrary to the values and environment I held dear growing up, and those that people have lived with for a hundreds of thousands of years; perhaps I'm also meant to be a Plantman?

One of the issues I struggle with in my work (system software development) is separating out the accidental difficulties from the essential.  One item that stresses me greatly that seems almost entirely accidental is the working conditions; a cubicle to sit in in a nearly windowless building for roughly fixed hours per day.  Our buildings are interspersed with green walkways, and one can escape with a laptop to work outside the usual box, but I keenly feel the alienation and isolation from our ecosphere that Plantman mourns.

This novel is as a trip through our own contemporary society, particularly the elements perceived as admirable, powerful and influential, without the benefit of our myths, heroes and culture to cover the sharp edges.  Plantman is particularly critical of the role of media in both commercialism and nationalism.

With shame, I remember my attitudes as a younger man when America first invaded Iraq.  Even without television, I remember listening to radio coverage of our devastating opening bombardment (Shock and Awe?  What egotistical merda of a name is that?) with cheerful, tidy nationalistic pride.  Over the course of Topiary, The Nation wages a highly televised, one-sided The War with a Rogue Regime.  It blasts on prime-time in HD, and shows on giant televisions in the gym for employees to pump their body too.  There is little discussion about what weighty concern, grave necessity, or painful tortured moral cause led The Nation into war; it is nearly a media production to unite The Nation and The Citizens.

The crass, self-conscious use of artistic methods and expressions to incite desires and drive sales for private profit is a subject of intense criticism in Topiary.  Plantman's first soul-draining job is as a copy-writer.

As I see the world, we put a dangerous load of fragile ecosystems and non-renewable resources that may well doom us.  Buddhism and other traditions teach that one of the primary weaknesses of human nature is our predilection to desire that which we do not have; we always want more, more, more!  Even with little natural encouragement.  We also have a foolish proclivity to always seek novelty and fit images, roles, and groups that our presented to us.

To then dedicate the talents, energy, and effort of intelligent, driven people to exacerbate these natural weaknesses, spurring higher consumption and greater drain on our shared planetary resources, is irresponsible and unethical.  Consumeristic drives say that a product can balm some wound inside of us, can provide meaning, or makes us the people that we want to be.  In Topiary, Plantman's prime work as a copy-writer is EARN, a polished but completely crass ad campaign for a designer perfume that comports to be bottled sexual desire.  The cynical centerpiece is a print of a naturalistic wedding of unattainably beautiful beings entitled "EARN the moment.  Forever".

Many of cultural criticisms I've mentioned are well-worn to astute observers, but Topiary, aided by it's non-traditional syntax and narrative structure and dystopian subversion of modern life, relays them with a freshness and immersively disturbing quality that is like plunging your head into an ice-cold bucket and being held under unable to breathe.  The overriding arc of the book is that the frenzy, complexity, impersonal economics, and mechanization of modernity squeezes out the life in the world and in us.  Topiary highlights the scope of the changes we should make in how we live, the consequences each of us face for acting without caring or thinking, and the despair that could await us if we don't act to live our lives and change our world for the better.

Saturday, October 19, 2013

The Great Divorce Review

 I'm doubtful of literal supernatural truth to a Christian afterlife, but I thought that The Great Divorce was a thought-provoking exploration of the limits and traps of human nature, behavior and cognition.  In the same way that from a cosmic perspective, we live in a vast, profound,ancient and wonder-rich universe, but we spend much of our time bound in small human struggles and to tied to earthly pursuits and possessions, the shades in The Great Divorce each had their own ball & chain binding them to their condemned state; their own attachments preventing them from realizing salvation, each one a cautionary tale about cognitive, social and behavioral traps that keep us from realizing the greatness of the universe, and our belonging to it.
    I found the narrative structure of the story effective.  The structural similarity to Dante's Inferno, with the narrator finding himself without explanation in this strange land with his mentor, is a natural choice.  The manner in which the world around him has no immediate explanation, but all the people speculate about it to each other.  This evoked for me how we all find ourselves on earth, in a vast and complicated social and natural world with no obvious meaning, but we all search for such meaning and understanding together over our lives.  Their abrupt, contextualizing openings are similar as well:.  The Great Divorce starts  "I seemed to be standing in a busy queue by the side of a long, mean street"; Dante's Inferno "In the middle of the journey of our life, I came to myself, in a dark wood, where the direct way was lost."  These both are apt ways to begin dream-parables (what were you doing before you find yourself in a dream-world?) The contrast is that this is a tale based off a modern world much like our own.
    I found the  strange behavior of changing scales, time & dimensions in The Great Divorce evocative.  Hell/Purgatory is present but seems immaterial, and new streets and houses can be simply wished into existence.  There are few social ties or bonds of affection to hold people together and souls seem bitter and unpleasant, so the city sprawls and the world stretches on millions of miles almost empty, and curves in some odd way.  One of the residents uses a telescope to look across it, like the city itself is a cosmic sphere.
    Yet when the bus departs out of Hell/Purgatory, looking back what seemed to have been a vast chasm looks in retrospect to be a miniscule crack.  I thought (somewhat ironically) about Richard Dawkin's Middle World idea ; that we experience the universe as we do because our brain's are tuned for existence at certain scale, timespans, and energy levels, and we perceive time, scales, and energy levels with respect to that.  We can reason abstractly about behavior at other scales (especially using science and mathematics, tools that do not rely so heavily on our intuitions) but the conclusions about the universe we arrive at may "do violence to our common sense".  We might imagine that from an alien perspective, rather than "in the trenches", our own moral trajectory as individuals or a species might appear very differently.
    At the end of the story, before the narrator awakens, he has a flash of an illusion that what he is seeing is another perspective of mighty and vast immortal souls and ideals interacting with the finite and temporal chessboard of existence we inhabit; another slice of the intersection between the eternal and the everyday.  I feel a similar perplexity (that almost interferes with  my work and projects) when I try to understand how mathematical truths are derived from reality.  It's hard to imagine Platonic ideals existing beyond physical reality, but The Unreasonable Effectiveness of Mathematics in the Natural Sciences begs explanation to our minds.  This similarity may not have be foreign to Lewis's mind; in the Screwtape Letters he writes:
Above all, do not attempt to use science (I mean, the real sciences) as a defence against Christianity. They will positively encourage him to think about realities he can't touch and see
   Another idea I found evocative from The Great Divorce was that salvation or damnation were retrospective; if a soul arrived in heaven, time in Hell retrospectively became Purgatory, and earthly agony became glorious trials.  However, for souls stuck in Hell, even their prior pleasures or triumphs were poisoned and soured into their downfall.  I found traces of how happy older people have described earlier times of struggle in this metaphor.  The other secular idea it reminded me of is that selfish concerns that give us immediate temporal pleasure are ultimately shortsighted and unsatisfying.  In a glorious, mysterious universe without obvious anthropomorphic divinity and great doubt about the existence of individual immortal souls, a high aim we can hope for is to understand our own place and belonging to the cosmos and work to bring about a joyful future for other people, life-forms and intelligence who come after us and share the world with us, and savor our own brief time on the planet.  Even if immortal ideals don't independently exist in a Platonic sense, we can still strive towards them.  It's not a traditional after-life but it may be the best we got.

Tuesday, April 16, 2013

How to Be Useful


How to Be Useful is an interesting little book that recaps the highlights of success literature in the 20th century. I read it in parallel with Rework, which takes a very 21st century approach to business and work, and struck an interesting contract.  Some of Paul Graham's essays such as The Power of the Marginal also came into my mind as counter-arguments.  The initial snag of this book for me was the quirky cover and fetching title. How to Be Useful: A Beginner's Guide to Not Hating Work. Well, I consider myself a beginner, I certainly hope to be useful, and I definitely don't want to hate work, so this seemed like the book for me!

I had a wonderful and rich childhood and education (both of which prepared me well for software engineering) but I had little previous exposure to the office and the corporate institution, so this book was a helpful aggregate of others' hard-won (and occasionally gimmicky) thoughts on the subject. I also found relevant the experiences the author included from her own time in publishing, which seems to be far more ruthless and careerist than software, but similarly structured.

The structure of the book is interesting. The chapters follow a chronological progression in the time of the literature being examined. They also roughly follow a progression in the duration of employment at one position, from making striking first impressions to firing yourself in preparation for moving onwards and upwards.

The main resolution I took from the reading is that if you take how special and unique and interesting you are and shove it for a bit, and get busy to solving other people's problems and making their lives easier, professional success hopefully follows.
  • On Being a PoseurThis chapter makes a solid argument for it being morally sound and commendable to pursue a successful career, separate from base material desires, and to earnestly strive with all your capabilities, not just "hard work", for the things you want to achieve. It also criticizes the ironic detachment and disdain young and educated people sometimes have for professional life. Why try to act like you don't care about the things you care about? There isn't enough time for irony.
  • Dodging the Great Failure ArmyAn interesting chapter that focuses on Andrew Carnegie and the dawn of white-collar work. The bit that spoke to me the most was that while we are each multi-faceted and endlessly fascinating people, of great individual worth and virtue, you perhaps shouldn't be your uninhibited natural self in your professional position. To quote: "Forget yourself, he essentially said, and maybe try being somebody else a few hours a day. Maybe somebody better than you."
  • Party Tips for the Nouveau Riche
    The best ready advice from this chapter was that acting questions both makes you a better conversationalist and less overbearing to your co-workers, it's a good way to find your bearings in an organization.
  • On Near Universal Self-Absorption
    "Why talk about what we ant?  That is childish. Absurd.  Of course, you are interested in what you want.  You are eternally interested in it.  But no one else is."
  • The Master Mind
    This chapter discusses building a valuable circle of friends.  "Once you've found people with whom you can openly, sincerely discuss what you wish for, you spend less time dwelling on the pedestrian events of the day, or the smell of your cubicle neighbor's tuna sandwiches, and more time talking about things you actually want to bring into existence."
  • Checking Yourself at the Door
    On the advantages of dressing in upper-middle class styles: "While everyone else wrung their hands about how bad, how very sad, it was that all America was conforming, these thinkers started toying with the notion that blending in actually has its advantages.  Indeed, it has a kind of subversive power."
  • When It's Not Just About You
    Anecdote: "The downside to meritocracy is that those born on third base think they hit a triple, and everyone else is subject to self-loathing."
  • Interlude (Why Most Everything from the 1970's Doesn't Help)
    Shortly: everything written then presumed people were dumb.  And presuming that your audience is dumb never made for a quality product.
  • Self-Deprecation
    This chapter advertises self-deprecation as a useful tactic, especially for surviving "So where did you go to school" type conversations.  I like to think that this isn't necessary in 2013, but it may be.
  • On DefenseOne of my goals in life is to remain fearless enough to admit my errors freely and move to correct them directly.  Intellectual honesty above much else.  This chapter advertises a similar ethic.
  • The Uses of No
    As a software engineer, I love the concept of "firing yourself".  I think that the highest professional goal a programmer should shoot for in a given position is writing such excellent software, tests, tooling, and documentation that you can simply walk away from your duties and have them keep themselves running.  How much more courageous and less petty than making yourself necessary.

Sunday, January 15, 2012


I made a clone of ytistant to learn more about client side scripting.

You can play with it here or get the source here

Not sure how permanent these heroku links are...