Funny to see this on Hacker News -- I wrote it. Which means I should also take full responsibility for the performance complaints that have shown up in this thread.
Someone in the thread mentioned that they're "not sure how you could screw up a web app this simple." I'm entirely sure how we screwed it up.
My friend came up with the idea, designed the layout, and I built it. It was a spare time thing, just for fun. When we launched we seeded the database with a couple hundred questions and put it out there. Somehow (thank you Twitter, Tumblr, etc), the site saw 10,000 uniques in its first day, which exposed the fact that I'd over-normalized the database to death, and the site could hardly function. We launched at 11am, and by 3pm I was on the phone with mediatemple to upgrade the server just so there'd be enough memory to allocate an ssh session.
I spent a sleepless 72 hours after that rebuilding the architecture to try and make it scale, which it did -- for a while.
But now we've got a database with 13 million votes in it, and the app must cross-reference those votes with a user guid so as to serve fresh content, and it's simply outgrown whatever fixes I was able to make during that marathon coding weekend.
I haven't done any work on it in months, yet every so often it pops up somewhere on the web and guilts me into thinking I should probably re-architect it once again...
So if I don't sleep or leave my apartment this weekend I've got you all to thank :)
So if I'm getting you right, you think that it is of tremendous importance that a user not be asked, in their 5 question run, whether to choose Good or Evil twice.
And you're willing to take a MASSIVE performance hit to guarantee that, for all users.
OK, let me take a wild stab in the dark: you've got over 1,000 unique pairs in the database. You ask the overwhelming majority of users 5 questions. The chance of a user getting 5 unique questions, if you just pull them randomly out of the DB, is about 99%. And that would be Pretty Darn Fast to calculate.
Or, here's a cheap trick for you -- partition your table of questions into 5 groups. A really simple way is to take primary key mod 5, but if you want to do it better you just hash the input and then take mod 5, then store that in a group column. For the first question, choose randomly from group 1. For the second question, choose randomly from group two. etc. By construction, it is now impossible to ask the same user the same question twice.
Which means you don't have to store a user's prior votes at all. Just store counts.
There, enjoy your million-fold performance increase.
Well, it's not just that we wanted to avoid asking the same question twice in a 5 minute span... we do have users that spend literally HOURS just answering questions (instead of paying attention in class). So in order to maximally squander their education, we wanted them to receive new questions all the time.
this is a perfect example of premature optimization. same thing happened to me. i'm not sure how you could screw up a web app this simple. they seem to have gone in and tried to institute some form of rate limiting, and it's actually kicking out legitimate users with that error, now.
I'm getting the impression that it's not rate limiting, it's just running out of questions since not many people are asking them. It says something like that, and even if I fill it out slowly I never make it through.
icantdeci.de is quicker, no frills. I just went to doxory.com and saw a bunch of text that I didn't read, saw a login box, and left. icantdeci.de is much quicker and easier in my opnion.
One thing, on the stats page i.e. http://icantdeci.de/mostvotes/today, different heights of the pairs of two option divs would mislead people to think the heights are proportional to number of votes, which I later found is not true.
Anyone know what the 'star' functionality is meant to be for? Clicking the question mark next to it simply selected the star. Mouseover didn't giove any helpful tooltips either.
I remember a site similar to this, giving you two options and you choose one of them. The only thing distinct about this one was the options were placed on the text of each button, and sometimes they'd get pretty long.
Anyone know the url? I remember having a laugh reading some of them.
Very addictive, very KISS. Small gripe though, after about 10 answers I got a repeat question ("a or b"). Might have been a good idea to seed the site with about 100-200 questions before even releasing to public.
I was confused when I first visited - the different color text entry fields made it look like a flag and I didn't initially realize they were text fields.
The question is, do we live in an age where someone (admittedly someone in a very strange place mentally) might actually take the response seriously, or is that age just a few years or months away?
Our biggest demo is highschool girls wanting to know if they should stay with their boyfriends. If you're asking icantdeci.de (or an 8ball) it is probably immaterial if you ultimately act on the advice :)
Someone in the thread mentioned that they're "not sure how you could screw up a web app this simple." I'm entirely sure how we screwed it up.
My friend came up with the idea, designed the layout, and I built it. It was a spare time thing, just for fun. When we launched we seeded the database with a couple hundred questions and put it out there. Somehow (thank you Twitter, Tumblr, etc), the site saw 10,000 uniques in its first day, which exposed the fact that I'd over-normalized the database to death, and the site could hardly function. We launched at 11am, and by 3pm I was on the phone with mediatemple to upgrade the server just so there'd be enough memory to allocate an ssh session.
I spent a sleepless 72 hours after that rebuilding the architecture to try and make it scale, which it did -- for a while.
But now we've got a database with 13 million votes in it, and the app must cross-reference those votes with a user guid so as to serve fresh content, and it's simply outgrown whatever fixes I was able to make during that marathon coding weekend.
I haven't done any work on it in months, yet every so often it pops up somewhere on the web and guilts me into thinking I should probably re-architect it once again...
So if I don't sleep or leave my apartment this weekend I've got you all to thank :)