Why people don’t cycle more

Short answer: because car drivers are arseholes.

Long answer: I’m cycling home, and there’s a pinch point where the kerb on each side renders the road wide enough for one car only. And, since I’m cycling—and because I’m cycling defensively, i.e. taking the lane rather than cowering within a centimetre of the kerb—the car behind can’t get past until the road widens again in about 20m. The **** driving the car beeps.

Beep-beep-beep-beep! Beep-beep-beep-beep!

What am I supposed to do? Not exist? (Hint: the correct answer is, apparently, yes.) Should I stop, mount the kerb, and defer to my master in his automobile? Does owning a car also give you ownership of the road?

As the road widens, the car pulls past me. The driver slows and enquires threateningly:

Do you want to get killed?

Fuck this Nietzschean bullshit.

That’s why people don’t cycle more.

A cock-up, not a conspiracy

It turns out that the reason that iPlayer TV downloads aren’t working is not that the BBC have changed anything. It’s just that their system’s broken down again for the second time in a couple of weeks. A page on the iPlayer Help system currently announces:

There is currently a problem with the availability of content on BBC iPlayer on iPhone, mobile WiFi and 3G.

My downloader emulates an iPhone, so if you can’t download something at the moment, that’ll be why.

iPlayer TV downloads are broken

Updated information on the problem: there’s a problem at the BBC’s end

For all that the BBC is nominally the British Broadcasting Corporation, they’re doing a rather good job of making sure that the only way to receive iPlayer content is through US software companies: Microsoft, Adobe, and Apple. I wouldn’t go so far as to call this traitorous—I’ve never been a big fan of nationalism—but it doesn’t seem particularly helpful to the digital economy of the UK in the longer term.

In the past couple of weeks, the BBC turned on SWF verification on the iPlayer RTMP servers, breaking clients using that method—notably the widely-used iPlayer streaming plugin for XBMC.

This didn’t affect my downloader which—in case you weren’t aware—works by imitating an iPhone (or iPod Touch).

I don’t have an iPhone: I have an Android phone. If the BBC hadn’t gone to such absurd lengths to ensure that only iPhones can access the HTTP/h.264 version of the iPlayer, I’d almost certainly be able to use it. As it is, I can’t. It’s this short-sightedness and bad faith that keeps me motivated to work on ways to circumvent these stupid, audience-hostile restrictions.

As of today, however, it appears that my downloader can no longer retrieve TV content from the iPlayer. Radio still works. I’m not yet sure what has changed, but I expect to have a fix in the next few days.

More Westminster woo-woo

Since last I wrote about it, several more MPs have pledged their support for the Dark Arts in the form of EDM 908 in defence of homeopathy.

Here’s the updated score card:

Tredinnick, David Conservative
Simpson, Alan Labour
Russell, Bob Liberal Democrats
Pound, Stephen Labour
Dismore, Andrew Labour
Simpson, David Democratic Unionist
McDonnell, John Labour
Campbell, Gregory Democratic Unionist
Cohen, Harry Labour
Corbyn, Jeremy Labour
Drew, David Labour
Gray, James Conservative
Hancock, Mike Liberal Democrats
Hermon, Lady Ulster Unionist
Key, Robert Conservative
Hemming, John Liberal Democrats
Bone, Peter Conservative
Davies, Dai Independent
Mates, Michael Conservative
Dodds, Nigel Democratic Unionist
Wyatt, Derek Labour
Sarwar, Mohammad Labour
Hamilton, Fabian Labour
Winterton, Nicholas Conservative
Davies, Philip Conservative

And scaled by the number of MPs in each party:

Party Signatories Total MPs Proportion Last time
Conservative 7 193 3.6% 1.0%
Labour 10 346 2.9% 2.0%
Liberal Democrat 3 63 4.8% 3.2%
Democratic Unionist 3 8 38% 25%

