This Too Shall Parse

Thoughts on Software Development by Richard George (

Job Hunting: time to warm this thing back up

2012-01-04 12:59:00
As the New Year starts, I'm bringing my study break to a close and looking for a new job. For the last couple of months of 2011, I took some time out to broaden my skillset and look for a new direction to take my career. I've enjoyed the years I've spent doing PHP but, eventually, it becomes time for a change.

I kicked the study break off by working through Seven Languages in Seven Weeks - an excellent book that I recommend to all developers. However, I confess that I didn't spend 7 weeks on it; my objective in reading it was to get some idea of the nature of a number of new languages, but to get some in-depth experience of at least one new one in a reasonably short timescale. As I was on a study break, and not earning, I didn't have the luxury of covering all these languages in any sort of depth!

The flipside of this, however, was that I actually looked at 9 languages - all those in the book, plus Python and Objective C (I already have various amounts experience in PHP, C, Perl, Java and Javascript). The ones from that selection that really caught my interest were Python, Ruby, and Objective C. The first two struck me (and I may not make too many friends saying this ;) as neater versions of PHP, which I felt I could drop into and enjoy quite quickly - in fact I'd already done small amounts of both, but it was good to get some structure. But it was Objective C, the object-based form of C that's used on iOS devices such as the iPhone and iPad, that really caught my interest.

Partly, this is because I managed to get a really good introduction to it. I signed up to take the iPhone Boot Camp course (in London, not NYC!) which, while not cheap for an individual, is still quite reasonably priced for the amount of training you get in a very short time. After that, I was able to start writing my own apps with a fair amount of confidence.

Of course, some of those early apps were pretty trivial or experimental; I have one app that "finds" Nelson's Column, which I use as a deployment test whenever anyone joins my TestFlight team, and one which is just an iPad soundboard which consists entirely of ducks. Why ducks? Because my 18-month-old niece thinks they're the best thing in the world, and who am I to argue? :)

The main app I've been working on is known as "LittleGym" (with apologies to Goon Show fans), and ties into my gym habit which has recently been reinvigorated by Fitocracy. You can get a few ideas of how it works from the app screenshots on Flickr. Unfortunately, as Fitocracy doesn't provide an API yet, you still have to enter your info on that site manually, but the app's a quick way of recording workouts, and does allow CSV export. And, to be honest, I find I really enjoy iOS development.

The second, slightly bigger app I'm working on is slightly secret at the moment... watch this space :)

So... What do I want to do with these new skills? And can I?

Well... many people claim (and I think it's true to a large extent) that a good developer really can work in any language. Certainly, the speed with which I've found myself picking up Objective C has supported this claim. I started off in C and I've got nearly 10 years of object-oriented experience, and I've always taken it pretty seriously, in terms of studying techniques and patterns, and applying good practice and testing. Why? Because it saves so much effort in fixing things later!

So... I happen to think I've got a fair bit to offer anyone who's looking for an iPhone developer; sure, my experience in the toolset is admittedly bit limited, but it's growing fast, and I can back it up with a career's worth of development experience, as well as skills in useful related fields such as team management, unit testing, server admin, version control... well, it's all in my CV. Plus, I've got more language skills than most people can lay claim to, which has certain uses :)

So, if any employer wants to talk to an experienced, rigorous developer who's looking for a slight change of direction, please drop me a line - or, if you know anyone I should be speaking to, or have any questions, let me know. In the meantime, I'll be looking around, polishing up the gym app, and hopefully releasing the new one (and a few more) to the public.


Forming Japanese Verbs

2011-06-30 17:59:00
This is a bit of a placeholder at the moment as I want to write quite a bit more on Japanese verbs, but people might still find this useful - a chart of the construction of common Japanese verb tenses, and of their usage, all based on the commonly taught -ます (polite) form:

Click on the image to view.

See also Wikipedia's page on Japanese Verb Conjugations


Get out there and say YES! on Thursday

2011-05-03 21:23:00
In a couple of days we get our best chance for generations to promote a system of government based on consensus and agreement rather than minority ideologies. The No campaign has been so entirely based on lies and myths that many of its own leading members have disowned their methods. Even David Cameron seems to find their methods unpalatable, and many generally non-political people of all walks of life have spoken out against them.

But, because confrontational, partisan politics suits the mass media better than the constructive and collaborative (if slightly boring) approach the country needs, they're using their power to encourage people to stick with the same broken system of single-party dominance. If they succeed, we'll be stuck with the same old politics for decades. Please, get out there and vote Yes to AV on Thursday, encourage others to do the same, and help guarantee us a political system that works together for the whole of our society.

