Archive for September, 2008

Sep 29 2008

In ur society, feeding u XML

Published by Dougal under Programming, Society

Spent the evening looking at mySociety and its associated projects — They Work For You, Fix My Street and so on. Really exciting stuff that I feel I should help out.

I don’t know what to do first. Writing bindings seems a bit silly when it’s such a simple interface to use in the first place (HTTP GET requests). I’ll probably spend a bit more time looking at what is (a) available on the local government/council websites and (b) not yet tied in to the rest of the system. Yay, screen scrapers!

No responses yet

Sep 28 2008

This list is still very long

Published by Dougal under Food, Programming

Had a fun time this evening making bread, making plans and hacking on the Nigella Express challenge evaluator gizmo to print us a list of pending recipes. These are the results. Still quite a few, eh?

Everyday Easy
Roast Poussin and Sweet Potatoes Workday Winners
Prawns with Maryam Zaira Sauce
Saké Sea Bass and Wilted Greens
Caribbean Creams
Retro Rapido
Mouclade
Cheese Fondue
Crêpes Suzette
Pineapple Upside-Down Cake
Get Up and Go
Chocolate Croissants
Frittata Party!
Quick Quick Slow
Lamb, Olive and Caramelised Onion Tagine
Lamb Shanks with Beans
Coq au Riesling
Swedish Salmon
Sweet and Sour Cucumber Salad
Warm Potato Salad
Gravlax Sashimi
Lazy Loaf
Against The Clock
Chocolate Peanut Butter Fudge Sundae
Instant Calmer
Chicken, Mushroom and Bacon Pie
Grilled Cheese and Slaw, and
Sandwich Slaw
Butterfly Cakes
Doughnut French Toast
Razzle Dazzle
Green Apple Martini
Ginger Pom
Potato Cakes with Smoked Salmon
The Instant Canapé: Quick Crostini with Avocado and Green Pea Hummus
Tuna and Crab & Avocado Wraps
Scallops-on-the-Shell
Griddled Venison with Pink Gin Apple Sauce and Roast Pencil Leeks
Tarte Fine Aux Pommes
Glitzy Chocolate Puddings
Blackberries in Muscat Jelly
Ginger Passionfruit Trifle
Speedy Gonzales
Mexican Chicken Salad with Tomato and Black Bean Salsa
Chopped Ceviche and Mexicola
Flan
Margarita Ice Cream
Buñuelos
On The Run
Lunchbox Treats
Mini Meatloaves
Buttermilk Roast Chicken
New Orleans Coleslaw
Cloudy Lemonade for a Sunny Day
Hey Presto
Pappardelle with Escarole
Lamb Cutlets with Chilli and Black Olives
Liver with Bacon and Charred Onions
Marsala Honey Pears with Gorgonzola
Peaches in Muscat
Amaretto Syllabub
Holiday Snaps
Snowball
Christmas in a Glass
Pomegranate Bellini
Rouge Limonade
Martini Olives
Maple Pepper Pecans
Cocktail Sausages
Festive Fusilli
Seafood Pot
Broccoli and Stilton Soup
Butternut Squash with Pecans and Blue Cheese
Turkey Tonnato
Spiced Peaches
Chocolate Pistachio Fudge
Quickly Scaled Mont Blanc
Mincemeat Parcels with Bourbon Butter
Holiday Hot Cake with Eggnog Cream
Steeped Christmas Fruits
Seasonal Fruit Salad
Hot Toddy
Storecupboard SOS
Golden Honey Mustard Dressing
Wasabi Lime Dressing
Merguez with Halloumi and Flame-Roasted Peppers
Curry in a Hurry
Nutella Pancakes
Clafoutis
Vanilla Apples with Sweetheart Croûtes

3 responses so far

Sep 27 2008

Second drink of the night and straight on ‘til morning

Published by Dougal under Life

Last night I did some coding on The Secret Project™ (don’t ask, it’s a secret) and then went to bed. I ended up reading a book about music, though what it was actually saying is beyond me. It talked a lot about Kylie Minogue and some avant-garde spoken-word piece from the 60s. After two dozen pages I decided nothing reasonable was going to happen any time soon and went to bed.

