Archive for June, 2009

Political Apathy IV: A new hope

Tuesday, June 30th, 2009

If you are one of the racist douchebags that voted for the BNP in the European elections then away with you, this is not the post you’re looking for, actually, if you’re one of the asshats that voted for one of the equally as vile, equally as extreme, religious parties then you can get to steppin’ too.

It’s interesting isn’t it, that as much as the majority of the UK professes a dislike for the BNP, a considerable number of people voted for them. It’s also interesting that the major parties allegiances with the previously mentioned extreme religious parties haven’t garnered more criticism over the years, although the fact that they haven’t probably explains why Darth Camerons move to distance the Conservative MEPs from such groups didn’t grab many headlines either.

Don’t fret though dear reader, because down here in the constituency of Brighton Pavilion we managed to make a real difference with our votes, without really making any difference at all. The last time I blogged about the political situation in these parts we had one Green candidate, one Labour candidate and one Conservative candidate, well since the European elections, Darth Cameron has decided that Dr David Bull would be better utilised heading up a Conservative policy review on sexual health and hence Dr Bull has withdrawn himself as a Conservative PPC. Well, that’s what the Tories are saying anyway, the more cynical amongst us might suggest that Dave was a wee bit concerned with the strength of the Green vote and felt that withdrawing one of the more high profile Conservative PPCs to prevent a rather embarrassing defeat was the best course of action. The *really* cynical amongst us might go so far as to suggest that the good Doctor might even reappear in a safer seat, maybe one of the ones vacated by someone committed not to standing next time around. To be honest though, who cares about the Tories, I have always said that I would judge Dave the chameleon once he replaced his no policies policy with some actual policies and guess what, now that he has it turns out that Dave the chameleon isn’t actually Green or Red at all, he’s true blue, which I guess makes him Dave the poisonous toad.

On the really bright side, I no longer have to report on the fact that Dr David Bull is not updating his blog with details of his political plans for Brighton, nope, no more shitty political websites for me… Except that we haven’t just lost a Tory, we’ve also gained a Lib Dem and whilst I can tell you his name, Andrew Falconer, I can’t tell you anything else because he doesn’t exist. No seriously, the official list of candidates as listed on the Liberal Democrats site does not contain his name and I could not find a search box on the site in which to enter his name, I can’t even offer you a link to the relevant web page as everything appears under one URL.

Of the two remaining PPCs, one is Nancy Platts… of Labour, a fact which eliminates her from my thinking  completely: I’ve had enough of Labour to last for quite a while. ID cards, renewal of Britain’s nuclear deterent, sending our troops into warzones ill equipped, university fees, Hazel Blears, European treaty sans referendum, quite a list of things to inflict upon the electorate and all the while lining their pockets with our money. Actually, the expenses scandal is another reason for forgetting about all of the traditional parties. On Question Time recently, Lib Dem MP Julia Goldsworthy was asked about a £1000 rocking chair she purchased on her expenses and I couldn’t get past thinking that “poor judgement” just didn’t even begin to explain her situation. Then you’ve got MPs buying expensive plasma screens and stuff like that and again I was left thinking that this just wasn’t reasonable or justifiable. For those of you keeping count, that leaves precisely one candidate and brings me neatly back to my starting point: I took these feelings of political apathy and voted Green at the European elections, a protest vote with only positive consequences.

I think I now fall firmly into the category of recovering Green. ;-)

Good to meh!

Thursday, June 25th, 2009

A colleague of mine attended a conference in Birmingham yesterday and was today explaining some of the ideas that were covered by the speakers, one of whom was Sir Clive Woodward. I was listening intently to his explanation, but began to experience a strange sort of word based déjà vu, a split second later and my colleague uttered three simple words that allowed me to reconcile the sense of déjà vu, whilst simultaneously filling me with feelings of “holy crap” and “not this shit again”. Those words were “good to great”. I have a distinct dislike for this book and most of the reasons why are captured excellently in this post by Rob May, suffice to say though that my main objection stems from my feeling that the advice within it can mainly be categorized as blindingly obvious and/or ambiguous beyond all belief. It enables managers to console themselves with the fact that they are on the road from good to great, despite them actually being in a state of moonwalking on a treadmill… next to the road to nowhere. It looks spectacular, but there really isn’t much progress being made and if one of the principles does get some traction, it won’t lead anywhere good.

