Sunday, 24 March 2013

Jurassic Park

I can hear the theme starting up...
Give or take a month, the film is twenty years old.  A re-release (in 3D!) is being planned for later this year, and a fourth movie is slated for next year.  I remember seeing the film in the cinema when I was little, the excitement for a giant t-rex and science and computers and pack hunting velociraptors and hissing dilophosaurs stayed with me for a long time, and no doubt influenced some of my future life choices.  I still hear John William's theme tune play when walking through the dinosaur section of the Natural History Museum, and, like many of my generation, I have an irrational fear of tip-toeing around a shiny metal kitchen in the dark -- luckily not something that interferes too much with daily life!

The film, of course, is based on a book.  And, of course, the book is well worth reading.  The story is slightly different, in particular the ending is less 1990's Hollywood.  In addition many of the memorable scenes from the sequel movies can be found in the book (the aviary from JP III in particular struck me as being ripped straight from the novel).

The book was also interesting for non-dinosaur related reasons.  Each chapter title page featured an evolving line drawing, with a slightly abstract title ("First Iteration", "Second Iteration", etc), and some text underneath that was always a bit ominous and technical sounding to my young mind.  Now I recognise the evolving pattern as a dragon curve fractal (Wikipedia claims the specific instance is the Heighway dragon, or Jurassic Park dragon).  I do have some feint recollection that deliberate errors were introduced - meaning to foreshadow and reinforce the regular patterns of man being disrupted by nature trying to find a way - but I could just be making that up.

