Whenever you're called on to make up your mind
And you're hampered by not having any
The simplest way to solve the dilemma you'll find
Is simply by flipping a penny

No, not so that chance shall decide the affair
As you're passively standing there moping
But as soon as the penny is up in the air
You'll suddenly know what you're hoping

--Piet Hein

  2008-03-28 20:53 Z
I've been writing this blog for over six years always to satisfy an audience of one: myself. But I'm vain and am curious what parts of my blog others like. Thanks to Google Analytics I now know my most-linked posts:
Why SOAP Sucks
Four years of web API development frustration boiled down to 500 words.
Google search history and privacy
Alarm at a new Google feature. I'm not as concerned about it as I was when I wrote this post.
Goodbye, Google SOAP search API
Learning Google turning off my once-loved search API. My comments about "discipline" were considered news to Google watchers.
Games imitating war imitating games
Call of Duty 4 remixes Iraq. Waxy gave it link love, but a lot of the links are search engine gaming. One of the spam pages has a funny picture, though.
Hostile movie theaters
A guest post from friend Marc, a fine cranky rant I'm in total agreement with.
Helping spiders find your new home
Deeply nerdy post about migrating a website to a new domain. Glad this is well linked, it should be useful.
Why Bloggers aren't journalists
My attempt at being controversial calling Techcrunch out for sloppy reporting.
Another gamer emoticon
The usage of <3 to express affection. BoingBoing liked it. Breaking emoticon news: <8 is the opposite of <3, presumably as rhyming slang.
My most linked posts are pretty varied, but generally technical. When I talk to people in person the posts they remember most are the ones about Paris; no one seems to link to those though.
  2008-03-23 23:11 Z
Do you want to enable Expires: headers on your Debian web-server? It takes three steps:
  1. Get mod_expires loaded into apache by symlinking expires.load in /etc/apache2/mods-enabled.
  2. Enable expires header in your specific site by adding the directive ExpiresActive On in 000-default or wherever you configure Apache.
  3. Enable a default expiration policy by adding the directive ExpiresDefault "now plus 2 days".
The expires header makes me a bit nervous. Pages render faster because the browser doesn't even do a HEAD request if it's in the period. But if the file actually changed, the browser will never know about it. Sort of the same problem with DNS cache times. It makes a lot of sense for static assets like images you never change.

Update: I hadn't realized how many non-static images I had on my server. Pretty much any script that generates graphs from realtime data, for instance. I have a lot of rrdgraphs and the expires header breaks them. Oops!

All this is motivated by Yahoo's guide for speeding up websites. Along with the YSlow tool webmasters have no excuse for not knowing why their site renders slowly. Some of their suggestions are a bit complicated for a small site (no content distribution network for my blog, sorry). But any serious web company should take a long hard look at its reports.

  2008-03-21 16:45 Z
We've been having our new house remodelled. One thing that really surprised me is how impermanent the walls are.
I've always thought of the walls of a house as fixed objects, invariant constraints you work around. But all it takes is a crowbar to open them up. Then you can run wires through them, put in plumbing, ventilation. We even moved a wall a couple of inches to steal space from a closet and make the kitchen larger. No big deal, assuming you have a good drywall guy to finish the job.
  2008-03-19 15:59 Z
20+ years later the Unix shell is still the fastest way to get work done on a bunch of files. I'm still regularly combining grep, awk, sort, uniq, etc to do analysis on data.

One common task is doing work for every line of a file.

for f in `cat list`; do
  ls -l "$f"

There are a lot of reasons this idiom is broken. The worst problem is that it doesn't work if the lines in the file list have spaces in them and no amount of quoting will fix it. Also if list is large (32k?) it fails because everything's expanded in the limited command line buffer.

The idiom works often enough that I use it all the time. And when I do I have a problem, I'm always left scratching my head to remember the right way. Well, here it is (in bash):

cat list | while read f; do
  ls -l "$f"

The read command in bash is a magic builtin. It reads a line from stdin and assigns its contents to shell variables. It also has a return code when EOF is reached, allowing a clean exit from a loop.

