Russell's Blog

New. Improved. Stays crunchy in milk.

A revolution in saffron

Posted by Russell on September 26, 2007 at 4:40 a.m.
The police in Burma are firing warning shots and arresting the monks who are defying a ban on public gatherings. I was literally holding my breath listening to the BBC reporting from Rangoon.

I first studied Burma when I was a freshman in high school. Burma was the topic in policy debate that I dreaded the most; just thinking about it put me on the verge of tears. Even today, I find it utterly impossible to say anything rational about the situation there.

Much of humanity is sustained through its daily misery by the hope that evil can be defeated without resorting to evil. We all hope that somehow, someone will figure out a way.

If I believed in God, I would pray for Burma.

LED lamps from IKEA

Posted by Russell on September 25, 2007 at 6:27 a.m.
Ikea has a very nice and aptly-named LED lighting product called DIODER. It has four lamps, uses about a watt, and nicely illuminates a good-size desk.

I installed one for my mom's microscope workspace. Yes, I'll do something about the dangling wires when I have time to buy wire-ties.

How to get out of Iraq

Posted by Russell on September 25, 2007 at 6:04 a.m.
This idea has probably been floated before, but it occurs to me that there is a very simple plan for getting us out of Iraq: Hold a national referendum in Iraq on whether or not to continue the occupation. If the Iraqis tell us to get out, then we should get out. Immediately.

The Republican position seems to be that we have to stay in Iraq to protect its "young democracy," as the president described it yesterday. There could hardly be a more democratic way of settling this question. On the other hand, a referendum is almost sure to result in a resounding "Get Out."

If the Democratic Party is looking for a nice, reasonable, uncontroversial plan for getting out of Iraq, I can't see how this one could be attacked. We're ostensibly in Iraq for its own good. If we're not wanted, then we ought to withdraw. No one could call it cutting and running if we are asked to leave.

A Prisoner's Dilemma

Posted by Russell on September 15, 2007 at 11:54 p.m.
Los Angeles traffic provides fertile grounds for situations that can be modeled with the Prisoner's Dilemma. It's not difficult to guess what strategy the owners of the Toyota Land Cruiser and the Chevy Tahoe have decided to play :

I encountered these two defectors in an extremely crowded parking structure in Old Town Pasadena. This isn't just antisocial behavior. The owners of these two titanic vehicles are also breaking the clearly written rules.

It occurs to me that the decision to buy these vehicles in the first place can also be modeled using many, many iterations of the Prisoner's Dilemma played against every other driver. Here's how such a model might be constructed. The options are :

  • Buy an SUV (defect)
  • Buy a compact car (cooperate)

In a single round of Prisoner's Dilemma, it is usually reasoned that the only rational choice is to defect. However, when two individuals play many iterations against one another, more interesting strategies can succeed. The strategy that seems to do the best in most situations is some variant of generous, randomly forgiving tit-for-tat. To apply the Prisoner's Dilemma to the automobile market, you must view the game as continuously ongoing because a player can trade in their car for a different model at any time, and the game is played against every other driver on the road. Each iteration makes a marginal contribution to the total outcome for the player. For example, the actual risk of death is the sum over the marginal risk of death arising from the outcome of each game.

The outcomes are :

Player's Choice
defect cooperate
Stranger's
Choice
defect Punishment for Mutual Defection

Both players buy an SUV, negating the advantages of owning a larger vehicle. Both players are penalized with substantial marginal increases in traffic congestion, gas prices, risk of death, risk of injury, and rate of damage to shared environmental resources.

Sucker's Payoff

Player suffers moderate marginal increase of gas prices, traffic congestion, and rate of destruction of shared environmental resources than the Punishment for Mutual Defection. However, the player suffers a worse view of the road and substantially increased marginal risk of death and injury.

cooperate Temptation

Player suffers a moderate marginal increase of gas prices, traffic congestion, and rate of destruction of shared environmental resources than the Punishment for Mutual Defection. They also enjoy better view of the road and a substantially reduced marginal risk of death or injury.

Reward for Mutual Cooperation

Both the Player and the Stranger enjoy a better view of the road and substantial marginal reductions in gas prices, traffic congestion, rate of destruction of shared environmental resources, and risk of death and injury.

