Another candidate drops out of ‘08 race

November 15th, 2007

The Onion nails it.

Minesweeper is NP-complete!

November 15th, 2007

Richard Kaye’s work on Minesweeper is a lot of fun to read. He first proved that Minesweeper is NP-complete (though the article in The Mathematical Intelligencer isn’t available online, unfortunately), and has a very neat paper that demonstrates some logic circuits in the game (the AND gate is truly impressive). I suspect that his latest paper, “Infinite versions of minesweeper are Turing complete“, is even more interesting, but I don’t know enough about the area to properly appreciate it.

Stock exchange in Erlang

November 10th, 2007

Joel Reymont has a kinda unusual programming background, having written big programs in Erlang, Common Lisp, Haskell, and OCaml. As you might expect, he has plenty of interesting things to say about them. (John Wiseman has some more info including quotes whose original sources seem to have disappeared.)

Joel wrote recently that he’s working with Pragmatic Programmers on a successor to Programming Erlang, and today announced that, as part of it, he’s going to build a stock exchange app with Erlang, Mnesia and EC2. Joel has a lot of experience here, and it sounds like it could be a great project. I’m really looking forward to seeing how it goes.

Update (30/1): Looks like it’s no more.

Tracking time

November 9th, 2007

A few weeks ago, I realised that I didn’t really have much idea of where the time I spent on my computer actually went, so I wrote something to track it. I just came across RescueTime, which seems to set out to solve this problem, but hasn’t launched yet. While I’m sure they’ve done a good job of things, I don’t really like the idea of using something that phones home here (though I can see why they’d love to have the data), and I’d also like to be able to analyze the data in different ways (with a spreadsheet, some custom script, Dabble, or whatever), rather relying on whatever they build.

So if anyone’s interested, I’ve uploaded the code I use. It’s very simple-minded—to track idleness, it waits for the screensaver process to start, so you probably want to set a low timeout; doesn’t daemonize; when storing URLs, it assumes you’re using Safari; and is also OS X-only. But maybe somebody can build something more interesting on top of it.

A README is still to come, but to get started, use something like:

$ sh time/time-log.sh &!

I’m not quite sure how, why or when this happened…

November 8th, 2007

…but apparently myself and John now feature in an Irish textbook.

Islam in Europe

November 7th, 2007

I’m hesitant to write anything about Islam in Europe. Its mention seems to be subject to a political form of Godwin’s Law[1]. And yet it’s hard to read something like Paul Belien’s latest piece, published today in The Washington Times, and not react in some way.

Belien’s thesis is that “the parallels between Nazism and Islamism are overwhelming” (though “the subject is a taboo”—naturally!). Making the claim, he cites as evidence the example of Matthias Küntzel, a German political scientist who had a lecture cancelled at the University of Leeds. Typical of the tenuous relationship those on Belien’s fringe have with the truth, he fails to mention (or doesn’t realise) that the lecture wasn’t cancelled at all, but merely rescheduled and delivered without issue last month.

Belien never makes much effort to specify what aspects of Nazism he sees in Europe’s Islamist movement (is it, say, the rejection of degenerate art?). Examination of his purported evidence doesn’t add much insight: Küntzel’s scholarly work—and the lecture he delivered in Leeds—are on the topic of antisemitism, and how it was transmitted, via the Muslim Brotherhood, to the wider Islamist movement. Is Belien’s revelatory parallel that both movements are antisemitic?

The essay progresses from the inaccurate to the inept. Belien is director of Islamist Watch, and, midway through, he lurches into his movement’s usual sententious drivel—which, regardless of truth, is at least irrelevant to the argument. “There is a war going on between the Jihadists and the West”; “we are losing the battle”; “the European Left, in league with the Islamists, is constantly reminding the Europeans of Hitler and the Nazis, accusing Europe’s identity, the very core of its being, of being intrinsically evil”; “attempts to rob Europe of its identity are seen as ‘good’”, etc., etc.

The flailing continues in the eventual return to the putative equivalence, where Belien offers the claim that “to some, defending Europe’s identity is seen as a characteristic of neo-Nazism” (”some”, as usual, being unspecified), along with a bizarre non sequitur concerning Hitler’s take on Islam—which isn’t even worth addressing.