As for Rob May’s comment about slimy weasels, I’m not even touching that one. <insert evil laugh here>

How to: make your OpenSuSE 11.1 VirtualBox VM bigger

Saturday, June 20th, 2009

When you set up a VirtualBox HDD you get two options, a fixed size disk, or a dynamically expanding one. Despite having no good reason for doing so, when I set up my OpenSuSE 11.1 VirtualBox VM I opted for the former; I created a 12Gb virtual disk and installed OpenSuSE 11.1 onto that. Long story short, it was a big mistake, 12Gb was nowhere near enough. So what to do? I didn’t want to have to do a clean install and set up a new development environment, so I looked for a way port my existing VM into a new dynamically expanding virtual HDD – I found one too, but since the process wasn’t as straight forward as you might think, I have included the steps that I used here.

  1. Create a new virtual HDD in VirtualBox. I would recommend that you create a dynamic one and set the capacity to something far larger than you will ever need – remember that it won’t actually take up this much space on your host system unless you actually fill it with stuff.
  2. Download SystemRescueCd.
  3. Modify the settings of your existing VM to have the new virtual HDD as its “IDE Primary Slave” and the SystemResuceCd iso as its CD.
  4. Boot the VM from the CD. If your VM won’t automatically boot from the CD, don’t forget to press <F12> to enter the Boot Menu and select it.
  5. Hit <Enter> to boot SystemRescue.
  6. Enter startx at the command prompt, this will start X Windows.
  7. When X Windows starts, type gparted in the terminal that is open on screen, this will start gparted.
  8. In gparted, right click on the first partition, /dev/sdb1, and select “Copy”.
  9. Select the new, larger HDD from the drop down (top right).
  10. Right click on the empty representation of the HDD and select “Paste”, you can use the slider to set the new size of the partition.
  11. Repeat steps 8-10 for the other partitions, /dev/sdb2 and /dev/sdb3.
  12. Select “Apply” (big green tick) from the toolbar.
  13. Wait for SystemRescue to do its stuff.
  14. Right click on the /dev/sdb2 partition on the new disk and select “Manage Flags”. Make sure the “boot” option is checked.
  15. Exit gparted.
  16. Exit the SystemRescue CD.
  17. Power off the VM.
  18. Download OpenSuSE 11.1.
  19. Create a new VM with the new HDD as its “IDE Primary Master” and the OpenSuSE 11.1 iso as its CD.
  20. Boot the new VM from the DVD and select “Rescue Mode”.
  21. Enter hdparm -i /dev/sda at the command prompt, this will pop up a bunch of information including the serial number of the new HDD – note this down.
  22. Enter mount /dev/sda2 at the command prompt, this will mount /dev/sda2 to /mnt.
  23. Using the editor of your choice (I used Vi), modify /mnt/etc/fstab and /mnt/boot/grub/menu.lst, replace all references to the old HDDs serial number with the new HDDs serial number. Be careful not to delete the -partx from each entry.
  24. Enter umount /mnt at the command prompt, this will unmount /dev/sda2. Make sure you aren’t in /mnt otherwise this command will fail.
  25. Power off the VM.
  26. Modify the settings of the new VM to remove the OpenSuSE 11.1 iso.
  27. Power on the new VM, which should now boot happily.

QString::null WTF!

Thursday, June 18th, 2009

I recently discovered the cause of a bug feature in some software that I wrote (Qt 3.3.8) and thought that I’d share the information since it feels like the sort of thing that lots of people might have done. Essentially, the problem was my assumption that QString::null is some sort of special value, it isn’t, it is just a reference to a static empty QString. Given this information, consider the following three QStringLists:

