Zoetica

Zoetica

Found while rambling. Yowzer.

Kassa for Monkey, 02007/04/02

Kassa djembe patterns for Shiko gig @ Monkey Bar, April 2nd 02007.

Read the rest of this entry »

Yankadi/Macru for Monkey, 02007/04/02

Yankadi/Macru djembe patterns for Shiko gig @ Monkey Bar, April 2nd 02007.

Read the rest of this entry »

Kennefoli/Soli for Monkey, 02007/04/02

Kennefoli/Soli djembe patterns for Shiko gig @ Monkey Bar, April 2nd 02007.

Read the rest of this entry »

A treat for everyone who prints Gimboland to read on the bus

Sweet. I’ve just discovered the joy of media="print" Cascading Style Sheets. Now if you print (or, yea, print preview) any of the pages on Gimboland, the printed version won’t include sidebar, footer, most of the header, or a comment entry form (if one is present). Tidy!

This is achieved using the strip-it-down magic that is my print.css.

Seems to work great under Firefox. Slightly less optimal under IE7 but hey, who cares? I haven’t tried it with Safari or Opera yet. Any takers?

If only there was a separate radio fee…

Your opinions, please:

As of the 10th of April, the Gimboland household will once again be television-free, and thus free of the obligation to pay for a TV licence. The Gimboland household will, however, continue to love such gems as Late Junction, Rob da Bank, Radio 4 (except the plays, obviously), and the BBC’s online presence in general. All of the above are funded by the licence fee, so the question is: should we in fact continue paying it? I’m half tempted, despite the lack of a legal obligation, simply because I do so value the BBC, in all its commercial-free glory. It has been said by wiser humans than I that the fee is worth it just for Radio 4, and that’s not entirely untrue, I’d say.

Thoughts?

There’s no escape

SQL injection attacks in a nutshell.

Come in, number 348, your time will be up in ten thousand years

Woo hoo. I am the 348th charter member of the Long Now Foundation. Among other things, this gets me access to the US premiere of Eno’s “77 Million Paintings”; alas, I’d say the probability of me affording a flight to the USA this year is approximately zero. Ah well.

On the other hand, I don’t really mind. The best thing you can do to protect the environment, as Spencer Beebe says, is stay at home. :-)

Bash, Singleton Park, 2003

Thumbnail: Bash, Singleton Park, 2003

She so foxy. 4 years ago now, mind! Oh, but still foxy. Don’t hit me, Bash. Ow.

That is comedy.

Surprise Shiko gig: Monday 2nd April, Monkey Bar

Woo. In a surprise move, Shiko will be drumming at the Monkey Bar, Swansea, on the evening of Monday 2nd April 2007. There is, apparently, some sort of African night going on, and since our beats are west African, our beats are invited. :-) Come!

Sayaka

Sayaka – gosh [via Bash].

All about python and unicode

Handy for future reference and pointing confused ASCII-loving students at: all about python and unicode, just the thing to explain the mysteries of unicode in a friendly manner, especially, er, if you know python.

What have you been doing? Acting mad.

I know this is nothing new, and I know there are many, many pages like this on t’Internet, but I just wanted to bookmark one for personal future chortle reference, thus: loads of pictures of cats acting mad or looking weird. Often the captions make the picture, though the whole “i’m on yr noun, verbing yr noun” meme gets stretched too far too often, I think. Still, I love cats, I love looking at them, I love laughing at them – so this is pure uplifting fun as far as I’m concerned. :-)

Classics: full speed ahead · your guy · dead of cute · proceed · offline · (original) · fail · charles · askance · thoughts · sup · shoryuken · relevant · rumbled · lion · slippers · trap · danger (how beautiful is that?) · cookie · hats · bat country · richard griffiths · camouflage · schweaty.

RSS feed – don’t miss a kitty!

One for Rich

Brings a nostalgic tear to the eye, is what it does

Parakeets UK

Parakeets in London & the home counties.

Tune in

Bash has just played me “Tune In” by Hadouken!. Incredible. I haven’t felt this way since Funky Town. No, wait. Turn The Page.

Photo goodies x 3

Some photographic goodness: sleep sequences (no gay couples, I note), lego escher, Leo Sayer (geddit!?).

Monad wrangling, and the joy of #haskell

Three days ago, I enthused about the Python community, and what a great help to me they were back in the day.

These days it’s Haskell that has my brain feeling too small, and I’ve just had my first experience of the Haskell community. I installed an IRC client for the first time in four years just so I could log on to the #haskell IRC channel. I’m happy to report that the experience was entirely positive.

For an imperative programmer, learning Haskell is initially hard because you have to stop thinking in terms of issuing instructions which will be performed in order, and start thinking in terms of composing pure functions (which have no side effects) together to Get Things Done. It’s weird at first, but ultimately very powerful, as it lends itself much more nicely to higher-order programming, lazy evaluation, actually composing programs out of reusable parts, etc. I’d say I’m starting to get a reasonable feel for that, although I’ve got a long way to go.

