Write a new post

Saturday, October 29, 2005

Blogging my hatred

  Here’s another one: I hate how everybody’s afraid to use the word ‘anagram’ for fear of some illiterate fool not understanding what they’re on about. ‘Mix up the letters’ is such an ugly phrase.

Thursday, October 27, 2005

I spent the last few days making something

  I felt like setting myself a project the other day, so I decided to try to write a program for constructing random sentences according to a context-free grammar. I was inspired by those nearly-grammatical-but-not-quite-meaningful spam subject lines you sometimes get; whilst they tend to use a core phrase with some random words added in to confound spam filters, it reminded me of the sorts of phrases context-free grammars (which I first encountered when reading Logic by Wilfrid Hodges) sometimes generated. Being an algorithmic and iterative process, it seemed to be quite well-suited to being processed by a computer. I was most experienced in Java, so at first I worked with that. To start off with, I didn’t want to complicate things by introducing external files (plain text or databases), so I hard-coded the CFG. This was obviously not an ideal solution, but due to the object-oriented nature of my approach, it was the most simple. I got things working to a reasonable degree, with only a little jiggery-pokery in order to balance the probabilities a bit. However, despite portability being one of the fundamental concepts behind Java, it’s not the sort of thing that most people want to mess around with. I quickly knocked up an applet front-end, but I could only get it working locally – as soon as I tried to upload it, it came up with nothing at all. I also tried compiling it to a Windows .exe, but for some reason this refused to run on anyone else’s computers. In light of all of this, and because I really felt that it was time I learnt it, I decided to try again using PHP. I downloaded UniServer, which was a lot more co-operative than previous PHP software I’d tried, and took a quick look at a basic PHP tutorial. Things were largely familiar, so I didn’t really have a problem picking it up. The most alien things were regular expressions, which I had encountered before, but which I found to be a bit fiddly. I think it’s the compactness of them – which, indeed, is one of their greatest strengths – that put me off.

  I decided that since I was starting things afresh, I might as well start using an external file for storing the CFG. It actually turned out not to be too difficult after all; I found PHP’s string-handling capabilities to be very impressive and quite helpful for what I was doing (I don’t know whether PHP is actually better at handling strings, or whether it’s simply the online documentation – which I like very much – that made things easier). My main problem was constructing a mechanism to prevent the recursion from repeating indefinitely – one of the advantages of my Java implementation was that I could determine how the program should react to excessive depth on a class-by-class basis (with a class for each symbol). I knew what I wanted to do pretty early on, but numerous small errors on my part led to several hours of misery. But it’s been over for a few days now, so I think I can safely report my success.

  Anyway, I’ve been talking at length about the creation process, which wasn’t very interesting, so I’ll cut to the proverbial chase and provide the links: the first version simply provides a random sentence each time, whilst the second allows you to alter the rule set used by the program. My intention is that people get so obsessed with fiddling with this pointless toy that humanity’s productivity is reduced to roughly zero. Why this should be my goal, I haven’t yet decided. I just like it. Any contributions anybody wants to make will be considered for incorporation, but so far most people haven’t bothered messing with the mechanics behind the thing.

  I started writing this three days ago, then got distracted and decided I’d finish it another day. When I came back to it, I couldn’t really work out what was left to say. I can’t be bothered to read it properly, so it might not make much sense. This troubles me, but not enough to actually do anything about it.

[Show more]

Sunday, October 09, 2005

Oh my god

  I sincerely hope this gets cheap enough soon. I want it quite, quite badly. I don’t particularly like those technology-tracking blogs (let’s face it: I don’t actually like any blogs), but I felt a strong and profound urge to say something about this.

  My flat’s TV at university actually once achieved a luminance that must have been approaching the Brightside’s 4000 cd/m2 over a small area (it was almost painful to look at), but that was entirely in error, and quite worryingly so, too. It was like all the light from the screen had been funnelled into a single thin line. If by any chance you’re reading this, Alex, imagine that kind of brightness power spread over the whole screen. Yet it still retains the capability to have completely black portions. Fucking amazing. Not that I expect you to care; merely to understand how impressive this is.

Pigeon pornography

  Today I saw two pigeons having sex next to a sleeping duck who had a broken wing and was standing on one leg. What have you done with your day, bigshot?

Sunday, October 02, 2005

Everyday conversation is a deeply unpleasant experience

  I don’t mind it so much when people answer a question with another question. What I do mind is when they answer a question with the same question.

‘Hi, how are you?’
‘How are you?
‘I want to carve out your insides and fill the remaining husk with pulped newspapers.’