Der Blog

I've been annoyed by the inadequacies of the SUCS blog system too long, so I've decided to switch to Wordpress.

The new blog is here. Please update your bookmarks, RSS/Atom feeds, etc.

[ Entry posted at: Wed 11 Jul 2007 09:06:35 UTC | Comments: 0 | Cat: News ]

You might have heard of the Garfield Randomizer. Turns out a similar thing exists for Dinosaur Comics.

I actually came across Dadasaurus Rex a couple of weeks ago. It lends itself very well to the treatment since not only is the panel layout the same in each strip, the art is the same as well. Here's a rather excellent one I got:

Dadasaurus Rex suffers from sleep madness.

A fairly accurate depiction of what happens when you don't get enough sleep, I think. :)

[ Entry posted at: Sat 07 Jul 2007 18:53:04 UTC | Comments: 0 | Cat: Funny ]

If you thought the one-line definition of the Fibonacci sequence in Haskell was beautiful, try this:

import Control.Monad

powerset :: [a] -> [[a]]
powerset = filterM (const [True, False])

A black box for sure, unless you have "internalized the list monad". But it does show how stonkingly powerful monads are.

[ Entry posted at: Mon 02 Jul 2007 17:45:21 UTC | Comments: 0 | Cat: Geeky ]

I just got an email from Virgin Media. The first part I noticed was:

it'll cost 25p per minute to call from a Virgin home phone, plus 10p to connect.

I immediately thought, "What on earth? Surely they don't expect customers to stick around with such extortionate call charges." Then I noticed the context, and realised that it possibly should have read:

it'll cost 25p per minute to call it from a Virgin home phone, plus 10p to connect.

The actual wording was fine, but the way I started parsing it made me interpret it in completely the wrong way. "It" in the actual wording means "our broadband helpline number"; but initially I parsed it as the dummy subject of an impersonal sentence, so I thought it was saying all calls from a Virgin home phone would have those charges. The altered wording adds an "it" referring to this helpline as the object of the embedded verb phrase, making my interpretation the only sensible one.

In the real world, I did two interesting things today. First, I went to the CS office to pick up my degree results: I was awarded a 2:1. I then went to talk to Dr Berger about applying for an MRes; this I have now finally done, as well as an EST bursary which would require going to Munich for a few months (no downsides there!). I mentioned the result, and he said it was disappointing, because the overall score was about 67%, only a couple of points off a first. Annoyingly, I won't know for certain what pulled me down for some time because I was only told the overall classification, not marks for each module. Even the average I only know informally, because Uli told me. But the bad marks are apparently on the German side, so as a CS student I'm better than I look on paper.

[ Entry posted at: Mon 25 Jun 2007 16:04:12 UTC | Comments: 1 | Cat: General ]

... writing without nouns.

But ahhh, to write nounlessly is to live anew, not to be tied to thinking concretely, not to be anchored, not to be grounded, but rather to lift off and fly, as if previously to write was just to crawl, penned in, hemmed in, restricted.

And I might add, like an Oasis song, to say everything and yet say nothing. (The traditional way to express this is to call it "abstract nonsense"; the book Abstract and Concrete Categories: The Joy of Cats has this cute limerick which captures the feeling:

There once was a man from Bay Shore.
When his fiancée said, "I adore
The beautiful sea,"
He said, "I agree,
It's pretty, but what is it for?")

Journal time: I came back from a week back home in Hampshire today, after going with my brother to the Muse concert at Wembley on Sunday. (Woo! That was brilliant!) We also went to a Spanish restaurant for Dad's birthday, which was pretty tasty.

Our degree results came out yesterday, but I wasn't around to get them, so I'm having to hold my breath until Monday.

[ Entry posted at: Sun 24 Jun 2007 00:04:41 UTC | Comments: 1 | Cat: Random ]

(In response to Gimbo.)

Speaking of Unix, I have thought that there is a pretty close connection between lazy evaluation and Unix pipelines. On the xmonad home page there's an example for using dzen that looks like this:

while true ; do
    date +"%H.%M %a %b %d"
    sleep 60
done | dzen2 -ta r -fg '#a8a3f7' -bg '#3f3c6d'

Of course, if that was strictly/eagerly evaluated, dzen would never run, because of the infinite loop. But what actually happens is that the two commands, joined together by a pipe (indicated by the | character), are executed in parallel; the while loop runs date, producing some output, which it writes to a pipe (just a first-in-first-out buffer shared by the two processes); it sleeps for 60 seconds; then it runs date again; sleeps again; ..., ad infinitum. Meanwhile, dzen reads its output, until there is none left, then blocks until the loop provides more.

But that's just like a lazily evaluated stream. Suppose we had an IO action getTimeString, then we could do:

statusBarContents :: IO [String]
statusBarContents = do
    sleep 60
    now <- getTimeString
    then <- unsafeInterleaveIO statusBarContents
    return (now:then)

statusBar = dzen statusBarContents

Again, it looks like statusBarContents would never terminate because it calls itself, and not even in an inductive manner with a base case where it bottoms out. In contrast to the above, this is all done in one thread; but the unsafeInterleaveIO says "only evaluate this when it's asked for" - so it manages to produce one time string, which dzen uses; then dzen asks for the next one, and the sleep in statusBarContents makes it block.

(For the mathematically minded, this kind of non-inductive recursion producing infinte amounts of data is called corecursion. I intend to do a SUCS talk on the topic someday.)

[ Entry posted at: Sat 02 Jun 2007 23:58:33 UTC | Comments: 3 | Cat: Geeky ]

I'm here to shoot a pilot.

— Nobody, apparently. A director called Mike Figgis was supposed to have said it, but apparently the story was a hoax. But it still makes a funny example of what not to say to the security people at an airport.

[ Entry posted at: Fri 01 Jun 2007 22:15:06 UTC | Comments: 0 | Cat: Funny ]

I just wrote the following snippet of code for my dissertation:

intNatI :: Int :~= Nat
intNatI = Iso {
            to   = fromInteger . toInteger,
            from = fromInteger . toInteger }

The components to and from have totally different types (to is Int -> Nat, from is Nat -> Int). Yay for type inference! :)