The Lib Dems have consolidated their top ranking among the main parties, whilst the DUP pull out even further in front overall. In a shock upset, however, the Tories have lost their place as standard-bearers of rationality to Labour.

If you liked this, you might also like the Quackometer’s take on the subject.

Old sea forts and 6Music

Do you care about old sea forts?

I don’t care about old sea forts. At least, I didn’t until I saw an excellent presentation on the topic at Ignite London 2 tonight. In fact, it was one of the outstanding talks of the evening.

This is a fundamentally important aspect of planning/organisation/curation/whatever you want to call it, I think: giving the audience both crowd-pleasing favourites and unexpectedly brilliant gems.

It’s something that Radiolab does really well. I never expected to be interested in what pets are thinking, but it turned out to be fascinating. When you lend your attention to a skilful guide, you can be taken to places you’d never have gone on your own.

The proposed closure of BBC 6Music has raised the ire of its small but loyal listenership for a good reason: it’s a genuinely excellent station. It’s excellent because it’s made by and for people who love music—this is genuinely unusual in the modern broadcasting environment—but it’s also excellent because of the breadth of its programming. Listen to 6Music for an hour and you’ll hear tunes you’ve never heard before—tunes spanning five decades—selected by people who really care about them.

If you listen to Radio 1, on the other hand, you won’t be challenged in the same way. Radio 1’s listeners may not care to be challenged, but that doesn’t mean that they shouldn’t be. Public service broadcasting needs to provide something significant beyond populist top 20 X-Factor pablum—that’s amply catered for in the commercial sector. The loss of 6Music is so depressing precisely because it is closer to what Radio 1 should be.

Modern communications give us many more avenues of expression than existed a few decades ago, but it comes at a cost: for each specialised community that forms, some attention is diverted from the mainstream. If this leaves the mainstream to the lowest common denominator—some kind of mediocre comfort zone—then society as a whole is poorer. We mustn’t let diversity and excellence be ghettoised, even if they are very nice ghettos.

That’s all for tonight, but I need to think about this further.

Goodbye to free Wi-Fi?

The Digital Economy Bill factsheet on Online Infringement of Copyright: Libraries, Universities and Wi-Fi Providers [PDF] (context) raises some serious questions about the legislative competence and technical expertise of the people drafting the Digital Economy Bill. It also describes a bleak future for public access networks.

One of the significant problems raised by the factsheet is the fact that, whilst the bill divides the world into subscribers and ISPs, the real world is less sharply delineated. People and organisations that might reasonably be considered to be providing an internet service may nonetheless be subscribers in the reductive world of the bill. This leaves them open to the risk of sanctions for infringement perpetrated by others using their network, and makes it an unattractive proposition to run a public access network.

Here are some quotes from the factsheet, annotated with my comments and analysis. The first section of the factsheet looks at libraries.

[Library] Firewalls do not allow access to a number of sites, such as those containing Flash technology (these firewalls are generally for security rather than file-sharing reasons)

Do they even know what firewall means in this context? What has Flash got to do with copyright infringement? Why are they bringing this up? It’s just filler.

Libraries will have a filter system, which should block access to known unlawful sites—although it is difficult to update filters often enough to keep up with new file sharing sites

Given that it is difficult to implement effective filtering (even the Chinese government struggles, and it has significantly greater resources than a local library), it’s impossible to rely on filtering to prevent infringement.

Where access is via a library fixed terminal the key factor is that library machines do not have P2P software and are set up to block attempted downloads and installation of the software. For fixed library terminals it is unlikely therefore they can—or could—be used for copyright infringement via P2P networks.

Why this obsession with P2P? The internet is inherently a network of peers, but let’s skip over that to the widely-accepted definition of what peer-to-peer means. P2P technology is orthogonal to copyright infringement. Copyright infringement occurs via non-P2P means, just as P2P is also used for non-infringing purposes. There are many ways to infringe copyright over plain old HTTP. Want me to show you some?

