Algorithmique Numérique Distribuée Public GIT Repository
1 #!/usr/bin/perl -w
2 use utf8;
4 \$first=1;
5 while(\$line = <STDIN>) {
6     chomp \$line;
7     if(\$line =~ /^\s*@[\w\s]*{/) {
8         if(!\$first) {
9             \$count{\$cat}{\$year}++;
10         } else {
11             \$first=0;
12         }
13         next;
14     }
15     if(\$line =~ /^\s*year\s*=\s*/) {
16         \$year = \$line;
17         \$year =~ s/\D*//g;
18     }
19     if(\$line =~ /^\s*category\s*=\s*/) {
20         \$cat = \$line;
21         \$cat =~ s/^.*=//;
22         \$cat =~ s/\s*//g;
23         \$cat =~ s/\W*//g;
24     }
25 }
26 \$count{\$cat}{\$year}++;
28 %pretty_print = (
29     "core" => "Other publications about the SimGrid framework",
30     "extern" => "Papers that use SimGrid-generated results (not counting our owns)",
31     "intra" => "Our own papers that use SimGrid-generated results"
32     );
34 @years=();
35 foreach \$cat (keys %count) {
36     push @years, keys %{\$count{\$cat}};
37 }
39 @years = sort {\$a <=> \$b} @years;
40 \$year_min = \$years[0];
41 \$year_max = \$years[\$#years];
43 #Print
44 print "<table border='1' cellspacing='3' cellpadding='3'>
45 <tr><td>Year</td>";
46 foreach \$year (\$year_min..\$year_max) {
47     print "<td>\$year</td> ";
48 }
49 print "<td>Total</td>\n";
50 print "</td>\n";
52 foreach \$cat (keys %count) {
53     \$sum = 0;
54     print "<tr><td>\$pretty_print{\$cat}</td>";
56     foreach \$year (\$year_min..\$year_max) {
57         if(defined(\$count{\$cat}{\$year})) {
58             print "<td>\$count{\$cat}{\$year}</td> ";
59             \$sum+=\$count{\$cat}{\$year};
60         } else {
61             print "<td>-</td> ";
62         }
63     }
64     print "<td>\$sum</td>\n";
65     print "</tr>\n";
66 }
67 print "</table>\n";