bma's journal


Mon, 29 Jun 2009

Increasing the Civil List

According to the Grauniad, the Queen lacks the funds “to properly maintain some royal residences”.

Surely this means that the royalist claim that the Queen earns for the country more than she costs is on somewhat shakier ground?

If nothing else, I find it very hard to muster up any sympathy for the fact that she can’t maintain all of her various residences; most people manage on much less than £41.5m a year, partly by only having the one house to live in.

(Incidentally, I heard recently a response to the argument that the monarchy earns plenty of money through tourism: France has been a republic for most of the last two centuries, yet people still come to visit Versailles and many other French palaces and so on.)

[/politics] #

Fri, 22 May 2009

Tory Leaflets

So today we’ve had leaflets from the Tories and Labour. In fact, we’ve had quite a lot from the Tories; they sent one to each voter registered at this address (that’s four). Obviously they realised that we’d each want to have one to ourselves, rather than having to share. They also sent them by post, rather than just sticking them through the letter box; does the Conservative Party have nobody willing to volunteer to spend some time delivering leaflets for them?

My first complaint is about David Cameron’s statement in it. Not particularly with anything he says in it (well, okay, that too) but just the lack of any demonstrated writing ability. I hope he got someone else to write it for him, and I hope he fired that person. Somebody with a First from Oxford should know, for example, that sentences can’t start with conjunctions, and a politician should know that “Euro-MPs” are actually called MEPs.

Next is that in the section of the leaflet quoting newspaper headlines that make Labour look bad, they couldn’t find any more reputable than the Daily Mail, the Sun, the Daily Express, and the News of the World. (Well, one from the Daily Telegraph. One out of eight’s not bad, right?)

On to actual policies, rather than just the Conservative Party’s embarrassing attempts at telling people about them.

“Voting to keep the UK’s opt-out from the EU Working Time Directive, allowing people to choose how much overtime they work.”

Now, for anyone who doesn’t know, the WTD limits working hours to 48 hours a week, averaged over 17 weeks, and mandates a rest period of 11 hours in each 24 hours. That’s nearly seven hours a day, every day of the week (6 hours 51 minutes) — seven hours doesn’t sound like much, but I must say I’d quite like to have a weekend, and to have just one day off a week pushes that up to 8 hours a day. Now, I realise this is about overtime, not ordinary hours — but if I was having to work from nine in the morning until gone nine in the evening from Monday until Friday (9.6 hours over five days, plus mandatory 0.5 hours lunch break) then I don’t expect I’d be going out of my way to try to do some more.

The WTD is not intended to screw people over who want to do some overtime occasionally; it’s intended to stop people working such long hours as to be dangerous. If you’re working a 50-hour week every week for four months, then you don’t need to opt out of the maximum — you need a better manager.

They go on to say that the WTD “could cause massive problems for our NHS and emergency services”. “Could cause”? It’s been around for 15 years, don’t you think that if it was going to it would’ve done so? Aside from that, if doctors and nurses not being allowed to work 50-hour weeks is a problem for the NHS, we don’t need to let them work more — we need more doctors.

“Local Conservatives have spoken of their “shock and disgust” at the continuing scandal of our fishermen being forced to throw away millions of tons of fish into the sea every year. Our fish stocks are in a perilous state and people are shocked at the amount of fish wasted each year due to a system that is immoral and environmentally wrong.”

Well, firstly, I’m not sure that you can say that something is “environmentally wrong”. Bad for the environment, certainly. However, the Tories don’t seem to explain what the issue is — merely that something is bad. I’m going to assume that what they want is for the fishing quotas to be raised, so that the fish don’t go to waste — since that’s what they’ve asked for in the past. I’m not sure how that is better for the environment, though: whether the fish are eaten or thrown away, they’re still dead. The real solution is not to catch so many in the first place; I realise this might make some people unhappy, but they’ll be a damn sight more unhappy if they don’t and cod are hunted to extinction.

I’m also amused by their claim to be “tackling climate change”. As I mentioned earlier, we received four copies of this leaflet — obviously the Conservative Party would like to make sure that everybody knows how seriously environmental issues are taken. Four leaflets when one would’ve done is frankly ridiculous — in fact, we’d’ve been happy with none, but that would mean I’d have nothing to mock this evening.

A final, unrelated point, found in Hansard when I was researching this article. Iain Duncan-Smith described Turkey as a “secular, democratic Muslim nation” — just how is it possible to be secular and Muslim at the same time?

[/politics] #

Sun, 17 May 2009

EU Elections

