the corner office

a blog, by Colin Pretorius

Unseasonal

Jeez, if I wanted clear blue skies and hot summers I could have stayed in Joburg.

It's been insanely hot here the past 2 weeks. It's also a little more humid here than the Highveld. Not as bad as KZN, but muggy nonetheless.

What surprised me last week, was how people here get into summer so quickly. I left work last Friday, and the lawns outside the office buildings were packed with people out enjoying the sun. I don't think I ever remember South Africans out en masse on the lawns of office parks during summer. I guess because glorious (yaaay) weather is rarer here, people appreciate it more.

Now some extended rainy spells, please.

{2008.05.13 22:21}

SpringSource Application Platform

The name isn't catchy enough, but the SpringSource Application Platform is interesting. Essentially, it's OSGi meets Spring, a modular application server; a comment on the TSS thread says that it's trying to do for servers what Eclipse RCP has done for clients.

What does that mean right now? I don't see this replacing ye olde containers just yet, but it is another indication that OSGi is taking off. As I've said before, I'm somewhat ambivalent about OSGi. It's a powerful way to put together large and complex applications (like IDEs and application servers), but I'm not so sure if the effort is justified when building smaller applications where a few jars and config files will do. So the appeal of things like the SSAP (or whatever the hell it ends up being called) comes down to just how much of the additional drudgery is necessary for business-as-usual apps, and/or how much can be made to go away with good IDE tooling.

{2008.05.04 22:52}

CXF, log4j, silly mistakes

If you were using CXF, and wanted all the logging output to be handled by log4j, you'll probably have Googled for an answer and come across this excellent post which explains how to configure CXF to use log4j. And you might duly create the necessary file in src/main/webapp/META-INF or the like and then spent a lot of time debugging CXF's LogUtils class trying to figure out why it isn't picking up your config change.

Only then might you realise that the post in question is indeed correct, and explains exactly what you need to do: put the string org.apache.cxf.common.logging.Log4jLogger into a file named META-INF/cxf/org.apache.cxf.Logger in the classpath. In the classpath. And then you'll go doh! Muppet! A web app's META-INF directory isn't in the classpath, and your mind is making a connection which isn't there. You should be putting the file into src/main/resources directory, or whereever else in your classpath. Classpath dammit, classpath. And you might feel embarassed at having made this silly mistake, but you'd only be human. And I think Donald Norman would be on your side.

{2008.05.01 22:54}

Ken v Boris

So we got to vote today. In the UK. Not something I'd expected to be able to do, being a lowly immigrant and all, but there you go. Being a member of the Commonwealth is worth something, after all, at least at local government level.

How different elections are here. We arrived at the polling station with our polling letters. Thank you, says dude. Don't you need our ID, says we? No, says dude, just your letter, please, and could you confirm your name? Thanks, dude. Wanted to say 'but I could be an imposter! I could be a crook! I could be voting at 15 other stations! Take my ID! But no, they're trusting, like self-checkout at Sainsburys and the postal service. So we made our ticks (3 forms, one with choice 1 and 2, which half the city thinks is a democratic travesty because it's too complicated, and the other half thinks it's symptomatic of the decline of the British Empire because people are too stupid to handle a simple first/second choice ballot paper), and put 'em in the boxes, and left.

No invisible ink, no ID, just a letter. So civilised. And rather nice to think, there's the off chance that the chap I voted for for might actually win, that my vote might've made a difference.

{2008.05.01 20:57}

Norton Internet Security can kiss my antivirus

Norton Internet Security 2007 rolled over and died on my XP partition recently, and Norton's website recommended upgrading to NIS 2008, which I duly did. And immediately regretted it.

First gripe, is that Norton decides to add an anti-phishing component to Firefox, adding a big ugly toolbar which steals real estate and chomps even more resources, and no obvious way in any of their byzantine configuration screens to disable it. I don't really want phishing protection - I don't think I'm in the at-risk demographic, but Norton seems to think I'm too stupid to look after myself.

You could just hide the toolbar (View > Toolbars > Hide...), but there's still a rotten little dll in your Firefox folder, getting in the way, chomping memory and doing dog knows what else. If you delete the file, NIS apparently just puts it back. Via this post, the best thing to do is close Firefox, delete coFFPlgn.dll from Firefox's components directory, then create an empty file of the same name, and mark it read only.

Bah.

{2008.04.23 12:26}

Review: The Dogs of War

