the corner office

a blog, by Colin Pretorius

Firefox restoring sessions

Firefox 2 was released last year, but since I was in the digital wilderness at the time, I sort of missed it, and only got around to upgrading recently.

One thing I don't like about the new Firefox is that the close 'x' icon is now on each browser tab. IIRC early Mozilla browsers did this and I think it's a pity they've regressed. I like having the single close button to the far right, because it's easier to close a number of tabs at once, without having to move the mouse. I find it a bit frustrating when I want to close a lot of tabs and have to move the mouse across the screen to catch 'em all. (Update: there's an about:config setting to restore the behaviour, and more, see comments for a link. Thanks Bryn!)

What is quite nifty is that if the browser crashes (or if it's open when you log off), it prompts you to recover your session, and will re-open all the pages you were visiting when the browser closed/crashed. That feature can also be quite useful for normal browsing, for example, when you're really busy with something and then need to reboot because that's what you sometimes still have to do with Microsoft Windows.

Of course, you can save everything with the Bookmarks > Bookmark All Tabs... option, but if you think restoring your session is really cool and worth using every time you restart Firefox, you can specify that too. Perhaps this option's been around for a while, but I never noticed because Firefox never prompted you on a restart? Either way... it's nice to know the feature is there. Just go to Tools > Options and in the main tab, from the 'When Firefox starts' drop-down, choose 'Show my windows and tabs from last time'.

What was that about never posting tips anymore?

{2007.02.20 22:14}

I'm just a peasant in the big shitty

London again, bright lights, big city. I really do like the place. The throng of people is incredible, but my mind always wanders back to how hectic the sewerage systems must be to support that many people in one place.

I feel like a country bumpkin walking around, I'm sure people can tell I'm not a local. It's probably because I'm constantly staring up at buildings and gawking at interesting things. What really piqued my interest this time were the basement flats in Bayswater and Kensington. They must have a really awesome urban jungle vibe, and a little more affordable than the 5-storey terrace houses above them, but living below street level in a city with a real risk of flooding is perhaps a little too adventurous for me. Even out here in the country, the Thames Valley becomes more of a Thames Marsh every time there's a heavy stretch of rain. I'm all for living on high ground, myself.

At least exams are over, for this year. Given the chaos of moving last year I decided to cancel two subjects, so I have another year of studying ahead, but with only two subjects it shouldn't be too much of a stretch. The only frustrating thing is that a postgrad 'Honours' degree by SA standards doesn't exactly map to the UK concept of 'Honours' so I'm working towards a qualification that doesn't seem to mean much to anyone here. I'm so close to finishing though, that I'd be crazy not to see it through.

What I do know is that I'm guilt-free and unburdened for the next month or two. Yippee!

{2007.02.17 00:24}

Licenses and pedantry

The weekend wasn't as studious as it should have been, and the coming week will be hectic and guilt-ridden as I cram for my next exam. On the upside, the blog app's TODO list emptied out, and there's very little left to do.

Something I've been giving some thought to, is a license for my little project. I'm very conscious of how pretentious it might sound... 'oh, I'm licensing my blog app, y'know...' - it suggests that I have greater ambitions for my piss-willy web app than the piss-willy web app merits.

That's not what it's about though... it's just that I do believe that it's prudent and helpful for shared code to come with some indication of how it may be used. Given that the blog app is a fair-sized chunk of code, I think that's even more important. I could just make it all public domain, but I like the idea, even if it's a purely symbolic gesture, of associating the code with some form of open-source license.

I decided that if I'm going to do that, it's got to be the GPL. So I figured all I'd need to do is what this GNU document advises: put a blurb at the top of each source file, and a copy of the license in the project's root directory.

I thought that would be easy enough, but it's easy to get bogged down in pedantry, and I am painfully prone to getting bogged down by pedantry. For example, the page I linked to gives two sample blurbs. The first says 'This program is free software' and is meant for single-source-file programs (not that common, anymore) and the second form, which says 'This file is part of MyProject...' is recommended for multi-file programs.

I've noticed after looking around sourceforge.net and koders.com, that most people just use the single-file version, which says 'this program'. It's not what the FSF says you should do, dammit, but I can understand why it's done. But what about a web app? That's hardly a program? Also, what about a re-usable utility library that doesn't really have a name of its own? Isn't it just lazy to bang a 'this program' notice into something that's not even part of a program? It seems wrong. OTOH, isn't re-wording the recommended GPL blurb to suit one's requirements just a bit fucking OTT? It also feels wrong (and sad) to actually be worrying about this stuff, but still.

I think perhaps it's time to set the blog project aside until exams are over...

{2007.02.11 22:47}

More snow, another exam

Thursday's bout of snow was a neat step up from the last - not only was it thicker, but this time, I actually got to stomp around in some untarnished white stuff on the way to the bus. In addition to that, I actually got snowed on. White snowflakes in the air and landing on me and melting. Yes, this was a thrill for me... and in a few years, the novelty will probably have worn off. But not yet!

Last night was spent in London again, at cheapo hotel, doing some last-minute cramming for today's exam, which was, hopefully, the last Formal Logic exam I ever have to write. The train into London yesterday, and back out today, was through snow-covered countryside. It all still feels a bit surreal...

{2007.02.09 23:55}

Space Cadet

It sounds like a bad made for TV movie, but you know that script writers couldn't make this stuff up. A famous astronaut drives for 1000 miles wearing NASA-issue adult nappies so's not stop for loo breaks, disguised in a wig, sunglasses and trenchcoat, and then tries to kidnap and plans to kill another woman who's a rival for the affections of another astronaut who, by the loonette's own admission, she ain't even been romantically involved with. Pepper-spray wielding astronaut lady is busted packing, according to the article, an air rifle, a steel mallet, rubber tubing, dustbin bags, black gloves and a knife. I, too, wonder what the rubber tubing was for.

I also wonder whether, deep in the bowels of NASA, someone's starting to wonder if some extra-terrestrial spores settled into this aunty's noggin and turned her brains to mush. Presumably somebody that nuts couldn't have gotten onto the Space Shuttle in the first place, could they?

{2007.02.06 23:45}

Generalising the blog

In between all the studying and being a doting husband, I still sneak away now and then and tinker on the blog app. At first I'd tackle something on the TODO list and as I got stuck in, I'd end up adding another 5 items that needed looking at. Thankfully the list has slowly been whittled down to LATERs and DONEs.

I've spent quite a bit of time generalising the app. The blog wasn't initially intended for anything other than The Corner Office, but soon Ronwen was asking about setting up her own blog, and I wanted to keep a quick-and-dirty private diary / tech scribble blog. Some parts, like headings and link bars and the like were easy to do, but others got a bit tricky: the dynamic CSS styles functionality was partly hard-coded, ditto for RSS feeds mapped to blog categories and so on, and these needed some fancy footwork to be fully configurable.

Most of that is done. I've been going through a lot of the old code (the app was initially my learn-JSP project, and somewhat uh, dated), and cleaning up the bits that are too ugly for posterity. One problem I picked up yesterday, is how the blog handles some images. Most dynamic files and images are stored as BLOBs in the back-end database, but the front-end logos and whatnot were actual images in the web directory in the .war file. This made good sense performance-wise, because every page hit requiring a BLOB to be hauled out of the back-end database is not what I'd call desirable. Problem is, if the app is going to be virtuously generalised, then having to personalise the app by shovelling different images into the .war file isn't the way to go either.

I see two possible solutions. The first is to push more images back into the database, but cache the most used ones in memory. For small things like a logo or background images, which are going to be required for nearly every page hit, this is probably the best approach. The second alternative is to dump the images to a temp directory, and then stream the files from there. I think both solutions are better than BLOB-streaming, but I'm starting with the former approach for now, and in particular, want to be able to specify which images / files are cached or not. I'll keep this extensible so dumping to the file system is an option, eventually, too (more thoughts on that another time). So that's the next chunk of work to do.

{2007.02.06 00:06}

Lousy time to be a turkey

I'm a bit grippe-stricken this weekend. Not much good when you're trying to study for a Formal Logic exam. It's somewhat ironic that an outbreak of bird flu has happened at the same time. At least nobody's planning to gas me to stop me spreading my germs.

Re the bird flu thing, I'm not sure what the big deal is (unless you're a turkey, of course). I think the reason why bird flu worries people is because even though bird flu won't easily spread to humans, it still raises the disconcerting prospect of a killer virus that spreads easily, at least on an island as densely populated as this. Something like AIDS is awful and deadly, but if you're not going around bonking people without protection, then you (generally) don't have to worry about getting it. That's quite different to contracting a disease and dying, just because you sat next to the wrong person on the bus.