A "No" vote, or abstaining, isn't a vote for PR instead; it won't save us money, it isn't "simpler", and it won't "send a message" to Nick Clegg, or whoever the media have chosen as their scapegoat of the day. It'll just consolidate the status quo that so many of us are sick of, for generations more.

I made many of my arguments behind this position in a previous post, so take a look there if you're interested. This time, I'm just asking you to do something good for all of us.


A few words on Voting

2011-02-20 19:36:00
In the UK, formal participation in the political process is pretty much limited to voting once every few years, so when I do get the chance to vote, I try and do so in as informed a manner as possible. I look at the policies of, usually, about 4 key parties, and decide which of them has policies I can most agree with, and which are likely to be best for the country. Given the sheer number of issues that can be in play, and the paucity of information provided, that can sometimes be tricky.

Then, once I’ve made up my mind, I go and vote; but I know that, because of our voting system, my vote will basically go into the pile marked “other” and have no effect on the two-horse race in my “safe” constituency. I have a choice of course; I can engage in what’s wryly referred to as “tactical voting”, where I discard my original voting intention, and decide which of the previously mentioned horses I dislike least. This, in the UK, is what’s known as voter choice.

In the Hitch Hiker’s Guide to the Galaxy, Douglas Adams provided us a pretty clear summary of why we keep voting for horses, or in his terminology, lizards:

‘On [that] world,” [said Ford], “the people are people. The leaders are lizards. The people hate the lizards and the lizards rule the people.’

‘Odd,’ said Arthur, ‘I thought you said it was a democracy?’

‘I did,’ said Ford, ‘It is.’

‘So,’ said Arthur, hoping he wasn’t sounding ridiculously obtuse, ‘why don’t the people get rid of the lizards?’

‘It honestly doesn’t occur to them,’ said Ford. ‘They’ve all got the vote, so they all pretty much assume that the government they’ve voted in more or less approximates to the government they want.’

‘You mean they actually vote for the lizards?’

‘Oh yes,’ said Ford with a shrug, ‘of course.’

‘But,’ said Arthur, going for the big one again, ‘why?’

‘Because if they didn’t vote for a lizard,’ said Ford, ‘the wrong lizard might get in.’

In homage to this exchange, the “Tactical Trap” inherent in First Past the Post voting is known to voting reformers worldwide as “Voting for the Wrong Lizard”.

Before looking at how we might vote for a human instead, it’s worth remembering what the effects of this situation are, beyond frustration; as most of the constituencies in this country are won on around 30-35% of the vote, almost two-thirds of the voters are un-needed (and effectively un-represented) by their MPs, who we cheerfully refer to as “our elected representatives”. And that’s ignoring the number of voters whose “tactical vote” is not to bother, because they believe it’ll have no effect. Elected they might be, but representative they are not.

The fact that MPs are only dependent on (and in effect, answerable to) only a small proportion of their electorate causes further problems. I said above that “formal participation in the political process is pretty much limited to voting once every few years”. You can of course participate informally, by writing to your MP. I’ve done so a few times, but it’s frequently a dispiriting experience. Because she only needs the support of her “core vote”, she disregards any policy that doesn’t appeal to that core, or that might upset it. Instead, I tend to get a letter back that adheres firmly to her party line. Because of FPTP, that core vote blocks me from interacting with my MP in any productive manner; she does not feel she needs to represent me.

These twin problems of the Tactical Trap and un-representative representatives are common throughout the country, and are, I strongly believe, a large part of why so many have become fed up of, and disengaged with, politics.

And it’s led to a great cynicism from the major parties, too. Because, nationally, all they need to achieve is to be the largest party (although they’d prefer to get over 50% of seats, which isn’t usually much harder), they don’t even need to engage with every constituency to get into power. We have the curse of FPTP twice – once to elect the MP in the first place, and once to form the government from those MPs.

In fact, because of FPTP, safe seats and the futility of tactical voting, the parties generally only need to target 2% (yes, two percent) of the electorate at election time to achieve a swing that will put them in power. 65% of us may be unrepresented, but 98% of us are disregarded.

It might seem obvious that this situation, from the point of view of the electorate, needs to change, but it suits those in power quite fine. The same two parties have swapped power for nearly a century, with a rump made up of a handful of smaller parties who generally get little input into policy. To quote a member of the House of Lords I happened to hear speak recently,

