Google Maps vs. MSN Virtual Earth #

MSN Virtual Earth was released today. My contribution to the discussion is not a review, but a Greasemonkey script. Google Maps vs. MSN Virtual Earth is a simple script that adds links between the sites. Using their respective UI APIs, it transfers state between them, making it very easy to do side-by-side comparisons. With this in hand, feel free to make your own (informed) decision as to which is the mapping site for you.

Screenshot of Greasemonkey modifications

Impromptu Market Research #

I was at an improv show yesterday, which ended up being very disappointing. The best thing that I got out of it was a quick glance at a class signup sheet that was outside the theater. I was happy to see that Gmail was doing just as well as the more established email players, despite being invite-only, in beta, and all that.

  • Gmail: 3 people
  • Yahoo: 3 people
  • AOL: 3 people
  • Hotmail: 2 people

Putting Your Reading List Online #

Lately, I've been playing around with Delicious Library, and after a few days of tedious labor (I am iSight-less), I have imported my entire collection of books into it. Once I had all this data gathered, I wondered what I could do with it. Unfortunately, while the program has all sorts of clever ways of getting data into it, it's much more miserly when it comes to exporting it. The only officially supported feature is an export command that outputs a CSV file. Unfortunately, with no AppleScript or Automator support, there's no programmatic way of invoking it.

However, as it turns out, Delicious Library stores all of its data in an XML file. ~/Library/Application Support/Delicious Library/Library Media Data.xml has a very sane schema and is easily parsed (I'm obviously not the first to realize this, some Googling turned up this FileMaker import script for example). With this in hand, I decided to complement my automatically updated online reading list with a book analogue.

The result is my book reading list, which is also linked to from the sidebar. A cron job periodically uploads my Library XML file to my server. There, another cron job reads it, generates a simple HTML file, and tells Movable Type to refresh the relevant template. I figured that dumping my entire library would not be all that interesting, so instead I picked a few "shelves" that I use to keep track of recent purchases and books I should read.

The source to the simple generator script is available It relies on ElementTree for its XML parsing. I am considering putting more metadata into Delicious Library, such as personal reviews, to play around with the hReview microformat. Other output formats are possible as well: my reading list may not be that exciting, but having other erudite people's available as RSS may be.

data: URL-based Animation #

A while back I happened to see Evan's minimalist Gmail notifier. One thing that struck me about it was that he not only base64 encoded his icon data, but that he split them into header, palette and footer sections. By swapping out the palettes, he could easily create active and inactive versions of the same icon.

Back in the days when most games were written for 8-bit displays, color palette animation was a common technique for simulating change without having to actually push new pixels to the screen. Out of sheer curiosity, I tried to replicate the same effect in a browser, using data: URLs and JavaScript. The result is this simple animation that is programatically generated by shifting a simple gradient color palette.

The main gotcha that I encountered is that using PNGs isn't really an option. All chunks in a PNG image (including the PLTE one that specifies the color palette) must be followed by a CRC of their data (see section 3.4). If I were to dynamically update the palette, I would have to re-compute the checksum. JavaScript isn't ideal for bit twiddling, and performance would've gotten even worse (the example given just about maxes out the CPU in Firefox/Mac and Safari on a 1.5 GHz G4).

I'm not sure if this technique has any real world value (even ignoring MSIE's lack of support for data: URLs), but it's still fun to see old school techniques such as this resurrected.

Linkblog