In computer models of the iterated Prisoner's Dilemma, and in real-world situations are well represented by the model, strategies that are "nice," "generous" and "forgiving" tend to thrive. These terms have a technical meaning here. "Nice" simply describes a strategy that will not defect first, "generous" describes strategies that will not retaliate against other players when they defect under some circumstances, and "forgiving" describes strategies that will "forget" about past defections of other players. Richard Dawkins describes this in some detail in The Selfish Gene (see Chapter 12: Nice Guys Finish First), basing much of his argument on the research of Robert Axelrod.

If the automobile market really can be modeled using the iterated Prisoners Dilemma, then we would expect to see the most successful strategies in Axelrod's tournaments, which are mostly "nice," become the dominant strategy for car-buying. That is to say, we should see mostly compact cars. So, why do people keep buying SUVs? They are playing Defect against the rest of us, hoping to receive the Temptation outcome from most of the iterations of the game.

This is especially curious because because both the Punishment for Mutual Defection and the Sucker's Payoff are very severe. It doesn't take very many people playing Defect to block the view on the road, to drive up gas prices, to dramatically increase the risk of death an injury for all drivers, and to accelerate the rate of destruction of our shared environment. The Reward for Mutual Cooperation should be a very strong attractor in the problem space.

It's very tempting to think of SUV buyers as stupid, or as assholes, or as sociopaths. However, it is more useful to model the decision as a purely rational decision based on what they think will be the best strategy. For most people, it probably isn't a rational choice, but that doesn't actually matter. In the model, we pretend that the players are playing as if they are making rational choices. This is how computers play Prisoner's Dilemma, even though they aren't capable of rational choices.

Game theory offers a fairly convincing (and rather grim) explanation for the phenomenon of SUVs. It makes less sense to play Cooperate if you don't think the game will go on for much longer. On the last round of the game, it becomes the classic, non-iterated Prisoner's Dilemma for which the only rational choice is Defect. Everyone knows that we're running out of oil. Consciously or unconsciously, people are behaving in a way that suggests that the shadow of the future is shortening.

Tiptoeing around perjury

Posted by Russell on September 11, 2007 at 2:29 p.m.
While I listened to Petraeus and Crocker tiptoe clumsily around perjury, I couldn't help but wonder how many people will take them at their word that the level of violence is declining. I find it difficult to understand how the level of violence is decreasing when the rate of killing has been increasing. I guess it must depend on how you count the bodies. Evidently, ordinary muggers shoot people in the face, and death squads shoot people in the back of the head. Accepting, for a moment, this ridiculous criterion for distinguishing muggings from sectarian killings as reasonable, it seems very weird that we don't count muggings as violence.

Ambassador Crocker, for his part, repeated the assertion that Iran is supplying the insurgency with sophisticated weapons, particularly explosively formed penetrators. If you will direct your attention to the photograph below, from Wikipedia :

This is a sophisticated weapon that exploits some very tricky hydrodynamics. It is also improvised from an ordinary copper pipe. The penetrator (the bowl shaped part) looks like it was turned out on a lathe, and that the machinist was either not very skillful or not very concerned with quality. Note the disk-shaped depression in the center where the lathe spindle was attached. The penetrator appears to be soldered to the pipe with plumbing solder.

I don't think the insurgency needs anyone's help to build these. The hardest part would be obtaining the explosive material. Who is supplying the insurgency with explosives? The simplest explanation is that they helped themselves to the weapons caches we left unguarded at the beginning of the war. How many improvised explosively formed penetrators could you make with 377 tons of high explosives?

Maybe Iran isn't being very helpful when it comes to American interests in Iraq. After all, why should they? I have no doubt that Iran's leadership would be delighted to see things go as badly for America as possible in Iraq and elsewhere. However, it's not as if Iran actually has to do anything to make Iraq a disaster for America. The fact that they don't like us is not in itself a very good reason for them to arm the insurgents. Practically any government in Iraq is likely to be friendly with Iran. Iran actually has a lot of good reasons to want the insurgency to stop.

If I were Mr. Ahmadinejad, I would just sit on my hands. At most, I would give some political support to Iraqis who might be friendly to Iran should they gain or keep power. But weapons? Why bother when the insurgents have already looted all the weapons they could ever want? It would be redundant and unnecessary.

