SuperGenPass In MicroB On The Nokia N900/Maemo

In the unlikely event that I’m not the only person who uses SuperGenPass to manage my passwords and MicroB on Maemo on my Nokia N900, here’s a few tips that I thought I’d share (they’re also valid on the N800 and N810 and “hacker edition” N770s, too, I expect):

  • You don’t have a Bookmarks Toolbar (where would you put it on a 3½ inch screen?), so once you’ve customised your SuperGenPass bookmarklet, you’ll need to click-and-hold on the generated link, and then select “Add bookmark” to save it to your bookmarks).
  • Use it as normal: either fill your master password into the form and click your Bookmarks menu and select the bookmarklet, or select the bookmarklet and give it your master password. Don’t forget when using complex forms or changing passwords that Maemo provides a full clipboard so you can copy/paste passwords around where the need arises (thankfully quite rarely).
  • If you’re irritated by the “You have requested an encrypted page that contains some unencrypted information” warnings that you see when logging into SSL-secured websites (and the fact that unlike desktop Firefox, you can’t turn it off from the settings), here’s how you disable it:
    • Enter the web address – about:config
    • Agree to the warning page, if you’re presented with one
    • Type “security.warn_viewing_mixed” into the search box, or browse the properties list for that option
    • Select it by clicking on it, and tap the Enter key to toggle it from true to false.
  • I don’t yet know the reason for the fleeting “Maximum number of characters reached” message, but it doesn’t seem to impact on functionality of SuperGenPass. Does anybody else know what it’s about or how it can be suppressed?

Nokia N900

I’ve just got myself a new mobile phone, and I thought I’d spend a moment to gloat about some of it’s more awesome features (and mutter under my breath about a few of the things that are less-fabulous about it).

So, my new phone is a Nokia N900. You’re not likely to have seen many of these floating around, yet, because they’re new to the UK and they’re currently in somewhat short supply, but thanks to some careful negotiation I’ve gotten my clammy mits on one just a little ahead of the curve.

I’m now loathe to say what I was initially inclined to about it – that it’s quite a remarkable phone – because it’s not really a phone (although it is quite remarkable). As somebody who has always gone for smartphones with heaps of geeky features, I’ve often gone through conversations like the one in the comic, above: where somebody has said “but can it make calls?” These comments tend to come from people who want a phone that makes calls, maybe sends texts, and little else, and often this “purist” view of mobile telephony somebody gives them a strange superiority complex (or perhaps it’s just a backlash against the feature-creep of modern portable devices: who knows). As for me, I don’t care – I want all of those extra features. I couldn’t imagine any more owning a phone without – at least – a fully-featured web browser, camera, bluetooth, wifi, and the capability for me to install (and ideally develop) my own applications onto it, such as connectivity tools, an instant messenger, and so on.

A Nokia N900 on a phone call

However, the Nokia N900 is the first communicator – yes, that’s the word I’m going to use, instead – where I’ve honestly felt that the telephony features “come second”. I suppose it’s the result of the natural progression of Nokia’s Nxxx range of PDAs that this should be the case – the N900 is the first in the series to actually support use of a mobile phone network at all; at least directly. In the device’s default configuration, out-of-the-box, supposing you wanted to make a cellular call, you’d need to:

  1. Switch desktops (by “swiping” one desktop along) or access the applications menu (by tapping the on-screen button for that purpose).
  2. Tap the “Phone” icon, which by default sits in 6th place on the list. Yes, 6th.
  3. Dial the number you wanted to call.

That’s about 66% steps more than just about any other phone ever made. (okay, there’s actually a faster way, but supposing you wanted to exclusively use the touch-screen interface, the above instructions are correct) I know a lot of people who would be put off by that, but I’m not one of them: I’m well past the point where phone calls are the primary thing I use my phone for!

There’s a few things that make the Nokia N900 remarkable by comparison to the phones I’ve had before:

Touchscreen (& hidden keyboard)