However, the things that have really stuck with me from Jurassic Park are its theme of science, curiosity, and responsibility.  Dr. Ian Malcolm's haunting line:
Yeah, yeah, but your scientists were so preoccupied with whether or not they could that they didn't stop to think if they should.
is something to reflect upon.  Even in the little sub-section of computer science that I'm involved in, it's very easy to dream up seemingly good ideas, without necessarily thinking through all the consequences.  The idea that sparked this post's self-indulgent nostalgia was an early morning reverie on how awesome Google Glass is going to be - and the crazy things that could be done with it while (say) teaching.  For example, lecturing with an autocue in your eye.  Or in a tutorial you could face recognise the students, work out automatically who was missing, and get the display to provide small little graphs to indicate progress.  It would be amazing, you could work out who needed help - even before they knew to ask.  But then Malcom's quote reminds you to think.  Would students react well to being so obviously tracked, logged and monitored?  What are the privacy concerns?    I'm sure I could work out ways of doing all of the above if I wanted to,and the challenge of making it all work is something I'd find ridiculously enjoyable (it's like a game or a puzzle to glue such technologies together and work around current limitations).  But, like breeding velociraptors, can it be made safe?  Is it a good idea at all?

Away from such moral ambiguities, let me end on a lighter note.  Any reasonable discussion of Jurassic Park has to include a nod to Lex Murphy's cry of delight at:
It's a UNIX system, I know this!
The graphical viewer she uses in the film was a real program, fsn (3D File System Navigator, developed by Silicon Graphics).  There's a linux reimplementation, fsv, which is great fun to play with.

And I think I'm all dinosaured out.

Sunday, 17 March 2013

Exam Timetable

A couple of months ago I spent a fair amount of time reading Bret Victor's essays.  If you haven't watched Inventing On Principle, or read Magic Ink I suggest you stop looking here and go there instead (it'll be a much better use of your time!).  One point that really struck me is the incredible bandwidth our eyes afford our brains to receive information.  By comparison, our means of sending data back to the world is incredibly limited.  When put in the context of how we interact with a computer (e.g. my work machine has 4147200 pixels to display information, my hands only have 10 fingers & thumbs) this has really shifted my attention to thinking much more carefully about what I and others get to see.

It's been a fun day, I've spent it thinking about exams I don't have to take...
Not really having much experience with visualisation and graphics, I've been working my way through Edward Tufte's Envisioning Information and Visual Explanations (with The Visual Display of Quantitative Information currently on order).  There are many take-home lessons from that I wish I'd known years ago, most interestingly they have given me an appreciation for paper as a reasonable output medium - the "resolution" (at 600dpi) for a tiny piece of A4 paper is 4960 x 7016 pixels (of course there are considerations for what you can distinguish by eye).  Other lessons about side-by-side static content not requiring memory across time (as opposed to rollovers or other means of dynamically showing/hiding information you may want to compare) have also been small insights.  There is a danger with technology that the programmer "doing something cool/interesting/difficult to program" outweighs doing something simple, but well.

Anyways...having read all of this stuff, I thought it'd be fun to pick a little side project to put it into practice.   As it happens, this Friday the 2013 Summer Exam Timetable for the computing department (where I work) was released.  This takes the form of a static HTML table, with rows sorted by time, with one row for each exam.  Each exam has a code, title, date, time, duration, room and size.  Now for the students (for whom this timetable is primarily designed), its be straightforward to search through the list for their exams, and add them to whatever calendar system they're using.  

However as staff, it's always useful to have a more global view of what's going on where.  Eventually there will be an allocation of primary and secondary invigilators to these exams (of which I'll be involved in several), and it's always useful to be answer the question of who is supposed to be where.

The idea then of a two-phase project struck me.  First (today), rework the existing timetable into something a bit more visual - using graphics to localise the exams in time (length, day, week), and also in physical location.  Second (to do later, once the information is known) - extend the visualisation to show the assignments of staff, and allow quick finding of particular people (in particular, the exams I'll be involved in!).

A plan.  The red stuff on the right is what I settled on actually trying to implement.
I started the day away from the computer, building a sketch/plan/storm of this mini-project, and working out some rough ideas.  I'm no artist - so my sketches are incredibly abstract, and I favour some textual notes.   From the outset, I quite liked the idea of localising the exams in space, by having a depiction of the rooms they can take part in, as-well as in time.  The A3 page right was my plan.

Then an afternoon of fun ensued.  Tech wise, I thought I'd make this a (large) web-page (so it's easy to share/show others), but with the eventual aim of making something that can be printed and stuck on a wall. -- I believe web-pages are fairly straightforward to convert to print medium.

Deciding to use this as an excuse to learn enough angular.js and javascript svg manipulation turned out to be frustrating at times (just how are you supposed to embed an svg that you want to dynamically restyle in a HTML5/angular document, - oh wait chrome needs svgs to be served from a server to allow you to alter their contents, and don't forget to hack around inkscape to add a viewport to your svg if you're wanting to resize it in a browser! ...sigh).  However, I got about 2/3rds of the way through my idea before running out of Sunday.

At top is a screenshot of the result (larger version below, the online version is likely to change or go away), there's a lot wrong and yet to be fixed, though I am quite pleased with the current state of it.  Hopefully (before the exams!) I'll get something I'm happy enough to turn into a (framed?) poster.

Sunday, 10 March 2013

Girls who came back...

Two of my favourite women had new outings this week.  The very real Dido finally released her latest album, and the I wish she was real Lara Croft has rebooted herself as a young, briefly innocent young woman ready for us to make a survivor out of.

Amazon deliveries don't get better than this...
For an impartial review of these two offerings I would suggest looking elsewhere, I was doomed to like whatever was put out by either of these ladies. Both were a very large and fond part of my late teens and early twenties, and I have been eagerly anticipating the return of both.

Dido's No Angel and Life For Rent were a soundtrack to my A-level and university education.  Seeing her perform live at Brixton was absolutely unforgettable, and I still use the DVD recording of that event to chill out / fall asleep to during life's more stressful moments.  Don't Believe in Love from Safe Trip Home has also been played on repeat for periods of time that some would consider close to torturous, but there's something about it that I can't get enough of.  It has also been a long five years since Safe Trip Home, with only the odd Faithless cameo and Sex in the City soundtrack single (Everything To Lose) to keep my Dido cravings at bay.

So with that backdrop, I was looking forward very much to the new album - and Girl Who Got Away is wonderful.  After a week's worth of being my looped background sound, it has established itself as something I will be coming back to again and again.  With Dido the lyrics and the story get just as much attention as the composition of the music.  There are is something very familiar and comforting about this album, while at the same time some lovely experiments and new directions.  The more dancy Blackbird (featuring a beautifully executed counterpoint intro story) and End Of Night in particular stand out.  However it's the little touches, such as the birdsong that can be heard at the end of Day Before We Went To War that really make this complete.

Familiar, but new, can also be used to describe the young Miss Croft's first/new/latest outing.  I have vivid memories playing an original Tomb Raider demo (which would have come on a *CD attached to a physical games magazine) during my teenage years.  One level of the village, with a few wolves, a bear and lots of ruins to jump around.  Fast forward and since then I've spent hours with Lara in her different incarnations - Tomb Raider II, then I, then III followed (yes, I did play them out of order), before Angel of Darkness,  Revelations, Anniversary, Underworld, and Guardian of Light and probably some others I've merged into a seamless memory of run, jump, spin, shoot, scream, reload, retry...

The new reboot still offers some of the puzzles and platforming (which has been executed brilliantly) but has traded some of the exploration and isolation for a very slick (but possibly incongruous) combat scheme.  On the flip side experience and skills are no longer learned by the player as the game progresses, but awarded by the game as points, unlocked moves and levels - a change that moves towards explicit rather than intrinsic rewarding of the player.  I do miss the days when nailing a tricky jump or surviving a trap in a world before quick time events brought a sense of achievement that hit green triangle now to not die just fails to deliver.  However the story (for at least the first hour or two) is pretty gripping, the graphics stunning.  However the world has changed, and my having a job means less free time, and at the moment Lara's still milling around a tomb despite being in my PS3 for several days.  Something I hope to go remedy right now...

Saturday, 2 March 2013

Story Cubes

One thing of the more unusual things I miss from my school days is writing.  A-level English Literature lessons presented the time and motivation to study a few select books and plays to a ridiculous level of detail, and to then craft meandering and imaginative essays that argued over some minor question of the author's motivations and how their real lives influenced their work.  GCSE English was even more open, with the occasional "stream of consciousness"  lessons thrown in, leaving us to put pen to paper to see what happened.  I'm not sure of the educational value of such random scribbles, but creating them was fun. Ten years on, and my job now consists of writing huge numbers of incredibly terse emails, detailed and (hopefully!) precise programming exercises, and miscellaneous bits of computer code - which should ideally be beautiful, short, and not really expressed in the flowery subset of English that is slowly fading from my brain.

Missing an excuse to ramble, and not really being sure what to ramble about - ideas such as creating even yet more content on known features of obscure programming languages, or decorating blow by blow accounts of particularly exciting games of Carcaassone, just don't seem to stick - I picked up a couple of sets of Rory's Story Cubes.  These are dice (principally aimed at children and/or primary school teachers), where each side has forgone the usual dot-based numeral, and instead has etched into it a glyph depicting a common object, action or place.  The instructions accompanying these blocks of fate suggest rolling nine, in three equal groups. You are to then interpret the trios of cubes as the beginning, middle and end of a story.  The only thing you need bring to the party is an imagination.  So, for this week, a tiny example:
Something to write about...

Two worlds

The incident

Dr. Lawrence looked out the window. The tree stood there, as it always did - rooted to the ground, solid, a constant reminder of nature which Lawrence sought to understand. It's trunk ascended parallel to the research lab wall, leaves glistening in the fading autumn sun and reflecting in the glass windows and doors.  The effect was magical, two separate worlds of sterile cleanliness and disordered chaos colliding, coexisting and completely dependent on each other.  Nature providing the inspiration, the ideas and the puzzles, but, as the Dr couldn't help but reflect upon, man was needed to provide the automated sprinkler system to keep this particular tree alive.

In the corner of the lab, a machine finished its assigned duty of mixing chemicals together, and Lawrence's reverie was abruptly broken by it chirping merrily.  Sighing, he turned from the window to give it attention, but in doing so his hand caught a small glass jar by the window, tipping it over the ledge and freeing it from the world of man.  

The beaker fell, tumbling to earth.  The windows sparkled as the light bounced from glass to glass, for a brief instant it appeared as though a shooting star were falling between the building and the tree - the natural and man made split.  Above a head poked out the window, a flash of panic flew across its face, and then was gone.  Below the unexpected shower of liquid upon the wings of a grazing Crow caused it to caw alarmingly as it flew hurriedly away.


Down on the ground, out of breath from having run the stairs, Lawrence looked for the crash site.  Twinkling in the fading light, he found the shattered glass.  The liquid contents were already gone, absorbed into the Earth.  Grabbing the instruments from his bag, the Dr took soil samples and some specimens of insects.  He had been careless, the contents of the former flask weren't thought to be harmful, but they hadn't been fully tested.  Looking up from the ground, Lawrence saw a butterfly exploring the area.  He tried to capture it, but in vain.  Every attempt at a grab failed, as though it knew what he would do - eventually it flew off high, out of reach, out of sight, and once Lawrence had taken the rest of his specimens back up to the lab for testing, out of mind.


Looking up from the machines, the data printouts, the colored test tubes and the microscopes, Lawrence could only conclude one thing.  The effect of the escaped liquid on the natural world was as expected and understandable as magic.  The sampled bacteria could tell they were being watched and would move to the sides of the petri dishes.  The insects seemed to have a 6th sense about the scalpels coming to examine them, and were proving very difficult to inspect.  Lawrence rushed to his bosses, excited at this accidental, and clumsy discovery.  However as he was half-way through the explanations of his discovery, a creaking sound was heard outside.  

"The tree! It knows what we have done to it!" Lawrence realized too late.  Branches snapped, glass shattered, bark scraped, and the tree descended into the world of man.

Now, this isn't exactly going to win any prizes - but it was fun.  It also makes it very clear how bizarre this type of writing is - with no set plan or agenda (other than to appease the sides of the dice), the content meanders around a bit aimlessly, and then tries to tie itself up at the end.  Next time some further planning is probably needed.