The factsheet moves on to the particular issue of wireless access in Libraries.

There are measures that can be placed on wireless networks to either restrict access to sites or restrict use of certain technologies or protocols (for example routing all traffic through a proxy server which did not support the use of particular technologies).

Except that they’ve already accepted the difficulty of comprehensive filtering, and, as I’ve said, copyright infringement can still take place over pedestrian protocols like HTTP and HTTPS.

We have considered the extent to which an exemption [for libraries] might be provided in the legislation. We cannot give blanket exemptions for any such establishment. This would send entirely the wrong signal and could lead to “fake” organisations being set up, claiming an exemption and becoming a hub for copyright infringement.

‘We are too incompetent to draft an effective bill. We consider “sending signals” to be more important than access to learning and the free exchange of ideas.’

The next section addresses universities.

Without examining the situation for each university and their relationship with JANET, it is not possible to say whether JANET is acting as an ISP or not; nor is it clear whether a university is a subscriber, ISP or is simply not in the scope of the Bill.

It is hard to believe that the authors of the bill did not consider the existence of universities. It’s easier to believe that they simply ignored everything that doesn’t fit into the simplistic ISP/subscriber model, leaving it to universities—in this instance—to clear up the mess.

Finally, we find out about public access wireless networks. This is where the bill’s ISP/subscriber model fails particularly badly. The factsheet is overly concerned with available bandwidth, and seems to misunderstand the nature of internet provision in this country and to assume that infringing files are always large files.

The type of free or “coffee shop” access is a basic bandwidth service which offers users access to e-mail and web browsing.

It’s frequently a bog-standard ADSL line hooked up to a consumer router. This is a cheap and effective way of providing wireless access in a small establishment. There’s no substantive difference between this and a home connection.

It is seems [sic] unlikely that the type of free broadband service currently available would be sufficient to support any file-sharing or could be used for significant copyright infringement.

Even if bandwidth is an issue (which it probably isn’t; see above), how much bandwidth is needed to copy a book? Electronic book readers (and rapacious pricing of e-books themselves) have made this an appealing form of copyright infringement. The bandwidth argument is both short-sighted and ignorant.

Under our proposals such a service is more likely to receive notification letters as a subscriber than as an ISP.

There are two main problems:

  1. It’s not completely clear whether a public access network is an ISP or a subscriber for the purposes of the bill, but
  2. A subscriber is responsible for any infringing activity that takes place on its network.

The factsheet offers no solutions to this, apart from some lukewarm suggestions.

Enabling the privacy/security features of the router, if these are available.

This may be useful for other reasons, but will not prevent infringement.

Installing Firewalls that do not allow access to a number of sites, such as those containing Flash technology

What’s Flash got to do, got to do with it?

Filters to block various sites

Again, this might be a good idea—porn browsing can put off other customers—but it’s not going to prevent infringement taking place.

Acceptable conditions of use policy – a “conditions of use” policy, which users have to agree to before getting access to the network, for example no unlawful activity including copyright infringement is permitted.

Hahahahahaha. Oh. That’s a serious suggestion? They’re actually relying on the honour principle now?

The only seriously useful suggestion is this:

One option is to route all traffic via a proxy server which does not support or allow (eg) use of file-sharing technologies.

Unfortunately, this is technically complex to set up and does not actually remove the risk of infringement.

In summary, people and organisations running public access networks are put in a difficult position. They may well be subscribers under the terms of the bill, even though they are providing internet access to others. As subscribers, they take the risk for copyright infringement carried out on their network. This risk cannot be eliminated by any technical or social measure.

There are likely to be two outcomes from this bill:

  1. Many small establishments offering free Wi-Fi turn it off, and
  2. £5/hour paid-Wi-Fi companies take over some of the market that used to be free.

To put it another way: say goodbye to free Wi-Fi.

Westminster woo-woo

Which political party is the wackiest?

