Another Reason I Hate Internet Explorer
January 23rd, 2008 by Andrew
I’ve never calculated it, but if I had to guess, I’d say I spend 30% of my time designing a site, 30% implementing the site, and 40% fixing it up so it will work in Internet Explorer. This goes for CSS and Javascript. I recently discovered mootools, a nice Javascript framework with some cool effects. In the past I have also used script.aculo.us, but I wanted to try something new. So while writing some new code for Mootools, I discovered that the Javascript worked fine in Firefox (of course), Safari, etc., but Internet Explorer 6 and 7 died on it. Here’s an example:
var Site = { start: function() { if ($('givenow')) Site.giveNow(); }, giveNow: function(){ var size_closed = 56; var size_open = 110; var gn = $('givenow-a'); var fx = new Fx.Styles(gn, {wait: false, duration: 300, transition: Fx.Transitions.Quad.easeOut}); gn.addEvent('mouseenter', function(){ fx.start({'width': size_open}); }); gn.addEvent('mouseleave', function(){ fx.start({'width': size_closed}); }); }, };
Can you see what’s wrong with that code? I couldn’t see it for about 30 minutes. IE kept giving the error “expected identifier, string or number”, and pointed to the last line of the script as the problem location. Well, the last line looked fine to me.
What it ended up being was the final comma after the function giveNow. Huh? Well, it seems that when grouping functions like this in an object, the last function shouldn’t have a comma after it. Firefox and everything else handled it just fine. Internet Explorer decided it wouldn’t run any of my Javascript code after seeing that. Thanks for making life wonderful, Internet Explorer.
Another Day Out My Window
January 20th, 2008 by Andrew
This time around my bash script for gphoto started when it was supposed to. I captured a full day worth of photos, 1 every 60 seconds. The frames were captures on January 18th, 2008. I ended up with 710 photos in the final video, which is about 11.8 hours worth of the day. When I made the video, I set the delay to 1/10th of a second, resulting in 10 photos per second. So every second of this video covers 10 minutes of the day.
This video is better than my first attempt, but still not as awesome as I’d like. The morning started cloudy and a little snowy/rainy, then the clouds moved away and the sky turned bright blue until sunset. I’ll need to find a better vantage point to take some more striking images.
Another hindrance to finding a good location is that gphoto still doesn’t work correctly on Mac OS X. That means I can’t use it on my laptop, so the camera has to be tied to my Ubuntu box. Even though I installed gphoto2 with Mac Ports, I can’t find any solutions to the delay and disappearing file problems I’m having.
One Day Out My Window
January 17th, 2008 by Andrew
I finally got the Nikon EH-5a, the $70 power cord for my camera. It’s crazy that a cord can cost that much money, and all it does it supply my camera with power from a wall socket. I put it to use though, by running my camera all day on the 16th. I shot out my window towards the woods. Unfortunately it was a really clear day, the sun was never really in the picture, and the script didn’t start when it was supposed to (6am). Lots of problems. So the video’s kind of boring, but it was a good learning experience for when I do more time lapse videos.
Here’s the process I used. I installed gphoto on my ubuntu box. Gphoto allows you to control a capable camera with your computer. It’s a very neat program. There are tons of options I can play with, and I think everything is controllable through the software from aperture to shutter speed to white balance and ISO. I didn’t use any of its crazy capabilities though. I just wrote a bash script that called it every 60 seconds to take a picture and download it to the computer. I set the camera to aperture priority (A) mode. That way, the depth of field of the images wouldn’t change throughout the day, only the shutter speed.
Once I had a directory full of photos (just under 600), I ran ImageMagick’s “mogrify” command on them to resize them all to 600×366. From there, I used ImageMagick again, this time it’s “convert” command to turn all the jpegs into an mpeg, with 5 jpegs every second. This resulted in a movie that plays for a little over a minute that shows about 12 hours worth of time.
PowerBook RAM Upgrade
January 11th, 2008 by Andrew
I had meant to post this back in August when it was relevant. I didn’t.
When my PowerBook hard drive crapped out on me, and I had to use Disk Warrior to retrieve all my data, I decided it was also a good time to finally upgrade my memory. Here’s a before and after of my memory usage:

flickr.com/photos/andrewmwhalen
linkedin.com/in/andrewmwhalen
twitter.com/awhalen
youtube.com/user/whalena