Archive for October, 2007

Eventually my laptop returns

Tuesday, October 30th, 2007

Readers of the blog blessed with long memories might recall that the hard drive in my laptop died recently. It transpired that the repair was not as straightforward as I imagined. Firstly I forgot that, whilst my old laptop had an IDE HD, my new laptop had a SATA HD. A straight swap wasn’t on the cards then. Fortunately an interim solution was found involving an iRiver and a USB cable. Running an entire OS off of an old external hard drive MP3 player is not pleasant.

Fortunately I discovered that replacement SATA 2.5″ hard drives are relatively cheap. I promptly placed an order with a local firm which promised same day delivery. Not wishing to embarrass them, let us given them the pseudonym “Kingdom of Calculators”. I placed an order with KoC’s brand new online order system and sat back in the warm glow that comes from knowing that new toys will arrive soon.

Unfortunately their new ordering system appeared to have a bug. Changing your delivery address in no way altered the address to which they attempt to deliver orders. Oh bugger. Indeed they had attempted delivery to my old workplace. My old workplace which no longer exists at the address I gave them. “But Rich,” I hear you cry, “surely they would not succeed and therefore have to phone you!” Oh, dear reader, if that were the case. In fact they managed to deliver a parcel to a non-existent company address to someone who does not work at the company. Needless to say I was surprised.

They promised to sort it out speedily. Which they might have done for all I know. Of course, having taken receipt of the package, stores decide to email the wrong R. Wareham (despite me having given them a piece of paper with my email address clearly written).

Eventually one and a half weeks after placing the order, it arrives. To add insult to injury, it has a PostIt from KoC proudly bearing the slogan “Don’t do it nextday. www.koc.example.com sameday!” Oh, the irony!

After getting said HD out from the packaging and removing the old broken one, I discover that the HD mounting bracket for the computer is screwed to the old HD with TORX screws. Needless to say that required a little journey around the department to find some suitable drivers.

Eventually I got it all together and am now installing the OS. Fingers crossed…

Pleasing

Wednesday, October 17th, 2007

I’m so happy. My new office’s phone number is 215.

Update: That is 2 ** 15 == 2 ^ 15 == 32768 for those reading in RSS without markup…

Yay (I hope)

Tuesday, October 16th, 2007

So the BBC have announced that the iPlayer, their ‘catch-up TV service’, will be available to Linux and Mac users “from the end of the year”. And how will this be? Are they porting the Windows DRM stuff? Are they creating some horrible in-house DRM system? No. From the article: “The broadcaster has signed a deal with Adobe to provide Flash video for the whole of the BBC’s video services, including a streaming version of its iPlayer.” Yup, Flash video. A fiver says that 10 minutes after launch there’ll be a JavaScript bookmark for Firefox that saves the video to your disk.

This is, of course, a Good Thing since FLV can be relatively easily transcoded onto your iPod or TV-connected media display device of choice.

Not all typos are created equal

Wednesday, October 10th, 2007

I’ve been using the CMake build system for a while now. After initially hating it, I am now just barely annoyed. Any degree of annoyance, however, is preferable to GNU autotools. Every so often I have to dive into the CVS logs to find where bugs features were added. In doing so I came across this amusing ‘introduce a thinko by fixing a non-typo’ patch. For those not in the know, ‘iff’ is a generally recognised shorthand for ‘if and only if’.

Index: FindPkgConfig.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindPkgConfig.cmake,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- FindPkgConfig.cmake	9 Dec 2006 20:02:19 -0000	1.3
+++ FindPkgConfig.cmake	26 Aug 2007 06:42:46 -0000	1.4
@@ -11,9 +11,9 @@
 # when module(s) could not be found
 #
 # It sets the following variables:
-#   PKG_CONFIG_FOUND         ... true iff pkg-config works on the system
+#   PKG_CONFIG_FOUND         ... true if pkg-config works on the system
 #   PKG_CONFIG_EXECUTABLE    ... pathname of the pkg-config program
-#   <PREFIX>_FOUND           ... set to 1 iff module(s) exist
+#   <PREFIX>_FOUND           ... set to 1 if module(s) exist
 #
 # For the following variables two sets of values exist; first one is the
 # common one and has the given PREFIX. The second set contains flags

I have a crazy dream!

Tuesday, October 9th, 2007

Dear crazy h4×0rs out there,