Superficially, the major change to my previous phones is the addition of a touchscreen, which seems to be The Thing if you want to make a smartphone these days, thanks to Apple’s innovations in that area. Unusually, the N900 also has a slide-out QWERTY keyboard. The slide-out keyboard takes some getting used to, because it’s best operated by your thumbs, which isn’t the way I’m used to using a keyboad. It also makes the phone almost twice as thick as the iPhone and slightly thicker than the HTC Magic, which may be a turn-off to those who like their devices skinny (again, not something that’s ever been a concern to me).

I’m quite pleased with the touchscreen. There’s a stylus embedded in the edge of the case (this is a resistive touchscreen, not a capacitative one like the iPhone, so a stylus can be used), which can be good for clicking tiny links on web pages without zooming in, sketching, and so on, but mostly I’ve just been using my big chunky fingers and that’s worked fine. While the hardware’s multitouch-capable, the factory-installed software isn’t (more on that later), presumably to avoid a lawsuit (there are a lot of complicated patents in that area right now), but having never owned a multitouch-capable phone I don’t miss it. Instead, there’s a good deal of standardised gestures – for example, drawing a spiral in a clockwise or anticlockwise direction can be used to zoom in and out.

The keyboard noticibly lacks a tab key, norkies (angle-brackets), and a few other uncommon pieces of punctuation, which is slightly disappointing (for a geek phone!), because acessing these using the alternate method is just slightly slower than would be ideal. Perhaps these could have been supplied as “special” characters on some of the keys which have no alternate function (e.g. the cursor keys): still, it should be reasonably easy to write this kind of functionality.

Operating System & architecture

Maemo OS screenshot

A particularly unusual feature of the Nokia N900 is it’s choice of operating system. It’s not that Linux-based smartphones are particularly rare per se – after all, Google Android is Linux-powered and the iPhone OS is based on a BSD kernel – but the thinking that’s behind the N900 that is unusual. You see, the N900 gives you root as-standard. If you want to install a different Linux distribution or completely change the one that comes with the device, you can – without “jailbreaking” the device or invalidating your warranty. The standard operating system for the N900, Maemo 5, is based on Debian Linux but with Matchbox and Hildon providing the GUI. This means that the entire operating system is open-source and virtually free of patents and restrictions, and the community support is quite significant. Plus, there’s something distinctly sexy about opening up a terminal on your new phone and typing “sudo apt-get install dosbox” onto it, and a few minutes later having a fully-functional DOS emulator running in your pocket.

I suppose you have to be my kind of geek to truly appreciate that.

Fresh from the factory, the N900 comes with the usual selection of tools – phone, SMS (Nokia have finally improved their stone-age predictive text system to a modern one with support for word-completion, Markov chains, and so on), address book, web browser (based on Mozilla Firefox, and with Flash 9.6 support – there’s nothing quite like watching Flash videos on your mobile, stutter-free), etc. There’s quite a lot more reliance on the community than on other devices: for example, despite the inlusion of an FM tuner in the hardware, there’s no software to support it unless you install it yourself. As a Linux geek, that suits me down to the ground, but this isn’t a phone for everybody – it’ll never be popular and it won’t hit the mainstream in the way that the iPhone and Android-powered phones have.

Want support for Ogg Vorbis in your media player (damn right you do): just install a community-supported codec package. Same goes for video formats, whatever applications or games you want, and so on. There’s a package to readily allow plain old Debian repo packages to “just work” on it, too, without recompilation, so there’s an immense number of applications already available without even having to go near the Ovi Store, Nokia’s answer to the Android Marketplace and the Apple App Store.

The hardware

Nokia N900 with keybord extended

If you’re the kind of geek who cares, the hardware for this device is really quite spectacular. But if you’re that kind of geek, you already know where to look it up… and if you’re not, you don’t need me to repeat it. Suffice to say that the N900 is nippy and responsive even when performing intensive tasks (like simultaneously restoring archives from parity files while listening to radio repeats on iPlayer and playing 3D-accelerated video games), thanks to a generous amount of RAM and a good seperation of responsibilities between the three (yes, three) individual processor cores.

This is a geek’s device, and it comes with all kinds of surprising extras for developers to tap into. As well as Bluetooth, the tilt sensors and accelerometers (some idiot has already written an app that detects how high you can throw your N900 based on what planet you’re on and the accelerometer readings – sounds like a quick way to break your new toy, to me!), two cameras (one a 5MP one, like the high-end Nseries phones), it’s even got an infared transmitter, so you’re only a copy of LIRC away from a universal remote, too.

