Archive for October, 2009

Hello World! (polyglot edition)

Friday, October 23rd, 2009

Sparked from a conversation I had with a friend and fellow programmer some odd hours ago, I decided it would be fun to try to make a program that would run in more than one language. Initially, I thought of Brainf*ck and C(++), but my friend suggested I add Whitespace to the mix too. As it turned out, I managed to throw in Python as well.

After some kind people in #esoteric@irc.freenode.net (I joined originally because it was my first foray into the madness that is Whitespace) told me that this is what is called a polyglot, they helped me shave the last fat off and this is the result. A 384 byte “Hello World!\n” that works in Brainf*ck, Whitespace, Python and C++. Not the worst thing I’ve spent a sleepless night on.

As for acknowledgements, I admit that the bf version was one I had lying around, and I don’t know if it was my own or someone else’s. I did the ws version myself because I couldn’t find a working version anywhere. I do owe thanks to coppro and immibis from #esoteric, they were most helpful in the final stages of the process.

UPDATE: reddit users mallardtheduck, isionous and youreameme have suggested further enhancements, which have resulted in shaving off a further 28  bytes, so here is an updated version weighing in at 356 bytes. Many thanks, reddit!

Breaking “The Next Big Thing in CAPTCHAs”

Friday, October 16th, 2009

I just stumbled upon this article (since taken down, see google cache) by Catch My Fame, and figured I would take him up on the challenge to break it. It was a good opportunity to play around with canvas and bookmarklets, neither of which I had tried before.

I won’t bore you with too many details, but the gist of it all is to transfer the image into canvas, then do some edge matching and figure out the best solution.

Without further ado, here are the solutions as a bookmarklet (follow the link to see it, WordPress wouldn’t let me link directly) and as a Ubiquity command

It does have it’s limits, but I’ve only seen it fail once, so it has a success rate of about 98% (which is better than my success rate when using Facebook’s CAPTCHA.) Also, I have only tested in Firefox, so no promises if you’re using something else.

If you want to understand what’s going on, I’d advise you to look at the Ubiquity command first; very little is related to Ubiquity.

Does this mean I caught his fame? :-)

UPDATE: It appears Mr. Catch My Fame didn’t want to display his post touting a broken CAPTCHA system, so he took the post down – the demo is still up, so if you hurry you can still see it in action: http://www.catchmyfame.com/jquery/slider_captcha/

UPDATE 2: I have made a small change in the fitness function, making it much more reliable — you can track changes by looking at the Ubiquity command at github

UPDATE 3: The demo has since also been taken down, but as they say, once burned twice shy, and I made a copy well in advance: sliderCAPTCHA. Also, the original blog post appears in google cache (thanks semanticist/Reddit)