3 # ***** BEGIN LICENSE BLOCK *****
4 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 # The contents of this file are subject to the Mozilla Public License Version
7 # 1.1 (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
9 # http://www.mozilla.org/MPL/
11 # Software distributed under the License is distributed on an "AS IS" basis,
12 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 # for the specific language governing rights and limitations under the
16 # The Original Code is mozilla.org code.
18 # The Initial Developer of the Original Code is
19 # Netscape Communications Corporation.
20 # Portions created by the Initial Developer are Copyright (C) 1999
21 # the Initial Developer. All Rights Reserved.
25 # Alternatively, the contents of this file may be used under the terms of
26 # either the GNU General Public License Version 2 or later (the "GPL"), or
27 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 # in which case the provisions of the GPL or the LGPL are applicable instead
29 # of those above. If you wish to allow use of your version of this file only
30 # under the terms of either the GPL or the LGPL, and not to allow others to
31 # use your version of this file under the terms of the MPL, indicate your
32 # decision by deleting the provisions above and replace them with the notice
33 # and other provisions required by the GPL or the LGPL. If you do not delete
34 # the provisions above, a recipient may use your version of this file under
35 # the terms of any one of the MPL, the GPL or the LGPL.
37 # ***** END LICENSE BLOCK *****
39 my($ret) = << "END_NPL";
40 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
41 /* ***** BEGIN LICENSE BLOCK
*****
42 * Version
: MPL
1.1/GPL 2.0/LGPL
2.1
44 * The contents of this file are subject to the Mozilla Public License Version
45 * 1.1 (the
"License"); you may
not use this file except
in compliance with
46 * the License
. You may obtain a copy of the License at
47 * http
://www
.mozilla
.org
/MPL/
49 * Software distributed under the License is distributed on an
"AS IS" basis
,
50 * WITHOUT WARRANTY OF ANY KIND
, either express
or implied
. See the License
51 * for the specific language governing rights
and limitations under the
54 * The Original Code is mozilla
.org code
.
56 * The Initial Developer of the Original Code is
57 * Netscape Communications Corporation
.
58 * Portions created by the Initial Developer are Copyright
(C
) 1998
59 * the Initial Developer
. All Rights Reserved
.
63 * Alternatively
, the contents of this file may be used under the terms of
64 * either the GNU General Public License Version
2 or later
(the
"GPL"), or
65 * the GNU Lesser General Public License Version
2.1 or later
(the
"LGPL"),
66 * in which case the provisions of the GPL
or the LGPL are applicable instead
67 * of those above
. If you wish to allow
use of your version of this file only
68 * under the terms of either the GPL
or the LGPL
, and not to allow others to
69 * use your version of this file under the terms of the MPL
, indicate your
70 * decision by deleting the provisions above
and replace them with the notice
71 * and other provisions required by the GPL
or the LGPL
. If you
do not delete
72 * the provisions above
, a recipient may
use your version of this file under
73 * the terms of any one of the MPL
, the GPL
or the LGPL
.
75 * ***** END LICENSE BLOCK
***** */
88 @k = split(/\s+/, $_);
89 @i = unpack("CCCC", $k[0]);
90 # printf("%x %x %s",$i[0] , $i[1] , "[" . $k[0] . "] " . $i . " " . $j . " " . $k[1] ."\n");
91 if((0xA1 <= $i[0]) && (0xA1 <= $i[1])){
97 # print "hello $v $h[$v] $u $l[$u]\n";
104 for($i=0x00A1;$i< 0x00FF ; $i++)
106 $fh[$i - 0x00a1] = $h[$i- 0x00a1] / $total;
107 $ffh += $fh[$i - 0x00a1];
109 $fl[$i - 0x00a1] = $l[$i- 0x00a1] / $total;
110 $ffl += $fl[$i - 0x00a1];
117 for($i=0x00A1;$i< 0x00FF ; $i++)
119 $sh = $fh[$i - 0x00a1] - $mh;
123 $sl = $fl[$i - 0x00a1] - $ml;
134 for($i=0x00A1;$i< 0x00FF ; $i++)
137 printf(" %.6ff \/\/ FreqH[%2x]\n", $fh[$i - 0x00a1] , $i);
139 printf(" %.6ff, \/\/ FreqH[%2x]\n", $fh[$i - 0x00a1] , $i);
143 printf ("%.6ff, \/\/ Lead Byte StdDev\n", $stdh);
144 printf ("%.6ff, \/\/ Lead Byte Mean\n", $mh);
145 printf ("%.6ff, \/\/ Lead Byte Weight\n", $stdh / ($stdh + $stdl));
147 for($i=0x00A1;$i< 0x00FF ; $i++)
150 printf(" %.6ff \/\/ FreqL[%2x]\n", $fl[$i - 0x00a1] , $i);
152 printf(" %.6ff, \/\/ FreqL[%2x]\n", $fl[$i - 0x00a1] , $i);
156 printf ("%.6ff, \/\/ Trail Byte StdDev\n", $stdl);
157 printf ("%.6ff, \/\/ Trail Byte Mean\n", $ml);
158 printf ("%.6ff \/\/ Trial Byte Weight\n", $stdl / ($stdh + $stdl));