click here for my current blog

this blog is no longer maintained and is here only for archival purposes

Cheetah Style Remix

May 24th, 2008

I’ve been working on a tune on and off for a few months. It’s a remix/remake of ‘Cheetah Style’ by the inimitable Keith! Party. I used Reason 4, and particularly the new Thor synthesiser (in fact I think all the synths use the Thor). Since it’s about as finished as it’s going to get, I’ve decided to release it. Download the tune here (4mb), and please, let me know what you think.

I’ve been too busy to work on much music recently, apart from practising the guitar whenever I can. However, Meyrick and I have just started sending Reason files back and forth with the hopes of creating something amusing, if not worth listening to. I’ll keep you posted.

Something old, something new

May 10th, 2008

Here are a couple of JavaScript things I’ve done, one of them about a year ago, another last week. I thought I’d better just write these up while I think of them, lest they disappear forever.

The first (and oldest) is the basis for a browser-based Raiden-esque game that I put together using Prototype. At the time I called it Journey to the Stars, and I’d intended to make it lightweight enough to be used as a loading screen for my (as yet unfinished, or really “unstarted”) web site.  The game was never completed, and the engine notably lacks collision detection among other things. What I like most about the game is its CSS-based sprite engine, which seems to work pretty effectively. (It even supports animated sprites, although I never got around to animating anything.) If I were to do it again, I’d use a more lightweight framework like jQuery. That Prototype ‘extends’ (ie adds a bunch of helper functions to the prototype) of every object you call with its $() function creates a lot of unnecessary memory overheads that must certainly compromise speed.

The second more recent thing is this simple JavasScript implementation of cellular automata. I was prompted to write it after I’d read th wikipedia aricle on Rule 110, and thought “hey, why not?” It would definitely benefit from being rewritten to use the new <canvas /> element, as its current method of flippng the background colours of hundreds of DIV elements is dog slow (and very “old world” in its approach, I think).

I’m highly sceptical that either of these will work in Internet Explorer. I doubt anyone reading this site is running it, anyway.

John Resig never ceases to amaze me.

May 9th, 2008

As if the guy hasn’t done enough impressive things lately, he’s now gone and implemented Processing in Javascript. This required him to write a parser for the Java-like Processing language and convert it into JavaScript, and re-implementing the Processing graphics API for the new “canvas” element.

Now I must resist the temptation to port processing.js to Rhino using native Java graphics widgets, thus bringing the whole exercise full circle.

When ASCII reflects reality

May 9th, 2008

Emil beat me to it, but this ASCII Art Fart couldn’t be closer to the truth. (although they’re rarely off the mark, in any case) Having just bought a new MacBook (and a very slick Airport Extreme base station to go with it), the one thing that pains me is the poor virtual desktop and focus model. God damn it, Apple! Get it right!

The things that Should Not Happen

May 2nd, 2008

I was completing a Parser for my Compilers subject at uni a couple of days ago, and I ran into an issue where my program (which is written in Java) was ending prematurely without producing any error messages. As I’m not very experienced with Java, I emailed my lecturer asking if he knew what was up. Kindly, he offered to take a look at my source file and tracked down the offending code (that was throwing an exception caught silently by the test framework (that I didn’t write)):

The error is that new_tAST = null before that constructor is called.
If you look back in your code to see what had gone wrong earlier:

// this shouldn’t happen

in parseType() had actually happened:-)

Moral of the story: if it shouldn’t happen, it most certainly will.

Facebook Chat

April 24th, 2008

Facebook’s new Chat feature certainly took me by surprise, but after a few minutes of using it I realised this was the smartest thing they could have done. It gives the whole “Facebook Platform” a new sense of immediacy, thus enhancing more or less every aspect of the site by adding the element of interactivity. (Eg, you can make a “witty” comment on a friend’s photo and immediately get an irate response from them.) At the very least, it’s caused me to spend more time looking at Facebook pages in the last couple of days than I had in the last month combined. I’m interested to see where this takes them, and if it can rejuvenate the platform whose user-base seemed to be suffering Facebook-burnout.

Social aspects aside, the technical implementation is rather clever. The one thing that made me go “buh?!” was the apparent persistency of chats across multiple windows. They make it seem like they are somehow able to preserve state between pages, but after some delving I found that they achieve the effect through some neat tricks.

