Just Another Right-Wing Rant

Saturday, July 28, 2012

I'm So Annoyed I'm Resurrecting This Blog Just To Moan

I have had it with software development.


I am going to Tibet.  To farm goats.

Recently I've started a new personal project.  It's pretty cool, if you're into that sort of thing.  Particularly cool is that it's not a lot of code in itself.  It takes a few packages that are out there, ties them together with about 100 lines of clever code and some bespoke data, and it does cool stuff.

Or that's the theory.

So far, it uses these packages:

  • Blender, for modelling things to be displayed.
  • Ogre3D, for displaying the things that are modelled.
  • OpenAL, for playing sounds.
  • OpenNI, for motion capture.
Actually OpenNI is pretty peripheral - all I want to do is capture a sequence of movements using the Kinect sensor from my XBox 360, import it into Blender, attach it to a modelled skeleton and have the skeleton in Blender reproduce my movements in the real world.  Simples, right?

Wrong.  Oh, so very wrong.

There are a few videos on YouTube demoing exactly this sort of thing, so, "How hard can it be?"  I thought.

First, I started to look for solutions that would work out-of-the-box with no coding effort on my part.  NIMate claims to do it, but it's not free - my project is a hobby, to be released as open source, and there is not money in it for me or anyone else.  Besides, all I want to do is capture about 3 seconds of motion - paying for a tool to do this is not an option.

Bloop also seems to do the right thing, and it's free.  The source is available.  So I downloaded it to give it a go.  It's not nearly so simple as installing a Blender plugin and clicking a button.  There are four separate packages you need to have working at the same time:
  • Two Blender plugins.
  • KinectToOsc - takes data from the Kinect SDK and re-broadcasts it as OSC, whatever that is.
  • The Kinect SDK.
So I install the Kinect SDK from Microsoft.  And download KinectToOsc.  And run it.  Nothing happens.  No error message.  No message box.  No window.  Nothing.  No process left running.  Nothing.

So I start digging into the code.  It has lots of references to Microsoft components that don't exist on my system.  "Maybe I haven't installed the right things."  An hour or so if installing and re-installing components later, I'm pretty sure this isn't it.  Another hour or so of Googling later, I discover that I have the Kinect SDK version 1.5 and KinectToOsc was developed against the pre-release version.  Microsoft kindly decided to completely reorganise the API in between and no-one has got around to updating KinectToOsc.  It's just not going to work.  I could learn the Microsoft Kinect API, and the differences between the versions, and essentially rewrite KienctToOsc, but life is too short.

"Well," I think now, "I've written software to get data from a Kinect before.  OpenNI provides a nice interface.  It has a Python wrapper.  Blender has a Python scripting module that can manipulate scene data.  Two things in Python-land, and all I have to do is shuffle data from one to the other.  How hard can it be?"

So I get PyOpenNI from git and build it.  It uses CMake, which I'm not very familiar with, but seems nice enough.  It spits out a library which I can install into Python.  Then I can run the examples and they work.  Great!  I'm nearly there!

But wait.  Python in Blender won't load the PyOpenNI module.  Why?

Well, it turns out that the OpenNI module I built was for Python version 2.7 and Blender uses Python 3.2.  So I install the module into the Python 3.2 modules directory.  It won't load, though, because the Python API has been reorganised between versions 2.7 and 3.  I need to actually build the module against Python 3.2.

Well, PyOpenNI uses CMake, and the CMake configuration includes these lines:
find_package (PythonInterp 2.7 REQUIRED)
find_package (PythonLibs 2.7 REQUIRED)
 Surely if I change that '2.7' to '3' or '3.2' it'll work, right???  I mean, CMake is supposed to make this stuff easy, isn't it?  We can say which package we want, and which version we need, and it just figures it out, right?

Wrong.  CMake only supports Python up to 2.7.  Sure, Python 3 was released nearly four years ago, but no-one has bothered to add support for it to CMake yet.

So, to recap:

  • I want to use my Kinect sensor to capture animation data in Blender.
  • To do this, I need to write some Python code, because Bloop has not been updated to the release version of the Kinect SDK.
  • To do this, I need to use OpenNI and PyOpenNI.
  • But PyOpenNI hasn't been updated to support Python versions less than 4 years old, so I need to modify its build scripts to build against a newer version (I still have no idea if it will work without modifications to the code).
  • To modify the build scripts for PyOpenNI, I also need to modify the CMake package definitions to add support for Python 3.2 to the CMake build system.