More charity shop specials, aka good books too old to be cool anymore, but cheap and right up my alley (™). This time, Frederick Forsyth's The Dogs of War. I haven't read a Forsyth novel since high school, I don't think. The Dogs of War: wasn't that a movie, thought I? Turned out yes, but I don't think I've ever seen the movie, (or if I did, it was a long long time ago), and apparently the movie and book are quite different.

The book itself - simple plot - rich fat cat mining magnate in London gets greedy after learning about a mining opportunity in a godforsaken African banana republic. Only problem is the pesky corrupt and incompetent president. Well, if a pesky corrupt and incompetent president is in the way, get rid of him. Mercenary, hero of the story, gets hired to plot and execute a coup, and we have ourselves a novel.

The majority of the novel deals not with the actual battle, but instead with the planning and preparation, which is deeply meticulous and thorough. Turns out Forsyth was involved in plotting a coup in the early 70's (for real or research, who knows?). Either way, the book is apparently regarded as a manual for coup plotters, and unsurprisingly so.

The ending wasn't the most momentous, but nonetheless satisfying. Most enjoyable thing about the book, though, and in stark contrast to the Da Vinci Code's ploddery, is quite simply that Forsythe knew how to write. An engrossing read by an author with a gift for crafting words, paragraphs and chapters. More Forsyth in my future, that's for sure.

{2008.04.22 23:58}

Oh yes

Got my letter in the post this week, and when the University gets around to dishing out the little certificates, I'll be the proud holder of a BSc Honours degree in Computer Science, with distinction. Jolly good of them!

Part of me would love to study further, but UNISA's suggested Masters topics and research specialties weren't too interesting to me, and and studying through a UK university would just be too damned expensive. That, and with this being only the fourth year since I left high school in 1990 that I haven't been studying something or the other, I'm enjoying the freedom too much. Maybe next year ;-)

{2008.04.13 23:06}

Review: The Da Vinci Code

Some time after exams, and after reading the Metro and London Paper for too long and finding myself becoming too irate with totally pointless news stories each day, I eventually decided to hit the charity shops and pick up a few books. First book I chose, and read, was Dan Brown's The Da Vinci Code.

I've seen the movie, and read a heap of the 'background' books, but I'd never read the Da Vinci code itself. Seems every charity shop in the UK now has about 5 copies of Dan Brown's bestseller, so I bought a cheap copy and read it.

If you don't know the plot line by now, you've probably been living under a rock. Dude murdered in the Louvre, American prof gets caught up in web of lies and deceipt, the Catholic Church is evil, Jesus is a black hermaphrodite, yadda yadda. OK, not a black hermaphrodite, but not divine and was actually married to Mary Magdalene and had kids and all of this is the world's most shocking cover-up.

The suspense of the novel was kind of ruined for me, having seen the movie, but I can understand why it was such a successful book. It's not your normal subject matter, and is obviously contentious. Despite that, I found the writing somewhat pedestrian and some of the 'shocking' exposition not that shocking. Is I mentioned though, I've read a few grail books in the past, so I knew what I was in for.

The one thing which really did annoy me, was Brown's fascination with the 'sacred feminine'. Now, I don't disagree that the Christian Church has a lot to answer for when it comes to the suppression of women, but please. The notion that women were rocking and free and the world was like, sooo woooow enlightened until those horrid Judeo-Christian oppressors turned up, is just silly. Fashionable amongst anti-Christian pro-pagan trendies, but bull nonetheless. Yes, there are some societies where women were respected and treated as equals, but generally speaking, most societies which have progressed beyond subsistence have grown and prospered on the back of the application of violence; and that violence could be applied as easily against physically weaker women as it could against the warriors in the neighbouring tribe.

That's horrible, but that's history. To say that all the wrongs and ravages of sexism in modern society are because of evil Christians pursuing some shady agenda one and a half thousand years ago, is just pushing things a bit. It seems to have helped Dan Brown flog a few books, though.

{2008.04.13 22:17}

C++, Windows, and late nights

As I was saying... the joys of C++ on Windows. The easy choice should be VC++. To date I'd used Visual Studio Express 2005. As far as compiler and debugger go it's great and headache-free. The problem is, as a Java developer, you're sooo spoiled by your IDEs that VC++ is a little bit long in the tooth, in comparison. Where's my refactor-rename? Where's my real-time syntax checking? Where's my comment auto-completion? Why is IntelliSense so hit and miss? Why is 'find all references' so clunky? Why can't I F3 an include file? Why can't I link my navigators and editors? Where's my refactor-rename, dammit!