We didn’t make it to Bex’s birthday pub lunch because Helen was still sleeping off a very late night. Apparently the night buses had changed back to day buses by the time she came home! So I got some stuff in for a post-drinking fry-up. It turns out that mushrooms fried alongside tomatoes seem to have a lemony flavour, from the acidic tomato juice.

There’s some kind of hippy/ethical/new-age/fairtrade/home-made craft fair thing going on across the road. We’ll see what they have on offer and maybe just buy some home baking or something. This evening is Bex’s Midnight and Magic themed party, and I haven’t a clue how we’ll meet that theme.

No responses yet

Sep 26 2008

Fishy results from Durham

Published by Dougal under Bad Science, Politics

After what seems like a hundred years, Durham County Council have decided to release the “results” of their fish-oil “trial”. What they have released are not results, because what they did was not a trial.

In short, they

  1. Gave fish oil to as many kids as would take the pills.
  2. Got laughed at by everyone.
  3. Took the huff, said it was never going to be a real trial. Took their ball home too.
  4. Refused to answer any questions. Even refused Freedom of Information Act requests. The whole thing became Super Top Secret.
  5. Decided they would release the results after all.
  6. Didn’t have a control group.
  7. Compared the GCSE results of some of the few compliant subjects (~600 out of 3000 starters) with another group of kids chosen after the fact, on the grounds they were quite similar. Really.
  8. Ignored another 200-odd compliant subjects because they presumably couldn’t match them against anyone. Science, it works bitches!

Ben Goldacre has the full press release on this sorry affair.

No responses yet

Sep 26 2008

If God wants to chop down my apple tree let him come round and try

Published by Dougal under Politics, Religion

I was going to just tag this one on my Delicious feed but decided it merited a bit more publicity. The Times on Revealed: UK’s first official sharia courts said:

The government has quietly sanctioned the powers for sharia judges to rule on cases ranging from divorce and financial disputes to those involving domestic violence.

I honestly don’t care who you get to arbitrate on the argument you have with the next-door neighbour about his apple tree blocking out your sunlight blah-blah-blah. But since when has domestic violence counted as a civil matter?

Has this been the case with other arbitration systems and I didn’t notice? The story is typically light on relevant details, comparisons and caveats — or even a comment by someone who might know the law. “News media: Like information, but less informative.”

Tip of the panama.

No responses yet

Sep 19 2008

Tropic Thunder, very funny indeed

Published by Dougal under Films, Reviews

We saw Ben Stiller’s new comedy, Tropic Thunder, on Thursday night and it was much better than I imagined. The trailer I saw looked silly, but in a really dumb way. The real film was much wittier than I expected. Off the top of my head, I can’t think of a better Ben Stiller movie. Keith will be very pleased, I’m sure.

Now I want to go back and watch some of the movies whose scenes it parodies — Platoon, Apocalypse Now and (surely a comedy already?) Predator. Also, for no reason in particular we should probably be watching Top Gun again, because it’s just that good…

2 responses so far

Sep 19 2008

Head in the clouds

Published by Dougal under Programming

I’ve been enjoying playing with the word clouds at http://wordle.net. They’re quite sophisticated and compact — small words can appear inside the bowls of large letters. The layout algorithm is obviously something more sophisticated than just placing bounding rectangles.

According to the FAQ the size of words should be related to their frequency in whatever source text you’re using. That hasn’t been the experience for me. Words that I have only written once can appear quite large, and I can’t really fathom this.

But in the interests of learning something more, I thought I’d put together a rudimentary word clouds implementation using the augmentations I recently made to the Haskell diagrams package. (BTW, none of these changes have gone upstream yet. I feel a bit bad about this, so I’ll work through the changes I’ve made later and send a bunch of patches to Brent Yorgey.) The technique was more-than-slightly influenced by this work done by Chris Done. Go to that site for a beautifully illustrated explanation of the algorithm.

In short, I scale all the words according to their frequency — to be exact, the number of instances of that word multiplied by 10. Then I place the biggest (most frequent) word in the middle of the empty canvas. Then I take the next word and place it in a free space around the perimeter of the first word. With each new word I look through all the words on the canvas in turn, looking for free space around their perimeter. As the centre fills up with words I have to move further out to get enough free space (though the words themselves get smaller as we reach the perimeter). This algorithm has terrible complexity. Don’t try it with more than the top 200 words. It still loads quicker than the Java implementation though ;-)

