How to draw anything (in 1 step)

Posted in Crumbs of the internet

OK, haven’t posted in a while, but I laughed at this and Aviary have some great apps…

How to draw anything (in 1 step)

A dog in front of the earth

1 Comment »

Free our Bills!

Posted in Blitherings

A duck-billed-platypus escaping somewhere

Thought I’d share another (vaguely) political whatsit with you today.

Theyworkforyou.com is a great resource for engaging with your local MP (or MEP, MSP etc…), seeing how they vote and how they compare with other MPs.

They’ve got a really interesting campaign on at the moment: Free our Bills!

Basically the idea is that UK parliament don’t publish the bills on which they vote in any sort of electronic format. This makes any sort of meaningful distribution absolutely impossible, which is ridiculous in this age of the internet. In addition to making distribution easier, theyworkforyou also have loads of other greta ideas for uses for the data - think email alerts and annotated explanations for a start!

If you need further selling on the idea, let me just say ‘XML’ and ‘open source’. Oh, and take a look at the site to see other interesting stuff.

Go sign the petition,

Tom x

No Comments »

Tell Simon Burgess your views

Posted in Blitherings

Today I received a letter from Simon Burgess of Brighton Kemptown and Peacehaven Labour abour “Our NHS”:

A scan of the letter sent to me (5 times) by Simon Burgess
Click for a bigger (readable) version.

To which I felt compelled to reply:

Dear Simon Burgess,
I’m am writing to express my most sincere disappointment with your
latest mailing: “Our NHS - the next 60 years”.
Like its police-focused predecessor, your letter is the worst kind of
unsubstantiated spin disguised as consultation. Sentences such as “I
care passionately about the NHS.” are so empty that they serve only to
warn the reader about the rest of the drivel in your letter and, in my
case, almost caused me to stop reading altogether.
I eventually managed to force myself to continue reading your missive,
but my persistence was only rewarded with my worst fears… Not only was
there an unholy abundance of partisan political rhetoric (seemingly a
desperate attempt to prevent me from voting Tory), but a distinct lack
of quantifiable facts, targets or solutions.
As a long-time Labour supported myself, your campaign methods sadden me.
It symbolises the fall of Labour from an advocate of socialism and
equality to a shiny marketing firm intent only on ensuring its own
survival. The New Labour of 2008 seems to treat the general public as
some sort of moronic cattle placable by positive, yet empty, sentiments
and promises. Please have some faith in the voter; give us facts and
plans so that we can make informed decisions as to our parliamentary
representation.
Moreover, the name-calling and emotive language aimed at the
conservatives is also highly galling - I, for one, am quite capable of
not voting Tory, without the goading, thank you all the same… Your
attempts to rubbish the opposition come across as a childish, futile,
and wholly pathetic effort to salvage some of the good-feeling Labour
has managed to destroy in recent years.
My final quarrel is with the mailings themselves. My household received
no less than five of your letters this morning. Whilst I might question
the need for such mailings in the first instance, I would be prepared to
concede that you hold them in high esteem as vehicles for your
self-promotion - and that’s OK. No, the aspect I cannot forgive is the
sheer scale of waste. Would not just one letter to my house have
sufficed? Or otherwise, could you not have simply put the five
(identical) letters into one envelope? Is this really a responsible way
to spend party funds? Furthermore, what of the environment? Not only
have you wasted five sheets of paper and five envelopes, but you made it
needlessly difficult to recycle the envelopes because of your use of the
type with plastic windows.
My criticisms are not intended to cause personal offence - it is a sad
fact that the problem lies not with you, but with the modern ethos of
the party. I feel sure now that I cannot vote Labour again until these
fundamental issues are resolved.
I sign off then, as a disillusioned red, with perhaps too much time on
his hands.
Wishing you the best of luck in your campaign,
Tom Wright
PS *insert meaningless catchphrase here*

In the name of good sport, I will happily post his response here too.

Tom x

No Comments »

Introuducing ScribeSense

Posted in Code

Some of you may know that I’m making a documentary this summer, but what very few people knew was that the documentary is just another excuse for me to be incredibly geeky. Ladies and gentlemen, boys and girls, please give a warm welcome to:

ScribeSense - Video transcription without the trauma

Basically, ScribeSense is a tool for annotating (transcribing) video without resorting to burning lots of DVDs. You’ll probably only ever find this useful if you’re doing some kind of film production, but if you are I hope it becomes an invaluable friend.