Like most Americans, Mr. Crocker knows that we've either lost or that we're loosing. What sets him apart from the rest of us is that Americans are grown up enough to accept responsibility for the bad outcome of this conflict, and Mr. Crocker would rather blame it on someone else.

The Surge Isn't Working

Posted by Russell on September 05, 2007 at 9:24 p.m.
Charles Boustany turned up on CNN to peddle the administration's latest outrage -- that the surge has reduced violence in Iraq substantially. So, Wolf Blitzer asks a hard question :
BOUSTANY: We’re clearly seeing some major improvements. Clearly in the Anbar Province, we’ve seen significant improvement. We were able to walk the streets of Fallujah. Sectarian deaths are down.

[...]

BLITZER: And Congressman Boustany, you say that the number of casualties is going down. But we took a closer look — and The Los Angeles Times did as well — citing Iraqi Health Ministry numbers. In June, it was 1,227 civilian deaths in Iraq. In July, it went up to 1,753 civilian deaths in Iraq. And in August, the month that just ended, 1,773 civilian deaths in Iraq. Those numbers are going in the wrong direction.

Ah, the numbers. It is rather alarming how often important news comes without any specific discussion of the numbers upon which it hinges. Someone needs to send Mr. Blitzer a pundit-snack. Good pundit.

But reading a triad of four digit numbers from a teleprompter (or maybe even from memory) is not the best way to communicate about numbers. That might be appropriate for MegaMillions, but we owe these particular numbers more careful examination. We are, after all, talking about the deaths of human beings as a direct result of our collective decisions at the ballot box.

So, I looked up the data on conformed killings of Iraqi civilians. Against the background of men and women and children turning up as abandoned corpses on the street, there are a lot of mass-casualty events. There are also a few rare days when there are no confirmed killings. It's somewhat difficult to see the trend in the raw data. So, I borrowed an analytical tool from the financial world -- the moving average.

That looks like a slight upward trend to me. The GAO agrees. Their data measures the number of attacks, rather than the number of dead, but one would expect attacks and deaths to correlate.

General Patreous is going to make his presentation in a few days, which everyone assumes is going to say that the surge is working. If it doesn't explain these numbers, then the report should be ignored.

GPL vs. BSD : Huullauauahgha!

Posted by Russell on September 02, 2007 at 4:26 a.m.
Evidently, when a chunk of software is simultaneously licensed under the BSD license and the GPL, it becomes unusable to projects that use the BSD license. No, wait. GPLed projects can borrow BSD licensed code, but not visa versa. No wait. When a chunk of code is under a dual BSD/GPL license, you get to pick which one to follow, which means you can ignore one of them.

Fuck. I hate this shit.

How about this :

The No-Lawyers License

Permission is hereby granted for the use of this file and all of its contents and any representation, derivative, or portion thereof for any purpose whatsoever, unless :
  • You are a lawyer
  • You are an employee of a law firm
  • You are a contractor of a law firm
If the conditions above are violated, you are prohibited from examining, discussing, writing about, quoting, referencing, citing, or interpreting this file or any of its representations, derivatives or portions for any purpose whatsoever.
I just want to write code and let other people use it. If people make improvements, I'd be happier if they gave their improvements back to me. Why is this so goddamn difficult?

Garage Sale

Posted by Russell on September 01, 2007 at 10:48 p.m.
I've got too much crap. I want to sell some of it. If you see anything you like, email me!

I have posted a Flickr gallery of all the stuff I'm selling.

Vintage WiFi Station -- $15

This is a commercial-grade Nokia 802.11 access point. Yes, 802.11, not that fancy Johnny-come-Lately 802.11b or that bling-bling 802.11g. The original.

It runs at a stately 2 MB/s, with none of this rushing around at manic 11 MB/s speeds or barbaric 54 MB/s speeds. It has a removable Bay Networks BayStack 660 PCMCIA card, which I presume can be replaced with something more modern if you want to spoil the experience. And it is an experience, let me tell you. I've done no fewer than six Debian installations over this wonderful example of Scandinavian craftsmanship.

