my$temp = '/home/dlandgre/perl/reputer/'; # where data files are saved
my$public_access = ''; # 'yes' disables config, downloads, and external program functions
my$bodytag = '
';
my$form_method = 'get'; # get or post, 'get' shows params in url
####
my$temp = '/home/dlandgre/perl/reputer/'; # where data files are saved
my$public_access = ''; # 'yes' disables config, downloads, and external program functions
my$bodytag = '';
my$form_method = 'get'; # get or post, 'get' shows params in url
##
##
my($mode,$td,$ta,$rd,$ra,$ca,$cd) = '';
##
##
my($mode,$td,$ta,$rd,$ra,$ca,$cd) = ('','','','','','','');
##
##
my $mode = '';
my $td = '';
my $ta = '';
##
##
unless($i{'n'} eq 'logout'){
if($ins > 1){$s='s'}
&begin_html('fu');
print qq~$bq $bq $bq
##
##
$var += 2 unless $condition;
##
##
#! /usr/bin/perl -w
use strict;
use Data::Dumper;
$Data::Dumper::Indent = 0;
use vars qw/$xpdat1 $dat1 $makedat/;
my $datafile = shift or
die "No data file specified on command line.\n";
my $today = localtime(time);
my $root;
eval "require '$datafile'" or die "bad eval: $@\n";
$root->{DATA} = $dat1;
$root->{XP} = $xpdat1;
$root->{MAKE} = $makedat;
open DAT, ">$datafile" or die "Cannot open $datafile for output: $!\n";
print DAT Data::Dumper->Dump( [$root], ['$root'] );
close DAT;
##
##
print DAT Data::Dumper->Dump( [$root], ['$root'] );
##
##
$var = 'root';
$Data::Dumper::Varname = "$var";
print DAT Dumper($root);
##
##
#! /usr/bin/perl -w
use strict;
use Data::Dumper;
use Storable;
use Benchmark;
use vars qw/$root $root1/;
my $ddi = 0; # data dumper intent level, 0 = smallest files
my $var;
my $datafile = shift or die "No data file specified on command line.\n";
my $today = localtime(time);
my $storefile = $datafile . '.store';
eval "require '$datafile'" or die "bad eval: $@\n";
$root = $root1;
store $root, $storefile;
my $debug = 0;
sub via_eval_dump {
eval "require '$datafile'" or die "bad eval: $@\n";
open DAT, ">$datafile" or die "Cannot open $datafile for output: $!\n";
$root = $root1;
$root->{DATA}{NODE}[45]{'reputation'} += 1;
$debug and print "$root->{DATA}{NODE}[45]{'content'} $root->{DATA}{NODE}[45]{'reputation'} \n";
$Data::Dumper::Indent = $ddi;
$var = 'root';
$Data::Dumper::Varname = "$var";
print DAT Dumper($root);
close DAT;
}
sub via_retrieve_store {
$root = retrieve $storefile;
$root->{DATA}{NODE}[45]{'reputation'} += 1;
$debug and print "$root->{DATA}{NODE}[45]{'content'} $root->{DATA}{NODE}[45]{'reputation'} \n";
store $root, $storefile;
}
timethese shift(), {
'eval & dump' => \&via_eval_dump,
'retrieve & store' => \&via_retrieve_store,
}
##
##
sub graph
{ # calculate and display the graphs
my($hm1,$hm2,$hm3,$bdr,$cs,$spacer,$mode,$descr);
if(!$i{histmode} or $i{histmode} == 1){
$hm1 = ' checked';
$spacer = ' | ';
$cs = 4;
$bdr = 0;
$descr = qq~mode one
bar height = fixed
bar width = number of nodes at that rep
~
}
elsif($i{histmode} == 2){
$hm2 = ' checked';
$spacer = '';
$cs = 3;
$bdr = 1;
$descr = qq~mode two
bar height = rep
bar width = number of nodes at that rep
~
}
elsif($i{histmode} == 3){
$hm3 = ' checked';
$spacer = ' | ';
$cs = 4;
$bdr = 0;
$descr = qq~mode three
bar height = number of nodes at that rep
bar width = rep
~
}
print qq~
Number of nodes by reputation
average rep and maximum num highlighted |
|
---|
|
~;
my@high = sort {$b <=> $a} values %rep_freq;
my@hig = sort {$b <=> $a} keys %rep_freq;
my$mult = sprintf "%d", (600/$high[0]); # normalize bar width to scale (highest num = 600 pixels)
my$mul = sprintf "%d", (600/$hig[0]); # normalize bar width to scale (highest num = 600 pixels)
print qq~$nb rep $nb | $nb num $nb | |
~;
my($ar,$fc,$arf,$fcf) = '';
for(sort {$b <=> $a} keys %rep_freq){
my$w = ($rep_freq{$_}*$mult);
my$h = 5;
if($i{'histmode'}){
if($i{'histmode'} == 2){ $h = $_ || 1 }
elsif($i{'histmode'} == 3){ $w = ($_*$mul); $h = $rep_freq{$_} }
}
if($_ == $avgrep){ # highlight avg rep
$ar = 'bgcolor="#880066"';
$fc = ''
}
else{$ar=''; $fc='';}
if($rep_freq{$_} == $high[0]){ # highlight frequency high
$arf = 'bgcolor="#880066"';
$fcf = ''
}
else{$arf=''; $fcf=''}
print qq~$fc $_ $nb | $fcf $rep_freq{$_} $nb |
$spacer
|
~
}
print qq~
$nb rep $nb | $nb num $nb | |
~;
}