Thanks to last year’s industry standards agreement, the N900 uses the new “standardised” mobile phone charger, so at least you shouldn’t have to throw out your charger ever again (at least, until mobile phones start charging by induction, as standard), and you’ll always be able to charge from USB. But in a genuine bit of Nokia care, the N900 box also contains an adapter that can be used to convert any old-style or even old-old-style Nokia charger into the new standard format, which is a world of awesome (what else was I going to do with my collection of Nokia chargers?). Thanks for thinking of us, Nokia. Oh: and the environment, I guess.

And now, the things I don’t like

It’s not all rainbows and kittens, though. There’s a few things about the N900 that haven’t won all of my praise and support just yet:

  • Why do virtually all of the default apps run exclusively in either “portrait” or “landscape” mode? Some applications will automatically switch when you rotate the phone, but not all of them: personally, I like to be able to browse the web in “portrait” from time to time! I’m sure it’ll be patched soon enough, but it’s a minor annoyance for now.
  • It would have been nice to have a physical “Task Manager” button on the device, for when a full-screen application has made the standard one inaccessible (this isn’t the iPhone – this is a true multitasking machine – so being able to switch apps “fast” would be nice, like we could on Symbian). On the other hand, there’s an app for that.
  • There’s no native A2DP support, so those “next track”/”previous track” buttons on your Bluetooth headset are officially useless. Would this really have been so hard to have in the standard package? Can somebody write it, please?
  • There are a few teething bugs in the first release of the Mail For Exchange package, which I use to synchronise my address book and calendar with my online accounts, resulting in some synchronisations simply failing (although failing-safely, of course: no data was damaged). Considering that Nokia have had working code to do this for several years now, porting it and then testing the port really shouldn’t have been so difficult.

So there we have it

An official thumbs-up from me, so long as you’re a geek and don’t mind the fact that this phone is – for the next month or two, I suspect – going have have the kinds of teething problems I’ve listed above. I’ll reiterate that this isn’t a phone for a regular Joe: if you’re not going to appreciate the freedom you’ve got with a device like this, you’d be better to save your money and get a HTC Nexus One or iPhone 3GS, or hold on for a couple of months and check out the spectacular-looking Sony Ericcson XPERIA X10.

The N900 is a phone for people with balls and a passion for the most open of open-source. And it’s awesome.

Your Experience May Differ

To: Daniel Hill <dlh9@….>
From: Dan Q <dan@….>
Subject: Aberystwyth University Is Awesome! Warning: Your Experience May Differ.

Dear Daniel,

There’s an age-old tradition amongst Aberystwyth graduates, and in particular amongst Computer Science graduates. But to truly understand it, you first need to understand a little bit about Aberystwyth University. Also, to understand recursion, you must first understand recursion (you’ll “get” that joke by your second year, if you don’t already).

As you know, your username is “dlh9”. There’s a reason for that: The letters are your initials. “But I don’t have a middle name,” I hear you cry (or, at least, not one that the University know about), “Where’s the ‘L’ come from?” Well, it turns out that Information Services, who look after all of the computer networks, have a System [TM]. And their System [TM] is that staff get usernames like “abc”, undergrads get “abc1”, postgrads get “abc12”.

(this has lead to some awesome usernames: for example, “bed” used to be the username of somebody from Residential Services, and “sad” was once the username of one of the counsellors at the Students’ Union)

Anyway, I digress. I was talking about usernames. The digit in your username is the year you started your course. So, because you’re starting this year, yours is “9” (see, ‘cos it’s 2009 – get it?). You’re not allowed to spend more than nine years getting your degree, so that’s a pretty good primary key (you probably know what one of those is, but if not, you will before the academic year is out). Postgraduates get two digits because they often hang around for years and years. I don’t know what would happen if somebody spent a century getting their PhD, but I’m guessing that it wouldn’t be pretty.

