Russell's Blog

New. Improved. Stays crunchy in milk.

No alternatives

Posted by Russell on April 30, 2009 at 11:44 p.m.
The term "alternative energy" annoys me. It is a sloppy bit of wordsmithing. Do we really have an alternative to this?

No, actually. We don't. It's obvious, by simple inspection, that the scene above cannot continue. Even if we wanted to continue making electricity this way, it is impossible. Any activity this intensive and inefficient will run its course very quickly. It could happen in several ways, but the simplest and surest way it will stop is that they will simply run out of coal.

On one hand, we have a few reasonably non-destructive means of generating energy, like wind and solar. On the other hand, we have idiocy and crime. How is it alternative energy when there is essentially no choice?

As I've pointed out, coal is responsible for most of our carbon emissions, but provides less than a third of our generating capaicty. That is stupid. I suggest we dump the terms "green energy" and "alternative energy," and simply call those things energy, and use the term "dumb energy" to refer to coal.

Google for bioinformatics

Posted by Russell on April 30, 2009 at 12:53 p.m.
Interesting thing of the day : If you plug the following nucleotide sequence into Google :
"gctagttaaa aaaggaaatt catacccaaa"
The only hit you will find is the Swine Flu genome. Google is a sequence homology tool!

The Davis Crash Map

Posted by Russell on April 29, 2009 at 12:02 a.m.
I want announce a little project I put together over the weekend. For want of a better name, I'll call it the Davis Crash Map. Basically, I analyzed the accident report spreadsheets from the City of Davis Public Works Department, and made an overlay for Google Maps to visualize the data. The spreadsheets are a bit difficult to analyze, so I'm leaving out the reports that aren't clear to me (about 15% of the reports). The reports that gave me some trouble seem to be randomly distributed over the city, so the overlay should still give an unbiased picture of what is happening.

In particular, this is map is intended to examine bicycle accidents. I hope people will look at this map, and think about how they behave on the roads, weather on foot, on a bicycle, or in a car. How you behave on the road has direct, and sometimes dire, consequences for you and for other people.

However, there is more to this than behavior. This is also a design question. Roads are not natural features. They are designed and built by people for use by people. As with anything that is made by humans, there are good designs and bad designs. These designs have a real impact on peoples' lives. In the case of streets, the impact on your life can be very literal, as this map shows.

Even good designs can always be improved. Davis is a pretty safe town in which to walk, bicycle and drive. But if you study this map, and think about it as you go about the town, it's also clear that things could be better.

I'm not a traffic engineer, or a civil engineer, or a city planner. I claim no expertise in those areas. I'll leave it to other people to make specific suggestions. However, I think it is important for the users of streets -- pretty much everybody -- to think about what kind of streets they want. This map should help give you a better idea of what kind of streets we actually have.

For some reason, people seem to get very emotional about traffic. I grew up in Los Angeles, home of the nation's worst traffic jams. Perhaps this is to make up for our lack of a professional football franchise. Passions about transportation, especially mundane things like parking spaces and HOV lanes, get people really worked up. Los Angeles is also famous for road rage, and nowhere is it in greater evidence than in the corridors of City Hall. Public meetings on traffic can make I-405 look like afternoon tea. In fact, thousands of people from all over the world tune into the internet broadcast of the Santa Monica city council meetings to listen to Californians scream at each other over the exact position of little blobs of paint on little strips of asphalt.

What the conversation needs, I think, is some perspective. Data can help provide that perspective, especially if it can be represented in a way that is easy to understand. Maps are good at that.

If you will indulge me, I'd like to share my perspective on this data. Each marker represents a traumatic event for someone. Under some of those markers, a life came to a sudden, violent end. I'd like to share a picture of what kind of event a marker on this map represents. You won't find a marker for this event because it happened in Norman, Oklahoma, a college town that is a lot like Davis.

Anna and me

