wholemeal

Complete | Quality

Geeks on Bikes

NOTE >>>> CANCELLED DUE TO LACK OF INTEREST <<<<

I’ve been toying with getting this going for a while now, so lets just see if this thing floats. Announcing …

Geeks on Bikes [0]

Photo credit: Steve Jurvetson

Ever noticed how geekdom and cycling seem to go hand in hand? Perhaps it’s an appreciation of the design and engineering perfection of the humble bicycle, or maybe the frittering of funds on gadgets leaves no other transport options. Whatever the cause, on the whole, geeks like to bike.

And so, fellow pedallers, I humbly invite you to lay down your arms in the programming language / OS / editor wars and join me in the first of hopefully many two wheeled forays in and around beautiful Churtown.

Geeks on bikes[0] - geeks_on_bikes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
geeksOnBikes.push({
ride: 'Bottle Lake Forest Loop',
type: 'MTB',
grade: 'Easy',
distance: 10.0, // km (approx)
rendezvous: {
where: 'Beach Cafe, 16 Beach Rd, Nth New Brighton',
when: 'Sun Sep 11 14:00:00 NZST 2011',
latlon: [-43.485248,172.722116]
}
});

Bring yourself and steed. Extra merit for GPS plots, helmet cams, Arduino cycle computers, and other gadgetry. Follow @malclocke for updates, I may postpone in the event of atrocious weather.

See you then!

Mix and Mash Nominations

I’m very flattered to have received 2 nominations for the ‘Best Mashup (so far)’ category for this years Mix and Mash contest.

The contest runs between August and September and challenges developers and artists to create innovative work using open New Zealand data and content.

As a prequel to the main event, there is a vote open for the best mash up so far, for projects created before the contest period.

Darfield quake timeline

This is a little mashup page I made after the September 4th earthquake in Christchurch. It uses the data from Geonet, the New Zealand geophysical information network, and the Timemap.js library to display the initial aftershock sequence from this earthquake as an interactive timeline.

The most interesting thing about this simple project for me is that I was contacted by Geonet and asked for permission to use the code on their own site, and it’s now present in the Canterbury quakes section of their site.

This is a great demonstration of the benefits of open data and open source in combination. Geonet provide open access to their quake data, allowing developers to create interesting and useful tools around that data. By making my code available as open source software, Geonet were free to incorporate it into their site. This kind of ‘round trip’ is what makes open data such a powerful concept.

Christchurch Metro

My second nomination is for my Christchurch Metro Android app, which uses real time data from the Metroinfo system to display arrival times, route maps and other information for the local bus service.

This was a ‘scratch an itch’ project for me, to provide a solid Android application for the Christchurch Metro, and also an opportunity to try out Android development. This project is also free and open source software.

The competition is decided by public vote, and any votes for either the Darfield Earthquake Timeline or the Christchurch Metro app would be greatly appreciated!

Find_or_create - Did You Find, or Create?

find_or_create_by_* is a great utility in the Rails toolbox. It allows you search for an object in the database by an arbitrary field, and if a matching object is not found, a new one is created.

# If a user with the given email address is present in the database, it is
# fetched and returned.  Otherwise, a new one is created and saved.
@user = User.find_or_create_by_email('user@example.com')

However, there does not appear to be a way to find out whether the object was found, or whether a new one was created.