Del.icio.us Error.
Jun 21 2005
While visiting http://del.icio.us/popular, I happened upon a lovely divide-by-zero error while Josh was performing an update to his site. I love seeing these errors, as they reaffirm to me that other developers are human as well, and that I am not alone in the world.
For the curious among you, here is the error message in its entirety. http://del.icio.us is written in Perl, and makes heavy use of the HTML::MASON module. Included in the error are 9 lines of the algorithm used to determine a link’s popularity:
64: if ($style == 3) { $score = ($recent * $recent) / $total; }
65: if ($style == 4) { $score = (($recent / $total) > 0.07 ) * ($recent * $recent) / $total; }
66: if ($style == 5) { $score = ($recent) / (1 + $total - $recent); }
67: if ($style == 6) { $score = $recent; }
68:
69: my $pct = $d->{popular_count} / ($d->{num} - $d->{popular_count} + 1);
70: if ($new eq 'NOPE') {
71: push @$dout, $d if ($score > 0 and $pct > .1);
72: } else {