In October of 2007, my little sister was riding her bicycle near her house. A lady in a Mercedes made a lazy left turn, and crossed onto the wrong side of the road. She hit Anna head-on. Anna went up and over the hood of the car, and face-planted on the windshield, breaking her nose and her front teeth. The lady slammed on the breaks, and Anna then went flying off the car and slammed her head on the pavement. That much is clear from where my mother photographed the tire marks, the blood stains, and scattered teeth.

Who designed this street, anyway?

The sequence of events afterward are a little unclear, since Anna does not remember anything from that day, or for several days before and after the accident. The police report includes several details that are impossible or don't make any sense; for example, the officer thought she was coming out of a driveway onto the street, but the driveway did not belong to anyone she knew, and was paved in gravel (extremely annoying to bicycle on). The report also places the accident on the wrong side of the street, which was obvious enough based on the tire marks and blood. Based on what her friends say she was doing -- biking from her house to a friend's house -- she would have just been pedaling along the side of the road. The details of what happened are somewhat unclear, other than the evidence left on the road and gouged onto my sister's face.

After hitting the pavement, she evidently got up and staggered around for a bit, and then collapsed. She stopped breathing, and officer on the scene couldn't find a pulse, and assumed that she was dead. This was the reason given for not immediately summoning an ambulance.

Then she suddenly revived and started mumbling. The lady who ran her down went into screaming hysterics, and had to be restrained (or evacuated, or something). It was only then that an ambulance was called. From the report, it appears that paramedics and police spent a good deal of time tending to the driver of the car, who was having an anxiety attack, instead of Anna, who was bleeding from massive head trauma.

Anna then spent the next several days in the hospital. My mother got on the next flight to stay with her. For the next several days, Anna went through long and short memory lapses and dizzy spells of various lengths. When I spoke to her on the phone over the next several days, she also had some kind of aphasia, which was very jarring to me because she is normally a very articulate person. And then there was the puking. Brain injuries often come with a heavy dose of overpowering nausea. She was on anti-nausea drugs for a long time after the accident.

It took a long time for he to start feeling "normal" again. Almost two years later, she's still not sure she feels completely normal. Fortunately, thanks to some really great work by her surgeons, she looks normal. Needless to say, she is both very lucky and very tough.

Anna's bicycle. The police kept it as evidence, but allowed my mother to photograph it.

You could say that I have a personal stake in this, and I will not claim to be unbiased. Many people who argue against safety measures that would slow traffic argue their case on the basis of personal responsibility. We are each responsible for our actions, they argue, and if you do something stupid, you are responsible for the consequences. Why should people who don't do stupid things be inconvenienced?

I agree completely. However, if one casts any real issue into the frame of personal responsibility, then things are rarely so simple. Everyone who could act in a situation has responsibilities, even if they are not they are directly involved. When you have the power to prevent something bad from happening, and you choose not to act, then some of the responsibility falls on you. Every unfortunate, stupid thing that happens involves a cast of thousands of silent, but not blameless, bystanders.

We have a responsibility to at least attempt to protect people regardless of what they are doing -- even if it is stupid. This is especially true when it comes to the things we build. We shouldn't, if we can possibly avoid it, build things that injure and kill people. If we can think of ways to make something we build less dangerous, we ought to give it a try.

Anna and Earnie, about a year after the accident.

My little sister was stupid not to wear a helmet that day. The lady in the car was stupid not to have been on the lookout for cyclists. But neither of them deserved what happened. Each of them is obviously bears some measure of responsiblity (and I have my own opinions on how those measures are apportioned), but the city of Norman is also responsible. The city didn't even bother to paint a line down the middle of the road; what was the driver supposed to be on the wrong side of?

Yes, this is about personal responsibility. We, the public, build the roads. We are responsible for the markers on this map, and all the terror, trauma and tragedy they represent. Let's try to do better.

Bike saftey in Davis

