Four Million

Four to six million people live in Yangon, aka Rangoon.  The recent cyclone swept away a lot of land, the photos below show that the city is now surrounded by water.  Of course lots of people lived on all the rest of that land.  Meanwhile scientists are a lot more confident that global warming is increasing the intensity and number of hurricanes/cyclones/et. al.

myanmar_tmo_2008126l.jpg

Via NASA

Conditions in Common Lisp

Dan Weinreb wrote a long blog post recently outlining what Common Lisp’s “Conditions (exceptions) are really about.”  He argues, and I won’t disagree, that they provide a clean, even elegant, way to handle all the long tail of situations that arise when your trying to be fastidious about the contract for your functions.  One of the things that used to be unique about Lisp was it’s elegant support for unwinding the stack when odd things forced you to abandon what ever your doing.  It was a lot easier to see to it that the printer handle was relinquished, the file closed, the gate shut in Lisp than it was in Fortran or C.  These days most languages are better about admitting that these things happen and something should be in the language to help.

Interestingly though the Common Lisp condition system remains a much more elegant thing than you find in other languages.  I don’t really understand why.  The condition system doesn’t just provide a way to unwind the stack, passing along an object instance to describe what ‘exceptional’ condition arose.  It also allows the handler for these conditions to resolve them.  In effect this provides an elegant way to implement call backs, i.e. that situation where a low level body of code needs to ask the higher, or later written, code how to resolve a problem.  For example you can use the condition system to implement the classic call back scenario where a GUI widget wants to provide it’s users with the ability to do additional checking on user input.

There’s more, but what I really wanted to get off my chest (and that’s what a blog’s for eh?) is that I sometimes I like to muse about raising a condition is yet another example of how complex function calling really is.  Back in the day we used to be able to figure out what function would implement a call site at link time.  Later we got used to having dynamic linking do some of that, and it was common in memory constrained systems to load and flush code on the fly under the covers when in the function call.  I’ve seen systems where you switched interpreters in the function call for performance and space trade off reasons.  These days people are used to having a complex method dispatch that puzzles out what method will will take care of the request.  The method dispatch is a messy beast when you allow new classes to be loaded.  It was with some pleasure that I first read the mythical man month’s description of how some ornate linker came to be obsoleted; since at the time I was struggling with how loading compiled lisp files was an amazingly disruptive event; since it upset all your method tables.

Generally method dispatch is done by searches up stream in the acyclic directed graph of types.  I.e. the behavior of the function is inherited from the class hierarchy.  The class hierarchy is not the only hierarchy in most programs.  For example there is almost always a containment hierarchy, i.e. the OK button is inside this dialog; or for example this file write is taking place inside the task of writing the log, inside the task of handling this web request.

At one point in my life I was quite enthusiastic about the idea of language designs that might allow these other hierarchies more respect.  During that period I built a few class systems where behavior was inherited first from the containment hierarchy and only secondarily from the class hierarchy.

What I like about conditions is how when a condition is raised and the system goes off seeking a handler for that condition – it’s just another variant of method dispatch – and the call hierarchy is were we search for the handler.  For me the fact that these calls often don’t return; or return in such unusual ways is part of what’s delightful about the condition system.

Man’s work – depolarization

barfight.jpgThis is a long, interesting, carefully written article by Alex Kotlowitz about a program to change community behaviors in service of decreasing violence. It is nice to see a discussion of how to reduce polarization. There is so much entertainment value in polarization that the media revel in it. It is further to the article’s credit that it doesn’t play the card of Chicago’s most recent violent troubles into the text.
If I was to be critical of the article it would only be how it leaves the impression that the means being used here were entirely gin’d up by the folks involved. I certainly hope that many of these were imported from other violence reduction efforts, and most of the methods outlined I’ve read about in other venues; particularly the negotiation handbooks.

Given my interest in group dynamics I was interested by the story about a kid who wanted to resign from a gang. Much negotiation through various possible outcomes, “no”, “well, maybe, after a beating,” until they settled with the kid paying a fee. Not unlike getting out of your cell phone contract, eh? Joining a group often involves a hazing, and I suspect leaving often involves a beating – or at least a standing debt.  You can’t make the books balance in such situations. They never balance between members inside a club, that’s the point, so you can’t make them balance when you exit.

That groups are a sources of violence is clear. You get discipline inside, and polarization between, but I hadn’t noticed before that movements of members across the group member boundaries can also generate violence.

One other thing that caught my interest, because it’s analogous to atomization effect we see in other systems these days. “Many of the interrupters seem bewildered by what they see as a wilder group of youngsters now running the streets and by a gang structure that is no longer top-down but is instead made up of many small groups – which they refer to as cliques – whose membejoebenadam_ahd.jpgrs are answerable to a handful of peers.” When the middle scale systems die off you left with nothing but long-tail, and elites in their walled-gardens.

