Monday, March 29, 2010

Freecell pwnage!


Well, maybe not exactly pwnage... but a respectable effort, I think - that's 50 wins IN A ROW, suckahs!

Thursday, March 25, 2010

It's Easter time!

And you all know what that means!



Ok, so I should have used a bigger pan to cook them in... they do look a bit, um, squished together...

Doesn't change the taste, though!

Here they are with a glaze added - just some melted jam (used plum, because we had some in the fridge) brushed over the top.



Personally, I think I prefer a bit more spice in my hot cross buns. Maybe next batch I'll use 4 or 5 teaspoons of mixed spice, instead of only 3...

Oh, and the taste?

Absolutely freakin' delicious!

Had to resist the temptation to eat the whole lot in one go, still warm from the oven...

Sunday, March 21, 2010

Adventures in GUI programming

So, I've been dabbling with a little Qt programming.

I wanted to develop a program that would let me do an easy search & replace for objects in ArmA2 map files. Naturally, while I could potentially write a CLI program, it would be much easier for me (& others who might use it) to have a GUI interface. As I thought writing a windows app would be in the too hard basket, I decided to try out the Qt GUI toolkit.

Not only that, but I installed the NetBeans IDE to do the programming in. The old DevCPP that I've been using for years is still very good (and I've written quite a few CLI C/C++ programs with it), but NetBeans promised to make Qt programming a lot easier.

Shame it didn't make installing all the required software & packages easier... I was rather disappointed, upon downloading the tools I needed, to see that I was promised an almost single-click installation experience - except on Windows.

This is a problem, because ArmA2 is a Windows-only game, so naturally I wanted to do the development in Windows. Not that it really matters all that much where I edit the map files from, but being able to fire up some of the official Windows-only editing tools to check stuff is pretty important.

Needless to say, I did eventually get everything working. I even got the proverbial "Hello World" application to compile & run.

Then I upgraded Qt from version 4.5 to 4.6, and broke everything again. :-(

Took me several hours to fix that problem, which probably says more about my lack of computing knowledge than anything else!

So, I started to code up my app. Quickly figured out how to use the Qt Creator to lay out the application window, with various buttons, checkboxes, and the like. Even figured out how to assign signals & slots to those things that needed them.

I had a moment of feeling pretty chuffed when I got the "exit" button to close the application. :-D

Now I've got the file dialogs working. You can select the input file, and the output file name. It'll even pay attention to those little "read only" & "allow overwrite" checkboxes I put in there.

Then it was time to do the hard part - actually read in the map file.

Well, with the Qt Reference Guide open on the second monitor, it wasn't all that hard. Except for the bit where I couldn't get it to read a float - it kept giving me doubles... turns out that was a compound problem. I was using the reference docs for Qt 4.5, not 4.6, and there's a change between those versions that means a QDataStream defaults to reading double-precision floats, not single.

Fixed that, and had another moment of feeling rather chuffed when I read in the file header (containing 7 or 8 different variables of five different types), wrote it out again to the output file, and compared the two in a hex-editor and found they were byte-for-byte identical for the header. :-)

As I said to the missus earlier - that's 72 bytes down, only 90 million to go! :-D