Posted on April 30, 02009
Filed Under Inspiration, Journal | Leave a Comment
Baselworld is the world watch and jewellery show held every year in Basel, Switzerland. It attracts around 100,000 visitors and is one of the most important events in the horological calendar. One of the stars of this year's show was not a watch but La Machine à Ecrire le Temps (translation: 'The Machine that Writes the Time'). This beautifully crafted "horological sculpture" contains 1200 components and took almost ten years to construct.
Much like the Corpus Clock or the Clock of the Long Now the machine is as much art project as it is timekeeper. It was designed and built by French watchmakers Montres Jaquet Droz and pays homage to the company's founder Pierre Jaquet Droz, who in addition to being a skilled watchmaker was also a master creator of mechanical dolls and automata.
Posted on April 29, 02009
Filed Under Bede, Development, Drake, Flash, Herodotus, Inspiration, Journal, Kepler, Latham | Leave a Comment

Open Knowledge Conference 2009
A few weekends ago I gave a short talk about The Computus Engine at the Open Knowledge Conference in London. It was interesting to attend a con outside of the usual Flash circuit, and with Open Knowledge being so 'em... open, it meant there was a wide range of topics under discussion. I missed the first part of the day but in the afternoon we were treated to everything from open source fashion (image below), to aid work in Africa, to the intricacies of semantic markup.