Honestly.  If I worked with these technologies all the time, I could probably manage most of this.  But I don't.  Most of the time, I write C++ code using Visual Studio, G++ and GNU Make.  I'm good at that. C++ using G++ and GNU Make are the technologies I've selected for the project because I'm good at them.

Now, because I want three seconds worth of motion capture, I need to:
  • Learn enough about the Kinect SDK for .NET to realise that Bloop isn't going to work any time soon.
  • Learn enough Python to try writing a Blender plugin.
  • Learn the Blender API well enough to start writing a Blender plugin - and, as an aside, the Blender documentation is rotten.  There are enormous stacks of it - so long as you are using Blender 2.4 or 2.5.  The API, to develop a continuing theme, has been reorganised between then and now and the documentation no longer applies.
  • Learn the differences between the C++ and Python interfaces to OpenNI.
  • Learn enough about Python to know what the differences between 3.2 and 2.7 are.
  • Figure out how the PyOpenNI source is structured and where to modify the build scripts.
  • Learn enough about CMake to add Python 3.2 support to it.
I'm sure many in the open source community would say, "This is what's great about open source!  The source is there, so you can modify it and make it work."  Well, I'm sorry if I'm particularly daft, but I've tried, honestly, and my brain has exploded in consequence.  All I wanted was to write some C++ code tying a few modules together and add some captured data tot it.  I don't want to have to figure out how to reprogram an entirely different build system just so I can capture that data.

I don't think I'm being unreasonable here.  I'm working on a project that will change a particular field of endeavour in a pretty radical way and I'm prepared to contribute it back to that community for nothing.  I'm sure I'll end up supporting it for nothing.  That's okay.

Three groups come in for harsh criticism in my view:
  • Microsoft.  You develop a cool new sensor, and an API to let people access it easily.  You generate lots of excitement, and even let people get a preview by releasing a preview version of the SDK.  Of course people will start developing with it - they're excited.  Then, for the release version, because now it's not part of Microsoft Research but part of Microsoft-Something-Else, you have to rename everything and (AFAICT) change how quite a lot of things work.  WHY?
  • Blender.  Don't get me wrong, Blender is cool and it's free.  I just wish they weren't so fond of wholesale change.  Learning to use Blender is painful anyway - the user interface is arcane.  When you know it well, I'm sure it's very productive.  But it follows no established convention in the work of computer applications and so every user has to learn it step by step, from scratch.  As if that's not bad enough, they also make very large changes in every release, leaving their existing documentation and tutorials pretty much useless.  It goes without saying that the documentation for the new version has lots of 'null pages'.  There aren't many tutorials out there for it, either.  They've also decided to re-organise the Python API.  A little more thinking-things-through up front would have saved a lot of people a lot of frustration.
  • CMake.  You do noble things.  You make navigating the maelstrom of library versions easy.  So why has it taken 3 1/2 years for Python 3 support to be not added yet?
Colour me frustrated.

Friday, November 28, 2008

In Defence of the Albumn

This post is written with the aid of a certain quantity of French brandy and in the ad-break of an Austin Powers movie. You Have Been Warned.

The world has abandoned the RIAA. Poor bastards. The major labels are seeing sales crash in ways that SCO can only dream of. So much of their sales, which used to be concentrated in albumns on CD or vinyl, are now in digital downloads. iTunes is the new CD store, at £0.99 per track.

And it's those last two words that worry me. When you can pay 99p per track, what are you going to do? Will you go buy a whole albumn, for about eight quid, or will you pick the two tracks you like at first hearing and buy them for £2?

Again, it's three words that worry me. The "tracks you like". The model of the digital download assumes that you will hear something and either like it, and buy it, or you will never listen to it again.

Is this your experience? It isn't mine. Take, for instance, the Coldplay albumn X&Y. When it comes to Coldplay albumns, everyone likes Parachutes. Why? Because it has Yellow on it. Let's face it: Yellow is a frickin' good song (remember, Austin Powers & brandy) and everyone wants it. It's got some other good songs on it, too; bonus!