QStringList listOne = QStringList();
QStringList listTwo = QStringList( QString::null );
QStringList listThree = QStringList( "" );

If, like me, you assumed that QString::null was a special null value, then you might reasonably expect both listOne and listTwo to be empty QStringLists and listThree a QStringList containing a single empty QString. The reality is that listTwo is actually equivalent to listThree, so when you are tearing your hair out trying to work out why your nice empty QStringList has a length of 1, remember this post. You have been warned.

It is worth noting that QString::null has been deprecated as of Qt4.0 and calls to it now evaluate to seperate calls to QString(), I guess I wasn’t the only person that fell into this trap! I know that assumption is the Mother of all fuck ups, but I can’t help thinking that this could have all been avoided by naming it QString::empty instead.

Oh no you ditn’t

Tuesday, June 9th, 2009

There is nothing worse than trying to surf the web and being bombarded with adverts. Thankfully, I use AdBlock Plus with Firefox to prevent such problems, but when testing the full release version of Safari 4.0 I discovered a few things:

  1. That the growlmail plugin still doesn’t play nice with Safari 4.0.
  2. That Apple saw sense and got rid of the tab-bar-at-the-top-of-the-window-ness that I found so disturbing.
  3. That one of the sites that I frequent fairly regularly was whoring itself out for a few extra bucks. Disgusting.

Close, but no cupcake

Tuesday, June 2nd, 2009

I was quite surprised to discover that Android, the mobile device OS created by Google and now developed by the Open Handset Alliance, isn’t any of the things that I thought it was. Somehow, I had managed to convince myself that Android was a Linux based OS, which it isn’t, it utilizes the Linux kernel, but that’s it. In fact, it’s lack of support for the standard Linux libraries makes it pretty much impossible to recycle any existing Linux apps or libraries for use on it. I also thought that Android provided full support for Java, but it doesn’t, for some strange reason, Android doesn’t use established Java platforms like SE and ME, it just uses the Java syntax. Disheartened, I sought solace in the fact that Android was at least fully open source, so it would still have the full support of the open source community, even if life was more difficult without Linux and Java. I was wrong again, parts of the SDK are closed source. Maybe so, but at least Google can put their weight behind making sure that the end user can use their Android running device in whatever manner they choose (think tethering)… Oh this is just getting stupid, how can the Android license be so open that it allows third party providers to close it!?!

<sarcasm>Yep, I can really see the advantage of plumping for Google and Android over Apple and iPhone OS 3.0.</sarcasm>

@Mail: Sanitizing data inputs

Monday, June 1st, 2009

If you use @Mail and have experienced an issue where you can see from the folder manager that some of your folders have email in, but you can’t actually see the email when you select the folder (this will make sense to anyone who *has* experienced the problem), then you need to be aware of the fact that certain characters in the email content can break the XML output that the advanced view uses: switch to the basic or ajax view and your problem will disappear.

Reminds me of little Bobby Tables

WordPress notification emails (nom nom nom)

Monday, June 1st, 2009

If you are WordPress powered then you will be familiar with the notification emails that WP likes to send out. I completely failed to notice that I wasn’t receiving any of the afore mentioned emails when I set this blog up, indeed it was only when one of my readers (hi Chris) commented on my tardiness in moderating his comment, that I became aware of the problem. There are lots of people out there experiencing exactly the same symptom, and many more who will happily diagnose the condition and prescribe a multitude of PHP hacks and/or plugins to correct it, but do yourself a favour and try setting up an email address to match your blog first, e.g. wordpress@yourdomain.com. This fixed my problem, which stemmed from the fact that a new spam filter had been installed by my host as part of a service upgrade. The new spam filter is so voracious that it devours even slightly meaty content and apparently not having a valid from address is the email equivalent of Quorn, not really meat, but close enough to fool most people.