Homeopathy is literally incredible. It is predicated on the notion that a substance, even when diluted 1060:1 in water to the point where not a single molecule remains, still exerts some curative influence—and, in fact, that that influence is somehow increased by the dilution. Even when that water has been evaporated away to make sugar pills. Oh, provided that you shook the water properly, that is.

It ought to go without saying that this is not supported by any existing model of science, but that doesn’t matter. What does matter is that homeopathy empirically doesn’t work: in trials, it has been shown to work no better than a placebo.

Earlier this week, the House of Commons Science and Technology Committee published Evidence Check 2: Homeopathy [PDF]. The report is scathing:

In our view, the systematic reviews and meta-analyses conclusively demonstrate that homeopathic products perform no better than placebos.

The Government should stop allowing the funding of homeopathy on the NHS.

It is unacceptable for the MHRA to license placebo products—in this case sugar pills—conferring upon them some of the status of medicines.

This was fairly uncontroversial in the reality-based community.

Meanwhile, at Westminster, the member for Bosworth (a man who believes that lunar phases inhibit blood clotting, and, it is alleged, claimed £700 on expenses for astrology software) swung into action with an Early Day Motion defending homeopathy:

That this House expresses concern at the conclusions of the Science and Technology Committee’s Report, Evidence Check on Homeopathy; … believes that evidence should have been heard from primary care trusts that commission homeopathy, doctors who use it in a primary care setting, and other relevant organisations, such as the Society of Homeopaths, to provide balance; …

The signatories at this time are:

Tredinnick, David Conservative
Simpson, Alan Labour
Russell, Bob Liberal Democrats
Pound, Stephen Labour
Dismore, Andrew Labour
Simpson, David Democratic Unionist
McDonnell, John Labour
Campbell, Gregory Democratic Unionist
Cohen, Harry Labour
Corbyn, Jeremy Labour
Drew, David Labour
Gray, James Conservative
Hancock, Mike Liberal Democrats

That’s 2 Conservative, 7 Labour, 2 Liberal Democrats, and 2 DUP. So on the face of it, Labour are the most woo-woo. But Labour have more seats than anyone else. Let’s scale it by the number of MPs in each party:

Party Signatories Total MPs Proportion
Conservative 2 193 1.0%
Labour 7 346 2.0%
Liberal Democrat 2 63 3.2%
Democratic Unionist 2 8 25%

So there you go. Of the main parties, the Liberal Democrats are the wackiest with a full 3.2% supporting homeopathy, while the Conservatives are the most rational: only 1.0% of their MPs have signed the EDM. Meanwhile, the Democratic Unionists are way out there: a full quarter of their MPs have signed up to defend quackery.

Footnote: Please do not bother to leave any comments of the ‘I tried homeopathy and it worked for me’ variety without reading up on and understanding regression to the mean, the placebo effect, double blind trials, experimental design, and sample sizes* first.

* Yes, I know. ;-)

I don’t like comments

As a general principle, I don’t like comments in source code. It’s not that I consider them onerous to write, I just don’t think that they’re very useful, for three reasons:

  1. They’re not synchronised with the code they describe, and their accuracy can deteriorate over time.
  2. They’re often a substitute for clearly-structured code
  3. They make source code longer, which can obscure the underlying logical flow.

That may sound controversial to some people: extensive commenting is still in some quarters considered an essential discipline of computer programming. But I use modern, expressive programming languages that allow me to communicate a lot more in the code itself.

Here’s a good Ruby example I encountered earlier in the week (I’ve broken the second line to make it readable on the site):

# pick the lowest total entries
pager.total_entries = kittens.total_entries > puppies.total_entries ? 
  kittens.total_entries : puppies.total_entries

You might legitimately ask why the comment’s there at all. It’s not as if it tells us anything we couldn’t work out by reading the second line, right?

Except … the second line is a bit long, and actually needs a bit of thought to decipher it—and when we do so carefully, we find that the code is doing the opposite of what the comment says: it’s finding the highest total entries.

