Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
1 #!/usr/bin/perl
3 #
4 # Treat each line as a sequence of comma and/or space delimited
5 # floating point numbers, and compute basic statistics on them.
6 # These are written to standard output
8 # This Source Code Form is subject to the terms of the Mozilla Public
9 # License, v. 2.0. If a copy of the MPL was not distributed with this
10 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 $min = 1.7976931348623157E+308;
13 $max = 2.2250738585072014E-308;
14 $sum = $num = 0;
16 while(<>) {
17 chomp;
19 @nums = split(/[\s,]+/, $_);
20 next if($#nums < 0);
22 $num += scalar @nums;
23 foreach (@nums) {
24 $min = $_ if($_ < $min);
25 $max = $_ if($_ > $max);
26 $sum += $_;
27 }
28 }
30 if($num) {
31 $avg = $sum / $num;
32 } else {
33 $min = $max = 0;
34 }
36 printf "%d\tmin=%.2f, avg=%.2f, max=%.2f, sum=%.2f\n",
37 $num, $min, $avg, $max, $sum;
39 # end