The BBC love their esoteric, obscure electronic music. I think it all started with Sigur Rós in Planet Earth and proliferated from there. It’s even started creeping into BBC Radio 4 trailers now. The trailer for Will Self’s ‘A Point of View: In Defence of Obscure Words’ had just such a music bed. I decided that I would very much like to know what that music was.
Crazy high CPU usage on Snow Leopard and a surprising culprit
After coming back from a team-building trip, I started to notice things were going a bit slow on my work laptop. I took it with me for casual emailing and working on the train, but spent about 4 days not really using it and certainly not ‘working’ on it. It came out once to display the lyrics to a song about Pithivier, and once to check emails, but that was about it.
WordPress on Apache being Reverse Proxied by Nginx in an Endless Loop
I have a couple of WordPress installations running on Apache (on a non-80) port, and I’m reverse proxying them through nginx. Somewhere along the line WordPress is getting its knickers in a twist about the port not being the same as it expects. This results in WordPress going into an infinite redirect loop.
To solve this, I put this in the nginx virtual server config:
proxy_set_header Host $host;
Fixed.
In Which we Discover Some Rules About Python Scoping (which we already knew)
I’ve just been bitten by scoping in Python. If you gave me this code and asked me what it did, I’d probably guess that it was a trick question and look carefully at it. What would you say?
def demo(): number = 100 one = number / 100 numbers = [one, one+1, one+2] big_numbers = [number * 100 for number in numbers] bigger_numbers = [big_number * 100 for big_number in big_numbers] print number
From La Mantovana to the Moldau. Musical similarity in the absence of rhythm and what it means to FolkTuneFinder
Má Vlast is a set of pieces written by the composer Smetana in the late 1800s about his homeland, Czechoslovakia. One of the pieces in the set, The Moldau (Vltava in Czech) is one of my favourite symphonies of all time ever. It could be something in my partially Czech blood, it could be the fact that I’m soppy about Romantic-period orchestral music, whatever it is, I love this piece of music and know it intimately.
FolkTuneFinder index building used to be expensive
The first version of FolkTuneFinder was written in a combination of Java and PHP. I was still working out the best way to do melodic indexing, and the index build process was parallelised. The job ran across 14 Apple Xserves, made available to me by my university. That was back in 2008. These days it runs in a single virtual machine … somewhere.
Recent downtime on FolkTuneFinder.com
I started FolkTuneFinder as a student project back in 2008. I’d done websites for a few years before, but this was the first serious one with any kind of heavy lifting or interesting behaviour. Over the years I added features that allowed people to interact, such as the commenting and FolkTuneFinder blogs, which has been surprisingly popular.
I have always had a very small problem with spam: I received perhaps a small handful of blog posts a month, which was fine to deal with. It wasn’t a problem, and the most time-effective way of dealing with it was to delete the posts when they arose. There has always been a battle with spare time, and various interesting things have happened to me since 2008 meaning that I haven’t quite had as much time as I’d like.
Storing integers in Redis
I’ve been looking into Redis. I wondered about storing integers as keys and values rather than plain old strings. After asking on Stackoverflow, I did my own experiments.
It looks like it is possible to use any byte string as a key.
For my application’s case it actually didn’t make that much difference storing the strings or the integers. I imagine that the structure in Redis undergoes some kind of alignment anyway, so there may be some pre-wasted bytes anyway. The value is hashed in any case.
Typing on a one-row keyboard possible?
I’ve seen a number of special computer keyboards. These include, for example, five-finger units that require learning special ‘chords’. The idea of a one-handed keyboard is enticing but I don’t like the sound of having to learn specific combinations. What about re-using existing knowledge?
Anyone who touch-types knows that each letter belongs to a given finger. I wondered what would happen if you restricted the keyboard to just one row (i.e. one button for each finger) whether this would make a functioning concept.
Crazy Idea: Physical haptic feedback of progress through an ebook
Haptic feedback is still an area where real books win over e-book readers such as Kindles. Being able to tell how far through a book you are by the feel of it, by the balance and thickness of the pages adds something instinctive to the reading process.
My idea is to have a little linear actuator with a small weight on it that spans the width of the ebook device. Just a very small motor (the type you get in phone vibrators) and a small worm-gear (like you get in floppy disk drives) would do, and wouldn’t take up much space. The weight would gradually move across from left to right as you moved through the book. This would allow you to assess your progress through whatever tome you were currently reading just by feel.