An essay from Belien, and those of his ilk, wouldn’t be complete without some anguished scaremongering, and in the final paragraph Belien doesn’t disappoint. We’re told that Germany is rapidly turning Islamic: “in addition to the many Muslim immigrants, 4,000 Germans convert to Islam each year”. Well then! Cause for concern indeed. If things continue at this rate, half the country will be Muslim in, um, ten thousand years. If the process started during the Mesolithic Stone Age, Germany would be just now be approaching fifty percent Muslim.

That essays like this are written isn’t surprising. But how does this feeble crap get repeatedly published in otherwise decent newspapers?

Update (7/11): Yesterday’s Washington Times: “Waterboarding is something of which every American should be proud”.

[1] Literally, in this case.

Building Thrift on Leopard

November 6th, 2007

Thrift doesn’t build out-of-the-box on Leopard. To get it to do so, you’ll need to do something like the following:

$ cd thrift-20070917
$ sudo cp -R lib/cpp/aclocal/ /usr/share/aclocal
$ curl collison.ie/code/thrift-time.patch | patch -p 0

Update (06/11): You’ll also need the Boost headers, as Ben points out. If you haven’t installed them before, note that you don’t have to actually build Boost—just copy the boost directory from the boost distribution to /usr/include.

Thrift bindings for Smalltalk

October 30th, 2007

Thrift is a cool project that Facebook open-sourced a few months ago. From their description:

Thrift allows you to define data types and service interfaces in a simple definition file. Taking that file as input, the compiler generates code to be used to easily build RPC clients and servers that communicate seamlessly across programming languages.

It doesn’t try to do too much (serialization of any arbitrary object), but it does more than enough to be useful: it allows reasonably elaborate data-types (like structs and dictionaries) to be transferred; is fast to develop with (no wrapper objects are required); and, with its binary protocol, has very little runtime overhead (Facebook use it for their ad-serving and logging mechanisms). The whitepaper is worth reading.

I recently wrote Smalltalk (Squeak) bindings for Thrift. They’re still a little rough and incompletely tested, but if anyone wants to take them for a spin, I’ve uploaded the patch for Thrift and the supporting Squeak code[1]. To try it out with the standard Thrift tutorial files, generate the Smalltalk code with something like:

$ thrift -r -st tutorial.thrift

Fire up one of the supplied server implementations for the tutorial, file in the generated .st files with Squeak, and then do something like:

calc := CalculatorClient binaryOnHost: 'localhost' port: 9090.
calc addNum1: 10 num2: 15

Which should result in 25 being computed by the server implementation of your choice.

Update (01/11): A more complete patch is now available.

Update (19/11): This code is now in the Thrift SVN repository.

[1] I’ve removed the links since the code is now in Thrift itself.

LispVan

October 30th, 2007

I’m going to be at the LispVan meet-up later today at Think! on 4512 West 10th. Come along and join in the language wars! (Or at least the beer drinking.) Full details are on Bill Clementson’s blog.

IDEs and languages

October 25th, 2007

Oliver Steele writes:

“Language mavens wax rhapsodic about the power of higher-level programming — first-class functions, staged programming, AOP, MOPs, and reflection. Tool mavens are skilled at the use of integrated build and debug tools, integrated documentation, code completion, refactoring, and code comprehension. […] This means that the more you invest in language features, the more they benefit you, to the exclusion of tool features — and vice versa. And this is what creates the two camps, with two perspectives on the relative merits of language features and tool support.”

Given the existence given the existence of software like the Genera operating system, the various Smalltalk environments, Emacs, Factor, Mathematica, and the PLT Scheme environment, this argument—that good languages in some way preclude good environments—is empirically baseless.

The exact opposite seems to be true—increasing language power leads to increases in environment power. In a sense, it has to be this way: in a powerful environment, the development environment and the runtime environment are the same thing. The real power in good environments is their ability to interact with a program during any stage of its life—from compile-time to runtime. This sort of power can only be accomplished by having the environment and program coexist as different parts of the same whole, and any language lacking this kind of metacircularity has a low upper bound on the maximum power of its environments.