June 18th, 2009, filed under
Software
There is a lot of room for miscommunication about estimates, as people have a startling tendency to think wishfully that the sentence:
I estimate that, if I really understand the problem, it is about 50% likely that we will be done in five weeks (if no one bothers us during that time).
really means:
I promise to have it all done five weeks from now.
from How to be a Programmer, by Rober tL Read.
June 9th, 2009, filed under
Geek,
Python
Are you a Python geek?
For starters - you should totally be going to EuroPython at the end of June. Python conferences like this attract brilliant presentations from some real community and industry heavyweights. This year we've got Professor Sir Tony Hoare (that's the creator of quicksort to you, amongst a venerable lifetime's worth of other things); Cory Doctorow (everyone's favourite science-fiction author, blogger and all-round geek activist), Bruce Eckel (author and renowned technical communicator); plus Dr Sue Black from code-breaking hothouse Bletchley Park. The veritable horde of over 100 exciting and interesting talks makes up probably the strongest line-up EuroPython has ever had.
Best of all, Python conferences like this one are organised and run at a grass-roots level. By enthusiasts, for enthusiasts, making them quite the most fun, educational and interestingly social conferences I've ever been to. Personally, I love the resultant absence of overriding commercial agendas - everything is done purely for the benefit of the delegates, and is pervaded by the community values that made you love Python in the first place.
One upside of this is that the conference is cheap - only £190 to attend. Interested enthusiasts can easily pay their own way. As a result, this is one of the few technical conferences that still has a robust attendance this year - both of presenters and delegates. Many others have been decimated or even cancelled altogether.
There is a downside though, and here's the rub:
The good folks organising EuroPython in their spare time are desperately short of volunteers to be session chairs.
If you're going to EuroPython, you could help out! Yes, YOU! You could sign up for the sessions you want to watch anyway, so you shouldn't miss anything. Just imagine the warm and fuzzies! The KUDOS of a roomful of eyes. The POWER of cutting off over-running speakers in mid-flow*. The WARMTH of a deftly-cupped microphone.
(*anyone cutting the power on Sir Tony will be duly ejected from the premises)
Responsibilities are described in loving detail here:
http://wiki.europython.eu/SessionTeam
Please think about it, and if you fancy it, sign up soon (on the wiki page above) because we're currently all a-flutter wondering how the heck we're going to manage this. :-)
Thanks!
May 11th, 2009, filed under
Books