Posted by Russell on April 25, 2009 at 11:18 p.m.
I've been tinkering with a little data visualization applet for looking at bicycle crash data in Davis, and I thought this map might be interesting to people. This is a image was generated with Google Maps and a heatmap overlay generated with a gheat tile server.

This is for 168 bicycle accidents that happened between 2004 and 2006. I have a lot more data, but 95% of the work in this little project involves parsing and renormalizing it. Evidently, police reports are not written with data processing in mind! I suppose that makes perfect sense. An officer at the scene of an accident probably has things on her mind besides generating a nice, easy to parse data point for future analysis. The priority seems to be completeness, rather than consistency. My parsing code, for example, has to be able to correctly detect and calculate distances measured in units of "feeet".

I'll release the applet here once I make an interface for it (and get the rest of the data imported). Stay tuned.

Awesome police report

Posted by Russell on April 24, 2009 at 3:23 a.m.
I'm not sure if I'm glad or sorry to have missed this conversation.

Fun with My Tracks, an accident, and Biking in Davis

Posted by Russell on April 21, 2009 at 5:40 a.m.
I was biking home today, and I decided to take a detour to enjoy the warm evening (and to avoid the not enjoyable warm apartment). About half way around the Davis Bike Loop, I remembered that I wanted to try out My Tracks. Here's the result :