When you open a Facebook page, your chat’s “state” is sent along with the main page data. They then make an GET XMLHTTPRequest to a specially-configured HTTP server. This is accepted, but the server delays its response until it has something to send (ie if there’s some change in state, like a message, or a user going on/offline). If nothing happens before the request times out, then another request is made. This effectively establishes a channel through with the server can “push” content at the user. I presume this is the same way that GTalk, MSN Web Messenger, and other similar web apps do this – although I’ve not personally investigated them.

As to persistence: If multiple browser windows are making GET requests to the same URLs, the browser’s internals will only make a single connection and serve the resultant content to all of the requesting windows. (the same way it would only download an image once that appears on several pages) When you send a message from one of your open windows, any others are then notified via the established “push channel” (not sure what the correct name for this is), keeping them in sync. If things go awry (connection issues, etc) an instance can POST to ‘history.php’ to refresh its state. This cleanly avoids out-of-sync issues that could conceivably plague such a system.

This all gives the illusion of a persistent chat application that spans multiple windows, and so far it seems to be pretty fault tolerant. Colour me impressed. It will be interesting to see if and how they decide to open this new feature up to developers via their API, although I’m fairly certain it won’t compel me to install any new Facebook apps in the near future.

Update: It happens that this technique has a name: see “Comet” at Ajaxian.

Facebook Fresh™

April 7th, 2008

I’m actually working on a new version of Facebook Fresh, the award winning* GreaseMonkey script that magically removes all your friends’ annoying Facebook applications. In the meantime, you can still get the old one here. (will not work unless you have GreaseMonkey, which is an extension for Firefox, installed)

(*Did not win any actual awards. Yet.)

BarCamp Sydney 3 Day Two

April 7th, 2008

So, BarCamp Sydney 3 is over. I attended yesterday, but left in the early afternoon after feeling decidedly “camped out”. Maybe it was the free beer and pub meal the night before, or maybe the free pizza at lunch yesterday sent me into a food coma. Either way, I found I had lost the energy to continue in any productive fashion.

In the morning I did, however, show lft’s Craft, an amazing demo written for a 20mhz microcontroller. (I insist you check it out, if you haven’t seen it already.) The reaction was really positive, despite my initial uncertainty that people would actually get why it is so amazing.

Overall, my BarCamp experience was great. I really enjoyed presenting and interrupting people contributing to some really interesting discussions. What I liked most of all, though, was meeting so many interesting and enthusiastic people. I thought that maybe 2 full days was a little much for me, but perhaps next year there will be more attendees that will justify the extended time.

Thanks to all the unorganisers, who worked tirelessly to make everything ran smoothly. Well done.

BarCamp Sydney 3 Day One

April 5th, 2008

Day one is over, and it was a lot of fun. I gave my presentation and it went really well. There were a few people who commented on having enjoyed it, and at least one or two who will definitely go on to play with Processing. Mission accomplished.

The other presentations were mostly very interesting. One that sparked particular debate was on “web 3.0″, and whatever that’s supposed to mean. I really enjoyed the format of the conference: interruptions are not just permitted, they are encouraged. You can see a photo of me making some sort of important point on Flickr (plus a couple of other embarrassing shots).

During the day a couple of guys and I set up a “Rick Roll” presentation, which was exactly what you would imagine. Surprisingly at least 20 or so people came, I still have no idea why. I think a lot of this Rick Rolling business is just a cover-up for the fact that people seem to just like the song.

BarCamp Sydney 3

March 25th, 2008

I’ve just registered to attend BarCamp Sydney 3, which is taking place at UNSW in a couple of weekends’ time.

I’ve said that I’ll be presenting on “recreating old-school demo effects in Processing“, which is what I was doing last weekend. If anything, it’ll give me the impetus to develop something a bit more concrete in Processing before I present. I’ll probably go back and look at some of my favourite older demos, and see which effects can be comfortably reimplemented in the 5-10 minute timeslot provided. (At the moment, I’m thinking of something from Second Reality by the Future Crew or, possibly, Bill G Force by Complex.)

I’ll also take some photos while I’m there, and post details on some of the discussions here.

Do come along if you’re in Sydney. It should be good fun!