So the EU Parliament elections are approaching (4th of June). I was a little concerned by the number of right-wing anti-EU parties standing in the south-west region; at the very least, there are five (BNP, English Democrats, No2EU, Libertas, UKIP). That’s not counting the Tories, an independent whose policies I don’t know, various other obscure parties whose policies I’m not sure on, and ‘the Christian Party “Proclaiming Christ’s Lordship”’, (and yes, the quote is part of the name, just like Libertas are apparently officially “Pro Democracy: Libertas.eu”, meaning they obviously have a very different idea of what “democracy” means).

The wingnuts aren’t really a concern, though, since there’s only so many right-wing loonies who can vote for them; all it’s going to do is split the vote. What I’d like to know is why are there so many different small parties all with the same goal? Do they not realise they’re shooting themselves in the foot, competing with people who have ostensibly the same goals? Are right-wing loonies particularly prone to disagreeing with other right-wing loonies to the extent that they go and form their own political party, with hookers and blackjack? Certainly there don’t seem to be any redundant parties other than the right-wing anti-EU types.

There are a couple of other parties that caught my attention. Firstly, “WAI D”, who say that ‘The name “Wai D” stands for Your Decision. (YD)’. They appear to be trying to introduce direct democracy single-handedly, by setting up “an internet site where citizens will have the chance to express, at any moment, during the entire legislative process, their own opinions”. They also claim that the entire party is run “money-free”, apparently appearing to believe that it is some heinous crime for a government to actually spend money.

The “Fair Pay Fair Trade” party are also interesting; they appear to mean well, but they have some truly hilarious policies, like establishing a single world currency, free passenger rail transport throughout Europe, abolishing “most” prisons, and phasing out private vehicles and lorries. Not that I don’t think there should be more and cheaper rail transport, less road traffic, more cycle traffic, and so on, but I doubt it’s as simple as they seem to think. Their policy on water shortages, especially, concerns me: “The EU will ban the vast bulk of imported fruit and vegetables from countries with water shortages.” — thus bringing about the economic collapse of every one of those countries, as a major source of their income disappears? Maybe not, but I really don’t think it’s as simple as they appear to believe.

I got bored before looking up most of the rest. Mebyon Kernow I already know about, but I don’t believe their specific goals are more useful than, say, the Green Party’s (they appear to be basically a watered-down version of the Greens or Lib Dems, vaguely liberal/leftish leaning, with the specific additional goal of greater self-determination for Cornwall). The Jury Team and Pensioners’ Party I just couldn’t be bothered with. The Socialist Labour Party, again, I already knew of, and likewise (obviously) Labour, the Lib Dems, and the Tory scum.

Finally, the Green Party, whom I’m planning to vote for, since they have pretty sensible policies all-round, including things like abolishing the constitutional role of the monarchy and replacing the House of Lords with an elected body, and nationalising the rail network.

Update: the People's Republic of South Devon linked to this post.

[/politics] #

Fri, 08 May 2009

New GPG Key

I'm assuming everybody (everybody who cares, that is) has heard about the attack against SHA-1. Part of what this means is that 1024-bit DSA GnuPG keys are vulnerable; accordingly, I'm replacing mine.

The new key is as follows:

pub   4096R/166891C7 2009-05-07 [expires: 2010-05-07]
      Key fingerprint = B62D 05AE 65F4 DAFD DE2E  10E2 ABAE 113A 1668 91C7
uid                  Benjamin M. A'Lee <bma@subvert.org.uk>

