Yearly Archives: 2007

Generating random user_ids

At work, each new user is assigned a totally random alphanumeric 12-character ID. They’re random instead of sequential because this is what goes into the user’s cookie (and in some cases into URLs) and we didn’t want the IDs to be discoverable. Sometimes we need to do what we call a subscriber load and generate [...]

Redirect referer test

A web user is looking at page A. He clicks on a link for page B. That page has a META Refresh to page C. What is the value of HTTP_REFERER for that last request? What if the redirect was a Status 307? Or a location.replace() JavaScript call? What if he’s using Opera? I’ve been [...]

Sports Uberchampion trivia question

Here’s a trivia question (to which I currently do not know the answer) inspired by the Red Sox’s recent World Series win and what I can only hope is soon to be the unbeaten 9-0 Patriots. If you take the 4 major American team professional sports championships (Stanley Cup, World Series, Superbowl, NBA Finals[1]), what’s [...]

Live photocasting Halloween

Sometime during the planning of our two parallel Halloween parties, Chris and I realized we needed some way to allow the two groups to communicate. Videocasting was our first thought, but we didn’t have the equipment or the knowledge. But when it came to taking photos and putting them on websites, we had all kinds [...]

Solitaire probabilities

For some reason, I’ve been thinking about Klondike solitaire probabilities a lot lately. Primarily, I’m wondering what the likelihood is that a game will have zero legal plays. I’m certain it happens, but it’s got to be pretty rare. It’s a complex game, though, so here’s my plan towards solving it: Given two non-ace cards, [...]