Now, name a good song on X&Y. I didn't know of one when I bought it. Just after I bought it, my brother (sorry, Rick, it's all your fault) said, "Everyone says X&Y is their rubbish albumn" and so I didn't listen to it much. For two years I didn't listen to it and didn't like it. Then I started listening to it, just at random. It is awesome. This albumn has some of the best music I have ever heard on it. Swallowed in the Sea is presently the best song I have ever heard. Fix You comes a close second, Talk, Square One, What If, X&Y, A Message, Low, The Hardest Part, and basically the rest of the album are all up there.

The point is this: On first hearing, a lot of music is not what you like. On second hearing, you might start to consider it. On fifth hearing, it's familiar and you kind of like it. On the twentieth hearing, it might be your favourite song. Good music isn't necessarily what you like on first hearing.

What hope is there, then, for good music, in a culture that only listens to the songs they immediately like? If you only buy the songs that yoiu like based on the 20sec preview on iTunes, what will you end up buying? I know I would end up avoiding a lot of music I would otherwise end up liking, and so I remain a firm fan of the albumn.

Wednesday, September 03, 2008

The Web Is...

Wonderful definition of the web from the New York Times, referring to the ability to quickly find the results of years of research:

The Web is a tool that enables people who have a life to benefit from the efforts of those who don't.
Now go outside and play for a while.

Sunday, June 22, 2008

Typical Liberal Junk

You may just have picked up that I am neither a liberal, nor much enamoured of liberals. If you haven't picked this up, I suggest you take a long, hard look at the title of this blog. Anyway...

Spotted this on Slashdot: Blogger Launches 'Google Bomb' At McCain. The gist of it is that some liberal blogger has decided to manipulate the Google PageRank system to make Google searches for John McCain return negative news stories. What had me particularly disappointed in human nature was this quote from the blogger in question:
Obviously, it is manipulating, but search engines are not public forums and unless you act to use them for your own benefit, your opponent's information is going to get out there. [As cited here.]
I hope we can all spot the rather blatant, cynical hypocrisy here. "Search engines are not public forums," he writes; then why do you consider them forums for spreading your own views? And, rather more disturbingly, "Unless you act to use them for your own benefit, your opponent's information is going to get out there." Right, OK, sorry for thinking that informed, respectful debate was important to our society. Yes, sir, I'l just shunt myself off to the gulag right now. No more spouting about those infamous right-wing ideals, like freedom of speech, or respect for people with differing ideas.

I think, funnily enough, that I am right about most things in life. I daresay I am actually wrong about a number of things, but I haven't been convinced of it yet; if I thought I was wrong, then I'd change my mind. I am so convinced that I am right, that I don't mind others hearing the other side of the story; I think that an informed debate will get us nearer the truth. I might even learn a thing or two from the other side. But this guy doesn't seem to think like that. His campaign is not to convince people that he is right, but to silence opposition: "Unless you act ... your opponent's information is going to get out there."

I guess I shouldn't be surprised; from the French revolution to the Stalinist purges, the idealism of the left wing has always turned to violent repression of anyone who disagrees. I don't say my side of politics is guiltless; Hitler is the right wing's skeleton in the closet. I think most on the right wing would agree that he was wrong, though; we would disagree with both his repressive actions and the motivation that lay behind them.

Pilate asked the rather excellent question, "What is truth?" Is truth that which is real? or that whiich you can convince someone to believe, even by such crass means as manipulating Google search results?

Monday, October 29, 2007

And Another Thing...

When filling out a passport application for said four-week-old child, they ask for her height. Do they think this will be useful in identifying her?

Like Pulling Hens' Teeth...

Ever tried taking a passport photo of a four-week-old child? The documentation says the child must be:

  • Directly facing the camera;
  • With both ears in view;
  • Holding her head square on her shoulders;
  • With her mouth shut;
  • And her eyes wide open, so the colour can be seen;
  • Not frowning;
  • Not smiling;
  • On a plain, light-coloured background;
  • With no hands in view (mine or hers);
  • Not too light;
  • Not too dark; and
  • Not too out of focus.
Sigh. There are maybe one or two here I can use.

Tuesday, February 20, 2007

Cricket and Why We Play It

Disclaimer: Americans can stop reading now. You will not understand. In fact, it might be best if everyone except Australians stopped reading now.

I am an Australian. If there is one thing that Australians are truly passionate about, it is not Vegemite, or Holdens, or Outback, but Cricket.

Opinion varies from Australian to Australian on why exactly we play cricket. There are two theories:

  1. We play cricket to beat the English.

  2. We play cricket to beat the New Zealanders.