My old key will expire in 90 days (or I'll revoke it, one or the other). I'll see about getting the new key signed (and resigning other people's keys) at some point.

[/tech] #

Mon, 04 May 2009

Object Abuse

One of the Javascript libraries we use at work includes a method called getLayersByName(). It has a parameter, name, described as follows:

{String | Object} A layer name. The name can also be a regular expression
literal or object. In addition, it can be any object with a method named
test. For reqular expressions or other, if name.test(layer.name) evaluates
to true, the layer will be included in the list of layers returned. If no
layers are found, an empty array is returned.

So, if you want to test using a function that returns true or false, similar to filter() in functional languages, you can't just do this:

var name = function(n) { var r = doSomeTest(n); return r; };

Instead, you have to do something like the following:

var name = {
    test: function(n) {
        var r = doSomeTest(n); return r;
    }
};

(Actually, there are several functions that work in a similar way, but this is the simplest one to use as an example.)

Why not check the type of the parameter and, if it's a function, call it directly rather than looking for a property? I have no idea. I'm assuming that originally the function was intended to take a regexp object, and the fact that it supports any object with a test() method is more by accident than design.

[/code] #

Tue, 14 Apr 2009

Javascript --- Some Thoughts

For most of the last 9 months, I've been working on a project called InterRisk; specifically, developing a web portal for viewing scientific data overlaid on a map. (The scientific data is marine-related, in our case mostly to do with algae levels around the UK and Irish coast). Anyway, most of the coding has been in Javascript; there was some PHP, but I'm trying to avoid it, and any new server-side code will probably be in Python because it's awesome.

Before I started, I'd done very little javascript, just a few toy programs and whatnot. Mostly my experience of it was through bloody annoying websites that use it unnecessarily.

What I've learned, though, is that it's actually a reasonably decent language --- yes, it has some misfeatures, and some things don't behave as I think they should (for (i in object), for example, which sets i to the index of the member, not the member itself like in python or sh). They're fairly minor, though, in my opinion, compared to some of the good features, like functions being first-class objects that you can pass around, for example as event handlers. (I know that quite a few languages can do this, but it was a surprise to learn that Javascript could).

The real spoiler, though, is browsers. If I could write an application that only had to support one browser, I'd be reasonably happy. At least, if the browser in question wasn't Internet Explorer. The variability in javascript support in the various browsers, though, is a serious issue; there are so many features that just can't be used because Internet Explorer 6 still needs to be supported (or even IE7, which as far as I know has almost identical javascript support to IE6). I don't know if IE8 will be an improvement, but it's hardly important --- it'll be years before IE6/7 are sufficiently rare to make using newer features safe in a portable application (mostly because there are organisations still using IE6, after more than two years --- I understand the arguments for not rolling out new software immediately, especially in large corporate environments, but two years? What the hell are you doing?).

(There is a bright side --- as I have no access to any IE6 machine at work, I have an excellent excuse not to support it. As mentioned, I don't think it makes a difference where javascript is concerned, but it's one less thing to worry about.)

Even discounting Internet Explorer for the moment, things aren't perfect; I've run into problems because, for example, Firefox allows things that Opera doesn't, when Opera's behaviour is actually the correct behaviour (but of course, I can't code to Opera's strict standards-compliance, because discounting Internet Explorer was only wishful thinking, and IE7 doesn't support the correct way of doing things that Opera mandates).

Not supporting large chunks of the DOM (DOM level 2 or 3, if I remember correctly) is okay, though, because I can just extend the Node object to provide wrappers --- if getElementByTagNameNS isn't defined, fake it using getElementByTagName instead. But oh, wait, Internet Explorer doesn't let you extend the built-in DOM objects. Why? No idea, but it means that I have to write a wrapper function for every browser to use, even if it supports the necessary methods natively. So much for that plan.

Then, when something goes wrong --- and it will --- you're sort of stuffed. While Firefox has Firebug, which isn't perfect but does the job well enough, and Opera has Dragonfly which was great while it worked but seems to have broken for me, Internet Explorer has...nothing. As far as I know. Extensive Googling has, at least, turned up nothing. IE7 seems to have only about two or three javascript error messages anyway (which at least is more than ed, which makes do with one --- ? --- but they aren't much more helpful), so it's back to alert() and popping up the value of variables at a dozen different points throughout the application. (I assume Microsoft expect people to fork out for Visual Studio or something to get access to a debugger. Sod that, all I want is useful error messages and a DOM inspector)

Anyway, this has turned into more of an Internet Explorer rant than a Javascript rant. As I mentioned, no browser is perfect, but some are less perfect than others, and as Internet Explorer is still ⅔ of the browser market, it's proportionately more of an issue than Opera or Safari, or even Firefox, would be if their javascript implementation was as poor.

[/code] #

Mon, 13 Apr 2009

Failed Weekend

So, this weekend I've had four and a half days off (Thursday lunchtime onwards) and, given my usual lack of planning, didn't have anything in particular lined up when I got home from work on Thursday. Well, other than fix my bike, which had been sitting in the yard for two weeks (the first waiting for me to get around to getting new tyres, the second waiting for me to find the well-hidden puncture). Incidentally, I did that, so that probably makes this a successful weekend.

Anyway. Friday was a waste. Saturday morning Dan texted and suggested a Dartmoor trip, so Gem drove us and Gareth (plus her sister and sister's dog) up near Sheepstor. We wandered around a bit, but failed to find any letterboxes, then drove out past Princetown to have a barbecue. Then it started hailing. Seriously. So we went back to Plymouth, where it was actually quite nice, and had the barbecue in the back yard, then watched some Red Dwarf.

On Sunday, Gem, Dan, and I went up to Bodmin Moor --- walked from Minions up around Cheesewring for a couple of hours, and this time I actually remembered my camera. Haven't actually looked at the pictures yet, though, so I don't know if any turned out particularly well.

Today I did bugger-all again; the nice (apart from the hail) weather apparently has given up, so going out wasn't really tempting. Back to work tomorrow; at least it won't take half an hour to get there or back now.

[/life] #

Copyright © 2004-2009 Benjamin M. A'Lee.
Licence: simple permissive licence (ISC, BSD-style).
Feel free to link to a post, or to quote a post as long as appropriate credit is given. I'd appreciate you letting me know, however.