And so there’s been a long-standing tradition amongst Aber grads, and particularly Comp. Sci. Aber grads, and especially particularly Comp. Sci. Aber grads-who-graduated-and-got-jobs-in-Aberystwyth and never got around to leaving… that when their username comes up for “renewal” – when a decade passes after they first started their course – they finger (you’ll learn what that means soon enough, too) the Aber computer systems and check if their username has been re-assigned. It’s a great way to make yourself feel old, as if the annual influx of younger-every-year Freshers didn’t do that perfectly well already.

Over the years, I’ve seen many friends play this little game. Some of them won, but most of them lost – it turns out that the odds aren’t really on your side: there are 17,576 conceivable username combinations each year – from aaa9 to zzz9 – and only 3,000 new students, so odds are less than 50% whether or not you ignore the statistical biases that mean that things like “qxz9” (Quentin X. Zachary?) are basically never going to turn up.

So imagine my surprise when I, for the first time, get to play the game, today… and I not only win, but I get a double-win, because the person to whom my old username has been recycled is an undergraduate in my old department!

Yes: I was the last owner of “dlh9”. I was “dlh9” from 1999, when I started, to 2004, when I graduated, an alumni of the Computer Science Department at what was then the University of Wales, Aberystwyth (it changed it’s name to Aberystwyth University shortly afterwards – this, combined with the fact that I have since changed my name by deed poll, means that I am the proud owner of a degree certificate that contains neither my name nor the name of an existing university!). At the time, my name was Daniel Huntley – I didn’t have a middle name, either – and I spent five years getting a four-year degree in Software Engineering before I started working for a software company here in this very town. I haven’t yet got around to leaving.

It still feels strange to write an e-mail to your e-mail address – my old e-mail address. It feels like I’m writing an e-mail to myself. I wonder what I’d have made of it if I’d have received this e-mail when I first arrived at University. It’s not so hard to imagine: the person I am now would be unrecognisable to the person I was back then, just like I am a complete stranger to you, but writing to you nonetheless. But even if you discard this e-mail and never think of it again, you’ll have done me a wonderful service by allowing me the chance to participate in a fascinating thought experiment that has granted me a great and deep nostalgia for the time I spent at that University.

(by the way; I apologise if your e-mail address is still getting the spam it used to get when it belonged to me)

Like me, Aber’s changed over the last ten years. The University’s changed, and the Computer Science Department has changed too. But I’m sure that you’ll find the place as beautiful and as satisfying as it has always been: this remarkable town on the West coast of Wales, where the mountains meet the sea, full of strange and quirky characters, a million miles from anywhere, and truly unique. I find myself longing for you to have *my* experience of Aberystwyth; to do all the great things I did, to meet all the great people I did – but you won’t. You won’t have the same lovers; you won’t discover the same music; you won’t join the same clubs; you won’t have the same beautiful sunsets while you roast burgers on disposable barbeques and the rising tide laps at your ankles; you won’t have the same hangovers; you won’t scrape through the same exams; you won’t steal the same traffic cones; you won’t climb the same mountains. A different story told differently.

You won’t have any of the things that made my time here in Aberystwyth so wonderful for the last ten years, but don’t dispair, because you’ll have something far better – you’ll have all of your own marvellous experiences. Mine are mine in nostalgia alone, but yours are yet to come. And I hope you have an ass-kickingly good time, because that’s what every Aber Comp. Sci undergrad deserves when they come to this magical corner of the world.

When you get as far as your lectures, tell Richard Shipman I said “Hi”. That’ll put you in his good books, I’m sure. ;-)

And if you see me around town, give me a wave and I’ll buy you a pint. If you got nothing else from reading this old man’s drivel, you just earned yourself a free pint. When I was a student, I’d have called that a win-win. Your experience may differ.

Good luck, and best wishes;


Dan Q

Home

jQuery Is Awesome. Yet Again.

I know that this probably isn’t news to any of you who care about such things and follow the world of web development even a little… it’s not even news to me, really – I’ve been an advocate of this particular programming library for a while now. But today in particular, I just felt so enamoured by the elegance of the jQuery Javascript Framework that I had to tell you about it.

This line of code:

$('.alpha').not(':has(.beta:visible)').hide();

Hides all elements with the class “alpha” which contain no visible elements with the class “beta” (i.e. if it contains any visible elements of class “beta”, the “alpha” is not hidden).