The skills these “interrupters” have are skills that we all should have. Skills the media should model. A culture rich in these skills can tolerate a lot more diversity. That there is honor in turning the other check. It is man’s work to intervene in a fight. The article is here.

Gas Tax

To be clear I think we should treat petroleum consumption as a sin and tax it accordingly. Because it’s: a) murdering the planet, b) it’s a principle contributor to the war, c) it’s running out and we need to accelerate the switching to alternatives, and d) the cost comes out of producer pockets, and e) it’s funding people who in many cases are coming to despise us.  I think lowering the tax is extremely bogus idea and a horrific diversion from other topics.

I gather that economists believe[1,2,3] that gas prices are largely unaffected by the gas tax. (That tax pays for highway maintainance, so it’s more like a user fee than a tax.) In fact I’ve heard it argued that if we raise the gasoline tax the effect will be to reduce the incomes of oil producers. I accept this logic, but I’ve had trouble seeing how to explain it in simple terms.

So rather than try to find a way to explain it i made this picture instead. This shows one dot for each state (except Hawaii and Alaska) plus the District of Columbia. The horizontal axis the the amount of gas tax [see] each state charges. The vertical axis is the price of gas in each state [see].

taxvsgas.png

Oh dear.  This doesn’t seem to be supporting the conventional wisdom.  In fact it seems to say that a gas tax has a disproportionate effect on the retail price.  Every 10 cent increase in the tax is corrolated with a 12 cent rise in the price the consumer pays.  Huh?

My insta-theory for the amplified effect is that the tax rates are higher in states where the cost of doing business is generally higher. For example they have more services, health insurance, employee rights, education, regulation, etc. etc.  As an aside I think it’s interesting that I view a high cost of doing business as a signal that a venue is highly attractive to business; while rhetorically it is often treated as a signal of a bad place to do business.
I must say that I don’t quite see how this chart supports the conventional opinion of the economists.

So, recalling that I think this that lowering the gas tax a very bad idea, my only reason for posting this is to dig into the evidence for the conventional wisdom.  I love the idea that a high tax on petroleum products would largely come out of the producer’s pockets. If that’s true and you can convince a lot of people it should be a easy move toward a better outcome.

Bolt Bus

This is a product endorsement. I wanted to go down to NYC from Boston for a few days, quite spontaneously. So I grabbed a hotel room via priceline at 2:30 in the afternoon; and then I had to find a way to get to down there.

For the past few years there has been an bloom of extremely cheap bus rides to NYC; these run from chinatown to chinatown. The press reports are totally wild-west. Fires, sleeping drivers, gun battles between competitors! But yeah, it’s cheap!

Recently the more established bus companies have decided they need to compete and two new lines have entered the competition. Boltbus and Megabus they both sell a few tickets for a few bucks, i.e. as a teaser rate; but their full fares are cheap too.

So I went downtown and into the bus station and found BoltBus guy sitting in his bus, they leave every hour on the hour. He took my $20 and I climbed in. It would have cheaper if I’d bought the ticket online but it wasn’t clear which one I was going to catch.
Very nice bus, nice drivers, very comfortable smooth fast ride. The trip back was even smoother, taking a little under 4 hours. For both trips the bus was about 30% or less full; so plenty of room to stretch out.

But most importantly free WIFI and a plug! On the trip down a guy behind me drew a crowd as they all watched the Celtics live in the basketball playoffs; via the WIFI.

Standards as Floors

One of the many things I learned reading the literature on standards is how they tend to set floors on behaviors. I was reminded of that from this posting from Kevin Drum

I want to highlight a single passage from the Roger Lowenstein article that I blogged about below. It’s about how investment bankers create complex financial instruments that receive high ratings:

Credit markets are not continuous; a bond that qualifies, though only by a hair, as investment grade is worth a lot more than one that just fails….The challenge to investment banks is to design securities that just meet the rating agencies’ tests….”Every agency has a model available to bankers that allows them to run the numbers until they get something they like and send it in for a rating,” a former Moody’s expert in securitization says.

Go ahead and call me a rube, but is this for real?
This is a bit like being surprised that the lunch on your airplane flight bears no resemblance to what would pass muster as lunch at mom’s house. In fact I love that the airline industry at one point had to convene their industrial standards body only to set a standard for what counted as a sandwich; since some carriers handing out “sandwichs” while others were actually providing a sandwich. Of course once you set the standard everybody in the industry pretty quickly starts handing out the minimum meal that meets the standard.

This kind of gaming of standards is well standard. One way to temper the effect is to keep the rules fuzzy. It is oddly perverse that if you give the regulators wide latitude in their enforcement you can undermine this gaming; since the regulated players will then have to strive to overshoot the standard sufficiently to avoid the risk of failing to meet it. The players will then complain that the rules aren’t clear and that the regulators are capricious. Another trick is to make the standard a bit competitive so only top N% get the rating. The judging will give an element of fuzziness, and it also creates striving for improvement. But then tends to create demands for the judging to be more transparent – a proxy for the return of the bright line – in the name of fairness.