“They know that the current system is the perfect one, because it’s chosen them”.

As it happens he was talking about unelected peers, but the same mentality applies to the majority parties’ view of the electoral system.

We need to move away from a system that is “perfect” for the incumbents to one that is at least a little more favourable to the electorate. But, since prevailing thought has been than a government voting for this would be “Turkeys voting for Christmas”, we’ve never had the chance previously.

But, this time, one of the turkeys blinked, and we’ve got a referendum on the Alternate Vote.

Now, to many people, a minor change in the voting system – after all, we keep our MPs, one per constituency, and an unelected upper house, might seem to be of interest only to academics and “political wonks”. And certainly, the No2AV campaign have been keen to support that view. After all, as noted above, the current system suits a lot of vested interests.

But does AV actually offer a significant benefit to voters over FPTP? Having taken a close look at it, and examined arguments for and against, I’m convinced it does.

Firstly, it solves the “Wrong Lizard” problem at a stroke. If your constituency has three humans to vote for, and two lizards (one of whom almost always gets in), you can give one or more of the humans your first (and second) choices, then list your least-loathed lizard last. That way, one of two things happen: either one of the humans gets in, because people can finally throw away the “tactical” desperation of always voting for a lizard, or your vote goes to your least-loathed lizard anyway. At worst, a lizard gets in, probably looking a bit more worried because they now know they aren’t a shoe-in, and need to be accepted by (if not actively preferred) by at least 50% of the electorate.

Of course, if you want to vote for a lizard, you still can. But as we’ve seen above, in the UK, most people don’t want the incumbent lizard.

Whoever is now in power, they know that they can no longer rely on their “core vote” as adequate to keep them in power; they need to engage with people for whom they might not be the first choice. Even if the incumbent is the same, the representation will be wider.

But, if the unnamed lizard planet above were to introduce AV, it wouldn’t always be the same incumbents. In the first AV vote, chances are than a certain minority of seats would go to humans. The cosy system of government would have been disrupted, and more people seeing this would realise that they had a choice in voting. In the next election, the minority of humans might become larger, or a majority.

Of course, talking about lizards and humans does make this look very “them and us”. But, while writing “squeezed out parties with a potentially wide base of support” and “traditional incumbent parties” is rather unwieldy, the meaning is much the same.

So, enough about lizards, and so long, Douglas Adams, and thanks for all the political analogies.

If AV delivers a broader base of more responsive government, why aren’t we using it yet in the UK? There are several answers to this.

The first I’ve covered above; the current rules suit those in power under the current rules, and their financial backers and supporters.

The second answer might be a bit more surprising: we are using AV in the UK; not for elections to the British parliament, but in local elections, Scottish elections, elections within political parties (both Labour and Lib Dems for a start, I’m not sure about the Tories). Even the House of Lords, the most stalwart opponents of electoral reform, use it internally to elect new hereditary peers. It’s also used in trade unions, charities, and numerous organisations; anywhere, really that wants the best system to elect responsive, widely supported representatives. And it’s used around the world, for elections of all levels up to parliamentary.

It’s not a new idea (it was invented in 1871), and it’s not untested. It just doesn’t suit some people’s agendas.

However, it’s possible to be opposed to a policy that doesn’t support you, and still have valid arguments; indeed, for that policy to be a bad one. So is AV a bad idea after all? In order to work that out, I’ve tried to look closely at several of the No campaign’s arguments.

However, to be blunt, I've yet to find an argument rating FPTP over AV that's stood up to more than fairly basic scrutiny. This might be why we're also seeing an increasing number of ad-hominem attacks from the No campaign, variously name-calling the pro-AV campaign as "Foolish", "Fraudulent", or "Dishonest", without ever clearly (if at all) explaining why. Troubling behaviour from an organisation seeking to define the nature of future British elections.

Perhaps no-one’s told them that voters don’t like negative campaigning. Which is also something AV might help with as, rather than just knock down their key opponent, politicians seeking election under AV will have to show their own worth to a wider selection of the community. Two front-running candidates that spend too much energy attacking each other under AV will just ensure they both shed first-choice votes and sink below the required 50% support.

It's not just the tone of campaigning that FPTP distorts, either. Because it splits the votes of parties sharing common ground, it compels parties to minimise shared values (often shared by most voters, too) and instead concentrate on carving out as distinct a territory as possible, then try to pull voters into that territory, deforming and polarising the political landscape in the process. As AV does not force this sort of polarisation and confrontation, it allows parties to work in the common ground they share with voters and each other.