I generally end this sort of thing with a snippet, and I’m not gonna let y’all down today:

function cuepoint() {
	if (this.inputbox.text.length>1) {
		var itemlabel:String = "[" + sec2tc(this.secbox.text) + "]\t"+ snip_txt(this.inputbox.text);
		if (edit_item_index.text.length>0) {
			var editIndex = Number(edit_item_index.text);
			logDP.replaceItemAt({label:itemlabel,timestamp:Number(this.secbox.text), data:this.inputbox.text},editIndex);
			edit_item_index.text = "";
		} else {
			logDP.addItem({label:itemlabel,timestamp:Number(this.secbox.text), data:this.inputbox.text});
		}
		logDP.sortOn("timestamp");
	}
	this.inputbox.text = "";
	this.secbox.text = timecode();
	this.tcbox.text = sec2tc(timecode());
}

The whole thing is a veritable mixing pot of actionscript, PHP and javascript with lashings of XML holding it all together. Producing it made me insanely happy.

Feedback would be appreciated (if you have any) through the usual channels.

Tom x

No Comments »

Wonka: A Recut Trailer

Posted in Crumbs of the internet

This needs no introduction…

Nor does it need a conclusion.

I hope you enjoyed it,

Tom x

No Comments »

Toilet roll update + pushy ice-cream vending

Posted in Blitherings

Right kids, as you may have guessed from the title, todays post is a double-bill…

First up: You remember I posted a while ago about the correct alignment of toilet roll? Remember how important we discovered it was to have the free-end hanging over, rather than under? Well the other day at work, I saw this:

Toilet roll sign

I’m just glad to see that there are companies in the UK that take toilet-roll safety & wastage seriously. I’m really quite chuffed to be able to say I work for them. Go Mothercare!

Next: When I was last in Leicestershire, I snapped this on my phone and forgot about it:

Quicker sales mean bigger profits

That’s right, the sign says: “Quicker Sales mean Bigger Profits - stock the UK Impulse top 6 sellers”.

A little bit of me died that day… Before that I had subconsciously believed in the innocence of ice-cream sales - surely no-one would want to sell pure pleasure for cold profit? Don’t they just want me to be happy?

Bet you’re glad I hit you with the good news first,

Tom x

2 Comments »

MD5 in PHP works exactly as it should (don’t believe the hype!)

Posted in Code

Hey guys,

I’m afraid today I have to confess to an almighty amount of stupidity, but first - please allow me to set the record straight so that nobody ever makes that mistake again:

The PHP MD5 function produces the same hashes as any other MD5 function written in any other language ever devised.

Please don’t pay any heed whatsoever to the whisperings that abound the wonderful interweb. Hmmm… Maybe ‘abound’ isn’t the right word, which is exactly what should have sent the rumour-alarm clanging away in my head. Truth is, there are a small spattering of references to this problem, but often people (like me) work out that it was a problem with their own code that they attributed to the ‘encoding problem’ because it’s easier to ‘blame their tools‘.

As was pointed out to me:

md5 always takes the argument as a bit vector rather than a string of letters, i.e. no encoding matters. If your script is written in ISO-8559-15 and you passed an embedded string literal to md5(), the result is the hash of a ISO-8859-15 string

Y’know what? It’s true! When I did a bit more debugging I found that I was inserting invisible whitespace into the string I tried hashing. Whitespace is as visible as any other character to the MD5 function - the hash of ‘ hashtext’ (notice the leading space) will therefore be different to the hash of ‘hashtext’. Nothing to do with utf7 or utf8!

And guess what? It’s not just me… On experts exchange1 I found a user with a similar problem in Java. He later explains that in his case a string wasn’t being lowecased prior to hashing:

Hello. Have got access to the php code now and can see that the php programmer did not actually follow the specification (did not make all chars to lowercase bfore md5…) Sorry to have bothereed u with this, was extremely painfull to sort out the bug when I could not see the php code.

But this sort of response is never publicised in the same way. These answers, these non-problems, are always buried as apologetic admissions of bad development practice. I want to put an end to this, and by publishing this post I hope to nip this slowly spreading rumour in the bud.

Go forth and spread the good news - The PHP MD5 is not dead. Long live (urm) the PHP MD5 function!

Tom x


Footnotes:

  1. See here to access without a login []

7 Comments »