Attention Economy?

I like to talk about leveraging the talent on the other side of the Internet, or talent scraping. That talent is only just recently discovered. We are in a kind of gold rush to figure out how to mine it. I’ve called that mining industry talent-scrapping, in part to suggest how it’s like a whale filtering plankton from nutrient rich waters.
Talent is usually considered scarce. But now it’s abundant. But now it is different in form than in the past. More diffuse. We used to concentrate it into locations, universities or cities, but now it’s just out there; on the other side of the net. So most of our intuitions are wrong about how to manage it or accumulate it.

We are in a curious situation where you have a choice between abundant talent v.s. scarce talent – but where we have very refined craft knowledge about how to mange scarce talent (think standardized testing, university diplomas, publication pipelines) v.s. very immature craft knowledge about how to tap diffuse talent pools.

That combo scarce-but-skilled vs. abundant-but-unskilled must be a common situation when a new option space break open. It is notable that their is scarcity on both sides of that equation; but they are of a very different nature. One is a resource scarcity, and the other is a lack of expertise – an information good.
When people talk about the attention economy I’ve tended to presume they were saying that attention is scarce. Certainly my attention is a limited resource. I certainly have a whole bag of tricks for managing that scarce resource.

Clay Shirky takes a run at this problem in a most excellent recent essay where-in he introduces the delightful term “cognitive surplus.” He gets there in a most marvelous way that is just hip slapping funny.

The idea of an attention economy is that there is some gross national product of talent out there. That it’s like the water supply of a big city, a pipe flows into the city of skill, and there is only a certain amount to be had – so you really ought to be careful what you spend it on.

I recall how when back in the 1960s there was a drought around NYC and people started talking about water conservation. We used to get a glass of water automatically when every you sat down in a restaurant and they stopped that. I recall hearing how silly that was since meanwhile the water authority came to discover that rivers of water were leaking from the system; entire pipelines were flowing hundreds of miles only be dumped into the Hudson.

To adopt Clay’s term cognition is the water of the attention economy and his point is that we just maybe we are pouring most of the talent on the planet into the abyss.

Talent isn’t scarce anymore, the real question is where the hell has all the talent been going all these years. Clay has some suggestions, and possibly most interesting to me was the hint that society in the past has struggled with this very same question; it’s “the idle hands – the devils playground” problem. And for God sake don’t miss the punch line at the end of his essay!

Misc. GAE Examples

Some other amusing little hacks on Google App Engine.

I like LunchStr, for coordinating the office lunch expedition.

Dot and Simple Sketch reminds me of the sheep market, talent scraping example; which is recursive of course since google app engine is a fine example of developer network as talent scrapper.

Of course you have to have your standard little apps. Tinyurl clones: grulx.com, Links’R’US, and hurl.

There are some slightly larger applications.

And some larger ones, like a chat rooms provider.
One of the app team’s example apps makes Google an OpenId provider, app here – it’s only version 1, which is lame, even useless.

Most of the really complex stuff is still Google authored. Their directory is filling up fast, including some spam entries. They already have preferential attachment bias in their ranking.

Finally a complain! The user nicknames appearing all over these application are actually revealing people’s email addresses, just add @gmail.com. Feel free to star this defect complaining about how all these sweet little applications are revealing user-email addresses unnecessarily. (Did somebody say oauth?)

Sprunge – Neat toys showing up in Google App Engine

Some fun things are popping up in Google App Engine.

I like sprunge (discuss) a tool for command line jockeys.  By example:

$ echo Hi there | sprunge
http://sprunge.us/eUdF
$ curl http://sprunge.us/eUdF
Hi there
$ uuencode foo.jpg < ost.jpg | sprunge
http://sprunge.us/WJHN
$ ls foo.jpg
ls: foo.jpg: No such file or directory
$ curl http://sprunge.us/WJHN | uudecode
% Total      % Received % Xferd  Average Speed    Time      Time        Time  Current
Dload  Upload    Total    Spent      Left  Speed
100  116k  100  116k      0        0  59640          0  0:00:02  0:00:02 –:–:– 68675
$ ls -l foo.jpg ost.jpg
-rw-r–r–  1 bhyde  wheel  86669 Apr 22 08:34 foo.jpg
-rw-r–r–  1 bhyde  wheel  86669 Apr 22 08:31 ost.jpg
$ cat ~/bin/sprunge
#!/bin/sh
exec curl -F ‘sprunge=< -' http://sprunge.us

Using uuencode made me happy!

Google App Engine

It’s fun observing what people are using Google App Engine for.

Sprunge.us provides a pastebin service which you use from the command line.  For example I put this script in my PATH:

#!/bin/sh
exec curl -F ‘sprunge=< -' http://sprunge.us'

At that point you can post things by doing

#!/bin/sh
exec curl -F ‘sprunge=<-' http://sprunge.us http://sprunge.us/