5/11/2004

Mr. Bald Eagle

A bald eagle lives somewhere around here. Arianna and I have seen him a few times. I saw him once last November, flying over the house on a blustery gust of wind. Ari saw him again in the middle of winter, along with my Dad, again flying directly over the house.


Today, Arianna spotted him again. He was flying low over the lake, being chased by a flock of seagulls. I ran downstairs and grabbed the binoculars, and went out on the breakwall to try to catch a glimpse of him. He was sitting on a sandbar a couple hundred yards north of the house, pecking at something on the ground and looking over his shoulder at the huge crowd of seagulls which were keeping their distance. I suspect he had caught a fish, and the seagulls were pretty pissed off about not getting any.


I wish we could have gotten a picture, but he was too far away. Hopefully Ari's next camera will be telephoto capable so we can get some nice shots of far-away stuff.



5/02/2004

Debugging JavaScript

One of the things I hate about web development is the absolute pain in the ass that is JavaScript. It's not a terribly bad language in itself, with a decent anonymous function syntax and prototype-based object system (even if it's completely useless because there is no object database). But the fact that errors often pass silently and the debugging tools available are tedious and a pain to use makes developing with JS almost unbearable. I have often wished for the staple, the crutch of development in tool-poor environments, of the 'print' statement.


Here is how to configure Mozilla so that calls to 'dump()' will show up in the console:


Fire up Mozilla and type 'about:config' in the url bar.


Right click and choose 'New->Boolean'


Type 'browser.dom.window.dump.enabled'


Type 'true'


Start Mozilla from a shell, and you will finally be able to debug complex javascripts by printing things to the console using the 'dump' function.


By the way, to start Mozilla from the Terminal on Mac OS X, execute the binary:


'Mozilla.app/Contents/MacOS/mozilla-bin'