{2007.02.05 00:03}

Train Smash

Ronwen decided to go all South African and made frikkadels tonight. For non-South African readers, frikkadels are just meatballs, but Ronwen thought it was quite funny when I said that when and where I grew up, if you said you were having 'meatballs' for dinner people would think you were nuts or too posh to call them frikkadels. There is no such thing as a 'meatball' north of the Drakensberg. I digress.

In tracking down a recipe and scouring some South African recipe websites, Ronwen introduced me to what seems to be a new term for tomato and onion gravy: train smash. What a delightful expression. I'd never heard it referred to that way before - I've always known it to be tomato & onion gravy or just 'sauce', or 'sous' if you were in an Afrikaans mood. I wondered where this seemingly new term came from, and Ronwen speculated that it might be an African term that's gained common usage. This sounds quite feasible, given the macabre but brilliant township slang used for other things: walkie-talkies (chicken heads and feet), smileys (a sheep's head), and half-smileys (yep, half a sheep's head).

Am I just out of touch though? For how long as the term 'train smash' been in circulation, and where did it come from?

Update: quick web search turned up a suggestion that it has a military and/or Australian origin. It's still a great name!

{2007.02.04 01:23}

Into the Past: A Memoir

Finished another book already... I'd started it back in South Africa already, so I'd had a head start. The book was Into the Past: A Memoir by Phillip V Tobias.

Phillip Tobias is a famous paleoanthropologist, whom I blogged about over years 3 ago, when Ronwen dragged me off to a commemorative lecture by (inter alia) Prof Tobias in 2003. I remarked at the time that Tobias' speech overran significantly, and after reading the book, have something of an appreciation for his joy in oratory: that's what famous academics do, and he's had some practice.

His memoir isn't a strict time-line recounting of his life experience - while some chapters are biographical, he also devotes some time to matters and issues dear to him (his academic contributions and efforts, evolutionary questions, his part in the struggle against apartheid), and his memories of people he worked with and was influenced by. Much of this might not have been particularly interesting to a philistine like me, but ultimately, the book was a pleasure to read, the enjoyment derived from his use of, and delight in words. The book is the product of a skilled wordsmith, the story one of a highly intelligent, somewhat eccentric, but fascinating person, and a well-lived life.

{2007.02.01 21:36}

The Fabric of the Cosmos

This morning on the bus, I finished reading Brian Greene's The Fabric of the Cosmos. I was in a sciencey mood after finishing The God Delusion, and this had been at the bottom of a pile of books Ronwen bought last year.

The book could be subtitled 'Physics They Didn't Teach Us In High School'. What's the universe made of, how did it come to be, and how does it all work? It starts out with Newtonian physics, and then works its way through Einstein's theories of special and general relativity, and the concept of spacetime, entropy and the direction of time, to quantum physics, neuron-popping concepts like entanglement and uncertainty, and thence to the Universe: the big bang, inflationary cosmology, dark matter and energy, string and M-theory.

My head exploded on about every second page, but the book is well-written and lays out concepts using accessible analogies. The book left me in awe of two things: first, the physicists who've grappled with these fundamental questions of how our universe came to be and how it hangs together. What manner of genius did people like Einstein possess, to explore hunches and intuition, and to develop theories about the world we live in, in some cases theories that were only proven years or decades later?

Secondly, as with the God Delusion, the book left me with a renewed sense of amazement at the strangeness and beauty of the universe we live in, the reality that hums along just beyond our simple senses and constrained concepts of three-dimensional space, and time. For that, the book is well worth reading.

{2007.01.29 23:56}

« Older | Newer »