And it’s just beautiful. Just to compare how elegant it is to something else, here’s the equivalent code in Prototype, another popular Javascript framework, which in itself still shortens the amount of code that this would take in plain-old vanilla Javascript:

$$('.alpha').each(function(element){
var has_visible_beta = false;

element.childElements().each(function(inner_element){
if (
inner_element.hasClassName('beta') && inner_element.visible()) has_visible_beta = true;
});
if (
has_visible_beta) element.hide();
});

(okay, that Prototype code could probably be a hair simpler, but you get my point)

Wow.

My New Pet Hate

I have a new pet hate.

A personal pet hate of mine for a long while has been that often, when I ask somebody for a screenshot to show me what’s going wrong with some software they’re using, they’ll take a screenshot or two, then paste them into a Microsoft Word document, and then e-mail me the Word document.

Why would you do such a thing? You’ve got Paint: paste it into Paint and save it, and you’ll get:

  • A faster result. Paint loads a lot faster than Word.
  • A smaller file. Even a Bitmap saved in Paint (the default) will usually be smaller than a Word document. A JPEG or a PNG will be even smaller still, which means it’s more suitable for e-mail and be faster still.
  • A more-compatible result. Just about anybody can open whatever you produce with Paint, without requiring a word-processor that’s compatible with the version of Word you’re using).

And that’s without even looking at the benefit directly to me: that I don’t need to re-extract your pictures so that I can upload actual pictures, not a document, to our bug tracking system, or the benefit that I can view thumbnails of your screenshots to sort and manage them easily.

But no; I have a new pet hate:

It’s when somebody who’s using Microsoft Outlook sends me a HTML e-mail with several screenshots… each one of them inside a separate Word document attached to the message. WTF?

  1. You could just have pasted the image straight into Outlook. Less work for you, easier for me, faster for everybody. It’s just like pasting it into Word, except you don’t have to open Word (or create a new document), and the images end up stored more-like actual images attached to an e-mail.
  2. One Word document per screenshot? Why? Do you just enjoy thinking about the fact that I’ll now have to open 15 – yes, 15! – different Word documents just to extract the screenshot from each and save it as an image file like you should have in the first place!

Sorry; it’s probably just me who gets bugged quite so much by this.

Update, 15th June 2011: almost two years later, I’ve revisited this topic having found something even more annoying than using Word documents as a medium for screenshots…

My Firefox Window

It didn’t occur to me until somebody looked over my shoulder and commented on it, today, that I actually have an at-least slightly unusual layout for my Firefox window. I thought I’d share with you all the thinking behind the particular collection of add-ons and tweaks that go into my day-to-day web browsing:

I’m a big fan of maximising the amount of screen real estate available for browsing, minimising the chrome that surrounds it. That’s why I use the LittleFox theme. It’s not the prettiest theme around, but it’s tiny, simplistic, and works with every version of Firefox I’ve ever thrown it at. It saves space by reducing the size of icons and excess space around tabs and buttons, and it does a great job of it.

To save even more precious vertical space (and because I’m generally running at high screen resolutions, and can spare the horizontal screen space), I combine my menu bar, toolbar, address bar and search boxes into a single toolbar. You can do this by right-clicking on the menu bar and clicking “Customize…” I drop the refresh, stop, and home buttons. I never pressed refresh nor stop anyway, always using the shortcut keys (F5 or CTRL-R, and ESC, respectively), and I my homepage is about:blank. On computers running at lower screen resolutions I’ve previously used the Searchbar Autosizer add-on to tuck-away the search box when I’m not using it, but nowadays I rarely bother.

I frequently find myself with dozens of tabs open, and I loathe it when tabbed applications force me to “scroll” left and right through my tabs (I’d rather my tabs just got narrower and narrower, until only the favicon remains), so I use about:config to change the browser.tabs.tabMinWidth setting to 0, which, after you’ve restarted your browser, changes this behaviour.

In addition to the add-ons that can be seen in my status bar – ColorZilla (in the bottom-left, so not visible in the screenshot above), Adblock Plus, FireGPG, Firebug (and a few extensions), Google Reader Watcher, Greasemonkey, HTML Validator, NoScript (with noscript.firstRunRedirection set to false, to stop it’s nagging), and ShowIP, I use one further add-on to tidy up my “bookmarks toolbar”.

