Posts Tagged ‘Web’

Two New Projects

Ahoy! I have two new projects up on github.

The python library is pretty trivial and self-explanatory, but I realized that I had copied it into enough projects that it deserved to be in setuptools.

The rationale for oplogutils is a little involved. Basically, this is what you need in some worst-case recovery scenarios. Those scenarios will be explained in more detail by John Allspaw and myself in upcoming posts on Code as Craft.

MongoDB at Etsy

Please check out my new post over at Code as Craft, MongoDB at Etsy.

There will be at least two more installments in this series, one by John Allspaw and another one by myself.

Programming Must Be An Open System

I decided I needed an hour break from Scala hacking, and I am about halfway finished with Sean Carroll's From Eternity to Here, which goes on at great length about entropy as it relates to time's arrow. So for the fun of it I whipped up a simulation of an Ehrenfest Urn using Processing.js.

Check it out here (requires a browser supporting canvas).

Now that I'm done, there are a couple of things I find amazing about this.

  • I felt like I needed a break from being paid to write Scala. As opposed to, like, Visual Basic, Java, C++, or something like that.
  • Within an hour I was able to download processing, learn the basics, and hack this animated demo together. And put it on a web page, viewable by pretty much anybody that I care to reach. Back in the early aughts I probably spent fifty or sixty hours just trying to figure out how to step debug javascript.

From eternity to here apparently involves a massive improvement in the state of the programming art. Everything is amazing and nobody's happy.

Etsy Haikus

Inspired by Peter Norvig, I have created a quick hack to generate haikus from Etsy listing titles. Check it out here.

Technical details for those who are interested:

  • The listings are downloaded from the Etsy API by an offline process, and stuffed into a MongoDB database if their titles are either five or seven syllables.
  • The CMU Pronunciation Dictionary handles the syllable wrangling.
  • The frontend is a very simple Django application.

All in all, about three or four hours of effort. Note that Etsy has nothing to do with these haikus, and doesn’t endorse this app.

And we’re back

So, I have finally fixed this stupid site. I spent years devising plans for rewriting it in lisp, or something, then one day read this essay about perfectionism and decided I was being completely ridiculous. Yes, that is my dog in the header, thank you for asking.

Some would have balked at the prospect of hand editing years of predominantly embarrassing posts, but I soldiered on through good times and bad. I am still messing with the layout and I haven’t even looked at the damn thing in Internet Explorer yet. (If you have IE—I don’t at home—let me know if something is really messed up.)

Evidently, once upon a time I had a career writing a lot of code for various Microsoft platforms. I feel like that part of my life needs to remain there for posterity, even though I am very happily participating in the open source, OMG-scale web world these days.

If I leave those posts there, perhaps someday someone can explain them to me. Very few of them make any sense to me now. I do remember fielding the e-mail from the ignoramus I-banker that prompted me to write Significant Digits for the Inummerate. With a little luck, his life is now ruined forever.

I thought I would miss debugging obscure threading issues, and rooting through core dumps, and staring at disassembly, but I was wrong. I have come to appreciate the sublime beauty of fork, the challenge of writing code for epic scale, having the damn source code, and solving problems that matter to people that are not evil mutants. I haven’t hand-edited XML in two years. Life is beautiful. Hopefully with the whole “blog” issue out of the way I will be able to think of something interesting to talk about.

PHP FAIL

The explanation for maybe 70% of the pages on the internet that say,

Well I don't know what the hell just happened but maybe you should delete your cookies.

can be found here. Specifically,

The setcookie function will silently change the '' cookie value to 'deleted' and override your expiry time to time() - 1 year.

Now in percentage terms, the number of people that have a local date that is incorrect by more than one year is probably very small. However the law of enormous numbers implies that at least of few such people will be using your site if you are successful, more or less depending on your usage demographics. What is the result? Well, those people are sending you "deleted" as a cookie value and your naively-written script probably has no idea what to do with it. Then your script tries to delete the cookie if it doesn't know how to handle it, but hey we've been here already, and everybody frowns and scratches their heads for a bit before giving up and writing the "what the hell" error page.

The preventative measure I would suggest in situations like these is writing relatively low-level tests to hit your pages and confirm that your application is being a good HTTP citizen. Even if you have to hack around PHP's hacks to accomplish this.

Re: my supergod blogging ability

Occasionally, I write things for Etsy's news blog thingamajig, the Storque. If this site isn't enough excitement for you, you can see what I am doing over there by following this link. End communication.

Rule of Thumb

So here's my method for determining whether or not a particular platform is worthwhile.

I ask myself, "how would David Letterman summarize this?" I know this doesn't seem very scientific, but it's a mask I have years of experience wearing. Trust me on this one.

When the curtain is raised to reveal a total square dancing around with a sign that says, "it's simply XML!" I ask myself, "is this anything?" Then I reflect for a second or two and decide, dismissively, that no. This is nothing.

Lakin Wecker has an alternative approach that involves thinking carefully and considering the lessons of history. I will re-evalutate my approach if our results ever differ significantly.

Feed Each Other

That site I have been working on in semi-secret for the last six or eight months is now live. Here it is:

http://feedeachother.com

Explanations, walkthroughs, etc. can all be found there.

Most of the credit for this thing really goes to Udi Falkson, one of my old Cornell friends who actually had the balls to quit a great job at Yahoo! to work on this full time. The lion's share of the code is his. I've seen it, and trust me, his dried blood and guts are all over this thing. At least I am pretty sure that's what it is.

Please check it out if you have not already, and add me as a contact. I am very proud of this site–working on something that you personally love and want to use is really satisfying.

People that I would like to thank, some of whom are pretty unlikely to ever notice this unless they google themselves:

  • Darrel Herbst, an early adopter and the source of a lot of typically brilliant feedback.
  • Katya Bassil, for being the best tester ever. You can thank her for Cute Overload working flawlessly.
  • Evan Reiser, for tons of good feedback, visual nitpickery, and for scouring the interweb for competitors.
  • Ron Eigen, for general enthusiasm and inviting a million people.
  • Rich Hedge, for awesome legal advice.