I am a subscriber to both these theories, in the inverse order of that given above. The principal reason for playing cricket is to beat New Zealand at every opportunity available.

So you might understand if I am a bit tender at losing a one-day cricket series to New Zealand 3-0. I have a couple of things to say about this.

Any New Zealanders who read this will no doubt accuse me of sour grapes (especially when they get near the end). They are right. But they are therapeutic sour grapes.

Cricket and How To Lose At It

If Michael Hussey ever captains Australia again it will be too soon. Much too soon.

One of the fundamental characteristics of a good captain of a cricket team is that he knows how to create pressure. Some captains have it, some don't. The ones that don't will not last long. Hussey does not have it. Michael Vaughan has it. Andrew Flintoff is learning it. Ricky Ponting is pretty good at it. Steve Waugh was legendary. Michael Hussey couldn't create pressure in his car tyre, let alone on the cricket field.

It is absolutely critical that a team in the field be able to put pressure on the batsmen and dry runs up, at least for a little while. This is how wickets are taken - by pressuring the batsmen into taking risks.

Of course, every player in the field plays his part in creating pressure. But it is the captain who is responsible for it. He uses his bowlers. He uses his field. He creates pressure and he gets batsmen out.

During the debacle witnessed today, the New Zealanders only took risks because they got bored. There was not a moment of pressure applied to them at any stage of the game. The captain has to take responsibility for this.

Now some captains are really good and can defend almost any total, but these are few and far between. It helps to have a great team, of course. Only a very few captains will successfully defend 130 runs. There are some captains who can defend 220 pretty consistently. Most captains in international cricket can defend 290 without too much trouble. But any idiot with a team taken from the Dubbo animal shelter ought to be able to defend 346.

Fair enough, once you might have been unlucky. Sometimes the luck goes against you. Sometimes the other team just play blindingly well and there's nothing you can do. But losing two games in a row, one defending 336 and the other defending 346 is utterly inexcusable. No captain ought to keep his job after such a scandal.

Now there will undoubtably be some nancy-boy out there who wants to defend Michael Hussey, who will point out that New Zealand lost four wickets for forty runs in the first ten overs. Isn't that a sign that he can find wickets? No no no no no no no. That is a sign that there are some good bowlers in the side who can take wickets with the new ball. The failure to capitalise on that start is the truly staggering thing about today's performance. Anyone with a team from the Tanami Desert Home For Geriatric Persons Who Have Lost Everything Below Their Navals ought to be able to defend 346 from a start of 4/40 from ten overs.

Michael Hussey has got to go.

A Plea to the Australian Broadcasting Commission

The other thing to say about today's game is that the ABC needs to lift its game and get some commentators into New Zealand games.

Every cricket-plaing country on earth has produced commentators of a reasonable level of proficiency and professionalism, except New Zealand, it seems. India has produced the excellent Harsha Bhogle and Sunil Gavaskar. Pakistan of course has their own batting legend, Wasim Akram. Allan Donald very respectably represents South Africa. Jonathan Agnew of course is among the very best from the BBC.

Even our very own K.J. O'Keefe, despite being a one-eyed lunatic (one-eyed in the metaphorical sense) with a snort for a laugh, at least has insight into the game, realises that he's one-eyed, is self-deprecatingly humorous about it and gives the other side a fair go.

The best New Zealand can produce is Bryan Waddle. The best Bryan and his fellows can produce is six hours of theorising on how New Zealand might still win the match, no matter how dim it might look. I just want to go and be sick after the first innings of it, even when Australia have put on 336 and look unbeatable (not a typo, I didn't get to listen to the first half of today's game).

Even the pretence of even-handed commentary is absent, as made all too plain by the rather-too-audible wild cheers from the back of the commentary box during the last two overs of today's game. This, it seems, is the height of New Zealand professionalism.


Thursday, February 15, 2007

A Piece of Prose from Yesterday

There comes a time on a Thursday afternoon, before Friday is imminent and when Saturday is as yet only the first blush of dawn on the horizon; when no email is arriving, when the notice board has nothing new; when the internet has been read and re-read, but the American and European news sites have pulled the covers up tight and gone to sleep for the night; when the investment made at lunch brings its drowsy return, and you realise that there are only so many cups of tea that can usefully be drunk in one day; and then you enter the long, dark tea-time of the soul.

Credit, of course, to Douglas Adams for the idea.