What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 127 Stack Exchange communities.

I found that marking http://stackoverflow.com/questions/234075/what-is-your-best-programmer-joke-closed as a favorite removes the number of people having set it as a favorite and resets it to 2, and subsequently unmarking it will set the number to 1. Refreshing the page with it marked shows the proper number again, but then unmarking it as a favorite will set the number to 0 marking it as a favorite again at this point changes the number to 1. This seems to hold true for other high favorited counts as well, such as http://stackoverflow.com/questions/9033/hidden-features-of-c

share|improve this question
2  
I'll keep doing it until they tell me I'm crazy. It keeps coming back to me. That damned joke question. If you like it so much why don't you just marry it. And I'll unfavourite their questions. Or become a moderator so that I can delete it permanently. Favourites. Also I could try unfavouriting it. Then I'll downvote them. And then marry it. It's questions like this that make me wish I could downvote something more than once. Always there with its off-topic upvotes and favourites. Downvoting their children. But then I would have to keep downvoting it until there's nothing left. –  XMLbog Jan 21 '10 at 20:42
    
Haha... sorry to have sent you into a psychotic break there... it was just where I happened to be when I noticed it. I don't have time to read ALL 19 PAGES of answers at once, otherwise it wouldn't really be favorite material. But I can call the men in white coats for you if needed, just say the word. :P –  Nathan Wheeler Jan 21 '10 at 20:47
4  
When those men come, I will downvote them. –  XMLbog Jan 21 '10 at 20:52
    
youtube.com/watch?v=hnzHtm1jhL4 –  Adam Davis Jan 22 '10 at 3:30
add comment

3 Answers

up vote 5 down vote accepted

My guess is it has something to do with adding or subtracting 1 from the number.

When creating a greasemonkey script, I ran into the problem with the formating of numbers, as they use 40k for 40000 or 1,000 for 1000. Both of these formats are regularly un-proccessable by Javascript without knowing about them before hand.

I ended up having to create a function that would translate StackOverflow numbers into regular parse-able numbers.

In jQuery, the function that updates the count is probably something like this:

score = parseInt($('#favorite_count').text(), 10);
$('#favorite_count').text(score-1);

or

$('#favorite_count').text(score+1);

What is happening is the `parseInt' sees the comma, and then stops reading the number. Therefore truncating it to 1.

Then:

1+1 = 2 

and

1-1 = 0

Following that logic, any question with 2,000 favorites will show 3 when you favorite it, and 1 when you unfavorite it.

The only reason we haven't figured this out till now is because there really hasn't been that many questions that get 1,000+ favorites, and we mostly deal with 1s, 10s, and 100s. All three of these do not have any special formating, and therefore have worked.

The problem is that you would have to parse the number, make a modification, and then reformat it, and then display it.

share|improve this answer
    
My guess is that your guess is right. I hadn't thought about the comma in there. –  Nathan Wheeler Jan 21 '10 at 20:41
add comment

Excellent find! Edge case, however.

share|improve this answer
    
Agreed, doesn't effect the usability of the site either, even where it effects the UI. Just thought it was worth a mention in the case that someone didn't have enough to work on (yeah, riiight) and wanted something to do. –  Nathan Wheeler Jan 21 '10 at 20:39
add comment

Rounding error. Favorite counts are stored as a 3 bit floating point number.

Don't ask why, just accept it and move on.

share|improve this answer
    
???????????????????????????????????? –  Tyler Carter Jan 21 '10 at 20:58
    
do you mean 3-byte? –  Lance Roberts Jan 21 '10 at 21:00
3  
Just a joke, folks. –  Adam Davis Jan 21 '10 at 21:14
1  
Dang, it's true, though :) –  Jarrod Dixon Jan 24 '10 at 10:35
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .