Archive for April, 2009

Apr 30 2009

I wanna be near you and blink in your light

Published by Dougal under Food, Friends, Music

Just back from a cracking night at Calistoga, Californian restaurant hidden in a side alley of Rose Street. You know, just down past the ‘sauna’.

We’re away tomorrow and for the long weekend, in Glasgow for a wedding. It’s going to be a bit new. Ostensibly a Muslim wedding but with certain obvious heresies — the groom’s family are Chinese, so there will be pork or chicken’s feet at the meal, possibly both. Because that’s tradition too.

Well, whatever happens the bride and groom are lovely people and I wish them all the best. I hope the events go without a hitch (apart from the obvious one). Here’s some Bell X1 to see you out, extolling the virtues of tea to a Boston audience and singing Flame.

One response so far

Apr 27 2009

All programs are examples of static or dynamic transformation

Published by Dougal under Programming

Here’s an interesting one:

Every system is either an interpreter or a compiler

Don Stewart’s talk Engineering Large Projects in Haskell: A Decade of FP at Galois at London HUG.

Having recently discovered that something I was writing was a compiler, it seems they’re more ubiquitous than people realise. In some sense it seems obvious. Even something like a computer game is obviously an interpreter, converting user input into the syntax of game play and evaluating it… but it also seems like such a stretch. :-)

No responses yet

Apr 27 2009

House concert in Leith. Not house music.

Published by Dougal under Gig, Music

Exactly ten days ago Helen and I went to a house gig at her brother’s house. It was a bit unusual but kinda nice. I’m just sorry we didn’t invite some of our friends along as I know a few people who would really have loved it.

The performers were Steve Lawson and Lobelia (his and hers websites). She does singer-songwriter stuff and he does looping, layered bass guitar songs. They did some songs solo each, and some songs together, including some reworked “cheesy 80s covers”. You know, like a (US) countrified version of You Spin Me Round (Like A Record).

The show was live-streamed to about 190-odd people on the internet, and there were about 18 of us in Paddy’s living room. Here’s one song, recorded from Lobelia’s phone I think. The laughter is hers…

We paid a few quid direct to the artists and even bought a couple of their CDs. Then we went for a curry with Helen’s family and the performers. It was a pretty cool evening. I wonder who else does regular house gigs? Here’s another tune:

Edit: I’ve just been informed that Steve Lawson blogged about it here Dontcher luv tinternet?

No responses yet

Apr 21 2009

Regular expressions are the evil twin

Published by Dougal under Programming

One of the biggest boons of getting a new laptop has been that I now have access to a powerful enough machine to do programming on. Until very recently I would remember that I had personal projects about once a month, and have to fire up the desktop machine that’s sitting on a desk in the hallway. Neither comfortable nor accessible.

But enough waffle. You sat down this evening thinking, what has Dougal been programming? Didn’t you?

I’ve been playing with the parser combinator library called Parsec. I’m using it to parse a script (as for a stage or radio play) which I’ll be using later.

One of the nicer facilities Parsec has is somewhere to store state as we go along. So you can parse something and store it for later parses. For example, the file I’m parsing has sections that start

Scene 1. <path/to/file>

It’s perfectly legal for subsequent paths to be omitted, in which case we just assume it’s the same as Scene 1:

Scene 2.

Every time we parse a file name we store it for later reuse if the filename isn’t specified at the next section:

-- If no filename is given we fill in the most recently
-- used one. Then we store the current filename for later.
sceneheader = do try scenekw ; spaces
                 num <- many1 digit ; char '.' ; many space
                 oldurl <- getState
                 url <- option oldurl filename
                 setState url
                 newlines
                 return $ Start (read num) url

This really simplifies the sanity checking later on. I like it.

No responses yet

Apr 19 2009

Booking and boozing and many-vegetable nosh

Published by Dougal under Books, Friends

We just got back from Bex’s flat. She had a Potluck and Prose evening, which is like a book group except you don’t have to talk knowledgably about a book. You take a dish and a book, everyone gets drunk to some degree, and you swap the book. I gave Richard Brautigan’s Revenge of the Lawn (worth it for the shortest-short-story ‘The Scarlatti Tilt’ alone) and received from another guest Arthur Ransome’s Swallows and Amazons.

I haven’t finished the book I’m reading at the moment, but I’m looking forward to this new one because many people have said how much they enjoyed it. (Indeed, several other people were inspired to read it again after it appeared this evening).

We have volunteered to take the next group in a month’s time. Which gives us some motivation to get our living room in order and our bookshelves attached to the wall.

3 responses so far

Apr 15 2009

Time to catch up

Published by Dougal under Friends, Gig, Music

Last week I saw Bat for Lashes at the QMU. Amazing. The new single’s not the strongest on the album, unfortunately, but it’s the only one I have a video for!

Helen was away at the weekend and I spent the time making too much bread. But I’ve discovered that Lidl sell bread flour half the price of anywhere else, so that compensates a bit.

Two baguettes on a bread board

Yesterday we saw some old friends and flatmates. They were visiting Scotland for a bit from the uncivilised hinterlands (London). We went to Calistoga and basically had the place to ourselves. It was a Tuesday night but still a bit eerie at first. Some dishes did go through to the other room, so we weren’t the only people in.

3 responses so far

Apr 11 2009

I have no fond memories of that compiler

There’s another post about static typing (amongst other things) just been posted to Reddit.

(Tangent: I’ve just discovered that left- and right-mouse buttons pressed together emulates the awesomely useful middle-mouse button in Gnome, presumably Linux, presumably other Unix variants. Excellent.)

Static typing in programming is a bit like grammar checking in writing. Except better, because grammar checking is a much harder job. Anyway, it stops you making dumb mistakes, but plenty of people object to it because either (a) they don’t make mistakes or (b) they know better than the checker.

I don’t particularly understand the problem many people have with static typing, though I think the problem may be to do with how badly most languages do it. (You can imagine quite going off grammar checkers if you only knew Microsoft Word. But if you had a real live editor to point out your flaws you’d probably appreciate things more. Obviously the comparison is not legitimate but I think you see the gist — if something is done badly it can become more of a hindrance and is better removed altogether.) I have never done anything where static type checking has held me back, but I’m sure such things exist.

One interesting comment to come out of the above discussion regards teaching. Is it better to have a strict language for teaching purposes, or should the novice programmer discover why their malformed program is bad? Despite preferring static typing, I am actually erring towards no static typing for teaching purposes. I think falling off your bike a few times (metaphorically speaking, of course) will go some way to encourage more rigorous thinking, in the way that being told “no! you’re wrong!” before you try won’t. (Actually, I wonder if there is a language that exists which does static typing but will compile all the same. Then you can read any compilation errors and watch your program fail.)

I certainly remember hating the compiler when I was learning Java at university. Hating it. It never seemed obvious or reasonable that the problem was with my code; it was just a capricious bully, that compiler. Maybe if I’d been able to see the disastrous effects of running my ridiculous code I would have learned that the compiler did know what it was doing after all. :-)

One response so far

Apr 10 2009

TV with its face ripped off

Published by Dougal under Books, Reviews, Television

I’ve just finished Screen Burn, the collection of Charlie Brooker’s TV review columns from the Guardian, collected in book form. In short, if you like Charlie Brooker then you’ll like this.

It was quite interesting for me because it’s been several years since I was a regular TV watcher. Even then, I was never interested in the soaps or reality TV shows for the most part. (With noted exceptions of the hilarity that TMF would occasionally show during the day. Jessica Simpson really is that absurd.) Reading Screen Burn allowed me to live through the worst of dumbed-down TV broadcasting without actually having to watch it.

Most of the programmes were stuff that I have already seen or was not interested in catching. Except when Charlie Brooker gets very excited about 24 about halfway through the book, then the second season comes around — and then the third! The one I haven’t seen! I actually caught a teeny spoiler for the third season completely by accident. I just glanced at the page and bang the information was in my head.

There were a few shows which got excellent reviews but I had never heard of and seem not to have made a big impact. No second series, no transfer to BBC2 from the hinterlands of BBC4.

But mostly, I just read it for the witty rage that is brought to bear on so much of the tedious television programmes. The kind of stuff that I no longer watch.

No responses yet

Apr 10 2009

How the other 90% live

Published by Dougal under Computing

I bought a new laptop yesterday, and I haven’t changed the OS yet. I’ve been doing some things inside Vista since last night. (I downloaded the Ubuntu 9.04 ISO and tried to burn it to CD. Found out Vista has no capacity to burn ISOs. Only learned this after it had tried to burn the ISO as a file to my blank CD. So that’s another coaster I’ve created due to useless user interface and completely inappropriate default behaviour.)

If I had bought this machine to use as-is I would be quite disappointed. It took about 45 minutes to set up with nearly no interaction from me — just repeated restarts and long periods of blank screen. The machine is so full of useless rubbish that it consumes 2GB of RAM and has about a dozen systray icons (all waving their little bubble notifications at me) at startup. McAfee just informed me that I had to restart the machine just after I turned it on this morning. Excuse me, whose machine is this?

No wonder people hate computers.

2 responses so far

Apr 06 2009

How to make a baking stone on the cheap

Published by Dougal under Baking, Home

I’ve been on a quest for some time now to get a baking stone for making nice crusty bread in our domestic oven. Most of the baking stones to buy are small and expensive, particularly the ones branded as “pizza stones”, which are actually circular and so of limited practical use for long loaves.

A few people sell more conventionally-shaped slabs of stone for your oven, but they are still awfully pricy. (I found one at a garden centre for thirty pounds. For some reason it’s always the garden centres that sell these things.) Until last week, when I stumbled across an alternative: a “worktop saver”.

Now, I honestly don’t know what a worktop saver is. They seem to be made of glass or stone. You can’t use them to put hot pans on, because the thermal shock would do for them pretty quickly. And I can’t imagine anyone using them as a chopping board unless they wanted to blunt their knives in short order.

But whatever the original purpose of these things, you can get a lump of granite about the same dimensions as the inside of an oven for between ten and twenty pounds. The one I bought was £20 from Debenhams because Asda didn’t have any £10 ones in stock. These things are ubiquitous, if you just know what to look for. (Curiously, I’m not the only one to delight in these things — they are useful for stabilising hi-fi equipment.)

I haven’t used mine extensively yet (a few pizzas in one baking session) but it’s holding up fine so far. I was careful not to put it cold into a hot oven, and it takes longer to come up to temperature, but it works well and radiates a lot of heat even when the oven is cooling.

Do it yourself

If you buy a granite worktop saver like mine you’ll probably need to prepare it first. Mine came with six foam-rubber feet on the unpolished side. I cut these off with a pen knife and then sanded down the remaining residue with the coarsest sandpaper I had. You’ll probably find that the unpolished side has very obvious grooves — presumably from where the stone was cut — and scraping/sanding along these ruts makes your job a bit easier.

Give it a quick once-over with a damp cloth to remove the dust and leave it to dry. I have used the stone polished-side up though I will probably try it upside down in future. The marks from the feet are still there, and very obvious when the stone is wet, but there is no smell of burning foam so I’m quite happy!

6 responses so far

Next »