After wandering off the Bike Loop a bit, I decided to head home. I was biking down Russell Blvd., and I witnessed a very scary car accident. The accident happened where I stopped recording the track, at the red marker. A guy in a cherried-out lifted F-150 was sitting at the traffic light (that's the point where I turned around). When the light turned green, he floored it. According to the other witnesses, he was racing with someone, or trying to catch someone who had cut him off. I couldn't see the other car because it was behind his gigantic stupid truck.

What I did see, though, was that he accelerated continuously until he reached the next intersection (the red marker), where he had a head-on collision with a girl in a 1990's Honda Civic trying to make a left turn. His engine was deafeningly loud even a block away, and I heard it roaring and down-shifting right up until the crash.

Looking at the damage to her car, it looked like he basically ran it over. The lift kit on the truck put his undercarriage about level with her roof, and there were even little ladders installed to climb up to the doors. After he ran over the Civic, he swerved around a bit, jumped the median, sideswiped a small SUV in the oncoming traffic, spun 180 degrees, and snapped his axle. When the axle snapped, I heard his engine redline for half a second and then cut.

Happily, nobody was hurt. The girl in the Civic was pretty much petrified, though. She was convinced that the accident was her fault because she didn't get out of the way.

I told her this was nonsense; the truck was going more than double the speed limit, and I'm pretty sure he didn't have his lights on (it was dusk, but not completely dark yet). She asked me about five times, "How much do you think it will cost to fix?" I told her, "Cost you? Nothing. He was committing maybe a dozen moving violations, and probably racing someone. His insurance company will probably be so happy not to have to pay medical bills that they will buy you a whole new car."

Maybe she could have been a little swifter completing her turn, but it's a busy street and there is a lot of pedestrian and bicycle traffic (it parallels a bike path). Making a quick turn is probably not a good idea. Or, maybe she could have waited until this asshole passed, but, as I pointed out, he was going maybe 50 or 60 in a 30 zone, and accelerating. She timed her turn right for reasonable traffic flow, but didn't account for total maniacs among the oncoming traffic. It would have been difficult to judge when he would reach the intersection she was turning through.


As it turns out, Davis has been thinking about redesigning this stretch of Russell Blvd. for several years. If you look at the proposed design, it would have made this accident impossible or unlikely. You can't race on a one lane road, and a landscaped medium would have prevented the second collision.

No love for today

Posted by Russell on April 19, 2009 at 8:37 p.m.
I'd like to give a big fat raspberry to the people today, and possibly the Debian maintainers, for pushing busted packages. Booo!

If you should happen to download said packages, you will find mouse and keyboard input on your computer completely disabled once the login manager comes up. If you log in via ssh (or boot with "single" in your kernel boot options), and look at /var/log/Xorg.0.log and observe the following,

(II) The server relies on HAL to provide the list of input devices.
	If no devices become available, reconfigure HAL or disable 
(WW) AllowEmptyInput is on, devices using drivers 'kbd', 'mouse' or
        'vmmouse' will be disabled.
(WW) Disabling Keyboard0
then you have contracted this particular affliction.

Dear X people, why the fuck would you make the default behavior to ignore properly configured devices? Especially when this can brick peoples' computers? Yes, I know about this. I stand by my raspberry. HAL still doesn't enable the right quirks for my motherboard, even though I submitted FDI files more than two years ago. HAL does not, and will not ever, work for everyone. When it works, it's nice, and I'm in favor of it. But please, please stop making life suck for people HAL doesn't help.

A pox on you all!

Anyway, the way you fix this particular bug is to add the line

Option "AllowEmptyInput" "false"
to the ServerLayout section of your xorg.conf file. For example
Section "ServerLayout"
    Identifier      "Default Layout"
    Screen          "Default Screen"
    InputDevice     "Generic Keyboard"
    InputDevice     "Configured Mouse"
    Option          "AllowEmptyInput"    "false"
Props to K.Mandla for figuring it out.

HOWTO: Repair a broken Brompton chain tensioner

Posted by Russell on April 13, 2009 at 12:56 a.m.
A little while ago, I was riding home on my wonderful Brompton bicycle, and the chain tensioner suddenly disengaged. That had never happened before, and I discovered that the gear on the chain tensioner had completely smashed to bits. Here's what it looked like :

After puzzling about it for a while, I think I understand what happened. I use the same chain oil on my Brompton that I use on my racing bike. The "oil" is actually a mixture of a heavy lubricant in a volatile solvent. The solvent evaporates after coating the chain, and dissolves whatever gunk has accumulated. I think the solvent damaged the plastic. I've seen this happen with some plastics when they come into contact with gasoline. The gasoline dissolves the plasticizing agents, and leaves behind an open matrix of molecules, like a very, very fine sponge. The open matrix has a huge surface area and oxidizes rapidly. Your nice flexible plastic turns into something hard and crumbly, like a stale cookie.

That's what I think happened here. The remaining bits of plastic are still relatively flexible, but the bits that broke off have turned into a powdery mess.

The guy who sold me my bike offered to let me buy an idler wheel off of one of the bikes in his stock, but I didn't want another plastic gear. Here is what I built :

I bought a standard anodized aluminum derailleur gear from a local bike shop, and attached it to the Brompton chain tensioner arm with a few pennies worth of standard hardware. The new idler wheel (gear? cog?) slides along a little stainless steel tube I picked up at the hardware store and cut to length. This gives it enough play to allow for easy shifting. The tube has just the right tolerance to allow the gear to spin very easily, but not wobble.

Here's the exploded view :

From top to bottom, the parts are :

  • regular old bolt
  • two washers
  • stainless tube
  • gear
  • another washer
  • lock washer
  • nut
The gear is part of a Shift Biscuits pully set (though probably any pully set would work), and the steel tube is 7.94mm x 7.4mm (stock No. 7117) cut to length with a hacksaw (this took a while). The rest of the hardware is standard hardware store stuff.

I had to saw off the plastic axle tube on the chain tensioner arm because it would have prevented the idler wheel from sliding into the right position for the outer gear. I chose a bolt with a hex-head that fit snugly into the socket on the tensioner arm (similar to the bolts on the toggles for locking the frame in place). Once the nut is tightened against the lock washer, the axle is extremely rigid. The gear slips across the tube with almost zero play.

The shifting action is actually much smoother than it was with the plastic gear, and the bike seems to make a little less noise than I remember (that could be my imagination).

Yay! I've got my bike back, and without another dorky plastic gear, too. Neat!