Getting equality straight
I must suffer from some rare and highly specific form of dyslexia. Even though I know exactly what the difference is, I keep using = when I mean ==. I reckon that about 80% of the problems I’ve had while writing Ruby have come from using the assignment operator when I really want a comparator.
I need to tattoo = != == on the back of my hand.
Future features
Filed under: — bsag @ 01:11 PM
I have a few features I’d like to add to my GTD Rails app eventually. I can see how I’d code some of them now (I just haven’t got around to adding them. Others will take a bit of thought and some more learning about Ruby before I’m ready to tackle them:
- List appointments. It would be nice to pull in the appointments for the current day from iCal, so that I can see everything I have to do at a glance. I think it should be possible to use iCal.rb for this purposeâit would just be a read-only listing.
- Dependencies. At the moment, all items in Projects appear in the main listing. I’d like to set up some way of marking some items in Projects that are contingent upon other items. That way, I could suppress the listing of those items until they can actually be done. One way of getting round this would be to set the context of those items to ‘Waiting’ so that they appear at the bottom of the list, and there’s some acknowledgement of the fact that these things can’t be done right now.
- Recurring action items. Sometimes you have an action item that regularly recurs. It would be good to be able to set the recurrence, and have the item mark itself as un-done after a certain interval, like you can do with Life Balance.
- Statistics. This probably really marks me out as a geek, but I love to have statistics and graphs. I think in this case it would really help me to understand how I work. For example, if I could plot my ‘completion index’ (no. completed items/no. items added per unit time) against number of items added, I could see whether I tend to wait for quiet periods before churning through work, or if I procrastinate until the situation becomes critical. I have my suspicions, but I’d like some hard data. This means that I’m going to have to learn how to draw graphs using Ruby. Does anyone know of a good module/library for this?
- RSS/PDA compatible version. This shouldn’t be too hard, as Rails comes with built-in commands to build RSS feeds.
This will probably all be a while in coming, as I want to tidy up the existing code and incorporate the fixes people have suggested so far, as well as making a proper edit action. I must say that it has really been fun making this app, and I’ve learned a lot faster than I would have done if I was just reading a book about Ruby (although Programming Ruby has been a vital reference and source of information and inspiration).
Rails GTD application
Filed under: — bsag @ 12:12 PM
I’ve decided that the GTD Todo application I’ve been developing is probably now in a state where I feel comfortable about distributing it. It’s certainly not finished in any sense of the word, and has lots of bugs. For that reason, I can’t stress enough that you shouldn’t use it for your precious data—I can’t guarantee that it won’t ruin your life in some way, and I don’t want to be responsible for that. It’s really for people who are learning Ruby or Rails, and are curious about what can be done by an absolute beginner (i.e. me). You can download the zip file here—the installation instructions are in a README in todo/docs. You also need to have Ruby 1.8.x, mySQL and Rails 0.8 installed.
{Read more...}
Filling the room
We went to Symphony Hall last night to see a performance of Handel’s La Resurrezione. We took a bit of a chance as neither of us had heard it before, but we really enjoyed the performance. They used an authentic Baroque orchestra with wonderful instruments like a Viola da Gamba, a couple of lutes and a pair of recorders. If you’ve only ever heard the dreadful honking, squeaking sound that happens when you mix small children and recorders, then it’s a bit of a revelation when you hear them played properly. In keeping with the period feel, they didn’t use any amplification (as far as I could tell) for either the orchestra or the singers.
The human voice never ceases to amaze me. Emma Bellâwho sang the part of Mary Magdaleneâmanaged to make the steel balustrades on the balcony ring at times with the power of her voice. The acoustics are pretty good in Symphony Hall, but even so, it’s amazing that one fairly small person can fill a huge auditorium like that, using only about 5 litres of air, some vibrating tissue, and muscular contraction. I realise that the last sentence makes me sound like a total philistine, so I’ll attempt to recover by saying that she wasn’t all about amplitude1, and her interpretation and phrasing was wonderful too.
1 Oops, I’m just digging myself a hole here.
Balti
I went out with a group of people from work to a balti restaurant yesterday, and I realised with a shock that it’s the first time I’ve been to a real balti since I’ve been living here. Of course, I’ve had many Indian meals at restaurants which have a few balti dishes on the menu, but I haven’t been to the real thing.
For those of you who aren’t from the UK (or who don’t know much about Indian food), the balti is an interesting phenomenon. The origins of the sub-cuisine are a bit obscure, but most people seem to agree that the balti was invented in Birmingham in the 1970s. Some claim that the word ‘balti’ comes from the Urdu word for ‘bucket’, and refers to the shape of the iron wok-like pan that the dish is cooked and served in. Others think that’s just an urban legend, and that balti refers to the style of cooking. Whatever the truth of the matter, the dish is one of those odd culinary inventions that sometimes arise when cultures meet.
The balti is a medium hot curry, and usually features coriander and tomato quite prominently. It can be just vegetables, or meat and vegetables (these are often referred to as just ‘meat’ in the menu, without being any more specific). The genuine balti experience involves scooping up the curry with big chunks of naan bread, rather than using cutlery, but you can have it with rice if you want. One thing to remember is that the balti dish is incredibly hot when it comes to the table, and there are none of those ridiculous ‘warning - contents may be very hot’ labels on them. I knew this and still managed to burn my knuckles while getting a bit carried away with naan scooping. Still, a few burns are the hallmark of a good balti experience, and are part of the fun.
Good balti restaurants are generally very cheap with few frills, and are therefore phenomenally popular with students. The one we went to didn’t have a drinks licence, so you can even buy cheap alcohol at an off licence and bring it in. There’s even a balti triangle, in which roughly every second establishment is a balti restaurant. I’m also told that it’s a bit like the Bermuda Triangle in that you can disappear there for days.
When I was searching for some links to add to this entry, I came across references to the country of Balitstan in the Himalayas, in which the language of Balti is spoken. I’d never heard of this before, but it seems to have nothing to do with the curry.
Libraries
I’m rediscovering the joy of visiting the library. I’m not talking about academic libraries (I visit them a lot) but public libraries, and borrowing fiction books. I used to be a frequent visitor when I first moved to Oxford, but at some point I lost my library card, and couldn’t be bothered to get a new one. Mr. Bsag had one, and he used to sometimes get me books, but somehow that wasn’t quite the same. Now I’ve joined the Birmingham library system, and I wander around like a kid in a sweetshop and emerge with an armful of books.
I do a lot of my reading during my commute, so about half of the books I get have to paperback and fairly small so that I don’t injure my back hefting them around every day (lugging a PowerBook is bad enough). These commuting books also need to be reasonably ‘light’ in content as wellâdense plots are hard to follow when you can only read small chunks at a time and you get distracted. Also, if it’s too gripping, you tend to miss your stop.
{Read more...}
MacExpo
I made my annual pilgrimage to MacExpo on Thursday. Now that I’m living further away, getting to London is more of an undertaking, though curiously it takes exactly the same amount of time to get there on the train from Birmingham as it used to on the coach from Oxford. As a consequence of the scandalous fares Virgin Trains charge you to travel before 9am, I arrived at lunchtime. However, I don’t think I would have needed the whole day. The Expo seems to shrink a little every year, and there were noticeably fewer exhibitorsâparticularly small companiesâthis year. Still, I had fun, and bought a Griffin radioShark and a tiny Firewire hard drive to relieve our poor overloaded and elderly iMac. The RadioShark is fantastic, and very simple to use. We used to use AudioHijack to record the RealOne feeds provided by the BBC, but lately we’ve been getting appalling quality on those feeds. Either they don’t work at all, or you get a bit rate of about 15kbs, even on our broadband line, and everyone sounds like they’re underwater. You can choose the encoding rate and format (AIFF or AAC) with the radioShark, and the quality is excellent. It’s also fun time-shifting radio if someone comes to the door or the phone rings. No more missing the middle of a play. And it has cool blue lights on the side which turn red when it’s recordingâyou can’t dislike a product with blue lights.
As a side-note, wandering around Islington was a bit of a culture shock after being in the Midlands for a few months. Brummies have a very non-pretentious attitude to life, even though they like to flash their money around as much as the next person. Islington is a place where there is a higher density of black polo-neck/turtle-neck jumpers per m2 than anywhere else in Britainâthis density nearly doubles during the MacExpo. It’s also the spiritual home of the leather seating cube, and you can’t walk into any bar, coffee shop or restaurant without barking your shins on a herd of them.
British Rocket Scientists
After the last episode of Space Odyssey last night, there was a great documentary on BBC4 about the British rocket science pioneers in the post-war period. They developed a wonderfully elegant propulsion system powered by hydrogen peroxide. Some shots of these engines firing showed a lovely clean blue flame like a blow-torch, which seems futuristic even today in comparison with conventional rocket engines. It was the usual story of chronic underfunding of brilliant people that we’re very familiar with in this country; because they were so financially constrained, they had to find elegant and innovative ways to side-step technical problems. They developed a wonderful rocket called ‘Puck’ (gloomily renamed to Prospero after funding was pulled just before its maiden flight), which would probably have made a good profit putting satellites into orbit if the project hadn’t been pulled. One contributor to the programme contrasted the hordes of people working at NASA with the small, focused teams working on the British projects, and said that they used to refer to NASA ‘trampling a problem to death’.
However, the old footage did provide some great film of men in badly-fitting duffle coats retiring to rickety-looking sheds before test firing enormous rockets. It reminded me of the films I’ve seen of the early development of the jet engine by Frank Whittle’s group. Their testing area looked exactly like a yard out the back of their building, where the bins are stored. As this enormous jet engine roared and spat flames, they stood around (in badly-fitting duffle coats or brown overalls), smoking pipes (with all that kerosene nearby!), and nodding in a proud but modest way. Technical brilliance on a shoe-string, that’s what it was.
Losing your place
One of the things I’ve noticed travelling on the train is the number of people who lose their place momentarily. They might be reading, listening to music or just day-dreaming, when they suddenly realise that they don’t know exactly where they are because they haven’t been paying attention to the stops. They search the darkness outside anxiously for some familiar pattern in the lights and shadows.
It’s happened to me a couple of times, and it’s very disorienting. The odd thing is that you think that you know the line intimately, travelling on it every day. I think that the problem arises because the familiar landmarks are strongly bound up in their linear sequence; recognising where you are is rather dependent on knowing where you are in the sequence. Even in the daytime, if you lose your place along the sequence, it takes several moments to place what should be very familiar landmarks. Odd.
Tunnel of Light
This photo reminded me of something I meant to write about when I got back from Germany, but forgot about. Frankfurt airport has an amazing link corridor through which those moving walkways run to speed you between gates. It’s painted white and generally dimly lit, but a series of lights paint the walls with a shifting set of colours, producing an effect a little like the Aurora Borealis. At the same time, there’s a sound track of bird song, running water and gentle bells, which is quite soothing. However, they they didn’t stop there, and there’s also a subtle but perceptible smell of mint or citrus (or perhaps both), which has a refreshing effect. I found it quite a niceâif slightly oddâexperience after being cooped up on a plane for several hours, although the whole thing made me feel as if I’d unwittingly ended up on that space station in the film 2001. It had the same self-consciously futuristic feel.
[via blue - Everyone’s Tagged Photos]
Merlin
Filed under: — bsag @ 04:11 PM
I’ve never really got into full-blown project management; most of my needs seem to have been met by using plain ToDo lists, and now GTD. However, I’m soon going to be running more complicated projects, involving more people and multiple stages, so I’m wondering if my GTD approach is going to hold up, or whether I should also learn about project management, with dependencies, risk assessment and all that jazz.
Right on cue, I found Merlin. It seems to be quite full-featured and nicely designed, though as I’ve never used a project management application before, I don’t know what it might be missing. There are one or two rough edges, such as a few German labels which crept into the English language version. They seem to have addressed these issues in a subsequent release and they don’t seriously detract from the experience anyway. I like the fact that they use built-in Apple apps to do certain tasks: you can send events out to iCal, and the people involved in the project (‘Resources’ in dreadful management speak) are added directly from Address Book. It makes no sense the reinvent the wheel when you have these applications which work well, and it avoids having to re-enter data. You can also export to the web, which is useful to keep your project team reading from the same hymn sheet (or whatever the current management parlance is).
I don’t know if I’ll be using it, but it might be of interest to other people with complex projects to manage. I also like the name, and I’m half wondering if it’s a tribute to the King of GTD Geeks.
Space Odyssey
Much to my surprise, I really enjoyed Space Odyssey: Voyage to the Planets last night. It is a fictionalâthough factually-basedâaccount of a six-year manned mission to all the planets in our Solar System. I thought that the combination of fact and drama might be really cheesy, but it was pretty well done. The facts were somewhat simplified for a popular audience, but it wasn’t dumbed down too much. The combination of ‘interviews’ with the scientists and astronauts involved, and the information on the voice-over worked quite well. The simulations of the landings on the planets, and also the scenes on Pegasus were beautifully done, and did bring the facts about the planets to life. There’s a good reason that the cameras mounted on the Viking Mars landers were at human eye height: we find it difficult to understand things unless we see them from our own familiar viewpoint. That’s why it’s so powerful to see human figures wandering around on a simulated Mars and Venusâit gives you a much better impression of scale. Even the dramatic bits weren’t gratuitous because space missions are really dangerous.
I got the impression that some of the quirky details might have come directly from stories told by people involved with space missions. There was one bit where one of the astronauts was talking about a bet they had during G-force training on who would withstand the highest G before fainting. The Russian won, but none of them could understand how he could survive 15 G until they found out he could faint with his eyes open. That had a ring of truth about it.
Of course, it may be that I didn’t pick up any of the egregious errors, physical impossibilities or huge generalisations because I’m not a planetary scientist, astronomer or astrophysicist. I tend to be much more critical of documentaries about biology or natural history. Anyway, it was fun and I’m looking forward to the second part next week.
GTD on Rails
Filed under: — bsag @ 09:11 AM
A while ago, I mentioned Railsâthe Ruby-based framework that allows you to quickly build database driven web applications. I’m still in the process of learning Ruby, but I decided that perhaps the best way to learn would be to actually try to build something. By using Rails, I could build something with a GUI, not just a command line interface, without having to jump through hoops to install and use something like Tk to draw windows, menus and so on.
I worked though Vince’s excellent Todo application tutorial, and decided to use that as a base to elaborate a more complex GTD-style Todo application. My aim was really to use it as a learning tool, but if I come out with something I can actually use at the end, so much the better.
I haven’t finished it yet, but it’s coming along nicely. I’ve got a main page which lists all my todos by context (@office, @call etc.), stores a creation date and completion date automatically, and allows you to set a due date (I’m going to flag these up visually when they get within a few days of being due). You can also store notes for an item (and have Markdown syntax in the note marked up as HTML automatically!). A link indicates if an item has a note attached and you can then click the link to toggle display of the note inline. I’m planning to set up a Projects page which will allow you to view and manage Todos which relate to a particular Project, though these will all be visible (sorted by context) on the main page. I also plan to provide an interface to edit and delete contexts so that you don’t need to mess with the database tables if you decide you want to add a new one.
There’s nothing particularly fancy about it, but remember that I’m not only new to Rails, but also new to Ruby and MySQL. I’m stunned that a framework which can create something as complex and professional as Basecamp can also allow a totally green newbie like me to make something cool and functional, without making me tear my hair out. In fact, it’s been really fun, and I have at times felt moved to punch the air and exclaim, “I rule!” when I solve a little problem. Ahem. The people who hang out in the #rubyonrails channel (irc://irc.freenode.net/#rubyonrails) are also fantastically helpful and enthusiastic, and perhaps one of the best possible advertisements for both Ruby and Rails.
Top Gear presenters in the making
I overheard this exchange at the bus stop this morning, delivered by three boys commenting on every car that went past:
[Boy 1, in a pre-pubescent Brummie squeak]: Whoa! That’s a Subaru!
[Boy 2]: Like the one in “2 Fast 2 Furious”!
[Boy 3]: Yeeahh!
[All watch in awed silenceâcrowded on the curb for a better viewâas the car goes by]
[Boy 1]: Crap spoiler1, though.
[Boy 3]: It’s the worst spoiler in the world!
Everyone is a critic. Bless ‘em.
1 By which they meant the aerodynamic spoiler on the car, not a spoiler of the film variety.
Power of Nightmares
I normally avoid talking about politics here because I don’t do it well, but the events of today have left me baffled and depressed. I know that I’m not a US citizen, and so have no right to have a say in who becomes President, but when this particular US President has such a huge and largely deleterious effect on world events, I think everyone has a right to express their opinion. Yes, it’s good that turn-out was so high (unlike most UK elections), and assuming that the ballot was fairly conducted, it’s good that there was actually a majority this time. But given what Iâand many other peopleâthink about George Bush, that forces me to conclude that I have no possible way of understanding the mentality of the majority of US citizens. They might as well be aliens. The minority who didn’t vote for Bush (and I know some of you personally) have my utmost sympathy. We only have to suffer the side-effects here, but you guys have to live in the country.
I’ve been watching the documentary series The Power of Nightmares, which would be hilarious if the implications weren’t so grave. The series tracks the parallel rise of the neo-conservatives and the radical Islamists. The ironic thing is that both seemed to have started with very similar aims: to halt the perceived decline in morals and the rise of individualism, and return to ‘traditional values’. To that end, the neo-conservatives tried to unite the country by building up a terrifying threat to society; in the beginning, this was the Soviet threat, but when the Cold War ended, it became Islamic terrorists (ironically, the former allies of the US in neutralising the Soviets).
Various neo-con commentators interviewed on the programme were very open about the fact that hard evidence didn’t much matterâit was just a means to an end, and they had the people’s best interests and democracy at heart. I don’t think it’s very democratic if the people are making their decisions on the basis of lies (or at least absent evidence), but there you go. At one point, they discussed a theory that emerged (I think during the early Regan era) among the neo-cons that all the terrorist organisationsâIRA, ETA et al.âwere actually secretly controlled by the Soviet Union. The head of the CIA was asked to prove that this was the case (note the wording), and relayed this to his agents. They looked a bit baffled and said, “Well, I can tell you right now that it’s not true, because we in the CIA planted the rumour as black propaganda.” These facts didn’t seem to matter, and they still had to ‘prove’ that it was true. Does this ring any WMD bells? Remind you of any comments about the ‘reality-based community’? As a scientist, this disregard for proof, evidence and empirical data makes me shake my head in disbelief. It’s just wrong.
I’m going to have a beer.