News for hackers. Stuff that matters.
Re:I Can't Decide by mattlanger on Monday December 08, 2008 @08:36AM (#389815)
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 :)

Re:I Can't Decide by patio11 on Monday December 08, 2008 @10:34AM (#389927)
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.

Re:I Can't Decide by aaronwhite on Monday December 08, 2008 @12:01PM (#390024)
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.
Re:I Can't Decide by Shamiq on Monday December 08, 2008 @01:14PM (#390110)
>>So in order to maximally squander their education, we wanted them to receive new questions all the time.

Sometimes I think this is the true reason the internet was created.

(additionally, you can substitute education with noun of choice)

Re:I Can't Decide by zasz on Monday December 08, 2008 @08:42AM (#389821)
It's cute and pretty, and pretty nice for a spare-time project. I like it well enough already. I'll just wait for the traffic to die down a bit.
Re:I Can't Decide by DaniFong on Monday December 08, 2008 @12:46AM (#389535)
I asked whether I should follow Good or Evil and it told me to go outside.
Re:I Can't Decide by jwilliams on Sunday December 07, 2008 @11:51PM (#389496)
Seems to be overloaded at the moment... Took ages to load and then said I was answering too quickly?
Re:I Can't Decide by drusenko on Monday December 08, 2008 @02:02AM (#389599)
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.
Re:I Can't Decide by mattmaroon on Monday December 08, 2008 @02:52AM (#389633)
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.
Re:I Can't Decide by aaronwhite on Monday December 08, 2008 @12:03PM (#390026)
It's most likely a bug. "Go outside" is intended to come up when you've answered all the quandaries that need answering that you haven't voted on yet.
Re:I Can't Decide by neilk on Monday December 08, 2008 @12:53AM (#389542)
Now I'm confused. Should I use Doxory.com or icantdeci.de?
Re:I Can't Decide by mnemonik on Monday December 08, 2008 @01:24AM (#389570)
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.
Re:I Can't Decide by jcl on Monday December 08, 2008 @02:01PM (#390173)
FWIW, icantdeci.de suggests icantdeci.de, by six votes to three.
Re:I Can't Decide by jrockway on Monday December 08, 2008 @02:57AM (#389640)
FWIW, a similar site called doxory.com (do x or y) has been around for ages. If this site is overloaded, try out doxory.
Re:I Can't Decide by mapleoin on Monday December 08, 2008 @03:40AM (#389667)
I'm surprised how nobody said that this was A COMPLETE WASTE OF TIME!, yet...
Re:I Can't Decide by gur on Monday December 08, 2008 @09:12AM (#389840)
It is, in the same way many fun things are.
Re:I Can't Decide by btw0 on Monday December 08, 2008 @02:02AM (#389598)
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.
Re:I Can't Decide by evilneanderthal on Monday December 08, 2008 @02:54AM (#389636)
also, it doesn't show the actual number of votes.

so, on a choice with many votes, if it's 50-50 with an odd number of votes you can't tell which one wins.

Re:I Can't Decide by FiReaNG3L on Monday December 08, 2008 @12:07AM (#389512)
Worked for me, lots of fun! It want me to keep working even though its midnight here :(
Re:I Can't Decide by light3 on Monday December 08, 2008 @01:18AM (#389564)
This site is the bomb! Could improve the speed a little tho ;p
Re:I Can't Decide by Dilpil on Monday December 08, 2008 @04:59PM (#390452)
Lesson: in a world of 6 billion people, everything is massively popular.
Re:I Can't Decide by Angostura on Monday December 08, 2008 @04:56AM (#389697)
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.
Re:I Can't Decide by zasz on Monday December 08, 2008 @06:18AM (#389737)
If it's a particularly cool question you want to save, star it.
Re:I Can't Decide by Angostura on Thursday December 11, 2008 @09:16AM (#394285)
Many thanks.
Re:I Can't Decide by Prrometheus on Sunday December 07, 2008 @11:51PM (#389497)
Might be fun if it worked.
Re:I Can't Decide by aquateen on Monday December 08, 2008 @12:44AM (#389532)
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.

Re:I Can't Decide by streety on Monday December 08, 2008 @03:44AM (#389668)
jrockway mentioned doxory.com

Might be what you're looking for.

Re:I Can't Decide by andrewljohnson on Monday December 08, 2008 @12:44AM (#389533)
You;'re site is a neat idea, but it broke on me and I never got to learn "dogs or cats"

:(

Re:I Can't Decide by andrewljohnson on Monday December 08, 2008 @12:45AM (#389534)
It said I was answering to quickly by the way.

Less robo-defense and more features please!

Re:I Can't Decide by nated on Tuesday December 09, 2008 @01:13AM (#391022)
Reminds me of this: http://uselesshypothetical.com/

I am not affiliated with that site but they seem fairly similar in concept. Not sure which I like better.

Re:I Can't Decide by sireat on Monday December 08, 2008 @04:27AM (#389682)
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.
Re:I Can't Decide by colinake on Monday December 08, 2008 @07:55AM (#389792)
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.

Worked well for me, though. Neat app.

Re:I Can't Decide by pjharrin on Monday December 08, 2008 @01:19AM (#389565)
if you go to fast and then refresh it makes you start over at 5
Re:I Can't Decide by mattjung on Monday December 08, 2008 @05:35AM (#389713)
If you can't decide or look for alternatives, you might also want to try my solution to that problem: http://dezidr.com
Re:I Can't Decide by ashleyw on Monday December 08, 2008 @06:09AM (#389732)

    2^10
      or
    ((10*101)+(((2^3)*2)-2))
Ummm...

Vert cool, like the design, layout, and how it works! :)

Re:I Can't Decide by LogicHoleFlaw on Monday December 08, 2008 @10:02PM (#390866)
...I asked the site what I should have for lunch.

I got back a tie.

Oh well, I worked through to dinner anyway.....

Re:I Can't Decide by DenisM on Monday December 08, 2008 @01:45AM (#389589)
Perfect platform for false choices. I have put in one already, let's see how many people get stuck in there. He-he! :)
Re:I Can't Decide by jfornear on Monday December 08, 2008 @01:33AM (#389575)
Interesting submissions. I could see myself checking the stats page on occasion.
Re:I Can't Decide by perfectlyfrank on Monday December 08, 2008 @07:57PM (#390708)
20% percent more people chose google over yahoo than life over death.
Re:I Can't Decide by d0mine on Monday December 08, 2008 @12:10AM (#389515)
`to be or not to be` seems to be working
Re:I Can't Decide by delackner on Monday December 08, 2008 @06:10AM (#389734)
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?
Re:I Can't Decide by aaronwhite on Monday December 08, 2008 @12:05PM (#390030)
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 :)
Re:I Can't Decide by peregrine on Monday December 08, 2008 @12:30AM (#389525)
You've seen mine :D
Re:I Can't Decide by blue1 on Monday December 08, 2008 @10:50AM (#389941)
isn't this a boolean version of the old Usenet Oracle?
Re:I Can't Decide by dexter on Monday December 08, 2008 @07:03AM (#389771)
Didn't accept my utf8 very well, the second answer is supposed to be P ≠ NP http://icantdeci.de/109438
Re:I Can't Decide by qqq on Monday December 08, 2008 @12:23AM (#389521)
several times it gave the same question twice in a row.