Unfortunately, a little later, you realise that there are cases where you need side-effects (eg input/output), which leads you into this whole sort-of-imperative side of Haskell, at the heart of which lie the hairy monad things. You totally can’t avoid this, because sooner or later you need to do I/O. Monadic I/O (and monads in general) look & feel imperative at first, but you soon hit barriers thinking like that, and ultimately really have to read stuff like The I/O Inside Tutorial, Tackling The Awkward Squad, etc. in order to understand what’s really going on, which is actually really clever, decidedly not imperative, and at some point turns into lambda calculus or category theory (take your pick).

It’s monads that I’ve been wrangling with lately. I’ve been trying to do a fairly simple I/O task: I have some directory containing some files; I want to operate on a subset of the files in that directory, for each of them reading the file and creating some data object representing its contents. The details aren’t important. Doing this in Python (say) is trivial. Doing it in Haskell has had me stuck for nearly a week. :-) I spent all day last Friday working through “I/O Inside”, and now understand monads much better than I did, and maybe half as well as I should (but maybe not even). That was all very informative and educational, but still didn’t answer my problem.

Anyway, long story short, tonight I installed an IRC client, went on #haskell, asked the question, and got an answer immediately and in a wonderfully friendly fashion. Full #haskell chat log for today is here if anyone’s interested, but in essence it turns out that mapM is what I need for this task. Sweet, and actually incredibly simple when you know it. I think a lot of Haskell is like that…

By the way, the #haskell channel has this neato lambdabot running, which among other handy functions, remembers and repeats amusing/apposite quotes when instructed to do so. Given the sad theory geek that I am becoming, this quote it kicked up tonight made me chortle:

Binkley: the sex is all in the operational semantics, denotational semantics only deals with love.

vincenz, 14:41:22

Get on the nut… foot.

The porn is deleted.

Two future Shiko gigs

Sometimes people complain to me that I don’t tell them about Shiko gigs far enough in advance (typically I forget about it until the day before, or the day after). Well, let’s do something about that, and put some gigs on the long-range radar for anyone who’s interested.

First, on Saturday 19th May, there’s a benefit gig in Cafe Cesso (?) at the Waterfront Museum, Swansea Marina. This is the cafe at the edge of the museum, with a stage, etc. I think this happens in the afternoon, and there’ll be various people playing, raising money for a project installing wells in Africa. (Novel wells where the pumping is powered by a kids’ roundabout at the top, which leads me to imagine parents swinging whips and shouting “play harder!”, though I’m fairly sure that’s not the actual intent.)

Second, and muchos excitingly, on Saturday 21st July, we’ll be playing at the Bee Hop festival in Dorset, which just looks so cute you could take it home and feed it. This one I’m really looking forward to.

So there you go – no excuses, come and watch! I’m sure there’ll be more cropping up as the summer gets going, and I’ll try to do a better job of mentioning them here. There is, by the way, also a running page of upcoming Shiko stuff on the Shiko site. But anyway.

Shiko at Mumbles St David’s Day Parade 2007

Drumming in public last Saturday was super ++fun.

The “Mumbles St David’s Day Parade” turned out to be somewhat smaller than I’d expected, but was excellent, nonetheless. It consisted of a group of primary school children in a Chinese-style dragon (red, of course), Shiko drumming alongside them, and another group of primary school childen behind, dancing and holding aloft a banner (which I didn’t actually read). About 50 people in total, I guess? It was enough, anyway, and a good crowd turned out to watch us.

The dragon looked like this:

Parade dragon (thumbnail)

Pretty good, eh? There are more photos on the all new Shiko flickr space.

The parade started in the quarry car park, crossed the road to get to the sea front, went south for maybe a couple of hundred metres in front of the grassy bit, then back north along the road to the mini-roundabout, and up Newton Road past the shops and the Ostreme Centre as far as the church at the top. We should have ended up in the school grounds opposite the church, but apparently nobody knew the combination lock for the gate! There was a moment of faff before plan b, and a diversion over the road.

This was the first time I’d drummed and walked at the same time. We all had light drums, mine one of these, donated to Shiko by Abbie, sadly missed since she disappeared around the world on a yacht. Although you can’t see it, I carried it via my climbing harness & a crab, as opposed to the more traditional sling (eg Chris, on the left). I wasn’t sure how well that was going to work, but it was great! I felt very much the modern climbing djembe innovator.

So yeah, it was a lot of fun. Lots of enthusiastic spectators, bemused shoppers & Mumblians, and an interesting mix of car drivers. The downhill traffic was halted all the way down Newtown Road (the uphill side was kept clear, halted further back), and the cars contained, I’d say, a 70/30 mix of people who were lovin’ it, happy to be in the middle of this strange unexpected happening (especially if they had kids, as you can imagine), and scowling men on their own in large cars trying to get to town and Do Important Things. I took particular care to play enthusiastically at these people, and make it as clear as possible that I was having a damn good time on this gorgeous sunny day, even if they weren’t. :-)

