my recent reads..

Rocket Ship Galileo - Apollo 11 40th Anniversary


Houston, Tranquillity Base here. The Eagle has landed -- 20 July 1969

The 40th anniversary of the Apollo 11 landing has been getting quite a bit of coverage, but the coolest initiative has got to be the addition of the Moon in Google Earth.

Quite coincidentally, I just read Robert A. Heinlein's "Rocket Ship Galileo" (well, actually listened to the audio version brilliantly narrated by Spider Robinson ).



Heinlein packs this atomic moonshot adventure with just about every Boy's Own plot twist possible and tells a rollicking ripping yarn. What's amazing is the detail of the hard science throughout the book - especially given the fact it was written in 1947.

All the shucks, gee willikins is quaintly pre-baby boom, while the embracing of atomic power with such wild abandon is frightening in retrospect. Altogether, it's a great - if dated - story; a true testament to Heinlein's genius and imagination.

On atomics: it is possible the tide of opinion may be swinging back to nuclear. The ABC Science show just featured a story on the safer and cheaper generations of reactors coming online (transcript, audio). Today's generation III reactors, and the generation IV on the horizon offer even cheaper, safer and cleaner power (literally eating the waste products of earlier designs). All well and good, but it would be a concern if "new atomics" became the quick and easy fix that sabotages the head of steam building up behind the true clean, green renewables (like solar nanopillars).


read more and comment..

ChordMaster 2000 - the sexy way to learn guitar chords

So this weekend I've dressed up jTab as a little web application to help you learn chord fingerings for guitar...

Introducing the ChordMaster 2000 ;-)




OK, so maybe I sexed up the design and UI a little too much for such a simple task, but it was fun to see how far I could go with javascript and SVG (and no flash or silverlight).

It was also a proof point for jTab - the javascript library I released last week that renders arbitrary guitar chord and tab using SVG. Happily, it worked fine without a tweak - just some extension methods that are specific to the ChordMaster application (like getting an array of all chords that are defined as "intermediate" level).

PS: big thanks to @jasonong who's jumped in and already made some great contributions to the jTab project on github -- It's amazing to see github rock as a "social coding" platform - create a public project one day, have changes to merge back the next. Trivial to do with git, and the great visualisation of the project revision/branch history makes merging so easy to understand.
read more and comment..

jTab - Guitar Chord and Tab Notation for the Web

Guitar tab (notation) is all over the internet, but it is usually in either a fixed/non-interactive form, or painstaking ASCII format.

I've always wanted a better way, and two things I've looked at recently inspired me to think it might be possible: Dmitry Baranovskiy's fantastic work on the Raphaël SVG library, and Alex Gorbatchev's syntaxhighlighter.

So now I can introduce the result of my latest weekend project:

jTab - newly minted and ready to rock and roll!

See the project home page at http://jtab.tardate.com for more examples and information about how you can use it too. jTab is open source, with the master source code repository on github .

What does it do?

jTab is a javascript-based library that allows you to easily render arbitrary guitar chord and tabulature (tab) notation on the web. It handles implicit and automatic rendering of any page elements given the special class name 'jtab'. It can also be scripted for more sophisticated or interactive effects.

Bottom line: jTab turns this..


<div class="jtab">Bm $3 4 4h5p3h4 5 $2 3 5 7 7h8p7 5/7 | A $4 7 9 $3 7 6 $5 9 $4 7h9 7 $5 9\7 5/7 | </div>

..into this:


Grab it, use it, help me improve it, or just let me what you think...
read more and comment..

Using Twitter OAuth with Rails + sample

I've been using rails with the Twitter REST API of late, using the oauth gem as the base. It works well, but keeping up with the API changes can be a challenge!

In the recent update to OAuth 1.0a, there were two critical changes required:

Web-apps should specify the oauth_callback


Through trial-and-error, I found that if you don't explicitly specify the oauth_callback when going through the authorization process, twitter will halt at the PIN page (behaving as if you are using a client application). That's easily fixed..
request_token = consumer.get_request_token( :oauth_callback => TWOAUTH_CALLBACK )
session[:request_token] = request_token.token
session[:request_token_secret] = request_token.secret
# Send to twitter.com to authorize
redirect_to request_token.authorize_url

NB: the root cause is that oauth 0.3.5 sets "oob" as the oauth_callback if you don't explicitly set it. This triggers the twitter desktop PIN flow.

Include the oauth_verifier when exchanging the request token for an access token


Next, the major change in 1.0a was to add an oauth_verifier parameter. Twitter sends this back to you after the user has authorized access, and you need to include this parameter when exchanging the request token for an access token.
request_token = OAuth::RequestToken.new(consumer, session[:request_token], session[:request_token_secret])
access_token = request_token.get_access_token( :oauth_verifier => params[:oauth_verifier] )


An example application


I've created a minimalist application that demonstrates the twitter API with OAuth 1.0a in rails. I've set this up to run at heroku.

The source is at github for all to share: http://github.com/tardate/rails-twitter-oauth-sample/tree/master

And there's a running demo site at http://rails-twitter-oauth-sample.heroku.com.
read more and comment..