Disk Clock 0.11 – Saving TIme

Disk Clock 0.11. Another martial arts seminar, so nothing revolutionary. Mostly it was smoothing out DST handling, trying to align the moon a little, and more general code cleanup. However, I did add another doomsday disk: the 32 bit Unix epoch.

Daylight Crazy Time

Having your own clock makes DST an interesting event. The vast majority of it is actually handled by the system libraries, but you still have be ready for discontinuous time. Or, as one code comment says “This last has a special exception for when time actually goes backwards.”

0.10 actually handled it fairly well; it shows solar noon off-kilter around 1:00 with dusk and dawn skewed appropriately. However, I had to reset it to see that, because daylight was calculated once per day. It is now recalculated after any major time jump.

It was also pulling the GMT offset from the local time rather than the display time, which might be different. I rewired the astronomical calculations to work with richer date objects, rather than millisecond counts.

Play It Again, Sam

In order to see that the transitions were happening in an, err, timely fashion, I finally implemented the arbitrary start date. I had ‘hold’ before, but you can’t roll over a time change doing that. Hacker features, as usual.

Checking Off Auto-Show

I did add one visible interface element; auto-show finally got a checkbox. Even if it might still be a little dumb outside of the usual clock/calendar setup, you can just shut it off.

Aligning the Moon

Moon phase can vary by over half a day, so the moon disk isn’t accurate. It is now aligned with the average point, however. Getting perfectly accurate will probably involve translating Perl:Astro:MoonPhase to javascript. In the process I ran across yet another Dashboard bug; it doesn’t handle dates far in the past very well. Perhaps it’s on the Unix Epoch?

Unix Disk

Usual feature creep, I suppose. There is a new ‘doomsday’ disk – the count down to the rollover of the Unix 32 bit clock around 2038. I thought it would be an easy one, but there was a bit of work involved in pondering whether to count it in bits or years, and how those decisions interacted with the various systems.

Big Time

I had been keeping a tight window size, which involved shrinking back down when the hover info box wasn’t displayed. I started leaving it at the largest extent to reduce size bounce.

Portability

I got the program to run, after a fashion, in IE last week; in principle the necessary fix is in 0.11, but I haven’t tested it yet. Not that it will be especially useful mind you, as IE+excanvas joins Opera in the scaled arc hall of shame, but in it’s own special way, of course.

Spit and Polish.

The rest is internal; some more code cleanup and a little more commenting. I rewrote my JSON to HTML engine to handle arrays differently. It used to assume which tag might come next, with no way to override a bad choice. Now it makes a special exception for the array’s label, and generates one tag for each element instead of one wrapping the collection.

Posted Sunday, March 9th, 2008 under Devlog.

Comments are closed.