OpenGL Shading Language cover
I've had a passing interest in computer graphics for years, but had avoided the technology of shaders these last few years, thinking that they were just another layer of complexity which I didn't need to embark upon while I was still getting to grips with the standard OpenGL API.
With hindsight, I was wrong. I was recently cajoled into getting on board after talking to Mike Fletcher (creator of PyOpenGL) after his talk at PyCon, and now I feel as if I should have read this book years ago. Shaders solve many of the problems I've been happily messing with for ages, in ways that are easier to implement, more powerful, and more performant.
I whined about the Red Book, but this "Orange" OpenGL Shading Language book is brill - just what I needed. Incisive without being overly terse, practical, and once it got into the chapters about applications of multidimensional Perlin noise it got me all hot'n'bothered about computer graphics again. Yay my inner geek!
Update: I started this book fascinated by using vertex shaders to transform geometry on the fly, with little interest in the superficial fragment shaders used to decorate the rendered surfaces with pretty images or lighting effects. Since finishing it, this has reversed: I've become obsessed with noise and Fourier transforms and all the paraphernalia of fragment shaders, imagining relatively simple fragment shader that could, I believe, provide a surface with infinite levels of detail. I dreamed about my old university 'Signals & Systems' type lectures. Uncanny.
Update2: Ohdear. Once I started trying to write anything more than the most trivial of my own shaders, I ran into an unexpected problem. My shaders just wouldn't link. I couldn't figure out why. The book was no help. Google was no help. The error messages certainly weren't any help (thanks ATI.) Eventually I realised that the 'built-in' noise functions which are part of the OpenGL shader language are simply not implemented by the vast majority of graphics card manufacturers - you have to roll your own. Which is not a major deal-breaker, but what *is* disappointing is that the OpenGL Shader Language book makes absolutely no mention of this in any of the chapters plural in which it lovingly describes the built-in noise functions, along with their characteristics and uses. Perhaps I spoke too soon when praising the book. Maybe it is another case of idealistic OpenGL theory that has something of a disconnect with real world development. Maybe the book was written before this situation came to pass - regardless, it's no bloody use to me.
Rating (oh, how I love my new rating system. Check this one out:)
10/10 if you want to learn the theory of how to use the OpenGL shader language.
0/10 if you don't.
April 30th, 2009, filed under
Movies
Against my better judgement I couldn't help but snag a torrent of this. Sure enough, as the opening credits kicked in, my housemates assured us it was rubbish.
But then what happened is that I proceeded to love it. Clearly it polarises. The whole thing is shot in a shaky handicam held by one of the characters - imagine Blair Witch meets 9/11, only it isn't terrorists, it's a giant, evil whatthefuckisthat stalking the streets of NYC. It reminds me of Primer, in which the script is so realistic and lacking in over-ripe gravitas that, unusually, the actors don't even look like they are acting! What a concept. Well this is similar - albeit a lot dumber - but the strength is not in the script, which isn't especially strong, but is in the novel method of presentation.
There's clearly a limited number of movies that could be made like this, but for me, it was a welcome respite from the staged set-pieces of Hollywood's more conventional output. The sense of panic and confusion was beautifully heightened by the total lack of exposition - viewers only get to see what this small group of characters get to see, and even that is in blurry and imperfect fragmetary snatches. The monster, when it is even visible, is only glimpsed from afar. It was the closest a movie has ever come to creating the kind of tense, terrifying immersion that really great computer games can create.
I was amused to note that a bridge they take shelter under at the end looks exactly like the bridge they took shelter under at the end of The Day The Earth Stood Still (2008) - do all the bridges in Central Park look the same, or does this one have some special meaning? Anyhow, the final scene is saddening and telegraphed quite plainly from the opening shot (Camera retrieved at incident site US 447. Area formerly known as "Central Park") and it makes me weep with relief that a movie could so willing try and break the mold.
Rating:
0/10 if you're not into monster flicks, or if handycam footage makes you vomit.
10/10 If you fancy being scared silly by a giant alien monster.
April 29th, 2009, filed under
Python,
Testing
Sometimes when programming I like to leave unit tests running repeatedly in one window while editing the code and tests in another. The bash command watch is useful for this, and can highlight the differences between one invocation and the next in inverse.
I wanted a version of watch for use on Windows, so I whipped up a quick Python script, testwatcher, which produces output very similar to watch, but is cross-platform, and features not just inverse text, but yellow inverse text. Woo-hoo!
python example_test.py
F.F
======================================================================
FAIL: testThat (__main__.TestWatcherTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "example_test.py", line 12, in testThat
self.assertEquals(0, randint(0, 10))
AssertionError: 0 != 4
======================================================================
FAIL: testThis (__main__.TestWatcherTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "example_test.py", line 9, in testThis
self.assertEquals('one', object())
AssertionError: 'one' != <object object at 0xb7d24460>
----------------------------------------------------------------------
Ran 3 tests in 0.001s
FAILED (failures=2)
_
Incidentally, the above test makes it very clear that Python objects in successive processes get new addresses on Linux, but interestingly on Windows the same addresses seems to get re-used for different processes.
I can't help but suspect this is a dumb script to have written - it should only be a:
while True:
command
but in order to shoehorn the inverse text and colors in, it's grown to 300 lines - a hideous bloat for a minor superficial thrill. Plus the Windows version flickers terribly - I'm currently using system('cls') to clear the screen and then redraw it every second. I'll do some searching for better ways to do it.
However - I've long wanted a Python interface to perform simple terminal actions like colors and animation on different platforms (the standard library 'curses' module that would otherwise do the job is simply not implemented on Windows.) So maybe it's time I used this script as an excuse to figure this out. Suggestions welcome.
April 29th, 2009, filed under
Movies

2008

1951
The Earth obligingly stood still for us twice this week, on back-to-back nights. In each, a lone alien man arrives in a spaceship with his giant robot buddy Gort, to tell humans that they must mend their destructive ways or be destroyed.
The 1951 version was very Fifties - intrusively hopeless special effects, and seems to my eyes to be riddled with outlandish social etiquette and hopelessly naive politics. I suppose in the years following World War II any platform for preaching pacifism seemed worth a shot. If only more people considered it worth preaching today. I completely missed the Christian allegory that permeates the movie until it was pointed out to me: The alien comes from the heavens, and lives amongst common people, taking the name 'Carpenter' to blend in. He preaches peace to humankind, or else warns we will suffer a fiery apocalypse. He is our intermediary to 'Gort' (in fact the servant of Gort, in the original script) who later resurrects him from the dead, so that he may deliver his final message before being taken back up into the skies. Cute if you're into that, I guess.
Equally predictably, the 2008 version was very Naughties. Intrusively overblown production values string together a mediochre script. The pacifism and Christian message of the original has been replaced with a more timely environmental message - the writers perhaps intuiting that modern Americans are not so receptive to anti-war talk. Otherwise the scope and potential of the ideas at play are completely wasted - lost amidst the creative wasteland of a budget that could no doubt have fed countries. Once provoked, Gort unleashes self-replicating insectile microbots, which swarm and consume Philly, spreading fast. At the last moment, Keanu / Klaatu sees some humans hugging and crying, and has a big change of heart - the Earth deserves to be spared, after all. What a crock.
So there you have it. Watch this space for more reviews from me - wasting nights of my life, so that you don't have to. Final ratings:
10/10 if you are a stump-sucking mealy-mouthed pig-dog with googly eyes.
0/10 if you have any vestigial glimmers of taste or discernment.
April 18th, 2009, filed under
Books
by Cory Doctorow (not yet published)
Cory very kindly brought an early manuscript of this as a gift to Michael, Giles and I when we met him a while ago, and I've been wracked with guilt ever since because I apparently lost it soon after. Thankfully, it recently turned up (on Christian's desk - my fault!) last week, so I happily finished it pronto.
It's his best fiction yet! He must be honing his abilities with practice. \o/ Michael do you want it next?.
Christian doesn't like my subjectivity-proof rating system, so this one is specially for him.
Rating:
10/10 if you want a lightly styled but deeply speculative and engrossing story that winds a like a sightseeing tour around the social and personal ramifications of the ways in which modern technology is changing the way people interact, organise and get things done.
0/10: If you aren't interested in the ways society is changing under our feet.