1 |
2 |
alfik |
/*
|
2 |
|
|
* Copyright (c) 2014, Aleksander Osman
|
3 |
|
|
* All rights reserved.
|
4 |
|
|
*
|
5 |
|
|
* Redistribution and use in source and binary forms, with or without
|
6 |
|
|
* modification, are permitted provided that the following conditions are met:
|
7 |
|
|
*
|
8 |
|
|
* * Redistributions of source code must retain the above copyright notice, this
|
9 |
|
|
* list of conditions and the following disclaimer.
|
10 |
|
|
*
|
11 |
|
|
* * Redistributions in binary form must reproduce the above copyright notice,
|
12 |
|
|
* this list of conditions and the following disclaimer in the documentation
|
13 |
|
|
* and/or other materials provided with the distribution.
|
14 |
|
|
*
|
15 |
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
16 |
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
17 |
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
18 |
|
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
19 |
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
20 |
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
21 |
|
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
22 |
|
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
23 |
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
24 |
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
25 |
|
|
*/
|
26 |
|
|
|
27 |
|
|
package ao486.utils;
|
28 |
|
|
|
29 |
|
|
import java.io.File;
|
30 |
|
|
import java.io.FileOutputStream;
|
31 |
|
|
import java.io.FileReader;
|
32 |
|
|
import java.io.LineNumberReader;
|
33 |
|
|
import java.util.Vector;
|
34 |
|
|
|
35 |
|
|
public class CompareTrack {
|
36 |
|
|
public static void main(String args[]) throws Exception {
|
37 |
|
|
|
38 |
|
|
File file_hw = new File("./../backup/run-ok-bad/track.txt");
|
39 |
|
|
File file_sim = new File("./../backup/run-ok/track.txt");
|
40 |
|
|
|
41 |
|
|
Vector<String> vec_hw = new Vector<>();
|
42 |
|
|
Vector<String> vec_sim = new Vector<>();
|
43 |
|
|
|
44 |
|
|
LineNumberReader reader_hw = new LineNumberReader(new FileReader(file_hw));
|
45 |
|
|
while(true) {
|
46 |
|
|
String line = reader_hw.readLine();
|
47 |
|
|
if(line == null) break;
|
48 |
|
|
vec_hw.add(line);
|
49 |
|
|
}
|
50 |
|
|
|
51 |
|
|
LineNumberReader reader_sim = new LineNumberReader(new FileReader(file_sim));
|
52 |
|
|
while(true) {
|
53 |
|
|
String line = reader_sim.readLine();
|
54 |
|
|
if(line == null) break;
|
55 |
|
|
vec_sim.add(line);
|
56 |
|
|
}
|
57 |
|
|
//350000 + 42719;
|
58 |
|
|
int start_hw =
|
59 |
|
|
100000 +
|
60 |
|
|
100000 +
|
61 |
|
|
100000 +
|
62 |
|
|
100000 +
|
63 |
|
|
100000 +
|
64 |
|
|
10000
|
65 |
|
|
;
|
66 |
|
|
//100000 + 28598;
|
67 |
|
|
int start_sim =
|
68 |
|
|
100000 +
|
69 |
|
|
99831 +
|
70 |
|
|
100000 +
|
71 |
|
|
100000 +
|
72 |
|
|
87282
|
73 |
|
|
;
|
74 |
|
|
|
75 |
|
|
//some extra block after IAC 0x50 -- setting 001cdd74
|
76 |
|
|
start_hw = 7100947 - 10000 - 5025 - 10000;
|
77 |
|
|
start_sim= 6079195 - 10000 - 10000;
|
78 |
|
|
|
79 |
|
|
//f8/c8 difference
|
80 |
|
|
//start_hw = 6271527 + 3*10000;
|
81 |
|
|
//start_sim= 5238455 + 3*10000;
|
82 |
|
|
|
83 |
|
|
//start_hw = 6271527 + 3*10000 + 5*100000;
|
84 |
|
|
//start_sim= 5238455 + 3*10000 + 5*100000;
|
85 |
|
|
|
86 |
|
|
int count = 10000;
|
87 |
|
|
|
88 |
|
|
FileOutputStream fos_hw = new FileOutputStream("cmp_hw.txt");
|
89 |
|
|
for(int i=0; i<count; i++) {
|
90 |
|
|
fos_hw.write(new String(vec_hw.get(start_hw+i) + "\n").getBytes());
|
91 |
|
|
}
|
92 |
|
|
fos_hw.close();
|
93 |
|
|
|
94 |
|
|
FileOutputStream fos_sim = new FileOutputStream("cmp_sim.txt");
|
95 |
|
|
for(int i=0; i<count; i++) {
|
96 |
|
|
fos_sim.write(new String(vec_sim.get(start_sim+i) + "\n").getBytes());
|
97 |
|
|
}
|
98 |
|
|
fos_sim.close();
|
99 |
|
|
|
100 |
|
|
Runtime.getRuntime().exec(new String[] {"meld", "cmp_hw.txt", "cmp_sim.txt"});
|
101 |
|
|
}
|
102 |
|
|
}
|