Enter Eclipse CDT. I last used it in 2006, and I used it on my Gentoo box. It was sluggish, but gcc and gdb and all the groovy tools Just Worked, as you would expect on a Linux system. I was rather keen on giving it a bash on Windows.

The problem is that CDT on Windows boils down to one of two choices: cygwin's gcc or MinGW's gcc. Early on I decided to go with MinGW. Opinion on newgroups was that it was the easier and less treacherous option. Alrighty then... if my experience over the past month is anything to go by, I feel really sorry for the poor buggers trying to wire it all up with cygwin. MinGW was tricky enough.

Admittedly, there is Wascana, a free all-in-one package which mostly works, but I couldn't get Wascana and wxWidgets working nicely, and eventually, I just gave up and rolled my own MinGW/MSYS/wxWidgets environment. It took a while to get that working, but work it finally did.

My impressions: CDT is nice. It has a lot of Eclipse goodness, a familiar interface (for a Java dude like me), its managed make tools take a lot of the drudgery out of building projects, and it's a lot faster and more functional than I remember it. The only let-down is the underlying tool chain. MinGW's half-Unix half-Windows schizophrenia is bad enough, but its overall integration into CDT is a pain. On top of that, MinGW is a dodgy old version of gcc that churns out bloated code (like, insane bloated, occasionally), and its debugger is old, spews out all sorts of crap when you least expect it, and is apparently buggy as hell. In short, it's just more pain than the IDE is worth.

I would have tried a pure cygwin setup, but apparently cygwin's debugger doesn't play nicely with CDT either.

So in the end, I've gone back to Visual Studio. I'm pretty sure CDT is going to rock if I go back to spending more time in my Linux partition, but for now, it's VC++. Oh well. I believe VC++ 2008's got refactor-rename...

{2008.04.03 21:44}

GUI apps

Techie ramble... as I mentioned a while ago, I've been at something of an impasse when it comes to picking a Hobby Technology of Choice. I'd promised myself that this would be the year of revisiting C and C++, and finally finishing my slow progress through a few Unixey books I spent lots of money on, once upon a time.

Then I went and re-subbed to Eve Online. Suddenly I found myself wanting to whip up GUI-based apps. In Windows, for now, but cross-platform for if/when I'm able to play Eve on Linux. The problem is, what to use? So many options... I started digging around. Didn't take long before I nixed WinForms (not cross-platform), Gtk (I really don't like Gtk), Qt (apparently great but fairly complex), Swing (I really really don't like Swing), and web-based (I want thick client GUIs). In the end, it came down to two options: SWT/JFace or wxWidgets.

SWT/JFace - I did a fair amount of RCP hacking last year. The toolkit is OK, and I like the look and feel, but if you're going to use SWT you really want JFace for more oomph, and you may as well be using RCP if you're using JFace. I wasn't blown away by RCP development - powerful concepts but still tedious for a lot of development. In terms of tooling, the Eclipse Visual Editor project is still struggling, but I got it working and it looked OK-ish for whipping up simple forms.

WxWidgets - I used it for a university project late '06/early '07, and quite liked it. Cross-platform, clean and accessible API, but powerful. Nice-looking visual editors, free and proprietary, so one doesn't need to hand-code everything.

Language choice becomes the final rub. If I want to get things done right now, it's Java or C++, because those are the languages I'm most comfortable with. (C# also appeals, except that I'm not excited about WinForms or Gtk#, the only two real C# GUI options).

SWT means Java. Downside is I promised myself I wouldn't do Java at home. Living in a JVM, I could start dabbling with, say, JRuby or Groovy as well though. An upside is I could re-use a lot of Eve-specific code I've already written, and I could quickly get through tricky bits of code in the language I'm most proficient in.

If I go with wxWidgets, I'd start out with C++, which isn't the most productive way to write GUI apps anymore, but the additional complexity would be offset by the thrill of being able to use the -> operator again. I'd be accomplishing my goal of using more C++ this year, and I could easy start playing around with the various other wxWidgets bindings (Ruby, say) when I'm good and ready.

I'm leaning towards Java, but I've still not made up my mind, entirely. I've been playing a bit with both, not making huge progress with either, but sort of enjoying stuffing around.

Next instalment: CDT versus Visual Studio - the joys of C++ development in Windows.

{2008.04.02 23:54}

« Older | Newer »