In other news, chor and indeed tle.

Threads should pass messages, not share memory

Highly recommended reading for any of my students out there: a comparison of message-passing concurrency vs. shared-memory concurrency, with a healthy dose of historical perspective. The author introduces Erlang-style concurrency in a Java-ish setting, and does so quite well, to my mind.

Reading the introductory remarks about candidates in interviews, I was pleased, nay, smug to realise that – albeit inadvertantly – I came to multi-threaded programming via the message-passing route, and would probably have made him quite happy if he’d interviewed me. Back when I worked at Frontier I did my first multi-threading work, in Python, and made heavy use of its excellent Queue class for inter-thread communication. Queue provides a thread-safe message passing mechanism, hiding all the nasty details of locking from me, which was exactly what I was looking for. My threads shared almost no state, and what state they did share was mostly Queue objects. They communicated by passing messages through Queues (messages could be anything, and often were), and it was all lovely and clean.

Why did I go down that route? No genius; I just got lucky (yeah, lucky in that I was using Python not Java or C or C++). I had excellent advice from the good folk on comp.lang.python/python-list: this was the way to proceed. Of course, looking back I realise many of these guys knew all about message passing vs shared memory, they knew about Erlang, they knew about Haskell, hell some of them even knew about Lisp. A community as smart and welcoming as that one is a precious resource for a budding programmer.

Anyway, this led to two strongly noticeable results.

First, my code worked well, and didn’t suffer from mysterious hard-to-debug race conditions, etc. It “just worked”, as is often the way with Python.

Second (confession time), I didn’t actually learn properly about semaphores, monitors, shared memory concurrency and all its ridiculous fiddly baggage until I came to teach them in the Operating Systems module at Swansea! By then I’d already formed a strong sense that high-level languages (and Python in particular) made life so much sensibler, so the shared memory stuff slotted quite readily into the mental space of “low level stuff which has to be understood, but is best done by software not humans” (like much of that module).

I was discussing this whole issue with one of my students earlier in the week. If she closed her app’s main window while a worker thread was running, the program would exit uncleanly. This being Python, it was nothing more drastic than an exception/traceback, but she found this properly displeasing and wanted to clean it up (good, I said). It turned out that the main thread wasn’t waiting for the worker to finish: it exited immediately, cleaning up all data, including data the worker was trying to update. Hence, exception city. I showed the simple fix (make the main thread wait for the worker to finish, using a shared boolean “I’m not dead yet” variable), but then I tried to persuade her that message-passing concurrency was the way to go for all inter-thread communication. Even, said I, right down to the (frequent, many) interface updates caused by the worker thread. That is, I suggested, the worker shouldn’t update the GUI component directly, because the GUI is owned by the main thread. Instead, the worker should pass messages to the main thread telling it what updates to perform, and the main thread should poll for these messages and do the updates. I don’t think I sold her on it entirely, but maybe I planted sump’n.

(Caveat: yes, if performance really matters – eg you’re doing volume graphics – this may be poor advice. For the other 95% of us, however…)

Callington museum goes up in flames

Sad day: Mum rang earlier to tell me that Callington museum caught fire this morning. Sadder still, I haven’t ever visited it – for all those years since it opened, I’ve always postponed going because “it’ll be there when I get round to it”. Well, too late Gimbo. Lesson in there for all of us, I’d say.

(Callington is my home town, btw.)

Update 2007-03-05: Dad sent me the following photo:

Callington Museum (burnt out)

Apparently he spoke to one of the firemen, and (I quote) it would appear most of the artifacts were saved, with only smoke & water damage. Cause was apparently an electrical fire at the control box.

“Somebody somewhere has got to be high”

PHP programmers: did you know that the name of your favourite language actually stands for Pot Head Pixies? All starts to make a bit more sense now, eh?

Spam problem seems to have resolved itself

The spam issue I reported a few days ago seems to have gone away (for now). I suppose they used gimbo.org.uk addresses for “one run”, and then I saw the undeliverable reports petering in over the next few days (though mostly on that first day), and now they’ve stopped. Still, it could start up again any time.

My ISP’s advice was to disable the (otherwise very handy) “catchall” account; I can still create “one use” addresses my setting up an alias/forward (easily via their web admin interface), but that’s still gonna be a PITA (I’ll be bound to miss some, too). Why is the world full of people who insist on making things shittier for the rest of us? The catchall is really handy but now I’m told I can’t use it because of some asshat trying to sell viagra? It ain’t right.

Tags working again

Tags in Gimboland were broken. Now they’re fixed. That is all.

Bee girl alive and well and living in the front bedroom

Wow… The Blind Melon bee girl (or someone claiming to be her) has sent a postcard to Postsecret. Apparently she’s 18 and still trying to find where she belongs. She shouldn’t worry; I’m 32 and only just starting to work it out, I think.

(I hope that permalink remains valid – in the past, Postsecrets have been impossible to link to effectively once they fell off the front page.)

The man with the van

This just in: Brandon Bird is still a genius. (Damn right he is.)