whiteink

Things done. Including very little academe.

It’s easy to notice when you’re procrastinating. When yours truly scores 3434 on a typeface recognition game when he’s supposed to be either working or writing letters, he realises that there are more constructive things to be doing. Doing something about it, on the other hand, often proves to be rather harder.

So, what better to do as redemption than take up an old and oft-neglected habit: writing. I’m resurrecting a weblog that has existed in many forms and places, with as little fanfare as possible.

My latest love is Javascript, which will confuse those who saw JS coded back in the bad old days of the web, but which will make perfect sense to those who’ve taken to time to understand the language. More on that later, I guess.

So, to set the scene: I’m currently a week or so from the end of my Easter vacation, about to start my first exam term at university in Cambridge. So far this holiday I’ve spent a week working on a piece of software called ScanBooker for the Appropriate Software Foundation, primarily as a visual designer, but this has stretched significantly into front-end coding (see aside →). ScanBooker is scheduling software for research MRI centres, which is currently being developed for use at the Medical Research Council’s Cognition and Brain Sciences Unit in Cambridge, but which will, we hope, be used in a number of research (and perhaps even clinical) MRI units across the world.

A screenshot of Scanbooker. The main schedule view is
shown.

I should have clarified that Scanbooker is a (relatively) long-term project. I’ve been working on it for a good six months now.

After that, I spent a 55-something hour week working on a new project: Microfacts. Microfacts is a concept that I’ve found surprisingly difficult to explain in person, so I suspect I shan’t do much better in text. Think mini-Wikipedia meets slideshows meets…Google Maps. Not helping? I thought not. I’ll leave you to work out what it’s all about from the website, but will note the most amusing part of my work that week. I decided early on that the front-end behaviour would be much easier to manage in the long run if it had some kind of pattern to it. ScanBooker’s front end was fairly object-oriented, having wedged Javascript’s prototypal inheritance patterns into something resembling classical inheritance with the help of Mootools, and one particular class—an Event Manager that I’d written to look after binding event actions to particular DOM elements—looked awfully like it was a Controller, missing its Model and its View. (If this isn’t making any sense, the usual advice is to check Wikipedia.) To cut a long story short, the end result is that for Microfacts, I implemented MVC in Javascript!

A new and exciting thing! Github is the first code hosting website that really gets the people aspect of DVCS right. If you want to learn more about git itself, visit its homepage, or check out Linus Torvalds’s talk at Google about his amazing creation.

Anyone who is {excited, appalled, worried} by the above idea should check out the git repository—my botched extraction of the MVC code from the Microfacts source. If you want to help develop it a bit further (check out the TODO list) please do fork the project on Github, or, if you don’t do git, download a tarball and email me with your wonderful patches!

And then, the exciting work at an end, I returned home to Cornwall, nominally to spend a couple of weeks doing academic work: revision, past papers, a Head of Class Lab Report. Unfortunately, while I’ve done a fair bit of all this, I haven’t exactly done as much as I hoped I’d do. Gulp. The lab report is missing most of a discussion and a conclusion, and I feel like I should rewrite large chunks of my introduction to the theory section as well, having had something of a revelation with respect to understanding gyroscopes in the past couple of days. (Yes, the lab report is about a gyroscope.) I feel I should perhaps share this revelation, on the off chance that you ever have to write a lab report about gyroscopes. =)

I’ve also got hold of a copy of the fantastic 1974 Royal Institution Christmas lecture given by Eric Laithwaite. Some amazing (and dangerous) demos, as well as horrific 70s hairstyles in the audience! I’ll try and upload this as soon as I clarify the rights.

Put simply, I didn’t understand how gyroscopes worked. I could write down all the equations necessary to get a good mark in my lab report, but I had no intuitive conception of what made them work, specifically why a precessing gyroscope opposed a couple about a fixed point on its axis of rotation. There was no doubt that it did: the fact that a nutating gyro looked an awful lot like a swinging pendulum assured me of that, but why?

As is so often the case, understanding came from a single diagram. As is almost as often the case, the perpetrator of said diagram was Richard Feynman.

Three snapshots of a precessing gyroscope.

The diagram highlights the fact that any given point on the outer edge of a precessing gyroscope flywheel travels in a curve, accelerating outwards from the fixed point. From that single observation, all you need to understand the behaviour of the gyroscope is Newton’s third law:

For every action, there is a reaction equal in magnitude and opposite in direction.

That reaction is responsible for the force on the upper half of the gyroscope. You can easily draw a similar diagram for a point travelling round the lower half of the gyroscope, and one sees that the reaction force must act to push the lower half of the gyroscope in the opposite direction, i.e. outwards. Suddenly we’ve got a couple acting about the fixed point! I thought that was rather neat.

So, procrastination done, I should probably get back to work…