The maze book for programmers!
mazesforprogrammers.com

Algorithms, circle mazes, hex grids, masking, weaving, braiding, 3D and 4D grids, spheres, and more!

DRM-Free Ebook

The Buckblog

assorted ramblings by Jamis Buck

Magic 8ttp Ball

7 March 2008 — 1-minute read

My son, Britton, woke up this morning a little before 4am. As I was getting back into bed after feeding him, I saw that the clock read “4:04”, and (being the geek I am) I immediately thought “heh, 404 Sleep Not Found”.

He woke up a few minutes later, needing a bit of comforting (he’s definitely not usually this needy!), and when I got back into bed, the clock read “4:22”, obviously telling me that sleep was an “Unprocessable Entity”.

And thus the Magic 8ttp Ball was born.

Go on! Ask it anything! It’ll give you a suitably ambiguous HTTP response code in return. I’ve even been told it works great on the iPhone for when you have those burning questions on-the-go.

Reader Comments

Amazing. Fantastic Job

You’ve impacted me for life. I will never look at a clock the same. Ever. :)

Enjoyed this greatly. Especially the fact that the styling of the answer looks like a browser response.

Damn, it’s 9:40, now I have to wait for about 4 hours before the hour becomes useful.

as someone else with a baby boy waking me up a few times a night I found this to be especially heart-warming

thanks

One of the funniest things I’ve seen in a long time.. Great work..

hehe, using brute force technique you can get really appropriate answers to the questions :)

I’m disappointed that the actual status code being returned for all of them is good ol’ 200. How are we supposed to implement applications that consume it in an efficient way if we have to scrape the body text?

@hatless, I tried having it actually return that status code, but some of them are actually interpreted by the browser as that status, with unexpected consequences. Imagine that! A browser understanding a status code! ;)

On the other hand, though, you obviously didn’t think to try the XML version:

1
curl -i "http://8ttp.jamisbuck.org/answer.xml?q=Will Java ever make a comeback"

That will return a blank body with the “correct” HTTP status code, and an X-Question header that echoes the original question.

sigh

Never mind. The XML version doesn’t actually work, because lighttpd translates HTTP status codes it doesn’t understand (which is most of them) to “400 Bad Request”.

Ah, well.

Must say I’m impressed that you at least intended to have it work “properly”. :)

As usual, I am in awe. I trust that the https version works for when I need a secure answer to “she loves me, or loves me not?”...

Goodbye the rest of the afternoon!

Jamis,

Aren’t you the original developer of Vade Mecum? You’ve come a long way! :D

404 Sleep not found! Awesome. Glad to see family life gets others up at 4:00 am to (hopefully) get something done.

@Dustin, yes, I originally wrote Vade Mecum, too! I’ve dabbled in quite a few different things, and PocketPC development was one of them. :)