read has a lot of options for how it handles the file input. I'm a bit confused that the above sample works, actually, because the bash docs suggest that each line is parsed via IFS and only the first word assigned to the variable f. But in practice that only seems to happen if you have more than one variable. See the docs for options for line delimiters, assigning to an array, backslash handling, etc.

  2008-03-16 15:39 Z
Looking for something intelligent to watch? Can't wait for Season 2 of Mad Men? Do yourself a favour and rent The Apartment, the 1960 film from which Mad Men borrows half its period setting.
It's a great movie thanks to the fantastic performance from Jack Lemmon. He's a total sap, a bit of a nerd, and yet despite everyone walking all over him he remains charming and self-posessed. He's also got enough backbone to get the girl in the end. Shirley MacLaine is good as the girl too, and while the movie falls a bit too much into dopey romance comedy it always has a bitter New York edge that keeps it tasty.
  2008-03-15 16:33 Z
Back when Google filed to go public in 2004, a bunch of investment banks came sniffing around Google looking to "help" all the newly minted millionaires. Merrill Lynch, Morgan Stanley, UBS, all the top tier brand names. And thanks to Eliot Spitzer (with some help from Jonathan Rosenberg), I didn't fall for their pitch.

Before he was governor, Spitzer was the attorney general for the state of New York. And he made it his business to ferret out corruption and double dealing in Wall Street investment banks. Thanks to Spitzer we learned in 2002 that the top investment banks were selling their retail clients securities that they knew were garbage but needed to sell from their investment arm. Nice bit of double dealing. And we learned in 2003 about "market timing", a coy word for the simple fraud of letting privileged customers buy securities at below market prices. He also uncovered the scandal around Dick Grasso; the guy in charge of regulating the NYSE who was getting paid the outrageous sum of $140 million dollars by the people he was supposed to be regulating. The same Grasso who'd failed in oversight on double dealing and market timing.

A lot of people hate Spitzer. Wall Street is glad to see him go, for obvious reasons. And from what I've read he wasn't particularly popular with anyone, you hear words like "abusive" and "arrogant". He's a fucking idiot for hiring prostitutes and the fact he's throwing around $80,000 or more on hookers raises troubling ethics questions.

But I'm still thankful to Spitzer for the work he did as attorney general. I found a way to handle my own investments that doesn't involve getting advice from crooked investment banks and am much better off for it.

  2008-03-13 15:54 Z
Can a great game be ruined by bad controls? I think so and Geometry Wars: Galaxies is my example, on both Wii and NDS. The lack of two joysticks destroys the game.

The Geometry Wars games are a series of great retro twin-stick shooters, a sort of Robotron spiced up with high-def graphics. Galaxies adds a lot of depth to the previous incarnations and I was greatly looking forward to playing all the different game modes.

Sadly, my attempts to play on the Nintendo DS quickly ended in hand cramping. The default controls are left hand holding the NDS up and working the D-Pad, right hand using the stylus to aim your shots. It works OK but holding the NDS up is fatiguing. The Wii is even more disappointing. The controls have you moving with one joystick and controlling where you shoot by pointing the remote at the screen. But the pointing is too imprecise to work. And it's awkward in that one hand is doing something abstract (moving a joystick) while the other is doing something fairly literal (pointing at screen).

I gave the game to three friends for Christmas. Not a big success with anyone. My eleven year old nephew liked it ok on the NDS and didn't mind the controls, but I think he got bored of it quickly. My friend Marc didn't play the game on his Wii very long; it's a more demanding hardcore game than they prefer to play and the controls didn't help anything. My other friend Mike is more of a gamer nerd and wasn't turned off by the hardcoreness, but also agreed the controls were awkward. He went so far as to buy the dual stick controller for the Wii, but that doesn't quite work either because the physical hardware design forces the joystick into the eight compass directions rather than allowing smooth 360 degree motion.

I still think Galaxies is a very good game, it's too bad it's hamstrung by being a twin stick shooter released on Nintendo platforms that don't have two joysticks. Particularly since Nintendo has made a name for themselves in having games with innovative controls.

  2008-03-09 17:07 Z