One argument that No2AV have made recently is that it’ll “Voting Yes will cost too much”. I’m not sure who decided that improving democratic accountability had to be cheap, but in any case the £250 million figure that’s being quoted as “the cost of voting yes” is absolute rubbish. It combines the cost of running the referendum, and the cost of campaigns for both sides (all of which arise whichever way the vote goes) with what appears to be a high estimate for the cost of electronic voting machines which might not be needed even if we did switch to AV voting; most locales using AV don’t use them.

Even the worst-case realistic figures for AV (if it costs any more) only seem to come out to two or three quid per voter. It’s certainly both cheaper and quicker than any form of multiple-round voting, while still having many of its benefits. Hence its alternate name of “Instant Run-off Voting”, as it emulates multiple run-off rounds of voting in turn.

The “need for electronic counting machines”, by the way, is a useful bit of misdirection for the No campaign, as it makes AV seem complicated and impenetrable. This is just a bit of scaremongering; AV (when not deliberately confused) is easy to understand; boiling down in our earlier example to “vote for the human you really want to win before the lizard you’ll accept”. AV elections can easily be counted by hand, too; they are in most countries where they occur. It just takes a marker pen and a bit of patience.

Alleged complexity of counting aside, the No campaign seems to have backed off from claiming straight out that “AV is too complex for British voters” when people started objecting to being painted as less capable than Australian, American, Irish, Scottish, Fijian (etc) voters.

The No campaign also want to have their argument both ways; as well as arguing it’s too large a change, they also claim (sometimes on the same page) that it’s far too small a reform for “true reformers” who should therefore vote against it. Given the options currently available for reform, this is a bit like saying you should refuse any lottery win that isn’t the jackpot. To add to the confusion, they then say that AV might lead to further changes later (surely, a benefit to the pro-reform voters they’re telling to block it), so that even anyone who does support minor change should vote against AV. So; it’s both too much and not enough reform; it’s a compromise and so should be refused.

The fact that they see compromise as something to be avoided may tell us something about the No campaign, and their preferred methods of government. They typically refer to “Government without Compromise” as “Strong Government” – but they don’t tell us quite why we need such a bull-headed, unresponsive leadership. One might think that we’d most need “strong” government in times of war, but of course in both the First and Second World Wars we switched to “National Unity Governments” as the real source of stability. Minor wars fought since then have not typically reflected so well on our leaders.

Another claim that seems to be gaining in popularity as all other No2AV arguments sink beneath the waves is that it violates the principle of “One man, one vote” (or more currently, “One Voter, One Vote” or OVOV). This argument works to some extent because people find votes emotive and hard to put a mathematical value on. The claim is that, if you get to switch your vote, you’re getting more voting power than some voting directly for the eventual winner.

But before we ask whether AV violates OVOV, are we sure FPTP really delivers it? Let’s look at how many votes it takes to elect an MP under the current system.

10,706,647 voters voted Conservative in the last election, returning 306 MPs, meaning 34,989 votes were required for a Conservative MP

8,604,358 voters voted in 258 Labour MPs, at 33,350 votes each. A slight discrepancy, but not too alarming.

But then it goes downhill.

Almost as many people voted Liberal Democrat as Labour - 6,827,938 voters. But they only got 57 MPs each, at a cost of 119,788 each. That means a Liberal vote has an effective weight of about a quarter of that of one for either of the traditionally incumbent parties. And if you look at the Green vote, you find that 285,616 returned one MP – almost 10 times the cost of a Labour or Tory vote.

So, while FPTP claims to stand for “One Voter, One Vote”, if some of those votes are worth more than others, that’s a fairly hollow victory in terms of voter equality.

Of course, as we vote locally, not nationally, the actual power of a vote varies massively by location. Estimates are that votes in some regional areas are effectively 500 times more powerful than those in the safest seats – which is why that 2% of voters mentioned above gets all the attention in election campaigns.

It’s interesting to look at another No2AV argument here – that a person’s second choice shouldn’t be worth the same as someone else’s first choice. They say that some choices should be worth less than others. It seems that they’d like to build unfairness into the system. But people already cast second and third choice votes under FPTP, and they’re already counted the same as first choices. The difference is that, under FPTP, many people never get the chance to express their first choice vote (as they feel it’ll be wasted), and so no-one knows how many people are casting a vote that for them is second-best.

