Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: More useful "best" and "worst" nodes display

by hossman (Prior)
on May 12, 2004 at 06:20 UTC ( [id://352655]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        sub weight {
           my $age = shift;
           return $age / $FACTOR;
        }
    
  2. or download this
         $score = $item->totalVotes() * weight($item->age());
    
  3. or download this
        $score = 0;
        foreach $vote ($item->votes()) {
           $score += $vote->value() 
                     * weight($item->age() - $vote->age());
        }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://352655]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-19 20:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found