It turns out that the code is right, and the comment’s wrong—we might have expected that, because there are tests to ensure that the code does what it’s supposed to. So what’s the comment doing, again, except for misleading us?

There’s no blame to be apportioned here—this is a natural consequence of trying to explain a long line of code—but we can improve it. Instead of using a comment to explain what’s going on in this line, we can get Ruby to do it for us:

pager.total_entries = [kittens.total_entries, puppies.total_entries].max

In less space than the original, that clearly conveys that we are choosing the maximum of two values. There was nothing wrong with the original code, it’s just that our programming language has a better way of doing it.

It’s a trivial example, but a good principle: use descriptive code instead of comments. The desire to add a comment is often a good indicator that the code itself can be made clearer. By choosing good variable names, extracting functional chunks of code into clearly-named methods, and taking advantage of language features, comments become mostly superfluous.

There is still a place for comments: sometimes, a program has to do something counter-intuitive that can’t be explained by the code. But these cases are relatively rare.

Fake gems

I tied together a couple of RubyGem irritations and an idea tonight.

The first is the Hoe problem. Hoe is a gem that helps people write gems. However, it also metastasises, making itself a dependency of those gems in turn. The result is that if you install a gem that was created with Hoe, you end up having to install Hoe. And yet Hoe is useless unless you’re actually developing that gem. Even then, it doesn’t really add anything.

That was historically the case, anyway. RubyGems now has the notion of development dependencies, and newer versions of Hoe are polite enough to use that. As a result, simply installing a Hoe-dependent gem for use won’t install Hoe.

… unless the gem is old, or was created with an old version of Hoe, or depends on a gem which in turn was created with an old version of Hoe. And that turns out to be rather a lot of gems. It’s almost impossible to avoid Hoe.

I admit, it’s not a huge burden to have to install Hoe. But being reminded of the annoyance earlier in the week made me wonder: what if we were to create an empty/stub/null gem that was called Hoe? We could install that instead. The dependency would be satisfied, and we’d never actually have to install Hoe.

The second irritation came to mind because I reinstalled Ubuntu on my laptop last weekend. I preserved my home directory but reinstalled the OS itself from scratch. As a result, I’ve been slowly reinstalling dependencies over the past week as I find them lacking.

I installed Mechanize via apt-get—it depends on Nokogiri, which requires a binary module which in turn depends on a couple of libraries (libxml2 and libxslt, I think). It’s a lot easier to install one package and have the package manager satisfy the dependencies than it is to find the dependencies, install those via the package manager, then install the Ruby library via RubyGems.

However, RubyGems doesn’t know that I’ve installed Mechanize or Nokogiri. If I install a third package via RubyGems that depends on either of those two, I’ll end up installing them again.

Creating a fake gem that would make RubyGems think that it’s already got, say, Nokogiri 1.3.1 installed would prevent RubyGems from building it unnecessarily.

So that’s what I’ve done. I’ve written a small library that extends RubyGems with a gem fake command. It installs an empty gem of the specified name and version, fooling RubyGems into believing that the dependency is satisfied. The default version is 99.0.0—that should be high enough that it will supersede any actually existing gem versions.

You can install it via:

gem install fake-gem

To prevent Hoe from getting installed:

gem fake hoe

To say that Nokogiri 1.3.1 is already installed:

gem fake -v 1.3.1 nokogiri

You can find more information along with the code at GitHub.

Ruby 1.9 support for iplayer-dl

I’ve fixed the small problem that prevented iplayer-dl from working with Ruby 1.9.

You can get it by installing iplayer-dl version 0.1.19 via RubyGems or by fetching the code from GitHub.

I’ve not made any changes to the Windows package. It’s not affected by this change.

Other improvements in 0.1.19:

  • Proxy authentication is supported
  • Dates in filenames will be converted from DDMMYYYY to YYYY-MM-DD. This means that they’ll sort in the expected order in directory listings.