So, FPTP’s unbalanced, but does AV, in guaranteeing that everyone can cast the one vote they want to, suffer a potentially worse problem? Does it really give someone two (or more) votes? Well, it’s never (as far as I know) been tested by law in the UK, but a Michigan judge ruled in the US, where AV is known as “Multiple Preferential Voting”, that:

Under the 'M.P.V. System', however, no one person or voter has more than one effective vote for one office. No voter's vote can be counted more than once for the same candidate. In the final analysis, no voter is given greater weight in his or her vote over the vote of another voter, although to understand this does require a conceptual understanding of how the effect of a 'M.P.V. System' is like that of a run-off election. The form of majority preferential voting employed in the City of Ann Arbor's election of its Mayor does not violate the one-man, one-vote mandate nor does it deprive anyone of equal protection rights under the Michigan or United States Constitutions.

So, legally, and logically, AV fits “One Voter, One Voice” at least as well as FPTP.

To confirm this while avoiding the emotive maths of voting, let’s look at an equivalent (and familiar) example – with no lizards, I promise.

You’re in a pub, with a bunch of friends. You’ve just got there, so you don’t know what they serve, but you can guess that they’ll have at least the normal two bland lagers – which you don’t particularly like, but they beat a dry throat.

Someone stands up and says they’ll buy you a drink. What would you like?

A typical answer might be “A Green’s Cider if they’ve got one, otherwise a Gold Lager”.

This is an “alternate vote” for a drink. If the person offering to buy told you to stop being cheeky, they only offered to buy one drink, you’d probably think them a bit of a prat. Yet this is the logic that claims that AV gives “Cider lovers” two votes.

Having established that the person buying the drinks is a No2AV supporter, you have a conundrum. If they don’t have the cider you want, and you ask for it, you’ll get nothing; in the absence of the second round of voting which AV (much more quickly and cheaply) emulates, you’ll go thirsty. Otherwise, if you ask for the lager, and later realise much of the rest of the pub is drinking cider, you’ll feel (justifiably) hard done by.

FPTP isn’t good enough to choose a pint, although it might suit the big breweries. Why on earth should we choose it to elect politicians?

(Oh – PS: I forgot the “AV will let in fringe parties” canard. MPs have to be accepted by 50% of the community under AV – that’s not going to let the BNP in. In fact it's more likely than FPTP to keep them out, which is probably why they oppose it.)


So what's an iPad for, anyway?

2010-05-30 13:56:00

Now here's a test - I'm trying to touch-type this on my iPad in a coffee shop. I suspect I need to trust to the autocorrect feature!

These are a few of the ways I've found myself using the iPad recently.

TV: streaming from the Elgato EyeTV in my laptop. For films, the built-in video functionality and/or Air Video.

Digital photo frame - built in functionality, or use FlickStackr for remote pics. With the camera adaptor kit, it'll also be a really good in-the-field preview device for my DSLR.

Book (or bookshelf). ePub functionality's built in (iBooks) but it's pretty good on PDFs too, particularly if you add Goodreader.

Magazine / comic. Numerous apps, particularly Wired, Comics, Marvel, Zinio.

Remote keyboard (yes, really - it's almost touch-typable, and I suspect with practice it'll get easier. Plus, for those occasions when you're not actually at the keyboard, you're probably not trying to type a great deal anyway). Touchpad's my current app of choice for this. The standard Apple iPad case puts the screen at a pretty good angle for this, or for TV/film/photo use the other way around.

SSH terminal - remote server admin. iSSH is excellent, and apparently even includes an X server. Plus, VNCLite when you need full GUI access.

Secondary monitor - Air Display seems to work for everything short of full-motion video.

Journal. Yes, you really can type fast enough on this for it to be useful. But you need to cut your fingernails short or it won't register some hits! Or use an external keyboard.

Meeting notes - it feels less invasive to use an iPad than a laptop in a meeting, and Soundpaper is excellent as it keeps an audio recording of the meeting that's synchronised to your notes. No more "but what did we agree!?!"

Weather station - WeatherBug and AccuWeather are both useful for quick reference.

Of course there are also masses of games available for this thing, and things like Adobe Ideas are quite fun for doodling. Plus Twitter clients galore, Skype, and so on... And all the things I tend to use on the iPhone for language learning - dictionaries, flashcards etc

I'm sure I'll think of more later, but for now I'm quite pleased at how usable and versatile this thing is...

Ah, I've not mentioned web or email - presumably they go without saying, don't they?

(I've cleaned up a few typos in this on my laptop and added the app links in).