The Microsoft Wireless Laser Mouse 8000 is good hardware. It's a full-size Bluetooth mouse that works pretty well and is fairly inexpensive at $50.

The main feature that matters in a wireless mouse is power management, and the Microsoft mouse is great at it. It goes into sleep mode automatically, so the battery lasts a week. (Something Logitech mice didn't do, last I checked.) I also like the smooth scroll wheel, with no click-like resistance. And it's standard Bluetooth, not some silly proprietary wireless protocol.

It's not a perfect mouse. In theory clicking the scroll wheel is a middle button, but you usually end up triggering the useless side-to-side scrolling instead. But there's enough extra buttons that you can have another act like button 3. I prefer a right handed mouse to Microsoft's ambidextrous design. The charging connection isn't tight so you have to carefully place the mouse and verify it's charging. I've had the tracking go wonky a couple of times; rebooting the mouse fixed it. And randomly at night my computer is waking up from the screen saver; not positive it's the mouse, but that's my best guess.

That's a long list of problems, but they're all pretty minor. The convenience of a wireless mouse with long battery life outweighs the small issues. Recommended.

PS: Apple LOL.

  2008-03-07 19:29 Z
MediaMonkey is good software. It's an MP3 cataloguer / player that works well. Something like iTunes, only without all the creeping awfulness and with lots of useful features.

The main feature I use is the autotagger. It uses the filename and existing ID3 tags to look an album up on Amazon, then tags your MP3 files with cleaner names and cover art. There's an addon to get lyrics, too. The UI for this is great, with a clear view of and control over exactly what tags you modify. Solved my problem.

My only complaint is that MediaMonkey is not very good at actually playing MP3 files. It takes awhile to launch if it's not running already, the available skins are ugly, and it doesn't buffer enough off my NAS. But it's good enough though and you can always just use it to clean up your collection and play music via a more lightweight player.

  2008-03-06 20:51 Z
A few months into our relationship and I still love my iPhone. Mostly because it's a cell phone with a decent UI. Having mobile email and Web is nice too, although EDGE is awfully bad in SF. But like any relationship, after a few months some things bug you...

The "Recents" UI makes me constantly call people by accident. You get this nice list of recent calls, so you click on one of the names to find out when they called you, see their number, maybe text them a message. Only clicking the name in that list immediately calls them back. Oops! You have to click the little right arrow on the side for all the other actions. That's backwards from how the contact list works and causes mistakes daily.

I love the hands free headset on the iPhone. Great sound, good mic, fits in the pocket. But the microphone has a terrible flaw; sharp corners. See the edges in the picture above? The microphone is just at the height of my shirt collar, so it's constantly catching when I walk. It's a small thing, but Apple often gets the small things right and their hardware design is why you pay the premium.
  2008-03-04 18:53 Z
ReGet Pro is good software. It's a download manager for getting large (10MB+) files with some management instead of straight in your web browser. Integrates into Firefox via the FlashGot addon.

I'd always thought download managers were stupid. Their primary advertised feature is downloading several chunks of a file in parallel "for faster downloads". Because of how TCP/IP works this idea is almost always terrible for large files. It only works because you're circumventing the server's bandwidth throttle; that's anti-social.

But ReGet Pro can be configured in a more useful way, to limit bandwidth. I've got mine set up to download only one thread at a time with a max bandwidth of 180kBps, comfortably under my 240kBps connection. That way I can download big files in the background while doing other things on the net. It also turns out that ReGet's suspend and resume function is surprisingly useful; Firefox is suprisingly unstable to be using for 3+ hour downloads.

  2008-03-04 18:40 Z
A few years back I blogged about an AC-130 gunship video. You can watch it on Youtube now, it's a creepy but fascinating live view of soldiers in a gunship killing people on the ground in Afghanistan. At the time, it struck me how much this real war video was like a video game.
Now we've come full circle; that war video has been made into a video game level in Call of Duty 4. Same visuals, same basic setup of bombing people on the ground but avoiding a church, even some of the same color dialog. The game's a little harder; you have to avoid hitting your own people as well as the church. But the effect is quite similar. And creepy.
  2008-03-02 18:43 Z