Valid CSS! Valid XHTML 1.0 Transitional! Powered by Blogger

A poem

When the act of standing upright makes your legs feel made of lead,
And you're constantly distracted by the pounding in your head.
When you're coughing and you're sneezing and you feel like you're half dead,
Then you know you've got the man-flu and should be tucked up in bed.

Thankyou and goodnight.

Posted on Tuesday, February 02, 2010 at 2:36 PM

Tuesday morning

For the first time in ages I feel compelled to write a blog post about my last couple of days.

I got free stuff yesterday! First of all I got a free MOT due to the loyalty scheme I have at my local garage, which is nice. I even got a free coffee with my free cup of tea. Then I drove in to work and got free parking because the parking machine was broken (which would normally cost around £6). Finally, through realising Virgin were screwing me (ironically) I got a free upgrade to 20MB broadband (although technically, they just stopped overcharging me for the 10MB broadband I had before.

So how could today top that? Well first of all I had a delivery today that I was going to stay in for, but I forgot about it. However, just as I was leaving the house the delivery man turned up and gave it to me. And then while I was waiting for the lift I found a pigeon roosting behind the heating pipes.

Life is good.

jk

I may change the colour scheme on this site - I'm not sure I like it any more.

Posted on Tuesday, December 01, 2009 at 10:04 AM

Marxism at large

Marxism as I understand it is fundamentally about everyone working together as a team for the good of all. So are the Marxist society going to clean up after themselves and remove the posters (and glue) that are up all on bus stops around the university advertising some Marxism expo that's going on?

I hate littering and stuff. Why are people so stupid? Can't they figure out that they live here too, and that if we keep the place a bit clean and tidy it's nicer for everyone.

I'm sure it all has to do with people's innate instincts to mark territory and show social status etc. etc. to which my reply is "Grow up you little prick and put your rubbish in the bin".

Posted on Wednesday, July 15, 2009 at 9:10 AM

Polite Notice

I just recieved an e-mail from a restaurant at the University where I work. It started with the dread phrase "Polite Notice".

Where the hell did this thing of putting "Polite Notice" everywhere come from! I don't even know what people mean when they use it. Does it mean that this is a polite notice but an impolite notice may follow? Does it mean that I should understand that the note was meant to be polite even if it seems rude?

What I am slightly more sure of is the etymology of the term. As I understand it (and this is only backed up by personal observation) the original use of the phrase was on signs such as "Polite Notice: No Parking" which were made to look almost identical to the signs "Police Notice: No Parking" apart from that change of a single letter. I guess that this was done in the hope that a busy motorist would not notice this difference and would be dissuaded from parking and blocking someones drive/garage.

Somehow this usage has seeped in to common parlance and I think it has lodged in peoples minds as a phrase, like "yours sincerely" at the end of a letter, that doesn't really have any specific meaning any more but is just a formal part of the structure of the communication. So "polite notice" is "something that you put before a sign/notice". This thoughtless use of language annoys me disproportionately.

I think I will make up a sign to put around the place. It will say "Polite Notice: Stop putting 'Polite Notice' on signs",

jk

Posted on Thursday, March 12, 2009 at 10:57 AM

Computer Vision Forum

I've just found a new computer vision forum on the web.

Oh yes - it's my new website. That's how I found it ;)

Posted on Tuesday, March 10, 2009 at 11:04 PM

Awesome Pictures

I just found this gallery of images of the super-kamiokande neutrino detector in Japan.

The pictures are pretty breathtaking, especially when you realise that each of those little domes is a hand blown piece of glass...

Posted on Wednesday, August 06, 2008 at 12:54 PM

Fire alarms

Just had to leave Starbucks due to a fire alarm :(. Still they have promised free re-fills for those of us forced to up and leave our seats!

Also I got my brand new gransfors bruks Small Forest axe, my lapplander folding saw and my fallkniven (spelling?) dry whetstone this morning (my Japanese sandstone is good but messy and not so portable...)

And just to top it all off I made some delicious double chocolate muffins this morning, although most of them have gone to Holly's meeting so I only got to try one (but I think I will make some more this evening!)

Pattern for multi threading matrix operations

When using numpy efficiently you often end up using broadcasting operations on large matrices to e.g. calculate a difference over all possible combinations of feature vectors and then take the minimum.

This kind of thing is very CPU efficient compared to looping and calculating in Python as all the looping etc. is handled by numpy's internal libraries but it can be memory innefficient (I keep on running out of RAM on our server which has 32Gb of the stuff...) and also as a monolithic operation doesn't make use of multiple threads (it also has 16 cores so I want to use them all).

Anyway I discovered the following usage pattern for easily splitting up a big matrix operation in to smaller chunks so it can fit in to memory and parallelising the operation (which is one of the big benefits of having all the heavy lifting done in numpy's C code rather than in GIL encumbered python)

First off you decide how you are going to split things up. So something like this:

cs = 10

Means I am going to split things up in to 10 column chunks for processing.

Then define a functor or lambda expression that operates on the data you want to process taking a start index as the parameter:

f = lambda x : log(A[x:x+cs] + B[newaxis])**2

Note that this is baking A, B and cs in to the expression - you could wrap things up in a functor and then specify A, B and cs in your final expression, but I can't be bothered.

finally you run parallel_map on your function and stitch together the results:

nt = 10
res = vstack(parallel_map(f,range(0,len(A),cs), nt))

This would split it over 10 threads. If you just want the parallelism speed up you set cs = len(A)/nt. If you want memory and speed optimisation you set nt and cs independently. If (for memory reasons) you want to further subdivide your problem you can use map within your lambda function to split up the indexing of B

Finally, vstack will do something wierd to your results if you are iterating over a single item each time so you may need to do something like this:

f = lambda x : [log(A[x] + B[newaxis])**2]

so you get a bunch of single entry lists which vstack will stack correctly.

So there you go - happy and efficient processing!

Posted on Friday, June 27, 2008 at 11:31 AM

See, I can organise a piss up in a brewery...

I've organised for me and my dad to go on a Hog's back Tour on Saturday as a joint Father's day / Birth day present

You get generous sampling and a souvenir glass to keep!

And I will get to use my new BBQ show off my new guitar and drum machine and my new Bass Strings (as used by Steve Harris - although they are really heavy and have put the relief and action on my Bass all out of whack) when the family come over for a birthday BBQ.

It will be great!