Lest you think this device is obsolete, I should point out that it works just fine with newer WiFi cards. Also, ask youself this: How fast is your internet connection, really? Is it faster than 2 MB/s? Probably not. Probably, you pay for 768 KB/s downlink, and you actually get 480 KB/s. You aren't fooling anyone with that fancy 54 MB/s 802.11g access point (that only actually runs that fast when you put your laptop directly on top of it, anyway). Your bits aren't moving any faster that your ISP says they will.

It's WiFi from a more civilized age.

Laser Level -- $25

Bulldog laser level, complete with tripod, carrying case, and eye-protection. Yours for $25.

Intel Centrino mini-PCI WiFi card -- $30

This was the original card that came with my IBM ThinkPad X40. I wanted an Atheros-based card, so I bought one and replaced the Centrino card. It's been sitting in its little anti-static bag since ever since.

See no evil, hear no evil...

Posted by Russell on September 01, 2007 at 9:59 p.m.
For various reasons, a lot of people remain very skeptical about global warming. The most often cited (sane) reason for maintaining this skepticism is that the data has been patched together from many different sources, and that no single source of evidence conclusively demonstrates that global warming is occurring. With such a complicated argument, perhaps there are alternative explanations, one might wonder.

The important thing about global warming is that it is a theory, and thus it is falsifiable. If there are doubts about the validity of this theory, we can design an experiment that would reliably falsify the theory if it were, in fact, wrong. NASA has designed and built such an experiment, called Deep Space Climate Observatory (DSCOVR). It would sit at the L1 Lagrange point between the Earth and the Sun, where it can continuously observe the Earth's daylight side. From this vantage, it would calculate an accurate, up-to-the-minute energy budget for the whole planet. It would also collect detailed measurements of the atmospheric and surface composition of our planet.

If anthropic global warming is a bad theory, then DSCOVR would shoot it down in a hurry. On the other hand, if the theory is correct, as most climate scientists have concluded already, DSCOVR would provide us with simple, conclusive evidence gathered with uniform methodology.

But the global warming skeptics, or at least the ones in Congress, have never been interested in actually falsifying the theory. They were much happier wallowing in ignorance.

Republicans didn't buy it. In 1999, GOP Congressmen put the project on ice, calling it the "Goresat," a "multimillion-dollar screen saver." Dick Armey, then House Majority Leader, quipped, "This idea supposedly came from a dream. Well, I once dreamed I caught a 10-foot bass. But I didn't call up the Fish and Wildlife service and ask them to spend $30 million to make sure it happened."

Lost in the grandstanding was the critically important science behind DSCOVR. In January 2006, NASA quietly canceled DSCOVR altogether, citing "competing priorities." Many in the scientific community are incredulous that such an important mission might be lost to rank partisanship. "Gore favored it," says Dr. Park. "This administration is determined that a Gore experiment is not going to happen. It's inconceivable to me." Climate analyst Trenbeth said, "It makes no sense to me at all either from an economic or a scientific viewpoint. That leaves politics."

Science ran a letter from Francisco P. J. Valero titled Keeping the DSCOVR Mission Alive. I will quote the relevant part since most people don't have access to articles in Science :
Our proposal was selected by NASA after rigorous scientific and technical reviews. Solar activity observations were added at NASA's request to satisfy scientific needs and NOAA's operational requirements for space weather monitoring. DSCOVR is firmly based on the ideas developed by the science team. The transmission of live images of Earth added to the educational outreach component of the mission but was by no means the primary objective.

Many scientists, both in the United States and abroad, view DSCOVR as one of NASA's most important and innovative Earth science missions. The satellite has been built and could still be launched in time to provide synergistic data coincident with current and future orbiting systems. It offers great potential both as a source of fundamental scientific observations and as a pioneering Earth sciences mission from deep space.

France and the Ukraine have offered to launch it for us, but NASA has rebuffed their offers.

Next time you find yourself arguing with someone about global warming, tell them that the experiment to prove or disprove it, once and for all, was canned by Congress when the Republicans were running it. By their own admission, they canned it because they wanted to humiliate Al Gore. All we have to do is launch the damn thing, instead of letting it sit in a box at Goddard Space Flight Center at the cost of a million dollars a year.