Sunday, February 18, 2007

Stevens Pass in January
A quick replay from the Stevens Pass public web cam in January. One second in the video represents one day (86400x speed-up).

Did you notice the tree branches bending up and down as snow accumulates and melts? The jump that is built and torn down? The snow falling off the fast moving clock? About half the days being cloudy? The night-time groomers?

Here's how the video was created:
  • Download images. A scheduled cron job downloaded the web cam image once every minute throughout January.

  • Select a subset of images. For 1s/day and 30fps I only need 1/48th of the images.

  • Remove duplicates. The web cam sometimes seemed to get stuck and not update the web image. I have filtered out images that are identical to the previous image to avoid having the video appear frozen at moments.

  • Stitch images into video. There are several tools for doing this, some better than others. The important thing is to use one that does not try to load all image data in memory up front. I found that RAD Video Tools worked quite well. The UI is not very polished but it's reasonably fast.

  • Add audio track. Something Windows Movie Maker can actually do :)

Sunday, February 11, 2007

NPEs and Static Analysis
Some days ago I was happily coding away when I stumbled over a bug in some Java code that I was using. More specifically I was getting a so called Null Pointer Exception, which is fairly common problem type. The funny thing this time was how long I had to stare at the one line of code before I saw the problem. The line contained several potential problems, but even a simplified example might look non-obvious...

  public void printWinner(String name) {
    System.out.println("The winner is: "
      + name != null ? name : "n/a");
  }


Do you see the problem? A quick code search shows that this bug exists elsewhere too. Now, if it's that easy to find a bunch of bugs like this, shouldn't there be a whole class of problems that can be detected automatically? Of course! Check out the Google engEdu tech talk on Static Analysis.

Monday, February 05, 2007


Visitor Stats for my Google Videos
4th of July fireworks254
Whistler ski action...249
Whistler Couloir Extreme128
Zero Gravity83
Bears in Bern II70
Night Riders63
Traffic49
Mt Rainer17
Adium 1.0A New Duck!
Last week Adium 1.0 was released (screenshots) - it's a really slick Mac client that handles a number of services: AIM, MSN, Yahoo!, ICQ, Google Talk and more. Love at first sight. You can download it from their webpage, where you also find help videos, a blog and xtras.