The Status Buttons add-on gives you the capability to drag-drop any other user interface component into the right-hand side of the status bar: I use this to move the entire contents of the Bookmarks Toolbar down into the status bar, tucked out of the way. I remove the titles from most of the bookmarks (I can identify these, my most-frequently-used sites, by their favicons), adding them only where there’d otherwise be ambiguity as to the purpose of the icon.

All of these tweaks give me a huge browsing space that works the way that I want it to. I’m a heavy user of keyboard shortcuts – I pretty much only use the mouse to click hyperlinks and the buttons in the status bar – so this kind of layout suits me very well. One of the great things about Firefox is it’s flexibility: that you can make these kinds of tweaks so easily. And hopefully if you’re a similar kind of power user you’ll take some of these tips and be able to make use of them, too.

×

Internet Explorer 8 More Popular Than 6

Today is a good day for the web. Internet Explorer 8, which actually has reasonably good standards support, is now more widely-used than Internet Explorer 6, which is horrific to code for (Internet Explorer 7 isn’t much better).

It’s always been hard to write good quality web sites that work in Internet Explorer 7 and below: generally, I’ve always taken the approach of writing sites to comply with the standards and then to put in hacks specifically to address the problems introduced by IE6 and IE7. The sooner that we can disregard these browsers, the better.

Despite the stupid marketing campaigns Microsoft’s been pursuing to try to increase adoption of IE8, I’m at least a little thankful that they’re apparently working. I’ll be so glad the next time I can launch a site and not even have to think about using <!–[if IE 6]> conditional comments.

The Latest Stupidity From The Internet Explorer Team

Have you seen the latest stupidity that the Windows Internet Explorer team have come up with? Ten Grand Is Buried Here.

The idea is that they encourage you to give up whatever browser you’re using (assuming it’s not Internet Explorer 8), calling it names (like “old Firefox” if you’re using Firefox, “boring Safari” if you’re using Safari, “tarnished Chrome” if you’re using Chrome, and… “that browser” if you’re using Opera) and upgrade to Internet Explorer 8, and they’ll be giving out clues on their Twitter feed about some secret website that’ll only work in IE8 at which you can register and win $10,000AUS (yes, this is an Australian competition).

After looking at the site in Firefox, Safari, Chrome, and Opera, I thought I’d give it a go in Internet Explorer 8. But it didn’t work – it mis-detected my installation of IE8 as being IE7 (no, I didn’t have Compatability Mode on).

In the end, though, I just used User Agent Switcher to make my copy of Firefox pretend to be Internet Explorer 8. Then it worked. So basically, all that I’ve learned is that Firefox does a better job of everything that Internet Explorer does, including viewing websites designed to only work in Internet Explorer. Good work, Microsoft. Have a slow clap.

What’s A Cripple Been Up To?

I’m sick of hobbling round on a crutch. Sure, it was an interesting novelty for the first couple of days, even despite the fact that I got almost no sympathy from folks (and, to be fair, I deserved none – what kind of idiot cripples himself while chasing after cake?). But now I’m just sick of it. Today, two weeks after my tumble, is the first day that I’m walking around outdoors without a crutch (and without being in pain). I still need a little bit of help from one when going up or down slopes (but not stairs), so I’m still carrying my happy little aluminium pole around with me, but I’m able to support my entire weight with either foot once more, so that’s a big step forward.

Helped out with Aberystwyth Samaritans fundraising event at Varsity, although as I wasn’t quite up to walking around on my bad foot I wasn’t able to go around shaking buckets, but I did end up with “24:7” face-painted on my forehead, and apparently a decent sum of money was raised by the event, so not all bad.

I bought myself an EeePC 1000 this last week, too. I’ve never had a very good relationship with laptops, but I felt that it was probably time to give one another go, and in particular I wanted something small, light, cool, and quiet, with a fabulous battery life, so the Eee 1000 it had to be. I’ve been really very, very impressed with it so far (at least, having stripped off the silly OS that came on it and replaced it with Eeebuntu). I’ll try to find time to write more about it in due course.

