Friday, January 26, 2007
This looks to be a terrific new tool for all web developers. Firebug allows you to inspect the contents of pages, scripts, css and DOM. I've only perused it for a few minutes but the possiblities are staggering. I sure could have used this before! Most interestingly perhaps is the javascript debugger that allows you to set breakpoints. Sweet!

1/26/2007 9:24:31 AM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [1]  | 
 Thursday, January 25, 2007
In my Asteroid Occultation site I generate dynamic Google Maps that draw the occultation paths with 5 Polyline elements. One of the things I wanted to do is center the polylines in the displayed map. Easy enough, I parse an XML response with coordinates (the AJAX part of the project) and store those in arrays. Simply take the middle coordinate from the middle polyline and center on that when the map is fully rendered. I wrote something like this:

var pts[];

// store coordinates in pts array

var middle = pts[pts.length / 2];


Easy as pi. Not. For some reason my maps wouldn't always center properly. Adding some debug messages I found that 'middle' was sometimes set to undefined. Unlike other languages I've used in the past (c/c++, VB6, VB.NET, Perl, PHP) if you divide an integer by another integer and use the result as another integer, you get, well, an integer. Not so in Javascript apparently. pts[5.5] is nothing. I assumed, incorrectly, that this would be pts[5] or pts[6]. For my application I don't care if the left or right middle element is chosen.

A little Googling found this article http://rextang.net/blogs/work/archive/2006/01/09/3325.aspx which suggests an easy way to turn a number into an integer. Simply do a bitwise or with 0:

var middle = pts[(pts.length / 2) | 0];

This works great! Someone then posted a comment saying that 'parseInt' is a more readable solution and I agree. I still liked the |0 solution though :)

1/25/2007 1:50:06 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 
 Wednesday, January 24, 2007
I've been participating in asteroid occultation measurements for a while now. To facilitate the creation of maps of the events I created a new website that uses dynamic data rather than static to display events. In the process I learned a few things about how to automate windows applications using Perl (check http://sourceforge.net/projects/winguitest/ ), creating dynamic Google Maps using AJAX and using MySQL with ASP.NET. I also learned a lot more about operating winoccult, a program that calculates and displays occultations of stars by asteroids.

Check it out at http://occult.tungstentech.com.
1/24/2007 10:38:07 AM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 
 Monday, January 22, 2007
SD Time's Linkapalooza alerted me to this site which provides 12 standard CSS templates to quickly create a professional appearing website. I think we'll all agree many sites could use a smidgen of professionalism :) Check them out!

1/22/2007 11:50:10 AM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 
 Thursday, January 11, 2007
This is a classic example of English understatement. I wish I could talk like that. The words I mean, not the accent, that's easy. The way he describes what happened to him (getting arrested in the most violent manner for jaywalking) is a great display of being able to being polite and accusatory at the same time. The vid is a bit long but worth it, I think.

http://www.timesonline.co.uk/article/0,,11069-2541133,00.html

1/11/2007 1:00:10 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [1]  |