[ Entry posted at: Mon 28 May 2007 00:24:46 UTC | Comments: 0 | Cat: Geeky ]

The title of this entry (if you take "buffalo" to be 1) the obvious noun with identical plural, 2) capitalised, the proper noun referring to the American city, and 3) a verb meaning approximately "bully") is a grammatically correct sentence of English. (I first came across it in The Language Instinct by Stephen Pinker, but was reminded of it recently.)

In fact, according to Wikipedia, for any n ≥ 1, buffalon is a grammatically correct sentence, if you disregard capitalisation. ("Buffalo!", "Buffalo buffalo", "Buffalo buffalo buffalo", etc.)

Don't you just love natural language?

[ Entry posted at: Thu 10 May 2007 14:36:16 UTC | Comments: 1 | Cat: Random ]

What does that community mean to me, a person who has to walk by the ROTC [Reserve Officer Training Corps] offices every day on my way to my own office just down the hall — who was watched, noted and reported, all in a day's work? Today, we gave in willingly and wholeheartedly to a culture of fear and blaming and profiling. It is deemed perfectly appropriate behavior to spy on one another and police one another and report on one another. Such behaviors exist most strongly in closed, undemocratic and fascist societies.

Kazim Ali, an Indian-ethnic professor of poetry at a university in Pennsylvania, after being reported as a terrorist for leaving a 'suspicious' box next to the bin to be recycled (which turned out to contain manuscripts that he was recycling). It's not his race that caused it, it's the culture of paranoia that exists over there. America is quite plainly not a free country any more.

[ Entry posted at: Fri 27 Apr 2007 15:43:14 UTC | Comments: 1 | Cat: Politics ]

"Suppose I wanted to--have a party?" I said.
"Like, what kind of a party?"
"Suppose I wanted Noam Chomsky explained to me by two girls?"
"Oh, wow."
"If you'd rather forget it..."
"You'd have to speak with Flossie," she said. "It'd cost you."

— From "The Whore of Mensa", a short story by Woody Allen (quoted at Language Log).

[ Entry posted at: Wed 25 Apr 2007 01:41:07 UTC | Comments: 0 | Cat: Funny ]

The other critical component of Ajax is Javascript, the programming language that runs in the browser. Microsoft saw the danger of Javascript and tried to keep it broken for as long as they could. But eventually the open source world won, by producing Javascript libraries that grew over the brokenness of Explorer the way a tree grows over barbed wire.

Paul Graham. Microsoft is dead, apparently. It certainly no longer taints my computer — I wiped Windows in favour of Ubuntu Feisty last week. The change affected my life so little that I never got round to blogging about it.

[ Entry posted at: Mon 09 Apr 2007 17:06:27 UTC | Comments: 0 | Cat: General ]

Being the functional programming nut that I am, I couldn't help but chuckle at this.

[ Entry posted at: Mon 02 Apr 2007 00:09:42 UTC | Comments: 0 | Cat: Funny ]

Suppose everyone communicates via scribes, who write in ancient Egyptian hieroglyphs, and Microsoft is the only company who trains them.

Now there do exist some talented linguists who can figure out approximately what they're writing. That's what the Rosetta Stone was about, except in this analogy there's no Demotic or Greek alongside, only the hieroglyphs and a scribe to tell you what they mean in English. Unfortunately, after they send the scribes away, the linguists can never be sure that they've got it right, especially since Microsoft can change the language as they like simply by changing the curriculum. As soon as new scribes start writing in this new language, the old scribes will stop being able to interpret some messages you receive because they don't know about the changes in the language.

So to be sure the message gets through, you have to hire a scribe. When Microsoft changes their curriculum, you'll eventually have to hire a new scribe, who will probably also demand a new house to live in. If you send me an important document in Egyptian, you assume I'm willing to do all that. You're propping up a powerful monopoly (the scribes can after all twist your message or send a copy to Microsoft without you knowing), and assume that I'm willing to do the same.

If instead we communicate in English, which everyone knows, then neither of us has to hire a scribe. Even if you don't know English, there are lots of scribes available from many schools, so you don't have to put up with a scribe from one particular school if you don't like him.

(Background: I just booked a place on Swansea uni's postgraduate open day, and got a Word document in return, which has the timetable in it (at least that's what the sender said). I replied asking for a plain text or PDF document, and a shorter version of the above by way of explanation. The initial booking email also had my signature in it which says to avoid sending me Word documents - unfortunately it seems like the recipient completely ignored it.)

[ Entry posted at: Tue 20 Feb 2007 17:38:12 UTC | Comments: 1 | Cat: Rant ]

The idea that a successful person should be happy has thousands of years of momentum behind it. If I was any good, why didn't I have the easy confidence winners are supposed to have? But that, I now believe, is like a runner asking "If I'm such a good athlete, why do I feel so tired?" Good runners still get tired; they just get tired at higher speeds.

Paul Graham. An interesting essay, which (indirectly) suggests that the reason why people seem more discontented these days is that more of them do jobs where it's not possible to know you did the best you could. I already know that manual labour is more "satisfying" in this sense than intellectual labour, so in hindsight this idea seems obvious.

[ Entry posted at: Fri 16 Feb 2007 23:44:13 UTC | Comments: 0 | Cat: Philosophical ]

Validate : XHTML / CSS / RSS / ATOM