The only other little bit of excitement for me, apart from being nicknamed “Hobbles” by just about everybody down here, was seeing the new Star Trek film at the Commodore last night. And while I thought the story was compelling and well-written and that the film was pitched right for a new generation of Star Trek fans, I can’t help but take issue at the artistic choices made by the director and by the special effects team. For example, whose clever idea was it that to show the vast, empty, hostility of space, the best way to shoot was entirely in close-ups? I’m pretty sure the only wide shot in the entire film is of the Academy! And what’s with all the lens effects? Barely a scene goes by without some digitally-added bloom or glare or lens flare. They were cute to begin with, when we’re panning across the bridge of the Enterprise in all it’s “this is what the inside of your iMac looks like” glory, but by the seventh or eighth time, it’s easy to get sick of. All in all, it’s a mediocre to good Star Trek film, not worthy in my mind of all the hype it’s attracting.

Is Cardiff Still Amazing?

If you’re planning to come to Cardiff Is Amazing next month, there’s some information on the website.

What do you mean, there’s not much information on it? That’s because you haven’t typed it yet! Get on with it, then!

Sleepless? Priceless!

  • Time for this iteration of a software project: 4 months
  • Time left after the client changed their mind about the “must have” requirements: 2 months
  • Amount of sleep within the last 40+ hours: 4 hours
  • Number of JOIN clauses in an eleventh-hour SQL statement that suddenly fixes everything: 12 (LEFTies, RIGHTies, INNERs… and also a UNION)
  • Time internal deadline missed by: 55 minutes… which isn’t actually that bad, considering everything that went wrong in the 55 minutes before them
  • Money earned: nil
  • Feeling after delivery complete: priceless*.

* also: knackered – guess I’d better get some sleep!

What Does This Bug Report Mean?

A bug report just came in from a client I’m responsible for at work. It reads:

…Main menu – home page – The ‘g’ of outstanding debts is permanently underlined.
Correct.

I’m not even sure what this message means. It looks like the client is telling me that the letter ‘g’ at the end of the word “outstanding”, which appears in the main menu of the software I’ve been writing for him, is underlined. I’m pretty clear on this bit of his message (although I’m as-yet unable to get the same effect on my own computer). What I want to know is, what does he want?

Is he saying that the letter ‘g’ is underlined but that it shouldn’t be? Or that it’s correct that it’s underlined (in which case, why is he filing a bug report?). Or is he asking, in a convoluted way, for it to be made to be permanently underlined (in which case: why – it doesn’t seem to make any sense?).

What a great start to the New Year’s work.

HttpOnly Session Cookies using ActiveRecordStore in Rails 2.2

If you’re using CookieStore to manage sessions in your Ruby on Rails application, Rails 2.2 provides the great feature that you’re now able to use HTTPOnly cookies. These are a great benefit because, for compatible web browsers, they dramatically reduce the risk of a Cross Site Scripting (XSS) attack being able to be used to hijack your users’ sessions, which is particularly important on sites displaying user-generated content. You simply have to adjust your environment.rb file with something like:

config.action_controller.session = {
:session_key => ‘_session_id’,
:session_http_only => true,
:secret      => ‘your-secret’
}
config.action_controller.session_store = :cookie_store

Unfortunately, the Rails developers didn’t see fit to extend HTTPOnly cookies to those of us using ActiveRecordStore, where the XSS risk is still just as real. To fill this gap, I’ve produced a very simple and only slightly-hackish plugin which overrides the functionality of Rails’ CGI::Cookie to force all cookies produced by Rails to be HTTPOnly, regardless of the session store being used.

To use it, download this file and extract it into your application’s vendor/plugins directory, and restart your application server. You can test that it’s working using Tamper Data, FireCookie, or whatever your favourite cookie sniffing tool is.

The Fife Diet from Kamikaze Cookery

I’ve been following Kamikaze Cookery (three geeks doing cookery… with science!) for a while now, and it’s got some real potential, but what really sold me on it was their recent series on the Fife diet (yeah, I know, it’s been out for ages, but I’ve been busy so my RSS reader’s been brim-full and I only just got around to watching it).

If you haven’t come across Kamikaze Cookery before, The Fife Diet videos are a great place to start.