The open philosophy is applied to the con as well as the subject matter. Much like BarCamp, speaking slots can be added to the schedule by audience members. Fitting everything in meant I rattled through mine at breakneck pace but I think I got my points across. I've submitted the slides to Jonathan Gray at The Open Knowledge Foundation and I'm told they have audio as well. If they put them up online I'll post a link.
New class documentation
I finally got round to configuring ASDoc (the Actionscript class documentation generator) in FlexBuilder. It's notoriously painful to configure but thanks to my friend Seb for publishing his efforts it gave me enough clues to get mine up and running. Since then I've worked my way through the current set of classes and marked them all up. Taking another tip from the PV3D team I'm checking the docs into the repo alongside the code so they'll always be in sync with the codebase.
GoogleCode repo updates
Yesterday I checked in a stack of updates to the Computus Engine repo on GoogleCode. In addition to the ASDoc markup and docs directory you'll also find updated examples for the Animated Main Preloader and the Timekeeper. The preloader now has a fix to resolve the problem of it stalling if the SWF is already cached.
More importantly I've made a change to the Timekeeper API. I've replaced a number of methods with single properties to reduce the complexity of the API. The affected methods are:
value:Number replaces getValue() and setValue()
tickDuration:Number replaces getTickDuration() and setTickDuration()
tickFrequency:int replaces getTickFrequency() and setTickFrequency()
I don't like changing a live API but I think these changes are sensible and greatly simplify things. The Timekeeper test example has been updated to use the new API.
A S.T.A.R. is born
Eagle eyed visitors will also spot a new set of unit tests and util directory called star. More about this in a forthcoming post!
Posted on April 23, 02009
Filed Under DaVinci, Development, Drake, Flash, Journal, Projects, Timelines | 1 Comment
The demo above attempts to locate your current position on the earth. I can't take any credit for the 3D stuff as I based it on Andy Zupko's great post about Geolocation in Papervision3D. My little contribution is the code below. This takes the humble Date class and does some reverse engineering on it to derive your approximate location on the earth. First the code, then I'll explain how it works...
// Estimate Latitide and Longitude from the Date class.
var latitude:Number
var longitude:Number
var now:Date = new Date()
var northernWinter:Date = new Date( 2000, 0, 1 )
var northernSummer:Date = new Date( 2000, 6, 1 )
var northernWinterOffset:Number = northernWinter.timezoneOffset
var northernSummerOffset:Number = northernSummer.timezoneOffset
// Find just the Timezone modifier TZD (in minutes).
// DST modifier is negative so TZD is the larger value.
var tzd:Number = Math.max( northernWinterOffset, northernSummerOffset )
// if you need the current value of DST (in minutes) it's...
var dst:Number = now.timezoneOffset - tzd
// Estimate Longitude:
// 60 minutes of time == 15 degrees of longitude.
longitude = tzd / -4
// Estimate Latitude:
// If DST is adopted we can detect the current season and from that we can find the hemisphere. If not assume equatorial.
if ( northernWinterOffset == northernSummerOffset )
{
// equatorial
latitude = 0
}
else if ( northernWinterOffset > northernSummerOffset )
{
// northern hemisphere
latitude = 45
}
else
{
// southern hemisphere
latitude = -45
}
// and the estimates are...
trace( "Longitude: " + longitude )
trace( "Latitude: " + latitude )
Last year I wrote a series of posts that looked Inside the AS3 Date class. One of the gotchas I mentioned was the confusingly named .timezoneOffset property which is actually comprised of two offsets: timezone designation (TZD) and Daylight Saving Time (DST). In the article I showed some code that split these values back out again. Well it struck me the other day that you can use these values to approximate a users position on the earth. The cool thing about this hack is that it relies solely on understanding the mechanics of timezones and daylight saving, so itl will work just as well in Javascript as it does in AS2 or AS3.
If you follow the code above you'll see the first thing we do is split out TZD and DST. Once you have these values you can make some estimates about latitude and longitude.
TZD ≈ Longitude
The earth rotates once on it's axis each day so that's 360° in 24 hours, or 15° of longitude every hour. So if we know a user's TZD we can estimate their longitude (east/west) to within about 15°. In reality timezone boundaries are a little wobbly so I'd gave or take another 15°.
DST ≈ Latitude
Using DST to estimate latitude is really inaccurate but if you need to know then this way is better than nothing - here's the theory anyway. As a general rule Daylight Saving Time is adopted by countries with temperate climates. Employing it nearer the poles is pointless and the last thing you need at the equator is more sunshine. In the code above we created a summer and a winter date. By comparing these we can tell if the user's current location employs DST and if it is currently in effect.
There are plenty of special cases for DST (don't get me started on that) but if no DST offset exists in summer or winter then the user is probably within the equatorial band. If DST exists but is not in effect then that hemisphere is in winter, and the opposite hemisphere is in summer. A quick check against the current date will tell you which hemisphere that temporal band is in.
Caveat Emptor
So there you go, GeoLocation using just the Date class. I'm the first to admit that determining latitude is really inaccurate so if you need to know for sure then use server side IP Location. If accuracy is less important then this method is small, self contained and works in AS3, AS2 and Javascript. One last piece of trivia before I finish up; although I said employing Daylight Saving Time near the poles is largely pointless, it turns out that for reasons of synchronicity most Antarctic survey stations follow the DST rules for their home country.
Posted on April 21, 02009
Filed Under Inspiration, Journal, Timelines | Leave a Comment
image courtesy of Google Labs
Temporal search took a big step forward yesterday with the announcement from Andy Hertzfeld of the launch of News Timeline on Google Labs. This is exactly the kind of thing I'm trying to build in Flash so it's exciting to see Google's take on it.
The interface is built in javascript and HTML and is similar to the sideways scrolling Simile Timeline used in other Google projects. Temporally related search results are displayed in columns within a zoomable, graphical timeline.
Historical data can be displayed for dates as far back as the 1400's and from what I can tell they are using the proleptic Gregorian calendar for any dates prior to the Gregorian reform in 1582. Most of the early content is pulled from Wikipedia but dates closer to the present return much richer data. The temporal granularity can be set to day, week, month, year or decade.
Posted on April 16, 02009
Filed Under Drake, Journal | Leave a Comment

Toeing the line
If you visit the Royal Greenwich Observatory you'll often see groups of tourists jostle for position to have their photograph taken "on the prime meridian". The notion that you can stand with one foot in the western hemisphere and one foot in the eastern hemisphere is pretty cool. What seems to elude many of them however is that the prime meridian isn't a place, it's a line. It's a line of longitude runing north/south from pole to pole. If you were so inclined, there's a petrol station on Greenwich High Road where you fill up your car with one foot in the western hemisphere and one foot... well, you get the idea.
The other thing to remember about meridians is that they are the astronomical equivalent of an "imaginary friend". We talk about them as if they are real, but they are only consensual human constructs that mark nothing more than where an astronomer placed his telescope. The prime meridian is in reality the Airy meridian - marking the position where the astronomer royal George Airy made his observations.
This becomes more obvious with a visit to the RGO where you'll also find a Bradley meridian, a Flamsteed meridian and a Halley meridian, each within a few yards of each other; and each marking the position where the eponymous astronomer (that's hard to say) fixed their observing apparatus. Just to confuse matters further if you take a GPS receiver with you, you'll discover the GPS meridian is somewhere else again. It doesn't even run through the observatory; but several yards east near the statue of General Woolfe.
125 years of the Prime Meridian
In October this year the RGO are commemorating the 125th anniversary of the selection of Greenwich as the prime meridian of the world. I've mentioned the 1884 International Meridian Conference here before but if you are interested in the full story behind the prime meridian I'd recommend getting hold of a ticket for Graham Dolan's lecture, The Greenwich Meridian and its significance to the World.
Graham is an entertaining and humorous speaker and an expert on the meridian. A few years ago I attended a seminar day at the RGO entitled 'On the line' - not to be confused with the RGO podcast of the same name. Graham showed a high-speed photo slideshow of markers and monuments along the prime meridian. I've always thought this collection would make for a great Google Maps mashup!
keep looking »