click here for my current blog

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

Archive for the 'Programming' Category

twexpire v0.2

Saturday, January 31st, 2009

Announcing twexpire version 0.2. This new release includes two major updates:

  • Support for pruning sent and received DMs, and
  • Unicode support.

I also rewrote a large chunk of it, making it generally a bit nicer. Enjoy.

Syntax Party 2008

Friday, November 14th, 2008

Last weekend I flew down to Melbourne to attend Syntax Party 2008, one of the few Australian demoparties. It was a great day, with lots of great work presented. I was struck by amount and quality of it, considering the meagre size of the Australian scene.

On the day, my friend sh0ck and I hacked together a JavaScript demo called ‘Syntaxed’. I roped sh0ck in at the last minute to help out, and was impressed by his “coloured ball effect”, and at how quickly he picked up programming for the canvas element. Our demo ended up placing second in the newschool demo competition! This took me by surprise – I suspect the novelty value of platform itself was what attracted the votes.

You can view the “extreme party version” (ie very hacky and not cross-browser compatible) of the demo here. It will only run under Firefox 3. (This is because it uses Mozilla-specific text drawing routines. I have since written a much faster version of the mandelbrot zoomer, too.)

I’ll definitely be back next year, by which time I hope to have a better demo, and something to enter in the music and graphics compos. Big thanks to all the Syntax Party crew (especially Ript and cTrix) for their efforts.

My first prod

Monday, October 20th, 2008

Those of you who are familiar with the demoscene might know what I mean by ‘prod’, if not, you may need to get some context.

Yesterday, inspired by the work of p01, I put together a demo effect using JavaScript and <canvas /> in 512 bytes. You can view it here*, and also see the entry on Pouet (where it has already received some positive, encouraging feedback). I have also made the un-crunched version available.

(* requires Firefox, Safari, or Chrome. I haven’t tested in in Opera, and IE doesn’t support canvas.)

Busy-ness

Thursday, October 16th, 2008

Lots of stuff happening at once, a lot of long-standing commitments all coming to a close at the same time.

On Tuesday a show called CATAPULT opened at Kudos Gallery in Paddingon, included in which was a piece of my photographic work. It’s an award-based show for emerging artists, designers, and curators, and I was one of the finalists. I was really happy with how my light box worked out for the show – I’ll put some pictures of it up at some stage. The standard of work at the show was really great. A friend of mine won the first prize ($1,500) for her very impressive video piece. (Congrats again Amy!)

I’m having my second light box constructed over the next week, and have some Duratran 8×10″ tests waiting to be collected from the printers. Exciting stuff.

I just finished doing the sound design for a flash game being put together by some friends of mine. It’s all old school, “8-bit” style music and sound effects. I’m told the game should be released any day now, so I’ll be sure to link it when you can. (It’s part of a Facebook app called Coin Cans (or is it Cash Cans?), so you’ll need to have a FB account to play it AFAIK.) It was a fun and challenging project, and the first professional sound design job I’ve done. It’s definitely something I’d like to do more of in the future.

I’ve also been putting the final touches on a Python/Django-based Content Management System for artists, as part of a freelance job for another friend. It’s my first foray into web programming in Python and Django, and what I’ve experienced so far has been quite painless, if not enjoyable. Deployment is a bit of a pain – I wasn’t able to find a Debian package for mod_python, and didn’t much fancy trying to grapple with some documented MySQL concurrency weirdness between mod_python and mod_php – I ended up using FastCGI, which is “okay, I guess.”

I spend a lot of time writing JavaScript these days, so I was a bit irked by Python’s rigidity at times, but it certainly beats the hell out of PHP (plus I definitely prefer the Python syntax over JS).

Incidentally, I felt I needed to put up some sort of ‘artist’ web site, so I have put up something modest at andrewgerrand.com for the time being. I may or may not give it a bit of an overhaul before the COFA Annual at the end of next month.

I’m reading Italo Calvino’s If on a winter’s night a traveller at the moment, and it is incredible. (Thanks Viv!)

Introducing LinkViz.com: StartupCamp Australia

Monday, September 8th, 2008

On Saturday afternoon I dropped in on StartupCamp in Sydney. It was a hive of activity, and I quickly found that one of the teams could use my JavaScript skills. By 9pm that evening, we had created LinkViz.com, a unique way of visualising and navigating the sites that people are talking about on Twitter and other social networks: 

It is still very much in beta form, and no doubt there are a few bugs here and there, but we have plenty of exciting functionality planned so please keep an eye on it.

The other two teams also produced some very impressive projects:

TrafficHawk.com.au is a useful Google Maps mashup that displays realtime traffic condition information over a map of Sydney.

uT.ag is a unique URL shortening service that allows bloggers and others to monetise the links they share around.

The quality and maturity of these projects is truly astounding given they were thrown together in much less than 48 hours.

A big thanks to Bart and Kim from Tjoos.com for their excellent work in organising the event. Also a big thanks to my teammate (and now business partner!) Ian Naylor for graciously hosting us at GeekDom.

There’s another StartupCamp happening in January next year. If you’re looking for enthusiastic, talented people to embark on an exciting project, I advise you to sign up. I’ll be there.

It’s coming…

Monday, September 1st, 2008

I don’t actually expect you to be excited, but I am at least. I’m writing the new backend for this site in Python, using CherryPy as a FastCGI wrapper and request handler, and Cheetah as a template engine. Python is awesome. As you can see from the screenshot, I will be aggregating my various “net presences” into the one site, and providing a single RSS feed for everything “me”.

Something old, something new

Saturday, 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.

Friday, 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.

The things that Should Not Happen

Friday, 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.