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 February 16, 02009
Filed Under Bede, DaVinci, Development, Drake, Flash, Harrison, Herodotus, Journal, Kepler, Latham, Projects | Leave a Comment
After reviewing what I want to achieve from the project I have identified seven areas I need to work on. Each area will become its own project and is named after a major figure in that field. The plan is to post about the work here and check in newly completed functionality into http://code.google.com/p/computus/ .
The Model View Controller declarations in the diagram below are only intended to be broadly indicative of the functionality. As you'll see most of the work falls into the Model domain as it involves managing historical data. This should be good news for anyone wanting to use this work elsewhere. Although I'll be using Flash to build my UI, all of the model classes will be in pure AS3; meaning they can be used as-is in Flex or AIR (and with a bit of fiddling, converted to Javascript).
Much of last years work falls easily into the new structure. The Timekeeper class becomes part of Harrison, a project focusing on timekeeping in AS3. The Flash BaseComponent class will form the foundation of the user interface, a project that could only be named after Da Vinci, the archetypal artist/engineer.
Herodotus concerns itself with the accumulation and management of historical data. Named after the first ever historian this project will focus on importing and parsing all kinds of temporal data.
The twin project to Herodotus will be Bede. This is a project concerned with the generation of temporal data. These classes will principally be used to calculate the dates of movable feasts and other days of observance.
Both Herodotus and Bede will make use of the calendrical framework Latham. This project is named after the late Lance Latham, who's Standard C Date/Time Library was one of the original inspirations for The Computus Engine. Latham will support the storage of historical dates and simplify conversion between different timescales and calendar systems. Algorithmic calendars will be the first to be supported.
Astronomical calendars will follow in Latham after the completion of Kepler. I find it ridiculous that we don't yet have an open source astronomical framework in Actionscript. It looks like Im going to have to build my own. I really only need to generate ephemeris data for the earth, sun and moon but hopefully this might be enough to jump start a full astronomical framework in AS3. This is the International Year of Astronomy after all.
The last part of the puzzle is Drake which concerns itself with spatial calculations, and geocentrics is a prerequisite for Kepler. I may not need to do much with this as there seems to be a fair bit of good geo code kicking around already - mainly due to the huge number of PV3D earth demos!
The diagram below shows how the different projects fit together.

Posted on May 8, 02008
Filed Under Bede, Journal | Leave a Comment
This coming Sunday is Mother's Day in the USA. Although it's often looked on as a "Hallmark holiday" it actually has a variety of definitions and derivations depending upon the country in which it is being celebrated. The second Sunday in May is the most popular date with over 60 countries participating.
In terms of Google traffic the next most popular date is 'Mothering Sunday', a related but much older festival. This is celebrated in the UK, Ireland and Nigeria and is an unusual secular example of a movable feast. Based originally on Laetare Sunday in the Christian Liturgical calendar, the date of observation is the fourth Sunday in Lent, which inevitably ties it to the annular dating of Easter.
Many countries celebrate International Women's Day annually on March 8th. Mongolia observes this day as well as 'The Mothers and Children's Day' on June 1st. Other unusual dates include an observation in the Middle East at the vernal equinox and observations in Israel and Iran which are dated in the Jewish and Iranian calendars respectively.
Posted on March 25, 02008
Filed Under Bede, Flash | 2 Comments
As I mentioned in my previous post, 'computus' is the name given to the calculation of the date of Easter. What I didn't get into was how to calculate it. There are dozens of algorithms for doing this but I've chosen the one from 'Mapping Time' by E.G.Richards. I like this one as it is relatively simple and it delivers a date in the Gregorian calendar.
function getEasterSunday(year:Number):Date
{
var a = Math.floor(year / 100)
var b = a - Math.floor(a / 4)
var c = year % 19
var d = (15 + 19*c + b - Math.floor((a + 1 - Math.floor((a+8) / 25)) / 3)) % 30
var e = d - Math.floor((c+11*d) / 319)
var s = 22 + e + (140004 - (year + Math.floor(year / 4))%7 + b - e) % 7
var easter = new Date( year, 2, s, 0, 0, 0, 0 )
return easter
}
The mechanics of the algorithm are fairly arcane and I won't be going into them in this post but if you really want to know about epacts, Golden numbers, and Dominical letters then the Wikipedia entry on computus is very good.
I looked at quite a few Easter algorithms before settling on this one. The simplest ones always delivered a date in the Julian Calendar; the reason for this being that the Julian leap year rule is much simpler than the Gregorian. This is fine but the conversion from Julian to Gregorian always required some lookup table and that felt like a bit of a hack. I've tested the Richards algorithm against all the dates I can find and it seems to hold up fine.