From: Steinar H. Gunderson Date: Wed, 30 May 2012 19:32:34 +0000 (+0200) Subject: Make rating.pl use the common function for fetching aux parms. X-Git-Url: https://git.sesse.net/?p=wloh;a=commitdiff_plain;h=44b0ccfdd1c79b013c72d1a6f71e3bc421f14186 Make rating.pl use the common function for fetching aux parms. --- diff --git a/www/rating.pl b/www/rating.pl index 40e9165..f69b19a 100755 --- a/www/rating.pl +++ b/www/rating.pl @@ -20,19 +20,13 @@ $dbh->{RaiseError} = 1; binmode STDOUT, ':utf8'; -# Find auxillary parameters. -my %params = (); -my $q = $dbh->prepare('SELECT * FROM ratings WHERE id < 0'); -$q->execute; -while (my $ref = $q->fetchrow_hashref) { - $params{$ref->{'id'}} = $ref->{'rating'}; -} -my $match_stddev = $params{-2} * sqrt(2.0); +my $aux_parms = wloh_common::get_auxillary_parameters($dbh); +my $match_stddev = $aux_parms->{'score_stddev'} * sqrt(2.0); print CGI->header(-type=>'text/html; charset=utf-8', -expires=>'+5m'); POSIX::setlocale(&POSIX::LC_ALL, 'nb_NO.UTF-8'); -printf <<"EOF", $params{-3}, $match_stddev; +printf <<"EOF", $aux_parms->{'rating_prior_stddev'}, $match_stddev; forklaring beregnet på ikke-matematikere.