$ time ./cloud 
 
real   0m0.915s
user   0m0.896s
sys    0m0.012s

I also apply a random colour to each word by choosing a random number for each of the red, green, blue components. This produces a surprisingly pleasing set of colours! The smaller words are then faded out by increasing their transparency proportional to its frequency — words which are one tenth as common are one tenth as opaque. This approach isn’t very helpful as far as visualisation and ease of understanding, but it does make things far prettier! (And helps to disguise the inelegance of the layout algorithm too.)

This is what the result looks like, when run on its own source code. Word clouds of source code can produce surprisingly beautiful output.

home made word cloud

It’s important to tune your stop words correctly, otherwise your cloud is filled with boring stuff. In an English text you get loads of “a”, “the”, “to”, “it”. In Haskell you get lots of “import”, “newtype”, “deriving” and so on. Remove all of these and you get a nicer picture of the source text. Here we can see Word and Weight are important — two type synonyms for the more boring String and Int — which gives a hint at what the program is measuring.

As always, these examples are online at the following address, which is also a darcs repository:

No responses yet

Sep 19 2008

Music, rain and comedy

Published by Dougal under Comedy, Friends, Music, Reviews

On Monday evening I skipped off to Glasgow with Martin to see Sun Kil Moon, one of the side projects of US singer-songwriter Mark Kozelek. The gig was at a place called Stereo, which sounds like it might be a nightclub but turned out to be a vegan cafe with a stage in the basement, all situated at the far end of a damp side-street.

The music was proper melancholic Americana. All about unrequited love and dead boxers. The band made sure never to crack a smile during the whole performance, or to accidentally look like they were enjoying themselves.

Kozelek’s voice sounds just like it did on the records, though I’m not really sure how to describe it. A strange smooth, strained quality. It was really apparent on Monday night, though hard to describe. Brilliant show, anyway.

Tuesday night we got into another Nigella that had been hanging over us, though I haven’t got round to blogging it yet. Wednesday we went to The Stand Comedy Club. It was a charity fundraiser night for a cancer charity, but we went to see Emily (and Ella, Francis and some other people who I can’t name right now), who has just moved to Aberdeen.

Comedy was reasonable but not great. Last time we were at The Stand in Glasgow it was a weekend show but was even more variable in quality: the best was better but the worst was terrible. After the gig we went to the pub and I dropped Coke all over the table and my seat. And not even in an amusing Woody Allen way either, just the ordinary sugary fizzy liquid way.

No responses yet

Sep 17 2008

Shake it like a polaroid

Published by Dougal under Computing

Cat and Wii
Cat and Wii
© Wasin Waeosri

It’s becoming more obvious. Accelerometers have got so cheap and useful that they’re properly changing the way people interact with computing machinery. This is exciting. The Wii is something totally new in computer gaming. The barriers to participation have been stripped away. To play Wii Tennis you don’t need to master the art of a backhand using a tiny one-thumb joystick and a selection of buttons. You just swing your arms.

The iPhone/iPod Touch interface is sensitive to orientation — flip the unit sideways and the screen reorients itself in the new perspective. The new iPods let you shake the device to change tracks — a nifty innovation that makes fabulous use of solid-state devices: you couldn’t do that if your player had a hard disk inside…

I recently saw a technology demonstration using the iPhone and video conferencing. Several people sat in proximity to a computer, and the computer would transfer the person on the other end of a video conference call onto the iPhone screen. You could then transfer that person from your iPhone to your neighbour’s by casting — like in fishing — so the imaginary video genie flew off the end of your device and into the other person’s. Magic, no?

I guess it must be a really exciting time to be working with these things in mainstream devices. What other motion-sensitive devices are available right now? And what do you think they’ll appear in next?

No responses yet

Sep 16 2008

How to make a blackboard (or four)

Published by Dougal under Home

I had intended to write a long post about blackboards and such, but in the end decided no-one was really interested in my waffle. So instead I’ll just outline the process we used to make our own blackboards. Click through for the full details!

Continue Reading »

No responses yet

Next »