Do you think it is technically possible to port GDK to an AJAX/Canvas sick hybrid?

CZip

Monday, October 8th, 2007

Recently I wanted to compile a quick OpenGL-based utility and be able to ship it to different machines as a single binary. For those not in the know, shaders — the micro-programs which run on the GPU — are usually compiled at run-time for the specific GPU that is accelerating OpenGL. This means one has to ship, in some form, the source code. This isn’t a problem except that I wanted a) a stand-alone binary and b) not to have to remember to copy around any resource files.

Now, I could simply write my code as a big static string at the top of my C source. That is pretty ugly though. What would be nice would be to embed the file in the executable somehow so that it can be retrieved at run-time. Windows has a mechanism for this termed resources but an equivalent is not available to Unix people without an advanced degree of ELF guru-ness.

Not possessing such guru skills I looked for a simpler solution and, crawling like a dæmon from past, the XBM format reminded me of itself. XBM is a simple format for storing 2d bitmaps. What makes it interesting is that it is capable of being parsed by a C compiler at compile time into a ready packaged chuck of data inside your executable.

“Surely someone will have written an equivalent for general data,” I said to myself. Five minutes Googling failed to turn up the (almost certainly existing) prior implementation and so using the maxim, “If it takes longer to Google it than to write it, write it,” I did so.

The result is czip.c. It is a trivially simple utility that, using zlib, takes a file and outputs a C-compatible compressed representation for later reading. Looking at the result of making czip compress its own source you can see quite how similar to XBM it is :).

Dit-dit-dit-dah-dah-dah-dah-dah-dah

Thursday, October 4th, 2007

A humourous piece on the BBC today about how the theme tune to Some Mothers Do ‘Ave ‘Em — or The Man that Breaks Things as I called it when young — is, in actual fact, an accurate depiction of the title in Morse. Specifically, each ‘dit’ is represented by a quaver and each ‘dah’ is a crotchet. The melody sits atop this rhythm. Apparently the composer, Ronnie Hazlehurst who sadly died this week, did this a lot just as Barrington Pheloung famously used to hide names of murderers or other clues in the incidental music to Inspector Morse. Just goes to show: there are patterns in everything.

Why Gtk+ is teh suckz0r

Thursday, October 4th, 2007

Let’s consider for a moment the selection of cross-platform C/C++ UI toolkits one might use to develop a few test apps at work. One might consider looking at Gtk+, Qt, FLTK or wxWidgets. All of these have neat little widgets that provide you with an OpenGL context to render into so that you can display the results of your exciting graphics algorithms. All of these? It turns out the Gtk+ doesn’t. There are unmaintained solutions but nothing ‘official’.

Looking into it a bit more, one finds a bug which requests some OpenGL integration in Gtk+. A bug started just over four years ago. This is frankly shocking and so it appears I’ll be keeping with the f-ugly but perfectly suitable FLTK for the time being then :(.

Smackdown!

Tuesday, October 2nd, 2007

Sometimes Linus’ laconic wit tickles me:

From: Linus Torvalds <...>
Subject: Re: [PATCH] Version 3 (2.6.23-rc8) Smack: Simplified Mandatory Access Control Kernel
Date: Oct 1, 7:04 am 2007

On Mon, 1 Oct 2007, Stephen Smalley wrote:
> 
> You argued against pluggable schedulers, right?  Why is security
> different?

Schedulers can be objectively tested. There's this thing called 
"performance", that can generally be quantified on a load basis.

Yes, you can have crazy ideas in both schedulers and security. Yes, you 
can simplify both for a particular load. Yes, you can make mistakes in 
both. But the *discussion* on security seems to never get down to real 
numbers. 

So the difference between them is simple: one is "hard science". The other 
one is "people wanking around with their opinions".

Comment poll

Monday, October 1st, 2007

Background: An often overlooked part of the standard GNU GPL boilerplate is the phrase “you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.” Much of my GPL-released software released in the past few years and all of my ‘private’ software that might be good enough for public release one day has had that part removed and replaced with an explicit reference to version 2 so that I wasn’t dangling my family jewells too near to RMS’s mouth. So far, mostly because it hasn’t affected me much, I haven’t paid much attention to GPL v3. Assuming that I’m not too upset by the terms of GPLv2 and that I’m politically liberal w.r.t. software licensing, I ask the following:

Comment poll: Should I re-license my GPLv2 only code to GPLv3?