I have this section of code (similar to the previous piece of code). It's supposed to just sweep 50 degrees left, then stop and sweep 100 degrees right, then stop and sweep 100 degrees to the left, and so forth. Only problem is it stops at the left, goes right, then continues to go right, even though I have a stop there to prevent that from happening.
try:
screen.blit(Turrets[1], (TurretCoords[1]))
if Rotation == 1:
print(TurretRotation[1])
print(Rotation)
TurretRotation[1] = TurretRotation[1] - 1
Turrets[1] = pygame.transform.rotozoom(Turret, TurretRotation[1], 1)
if TurretRotation[1] == -50:
Rotation = -1
else:
print(TurretRotation[1])
print(Rotation)
TurretRotation[1] = TurretRotation[1] + 1
Turrets[1] = pygame.transform.rotozoom(Turret, TurretRotation[1], 1)
if TurretRotation[1] == 50:
Rotation = 1
Yes, I know, I was supposed to change the variables capital letters, and I haven't gotten around to it yet.
This is the output I get from the console.
-1 = Rotate
1 = TurretRotation[1]
-1
2
-1
3
-1
4
-1
5
-1
6
-1
7
-1
8
-1
9
-1
10
-1
11
-1
12
-1
13
-1
14
-1
15
-1
16
-1
17
-1
18
-1
19
-1
20
-1
21
-1
22
-1
23
-1
24
-1
25
-1
26
-1
27
-1
28
-1
29
-1
30
-1
31
-1
32
-1
33
-1
34
-1
35
-1
36
-1
37
-1
38
-1
39
-1
40
-1
41
1
40
1
39
1
38
1
37
1
36
1
35
1
34
1
33
1
32
1
31
1
30
1
29
1
28
1
27
1
26
1
25
1
24
1
23
1
22
1
21
1
20
1
19
1
18
1
17
1
16
1
15
1
14
1
13
1
12
1
11
1
10
1
9
1
8
1
7
1
6
1
5
1
4
1
3
1
2
1
1
1
0
1
-1
1
-2
1
-3
1
-4
1
-5
1
-6
1
-7
1
-8
1
-9
1
-10
1
-11
1
-12
1
-13
1
-14
1
-15
1
-16
1
-17
1
-18
1
-19
1
-20
1
-21
1
-22
1
-23
1
-24
1
-25
1
-26
1
-27
1
-28
1
-29
1
-30
1
-31
1
-32
1
-33
1
-34
1
-35
1
-36
1
-37
1
-38
1
-39
1
-40
1
-41
1
-42
1
-43
1
-44
1
-45
1
-46
1
-47
1
-48
1
-49
1
-50
1
-51
1
-52
1
-53
1
-54
1
-55
1
-56
1
-57
1
-58
1
-59
1
-60
1
-61
1
-62
1
-63
1
-64
1
-65
1
-66
1
-67
1
-68
1
-69
1
-70
1
-71
1
-72
1
-73
1
-74
1
-75
1
-76
1
-77
1
-78
1
-79
1
-80
1
-81
1
-82
1
-83
1
-84
1
I can't run it so I can only advice - I see you have print - so see what's going on with variables. Maybe one of them is changed in different place.
But you can do one this - use <= and >= - it should help.
if TurretRotation[1] >= 50:
if TurretRotation[1] <= -50:
Related
This question already has answers here:
bash: shortest way to get n-th column of output
(8 answers)
Closed 4 years ago.
I would like to extract column number 8 from the following table using shell (ash):
0xd024 2 0 32 20 3 0 1 0 2 1384 1692 -61 27694088
0xd028 0 1 5 11 1 0 46 0 0 301 187 -74 27689154
0xd02c 0 0 35 14 1 0 21 0 0 257 250 -80 27689410
0xd030 1 1 15 13 1 0 38 0 0 176 106 -91 27689666
0xd034 1 1 50 20 1 0 8 0 0 790 283 -71 27689980
0xd038 0 0 0 3 4 0 89 0 0 1633 390 -90 27690291
0xd03c 0 0 8 3 3 0 82 0 0 1837 184 -95 27690603
0xd040 0 0 4 5 1 0 90 0 0 0 148 -97 27690915
0xd064 0 0 36 9 1 0 29 0 0 321 111 -74 27691227
0xd068 0 0 5 14 14 0 40 0 0 8066 2270 -85 27691539
0xd06c 1 1 39 19 1 0 15 0 0 1342 261 -74 27691850
0xd070 0 0 12 11 1 0 53 0 0 203 174 -73 27692162
0xd074 0 0 18 2 1 0 75 0 0 301 277 -94 27692474
How can I do that?
the following command "awk '{print $8}' file" works fine
I have a matrix that is 50x2. But column 2 has different amount of entries. How can I make a box plot where the x axis is position and the y axis are the different counts? Ideally, I'd like to take the absolute value of the counts. Thanks in advance!
> mat.count[1:50,]
position count
1 136873135 0
2 136873136 0
3 136873137 0
4 136873138 0
5 136873139 0
6 136873140 -15
7 136873141 0
8 136873142 0
9 136873143 0
10 136873144 0
11 136873145 0
12 136873146 0
13 136873147 0
14 136873148 0
15 136873149 0
16 136873150 0
17 136873151 0
18 136873152 0
19 136873153 0
20 136873154 0
21 136873155 0
22 136873156 0
23 136873157 0
24 136873158 0
25 136873159 0
26 136873160 0
27 136873161 0
28 136873162 0
29 136873163 0
30 136873164 0
31 136873165 0
32 136873166 0
33 136873167 0
34 136873168 -1
35 136873169 0
36 136873170 0
37 136873171 0
38 136873172 0
39 136873173 -70
40 136873174 -66
41 136873175 -73,-1,-1,-1,-73,-1
42 136873176 -52
43 136873177 0
44 136873178 0
45 136873179 -66,-1
46 136873180 -1
47 136873181 0
48 136873182 -68,-75
49 136873183 -67,-67
50 136873184 -60,-56,-56
So I have done this in both python and bash, and the code I am about to post probably has a world of things wrong with it but it is generally very basic and I cannot see a reason that it would cause this 'bug' which I will explain soon.. I have done the same in Python, but much more professionally and cleanly and it also causes this error (at some point, the maths generates a negative number, which makes no sense.)
#!/bin/bash
while [ 1 ];
do
zero=0
ARRAY=()
ARRAY2=()
first=`command to generate a list of numbers`
sleep 1
second=`command to generate a list of numbers`
# so now we have two data sets, 1 second between the capture of each.
for i in $first;
do
ARRAY+=($i)
done
for i in $second;
do
ARRAY2+=($i)
done
for (( c=$zero; c<=${#ARRAY2[#]}; c++ ))
do
expr ${ARRAY2[$c]} - ${ARRAY[$c]}
done
ARRAY=()
ARRAY2=()
zero=0
c=0
first=``
second=``
math=''
done
So the script grabs a set of data, waits 1 second, grabs it again, does math on the two sets to get the difference, that difference is printed. It's very simple, and I have done it elegantly in Python too - no matter how I would do it every now and then, could be anywhere from 3 loops in to 30 loops in, we will get negative numbers.. like so:
START 0 0 0 0 0 19 10 563 0
-34 19 14 2 0
-1302 1198
-532 639
-1078 1119 1 0 0
-843 33 880 0 5
-8
-13508 8773 4541 988 181
-12
-205 217
-9 7 1
-360 303 60 1 0 0
-12
-96 98 3
-870 904
-130
-2105 2264 6
-3084 1576 1650
-939 971
-2249 1150 1281
-693 9 513 142 76 expr: syntax error
Please help, I simply can't find anything about this.
Sample OUTPUT as requested:
ARRAY1 OUTPUT
1 15 1 25 25 1 2 1 3541 853 94567 42 5 1 351 51 1 11 1 13 7 14 12 3999 983 5 1938 3 8287 40 1 1 1 5253 706 1 1 1 1 5717 3 50 1 85 100376 17334 4655 1 1345 2 1 16 1777 1 3 38 23 8 32 47 781 947 1 1 206 9 1 3 2 81 2602 7 158 1 1 43 91 1 120 6589 6 2534 1092 1 6014 7 2 2 37 1 1 1 80 2 1 1270 15448 66 1 10238 1 10794 16061 4 1 1 1 9754 5617 1123 926 3 24 10 16
ARRAY2 OUTPUT
1 15 1 25 25 1 2 1 3555 859 95043 42 5 1 355 55 1 11 1 13 7 14 12 4015 987 5 1938 3 8335 40 1 1 1 5280 706 1 1 1 1 5733 3 50 1 85 100877 17396 4691 1 1353 2 1 16 1782 1 3 38 23 8 32 47 787 947 1 1 206 9 1 3 2 81 2602 7 159 1 1 43 91 1 120 6869 6 2534 1092 1 6044 7 2 2 37 1 1 1 80 2 1 1270 15563 66 1 10293 1 10804 16134 4 1 1 1 9755 5633 1135 928 3 24 10 16
START
The answer lies in Russell Uhl's comment above. Your loop runs one time to many(this is your code):
for (( c=$zero; c<=${#ARRAY2[#]}; c++ ))
do
expr ${ARRAY2[$c]} - ${ARRAY[$c]}
done
To fix, you need to change the test condition from c <= ${#ARRAY2[#]} to c < ${#ARRAY2[#]}:
for (( c=$zero; c < ${#ARRAY2[#]}; c++ ))
do
echo $((${ARRAY2[$c]} - ${ARRAY[$c]}))
done
I've also changed the expr to use arithmetic evaluation builtin $((...)).
The test script (sum.sh):
#!/bin/bash
zero=0
ARRAY=()
ARRAY2=()
first="1 15 1 25 25 1 2 1 3541 853 94567 42 5 1 351 51 1 11 1 13 7 14 12 3999 983 5 1938 3 8287 40 1 1 1 5253 706 1 1 1 1 5717 3 50 1 85 100376 17334 4655 1 1345 2 1 16 1777 1 3 38 23 8 32 47 7
second="1 15 1 25 25 1 2 1 3555 859 95043 42 5 1 355 55 1 11 1 13 7 14 12 4015 987 5 1938 3 8335 40 1 1 1 5280 706 1 1 1 1 5733 3 50 1 85 100877 17396 4691 1 1353 2 1 16 1782 1 3 38 23 8 32 47
for i in $first; do
ARRAY+=($i)
done
# Alternately as chepner suggested:
ARRAY2=($second)
for (( c=$zero; c < ${#ARRAY2[#]}; c++ )); do
echo -n $((${ARRAY2[$c]} - ${ARRAY[$c]})) " "
done
Running it:
samveen#precise:/tmp$ echo $BASH_VERSION
4.2.25(1)-release
samveen#precise:/tmp$ bash sum.sh
0 0 0 0 0 0 0 0 14 6 476 0 0 0 4 4 0 0 0 0 0 0 0 16 4 0 0 0 48 0 0 0 0 27 0 0 0 0 0 16 0 0 0 0 501 62 36 0 8 0 0 0 5 0 0 0 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 280 0 0 0 0 30 0 0 0 0 0 0 0 0 0 0 0 115 0 0 55 0 10 73 0 0 0 0 1 16 12 2 0 0 0 0
EDIT:
* Added improvements from suggestions in comments.
I think the problem has to be when the two arrays don't have the same size. It's easy to reproduce that syntax error -- one of the operands for the minus operator is an empty string:
$ a=5; b=3; expr $a - $b
2
$ a=""; b=3; expr $a - $b
expr: syntax error
$ a=5; b=""; expr $a - $b
expr: syntax error
$ a=""; b=""; expr $a - $b
-
Try
ARRAY=( $(command to generate a list of numbers) )
sleep 1
ARRAY2=( $(command to generate a list of numbers) )
if (( ${#ARRAY[#]} != ${#ARRAY2[#]} )); then
echo "error: different size arrays!"
echo "ARRAY: ${#ARRAY[#]} (${ARRAY[*]})"
echo "ARRAY2: ${#ARRAY2[#]} (${ARRAY2[*]})"
fi
"The error occurs whenever the first array is smaller than the second" -- of course. You're looping from 0 to the array size of ARRAY2. When ARRAY has fewer elements, you'll eventually try to access an index that does not exist in the array. When you try to reference an unset variable, bash gives you the empty string.
$ a=(1 2 3)
$ b=(4 5 6 7)
$ i=2; expr ${a[i]} - ${b[i]}
-3
$ i=3; expr ${a[i]} - ${b[i]}
expr: syntax error
I'm not good at English. So I ask for your patience and editing.
I have analysed census data of South Korea. I used 'adaboost' as a analysis method and adaboost was implemented for each cities. Target variable, independent variables, formula, options, the number of observation, etc, everything is same among cities. There is no difference. And I made a macro that implements adaboost for the cities one by one. The macro removes all objects except for itself before it starts to analyse the next city.
And I found that average process speed is getting slower as time goes on. I mean that the average time needed for cities 1-30 was around 10 minutes, but it became 25 minutes for the cities 80-100. So I terminated the R session and re-opened. I re-ran the macro from 80th city, then the average time for cities 80-100 was reduced to 10 minutes.
Why does this happen? How can I solve this problem? I need your help. Thanks in advance.
The r code and macro are as below. 'sgg' macro variable indicates city codes. Target variable has six categories. So I used 'one-others' method for multi-class classification.
memory.limit(size=4095)
library(gbm)
library(gtools)
dbset<-strmacro(sgg,sampnum,
expr=
{
setwd("C:\\Users\\Kim\\Desktop\\JQ\\");
db.sgg<-read.table('sgg.TXT', header=TRUE);
db.sgg<-subset(db.sgg, AGE>=10)
N<-nrow(db.sgg);
if(N>=sampnum)
{
db.sgg<-db.sgg[sample(1:N, sampnum),]
};
db.sgg$SEX<-factor(letters[db.sgg$SEX])
ordered(db.sgg$AREA);
db.sgg$josagu_attri_mod2<-factor(letters[db.sgg$josagu_attri_mod])
db.sgg$geocheo_type_mod2<-factor(letters[db.sgg$geocheo_type_mod])
db.sgg$dandok_type_mod2<-factor(letters[db.sgg$dandok_type_mod])
colnames(db.sgg)[10:15]<-c('FLC3.1','FLC3.3','FLC3.4','FLC3.5','FLC3.6','FLC3.7');
}
);
train<-strmacro(i, sgg,
expr={
res.sgg.i<-gbm(FLC3.i~SEX+AREA+AGE+josagu_attri_mod2+geocheo_type_mod2+dandok_type_mod2,
data=db.sgg, distribution='adaboost', n.trees=3000,shrinkage = 0.005,
cv.folds=5, keep.data=TRUE,
bag.fraction=0.7, interaction.depth=3);
BI.sgg.i<-gbm.perf(res.sgg.i, method='cv');
PRED.sgg.i<-predict.gbm(res.sgg.i, db.sgg, BI.sgg.i);
}
);
clean<-strmacro(sgg,
expr={
rm(BI.sgg.1);rm(BI.sgg.3);rm(BI.sgg.4);rm(BI.sgg.5);rm(BI.sgg.6);rm(BI.sgg.7);
rm(res.sgg.1);rm(res.sgg.3);rm(res.sgg.4);rm(res.sgg.5);rm(res.sgg.6);rm(res.sgg.7);
rm(PRED.sgg.1);rm(PRED.sgg.3);rm(PRED.sgg.4);rm(PRED.sgg.5);rm(PRED.sgg.6);rm(PRED.sgg.7);
rm(db.sgg);
}
);
all<-strmacro(sgg,num,
expr={
dbset(sgg,num);
train(1,sgg);train(3,sgg);train(4,sgg);train(5,sgg);train(6,sgg);train(7,sgg);
clean(sgg);
}
);
all(11010,3000)
all(11020,3000)
all(11030,3000)
Data is as below. This data is stored in '11010.txt'.
C3 mem_num josagu_attri_mod SEX AGE geocheo_type_mod dandok_type_mod C97 FLC3 FLC3_1 FLC3_3 FLC3_4 FLC_4 FLC3_6 FLC3_7 AREA
1 3 3 1 14 1 1 49 3 0 0 1 0 0 0 2
1 1 1 2 44 1 1 49 3 0 0 1 0 0 0 2
2 1 1 1 67 1 1 46 6 0 0 0 0 0 1 2
2 2 2 2 60 1 1 46 6 0 0 0 0 0 1 2
3 1 1 2 65 1 1 49 6 0 0 0 0 0 1 2
4 1 1 1 66 1 4 16 6 0 0 0 0 0 1 1
4 2 2 2 61 1 4 16 6 0 0 0 0 0 1 1
5 1 1 2 32 1 6 15 1 1 0 0 0 0 0 1
7 2 2 1 55 1 6 59 5 0 0 0 0 1 0 2
7 4 3 1 23 1 6 59 5 0 0 0 0 1 0 2
7 1 1 2 50 1 6 59 5 0 0 0 0 1 0 2
7 3 3 2 24 1 6 59 5 0 0 0 0 1 0 2
8 1 1 1 68 1 1 46 6 0 0 0 0 0 1 2
8 2 2 2 64 1 1 46 6 0 0 0 0 0 1 2
9 1 1 1 57 1 1 59 5 0 0 0 0 1 0 2
9 2 2 2 55 1 1 59 5 0 0 0 0 1 0 2
9 3 3 2 28 1 1 59 5 0 0 0 0 1 0 2
10 2 3 1 17 1 6 16 4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 0 0 0 0 1 0 2
65 2 2 2 57 2 1 50 5 0 0 0 0 1 0 2
66 1 1 1 49 2 1 50 5 0 0 0 0 1 0 2
66 2 2 2 54 2 1 50 5 0 0 0 0 1 0 2
66 3 3 2 25 2 1 50 5 0 0 0 0 1 0 2
67 1 1 1 67 2 1 120 6 0 0 0 0 0 1 4
67 2 2 2 65 2 1 120 6 0 0 0 0 0 1 4
68 1 1 1 49 2 4 98 5 0 0 0 0 1 0 3
68 4 3 1 18 2 4 98 5 0 0 0 0 1 0 3
68 2 2 2 48 2 4 98 5 0 0 0 0 1 0 3
68 3 3 2 20 2 4 98 5 0 0 0 0 1 0 3
70 1 1 1 66 2 1 101 6 0 0 0 0 0 1 4
70 2 2 2 56 2 1 101 6 0 0 0 0 0 1 4
71 1 1 1 37 2 2 101 2 0 1 0 0 0 0 4
71 2 2 2 37 2 2 101 2 0 1 0 0 0 0 4
72 1 1 1 74 1 1 91 5 0 0 0 0 1 0 3
72 3 3 1 41 1 1 91 5 0 0 0 0 1 0 3
72 2 2 2 71 1 1 91 5 0 0 0 0 1 0 3
73 1 1 1 60 1 1 91 5 0 0 0 0 1 0 3
73 3 3 1 27 1 1 91 5 0 0 0 0 1 0 3
73 2 2 2 57 1 1 91 5 0 0 0 0 1 0 3
74 1 1 1 61 2 1 119 5 0 0 0 0 1 0 4
74 4 3 1 30 2 1 119 5 0 0 0 0 1 0 4
74 2 2 2 56 2 1 119 5 0 0 0 0 1 0 4
74 3 3 2 32 2 1 119 5 0 0 0 0 1 0 4
75 2 2 1 72 1 1 99 6 0 0 0 0 0 1 3
75 1 1 2 71 1 1 99 6 0 0 0 0 0 1 3
78 1 1 2 28 1 4 15 1 1 0 0 0 0 0 1
80 1 1 1 68 1 1 92 6 0 0 0 0 0 1 3
80 2 2 2 66 1 1 92 6 0 0 0 0 0 1 3
81 2 3 1 27 1 6 46 5 0 0 0 0 1 0 2
81 3 3 1 29 1 6 46 5 0 0 0 0 1 0 2
81 1 1 2 57 1 6 46 5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 0 0 0 1 0 0 3
97 2 2 2 51 2 1 83 4 0 0 0 1 0 0 3
97 3 3 2 21 2 1 83 4 0 0 0 1 0 0 3
98 1 1 1 49 4 1 85 4 0 0 0 1 0 0 3
98 2 2 2 42 4 1 85 4 0 0 0 1 0 0 3
98 3 3 2 20 4 1 85 4 0 0 0 1 0 0 3
98 4 3 2 17 4 1 85 4 0 0 0 1 0 0 3
99 1 1 1 69 4 1 96 6 0 0 0 0 0 1 3
99 2 2 2 66 4 1 96 6 0 0 0 0 0 1 3
100 1 1 1 69 4 1 96 6 0 0 0 0 0 1 3
100 2 2 2 60 4 1 96 6 0 0 0 0 0 1 3
101 1 1 1 32 4 4 33 1 1 0 0 0 0 0 2
101 2 2 2 32 4 4 33 1 1 0 0 0 0 0 2
103 1 1 1 39 1 6 27 4 0 0 0 1 0 0 1
103 2 2 2 34 1 6 27 4 0 0 0 1 0 0 1
103 3 3 2 13 1 6 27 4 0 0 0 1 0 0 1
105 2 3 1 19 1 6 27 5 0 0 0 0 1 0 1
105 3 3 1 25 1 6 27 5 0 0 0 0 1 0 1
105 1 1 2 49 1 6 27 5 0 0 0 0 1 0 1
106 1 1 1 28 1 6 23 1 1 0 0 0 0 0 1
107 1 1 1 49 2 1 78 5 0 0 0 0 1 0 3
107 3 3 1 18 2 1 78 5 0 0 0 0 1 0 3
107 4 3 1 21 2 1 78 5 0 0 0 0 1 0 3
107 2 2 2 49 2 1 78 5 0 0 0 0 1 0 3
108 1 1 1 33 2 4 78 1 1 0 0 0 0 0 3
108 2 2 2 28 2 4 78 1 1 0 0 0 0 0 3
109 1 1 1 55 2 1 78 5 0 0 0 0 1 0 3
109 3 3 1 21 2 1 78 5 0 0 0 0 1 0 3
109 2 2 2 53 2 1 78 5 0 0 0 0 1 0 3
110 1 1 1 48 2 1 78 4 0 0 0 1 0 0 3
110 2 2 2 45 2 1 78 4 0 0 0 1 0 0 3
110 3 3 2 20 2 1 78 4 0 0 0 1 0 0 3
110 4 3 2 15 2 1 78 4 0 0 0 1 0 0 3
111 1 1 1 37 2 4 78 2 0 1 0 0 0 0 3
111 2 2 2 34 2 4 78 2 0 1 0 0 0 0 3
112 1 1 1 28 4 4 82 2 0 1 0 0 0 0 3
112 2 2 2 30 4 4 82 2 0 1 0 0 0 0 3
113 1 1 1 64 4 1 63 5 0 0 0 0 1 0 2
113 3 3 1 26 4 1 63 5 0 0 0 0 1 0 2
113 2 2 2 55 4 1 63 5 0 0 0 0 1 0 2
113 4 3 2 24 4 1 63 5 0 0 0 0 1 0 2
115 1 1 1 42 4 4 58 3 0 0 1 0 0 0 2
115 4 3 1 10 4 4 58 3 0 0 1 0 0 0 2
115 2 2 2 39 4 4 58 3 0 0 1 0 0 0 2
115 3 3 2 12 4 4 58 3 0 0 1 0 0 0 2
116 1 1 1 56 4 1 63 5 0 0 0 0 1 0 2
116 3 3 1 29 4 1 63 5 0 0 0 0 1 0 2
116 2 2 2 51 4 1 63 5 0 0 0 0 1 0 2
118 1 1 1 75 4 1 70 6 0 0 0 0 0 1 3
118 2 2 2 74 4 1 70 6 0 0 0 0 0 1 3
119 1 1 1 49 1 4 66 4 0 0 0 1 0 0 2
119 3 3 1 18 1 4 66 4 0 0 0 1 0 0 2
119 4 3 1 17 1 4 66 4 0 0 0 1 0 0 2
119 2 2 2 47 1 4 66 4 0 0 0 1 0 0 2
120 2 3 1 32 4 1 56 5 0 0 0 0 1 0 2
120 1 1 2 64 4 1 56 5 0 0 0 0 1 0 2
120 3 3 2 41 4 1 56 5 0 0 0 0 1 0 2
121 1 1 1 44 4 4 56 4 0 0 0 1 0 0 2
121 3 3 1 17 4 4 56 4 0 0 0 1 0 0 2
121 4 3 1 16 4 4 56 4 0 0 0 1 0 0 2
121 2 2 2 42 4 4 56 4 0 0 0 1 0 0 2
123 1 1 1 44 4 4 56 3 0 0 1 0 0 0 2
123 2 2 2 43 4 4 56 3 0 0 1 0 0 0 2
123 3 3 2 11 4 4 56 3 0 0 1 0 0 0 2
123 5 3 2 14 4 4 56 3 0 0 1 0 0 0 2
125 2 3 1 21 1 4 30 5 0 0 0 0 1 0 1
125 1 1 2 48 1 4 30 5 0 0 0 0 1 0 1
126 1 1 1 49 1 4 30 5 0 0 0 0 1 0 1
126 2 2 2 44 1 4 30 5 0 0 0 0 1 0 1
126 3 3 2 25 1 4 30 5 0 0 0 0 1 0 1
127 1 1 1 75 1 6 25 6 0 0 0 0 0 1 1
128 1 1 1 49 2 1 82 3 0 0 1 0 0 0 3
128 3 3 1 12 2 1 82 3 0 0 1 0 0 0 3
128 2 2 2 43 2 1 82 3 0 0 1 0 0 0 3
129 1 1 2 66 2 1 82 6 0 0 0 0 0 1 3
130 1 1 1 36 2 4 82 3 0 0 1 0 0 0 3
130 2 2 2 41 2 4 82 3 0 0 1 0 0 0 3
130 3 3 2 11 2 4 82 3 0 0 1 0 0 0 3
132 1 1 2 64 2 1 82 6 0 0 0 0 0 1 3
133 1 1 1 34 2 1 82 2 0 1 0 0 0 0 3
133 2 2 2 35 2 1 82 2 0 1 0 0 0 0 3
134 1 1 1 37 2 4 82 2 0 1 0 0 0 0 3
134 2 2 2 35 2 4 82 2 0 1 0 0 0 0 3
135 1 1 1 38 2 4 82 2 0 1 0 0 0 0 3
135 2 2 2 37 2 4 82 2 0 1 0 0 0 0 3
136 1 1 1 31 2 6 83 1 1 0 0 0 0 0 3
136 2 2 2 29 2 6 83 1 1 0 0 0 0 0 3
137 2 2 1 47 2 5 30 3 0 0 1 0 0 0 1
137 3 3 1 19 2 5 30 3 0 0 1 0 0 0 1
137 1 1 2 43 2 5 30 3 0 0 1 0 0 0 1
137 4 3 2 10 2 5 30 3 0 0 1 0 0 0 1
138 2 3 1 24 2 5 30 5 0 0 0 0 1 0 1
138 1 1 2 54 2 5 30 5 0 0 0 0 1 0 1
139 1 1 2 44 2 5 30 4 0 0 0 1 0 0 1
139 2 3 2 13 2 5 30 4 0 0 0 1 0 0 1
139 3 3 2 15 2 5 30 4 0 0 0 1 0 0 1
140 1 1 2 55 2 5 30 5 0 0 0 0 1 0 1
140 2 3 2 29 2 5 30 5 0 0 0 0 1 0 1
141 1 1 1 45 2 5 30 4 0 0 0 1 0 0 1
141 2 2 2 43 2 5 30 4 0 0 0 1 0 0 1
141 3 3 2 15 2 5 30 4 0 0 0 1 0 0 1
141 4 3 2 13 2 5 30 4 0 0 0 1 0 0 1
142 1 1 2 52 2 5 30 4 0 0 0 1 0 0 1
142 2 3 2 23 2 5 30 4 0 0 0 1 0 0 1
142 3 3 2 18 2 5 30 4 0 0 0 1 0 0 1
144 1 1 1 52 2 5 30 5 0 0 0 0 1 0 1
144 4 3 1 19 2 5 30 5 0 0 0 0 1 0 1
144 2 2 2 48 2 5 30 5 0 0 0 0 1 0 1
144 3 3 2 22 2 5 30 5 0 0 0 0 1 0 1
145 1 1 1 61 2 4 72 6 0 0 0 0 0 1 3
145 2 2 2 55 2 4 72 6 0 0 0 0 0 1 3
147 1 1 1 32 2 4 85 1 1 0 0 0 0 0 3
147 2 2 2 33 2 4 85 1 1 0 0 0 0 0 3
148 1 1 1 30 2 1 85 1 1 0 0 0 0 0 3
148 2 2 2 35 2 1 85 1 1 0 0 0 0 0 3
149 2 2 1 54 1 1 46 4 0 0 0 1 0 0 2
149 1 1 2 51 1 1 46 4 0 0 0 1 0 0 2
149 3 3 2 20 1 1 46 4 0 0 0 1 0 0 2
149 4 3 2 13 1 1 46 4 0 0 0 1 0 0 2
149 5 3 2 27 1 1 46 4 0 0 0 1 0 0 2
152 1 1 1 72 1 1 99 5 0 0 0 0 1 0 3
152 3 3 1 39 1 1 99 5 0 0 0 0 1 0 3
152 2 2 2 69 1 1 99 5 0 0 0 0 1 0 3
153 1 1 1 28 1 6 49 2 0 1 0 0 0 0 2
153 2 2 2 27 1 6 49 2 0 1 0 0 0 0 2
155 1 1 2 54 1 6 27 5 0 0 0 0 1 0 1
155 2 3 2 29 1 6 27 5 0 0 0 0 1 0 1
156 1 1 1 48 1 1 76 3 0 0 1 0 0 0 3
156 3 3 1 17 1 1 76 3 0 0 1 0 0 0 3
156 2 2 2 43 1 1 76 3 0 0 1 0 0 0 3
158 1 1 1 52 1 4 50 5 0 0 0 0 1 0 2
158 3 3 1 23 1 4 50 5 0 0 0 0 1 0 2
158 2 2 2 47 1 4 50 5 0 0 0 0 1 0 2
158 4 3 2 20 1 4 50 5 0 0 0 0 1 0 2
159 1 1 1 54 1 6 40 5 0 0 0 0 1 0 2
159 3 3 1 30 1 6 40 5 0 0 0 0 1 0 2
159 2 2 2 51 1 6 40 5 0 0 0 0 1 0 2
159 4 3 2 28 1 6 40 5 0 0 0 0 1 0 2
160 1 1 1 35 1 4 36 2 0 1 0 0 0 0 2
160 2 2 2 34 1 4 36 2 0 1 0 0 0 0 2
162 1 1 1 74 1 1 76 6 0 0 0 0 0 1 3
162 2 2 2 74 1 1 76 6 0 0 0 0 0 1 3
163 3 3 1 16 1 4 40 4 0 0 0 1 0 0 2
163 1 1 2 44 1 4 40 4 0 0 0 1 0 0 2
163 2 3 2 20 1 4 40 4 0 0 0 1 0 0 2
165 1 1 1 72 2 1 114 6 0 0 0 0 0 1 4
165 2 2 2 69 2 1 114 6 0 0 0 0 0 1 4
166 1 1 1 59 2 4 114 5 0 0 0 0 1 0 4
166 3 3 1 26 2 4 114 5 0 0 0 0 1 0 4
166 2 2 2 54 2 4 114 5 0 0 0 0 1 0 4
166 4 3 2 28 2 4 114 5 0 0 0 0 1 0 4
168 1 1 1 55 2 1 114 5 0 0 0 0 1 0 4
168 3 3 1 28 2 1 114 5 0 0 0 0 1 0 4
168 2 2 2 49 2 1 114 5 0 0 0 0 1 0 4
168 4 3 2 26 2 1 114 5 0 0 0 0 1 0 4
171 1 1 1 57 2 1 114 5 0 0 0 0 1 0 4
171 3 3 1 26 2 1 114 5 0 0 0 0 1 0 4
171 2 2 2 50 2 1 114 5 0 0 0 0 1 0 4
172 1 1 1 58 2 1 114 5 0 0 0 0 1 0 4
172 3 3 1 22 2 1 114 5 0 0 0 0 1 0 4
172 4 3 1 25 2 1 114 5 0 0 0 0 1 0 4
172 2 2 2 53 2 1 114 5 0 0 0 0 1 0 4
172 5 3 2 27 2 1 114 5 0 0 0 0 1 0 4
173 1 1 1 45 3 4 59 3 0 0 1 0 0 0 2
173 3 3 1 12 3 4 59 3 0 0 1 0 0 0 2
173 2 2 2 33 3 4 59 3 0 0 1 0 0 0 2
174 1 1 2 80 3 1 59 6 0 0 0 0 0 1 2
175 1 1 1 71 3 1 59 5 0 0 0 0 1 0 2
175 2 2 2 67 3 1 59 5 0 0 0 0 1 0 2
175 3 3 2 28 3 1 59 5 0 0 0 0 1 0 2
176 1 1 1 55 3 1 59 4 0 0 0 1 0 0 2
176 3 3 1 25 3 1 59 4 0 0 0 1 0 0 2
176 2 2 2 50 3 1 59 4 0 0 0 1 0 0 2
176 4 3 2 17 3 1 59 4 0 0 0 1 0 0 2
178 2 2 1 60 3 1 59 5 0 0 0 0 1 0 2
178 3 3 1 26 3 1 59 5 0 0 0 0 1 0 2
178 4 3 1 23 3 1 59 5 0 0 0 0 1 0 2
178 1 1 2 50 3 1 59 5 0 0 0 0 1 0 2
179 1 1 1 52 3 1 59 4 0 0 0 1 0 0 2
179 3 3 1 18 3 1 59 4 0 0 0 1 0 0 2
179 2 2 2 43 3 1 59 4 0 0 0 1 0 0 2
179 4 3 2 17 3 1 59 4 0 0 0 1 0 0 2
180 1 1 1 60 3 1 59 5 0 0 0 0 1 0 2
180 3 3 1 27 3 1 59 5 0 0 0 0 1 0 2
180 2 2 2 60 3 1 59 5 0 0 0 0 1 0 2
182 1 1 2 47 4 1 53 3 0 0 1 0 0 0 2
182 2 3 2 10 4 1 53 3 0 0 1 0 0 0 2
184 1 1 1 36 4 4 59 2 0 1 0 0 0 0 2
184 2 2 2 38 4 4 59 2 0 1 0 0 0 0 2
185 1 1 1 43 4 1 59 3 0 0 1 0 0 0 2
185 3 3 1 15 4 1 59 3 0 0 1 0 0 0 2
185 4 3 1 11 4 1 59 3 0 0 1 0 0 0 2
185 2 2 2 41 4 1 59 3 0 0 1 0 0 0 2
186 1 1 1 36 4 1 50 2 0 1 0 0 0 0 2
186 2 2 2 32 4 1 50 2 0 1 0 0 0 0 2
186 5 3 2 10 4 1 50 2 0 1 0 0 0 0 2
187 1 1 2 55 4 1 53 5 0 0 0 0 1 0 2
187 2 3 2 25 4 1 53 5 0 0 0 0 1 0 2
187 3 3 2 27 4 1 53 5 0 0 0 0 1 0 2
188 1 1 1 67 4 1 53 6 0 0 0 0 0 1 2
188 2 2 2 64 4 1 53 6 0 0 0 0 0 1 2
189 1 1 1 69 4 1 50 5 0 0 0 0 1 0 2
189 3 3 1 34 4 1 50 5 0 0 0 0 1 0 2
189 2 2 2 57 4 1 50 5 0 0 0 0 1 0 2
190 1 1 1 62 4 1 50 5 0 0 0 0 1 0 2
190 3 3 1 27 4 1 50 5 0 0 0 0 1 0 2
190 2 2 2 55 4 1 50 5 0 0 0 0 1 0 2
191 1 1 1 38 3 1 54 2 0 1 0 0 0 0 2
191 2 2 2 36 3 1 54 2 0 1 0 0 0 0 2
192 1 1 2 69 3 4 54 6 0 0 0 0 0 1 2
193 1 1 1 58 3 4 54 5 0 0 0 0 1 0 2
193 3 3 1 27 3 4 54 5 0 0 0 0 1 0 2
193 4 3 1 24 3 4 54 5 0 0 0 0 1 0 2
193 2 2 2 50 3 4 54 5 0 0 0 0 1 0 2
194 1 1 1 77 3 1 54 6 0 0 0 0 0 1 2
194 2 2 2 77 3 1 54 6 0 0 0 0 0 1 2
196 1 1 1 63 4 1 73 5 0 0 0 0 1 0 3
196 3 3 1 37 4 1 73 5 0 0 0 0 1 0 3
196 4 3 1 33 4 1 73 5 0 0 0 0 1 0 3
196 2 2 2 62 4 1 73 5 0 0 0 0 1 0 3
197 1 1 1 66 4 1 73 6 0 0 0 0 0 1 3
197 2 2 2 59 4 1 73 6 0 0 0 0 0 1 3
198 1 1 1 52 4 1 73 3 0 0 1 0 0 0 3
198 3 3 1 13 4 1 73 3 0 0 1 0 0 0 3
198 2 2 2 47 4 1 73 3 0 0 1 0 0 0 3
198 4 3 2 12 4 1 73 3 0 0 1 0 0 0 3
199 1 1 1 43 4 4 73 3 0 0 1 0 0 0 3
199 2 2 2 41 4 4 73 3 0 0 1 0 0 0 3
199 3 3 2 11 4 4 73 3 0 0 1 0 0 0 3
200 2 3 1 26 4 1 73 5 0 0 0 0 1 0 3
200 3 3 1 28 4 1 73 5 0 0 0 0 1 0 3
200 1 1 2 53 4 1 73 5 0 0 0 0 1 0 3
201 1 1 1 53 4 1 73 5 0 0 0 0 1 0 3
201 3 3 1 27 4 1 73 5 0 0 0 0 1 0 3
201 2 2 2 50 4 1 73 5 0 0 0 0 1 0 3
202 1 1 1 77 4 1 73 5 0 0 0 0 1 0 3
202 3 3 1 35 4 1 73 5 0 0 0 0 1 0 3
202 2 2 2 60 4 1 73 5 0 0 0 0 1 0 3
204 1 1 1 56 4 1 53 5 0 0 0 0 1 0 2
204 2 2 2 53 4 1 53 5 0 0 0 0 1 0 2
204 3 3 2 22 4 1 53 5 0 0 0 0 1 0 2
205 1 1 1 60 4 4 66 5 0 0 0 0 1 0 2
205 3 3 1 29 4 4 66 5 0 0 0 0 1 0 2
205 4 3 1 27 4 4 66 5 0 0 0 0 1 0 2
205 2 2 2 56 4 4 66 5 0 0 0 0 1 0 2
206 1 1 1 67 4 1 76 6 0 0 0 0 0 1 3
206 2 2 2 67 4 1 76 6 0 0 0 0 0 1 3
208 1 1 1 46 4 1 66 4 0 0 0 1 0 0 2
208 4 3 1 14 4 1 66 4 0 0 0 1 0 0 2
208 2 2 2 45 4 1 66 4 0 0 0 1 0 0 2
208 3 3 2 17 4 1 66 4 0 0 0 1 0 0 2
209 1 1 1 42 4 4 56 2 0 1 0 0 0 0 2
209 3 3 1 10 4 4 56 2 0 1 0 0 0 0 2
209 2 2 2 38 4 4 56 2 0 1 0 0 0 0 2
210 3 3 1 12 4 1 56 3 0 0 1 0 0 0 2
210 1 1 2 40 4 1 56 3 0 0 1 0 0 0 2
210 2 3 2 10 4 1 56 3 0 0 1 0 0 0 2
212 1 1 2 37 1 4 63 2 0 1 0 0 0 0 2
214 1 1 1 63 3 1 40 6 0 0 0 0 0 1 2
215 1 1 1 62 3 1 40 5 0 0 0 0 1 0 2
215 3 3 1 28 3 1 40 5 0 0 0 0 1 0 2
215 2 2 2 57 3 1 40 5 0 0 0 0 1 0 2
216 1 1 2 71 3 1 40 6 0 0 0 0 0 1 2
217 1 1 2 49 4 1 40 5 0 0 0 0 1 0 2
217 2 3 2 24 4 1 40 5 0 0 0 0 1 0 2
218 1 1 1 74 1 1 37 6 0 0 0 0 0 1 2
218 2 2 2 67 1 1 37 6 0 0 0 0 0 1 2
220 1 1 1 51 4 4 66 4 0 0 0 1 0 0 2
220 4 3 1 13 4 4 66 4 0 0 0 1 0 0 2
220 5 3 1 18 4 4 66 4 0 0 0 1 0 0 2
220 2 2 2 49 4 4 66 4 0 0 0 1 0 0 2
220 3 3 2 16 4 4 66 4 0 0 0 1 0 0 2
221 1 1 2 81 1 6 40 6 0 0 0 0 0 1 2
222 1 1 1 45 2 1 85 3 0 0 1 0 0 0 3
222 4 3 1 10 2 1 85 3 0 0 1 0 0 0 3
222 2 2 2 41 2 1 85 3 0 0 1 0 0 0 3
222 3 3 2 15 2 1 85 3 0 0 1 0 0 0 3
223 1 1 2 51 2 1 85 5 0 0 0 0 1 0 3
223 2 3 2 25 2 1 85 5 0 0 0 0 1 0 3
224 2 3 1 12 2 4 85 4 0 0 0 1 0 0 3
224 1 1 2 47 2 4 85 4 0 0 0 1 0 0 3
224 3 3 2 18 2 4 85 4 0 0 0 1 0 0 3
225 1 1 1 68 2 1 85 6 0 0 0 0 0 1 3
225 2 2 2 67 2 1 85 6 0 0 0 0 0 1 3
226 1 1 1 50 2 1 85 4 0 0 0 1 0 0 3
226 4 3 1 17 2 1 85 4 0 0 0 1 0 0 3
226 2 2 2 46 2 1 85 4 0 0 0 1 0 0 3
226 3 3 2 19 2 1 85 4 0 0 0 1 0 0 3
229 2 2 1 67 2 1 85 5 0 0 0 0 1 0 3
229 1 1 2 57 2 1 85 5 0 0 0 0 1 0 3
229 3 3 2 37 2 1 85 5 0 0 0 0 1 0 3
232 1 1 1 54 2 1 86 5 0 0 0 0 1 0 3
232 2 2 2 53 2 1 86 5 0 0 0 0 1 0 3
232 3 3 2 29 2 1 86 5 0 0 0 0 1 0 3
233 1 1 1 57 2 1 86 5 0 0 0 0 1 0 3
233 2 2 2 52 2 1 86 5 0 0 0 0 1 0 3
233 3 3 2 24 2 1 86 5 0 0 0 0 1 0 3
235 1 1 2 51 2 1 86 3 0 0 1 0 0 0 3
236 1 1 1 41 2 4 86 2 0 1 0 0 0 0 3
236 5 3 1 12 2 4 86 2 0 1 0 0 0 0 3
236 2 2 2 39 2 4 86 2 0 1 0 0 0 0 3
236 3 3 2 10 2 4 86 2 0 1 0 0 0 0 3
237 1 1 1 48 2 1 86 4 0 0 0 1 0 0 3
237 2 2 2 48 2 1 86 4 0 0 0 1 0 0 3
237 3 3 2 20 2 1 86 4 0 0 0 1 0 0 3
237 4 3 2 16 2 1 86 4 0 0 0 1 0 0 3
238 1 1 2 53 4 1 50 5 0 0 0 0 1 0 2
238 2 3 2 29 4 1 50 5 0 0 0 0 1 0 2
240 2 3 1 31 4 1 50 5 0 0 0 0 1 0 2
240 1 1 2 61 4 1 50 5 0 0 0 0 1 0 2
241 2 3 1 24 4 1 50 5 0 0 0 0 1 0 2
241 1 1 2 51 4 1 50 5 0 0 0 0 1 0 2
242 1 1 1 39 4 6 50 3 0 0 1 0 0 0 2
242 3 3 1 11 4 6 50 3 0 0 1 0 0 0 2
242 2 2 2 38 4 6 50 3 0 0 1 0 0 0 2
245 1 1 1 48 4 1 50 4 0 0 0 1 0 0 2
245 3 3 1 17 4 1 50 4 0 0 0 1 0 0 2
245 2 2 2 42 4 1 50 4 0 0 0 1 0 0 2
246 1 1 1 58 5 4 50 5 0 0 0 0 1 0 2
246 2 2 2 50 5 4 50 5 0 0 0 0 1 0 2
246 3 3 2 26 5 4 50 5 0 0 0 0 1 0 2
247 2 2 1 43 4 1 46 3 0 0 1 0 0 0 2
247 1 1 2 41 4 1 46 3 0 0 1 0 0 0 2
247 3 3 2 11 4 1 46 3 0 0 1 0 0 0 2
248 1 1 1 40 4 1 70 1 1 0 0 0 0 0 3
248 2 2 2 32 4 1 70 1 1 0 0 0 0 0 3
249 1 1 1 43 4 1 64 4 0 0 0 1 0 0 2
249 3 3 1 16 4 1 64 4 0 0 0 1 0 0 2
249 2 2 2 41 4 1 64 4 0 0 0 1 0 0 2
249 4 3 2 15 4 1 64 4 0 0 0 1 0 0 2
250 2 2 1 32 4 1 54 1 1 0 0 0 0 0 2
250 1 1 2 30 4 1 54 1 1 0 0 0 0 0 2
251 1 1 1 65 1 1 132 6 0 0 0 0 0 1 4
251 2 2 2 62 1 1 132 6 0 0 0 0 0 1 4
254 1 1 1 37 2 4 85 2 0 1 0 0 0 0 3
254 2 2 2 37 2 4 85 2 0 1 0 0 0 0 3
256 1 1 1 50 2 1 85 4 0 0 0 1 0 0 3
256 2 2 2 47 2 1 85 4 0 0 0 1 0 0 3
256 3 3 2 16 2 1 85 4 0 0 0 1 0 0 3
256 4 3 2 14 2 1 85 4 0 0 0 1 0 0 3
257 1 1 1 46 2 4 85 4 0 0 0 1 0 0 3
257 4 3 1 16 2 4 85 4 0 0 0 1 0 0 3
257 2 2 2 44 2 4 85 4 0 0 0 1 0 0 3
257 3 3 2 19 2 4 85 4 0 0 0 1 0 0 3
259 1 1 1 55 2 1 85 5 0 0 0 0 1 0 3
259 2 2 2 53 2 1 85 5 0 0 0 0 1 0 3
259 3 3 2 31 2 1 85 5 0 0 0 0 1 0 3
261 1 1 1 65 2 1 145 6 0 0 0 0 0 1 5
261 2 2 2 62 2 1 145 6 0 0 0 0 0 1 5
262 1 1 1 44 3 1 56 4 0 0 0 1 0 0 2
262 3 3 1 19 3 1 56 4 0 0 0 1 0 0 2
262 2 2 2 42 3 1 56 4 0 0 0 1 0 0 2
262 4 3 2 15 3 1 56 4 0 0 0 1 0 0 2
263 1 1 1 49 3 1 54 5 0 0 0 0 1 0 2
263 4 3 1 22 3 1 54 5 0 0 0 0 1 0 2
263 2 2 2 47 3 1 54 5 0 0 0 0 1 0 2
263 3 3 2 19 3 1 54 5 0 0 0 0 1 0 2
266 1 1 1 54 3 1 56 5 0 0 0 0 1 0 2
266 3 3 1 29 3 1 56 5 0 0 0 0 1 0 2
266 2 2 2 49 3 1 56 5 0 0 0 0 1 0 2
267 1 1 2 63 3 1 42 6 0 0 0 0 0 1 2
268 1 1 1 45 3 1 43 3 0 0 1 0 0 0 2
268 3 3 1 11 3 1 43 3 0 0 1 0 0 0 2
268 2 2 2 36 3 1 43 3 0 0 1 0 0 0 2
268 5 3 2 12 3 1 43 3 0 0 1 0 0 0 2
269 1 1 1 45 3 1 47 3 0 0 1 0 0 0 2
269 2 2 2 42 3 1 47 3 0 0 1 0 0 0 2
269 3 3 2 11 3 1 47 3 0 0 1 0 0 0 2
270 1 1 1 34 2 4 59 2 0 1 0 0 0 0 2
270 2 2 2 34 2 4 59 2 0 1 0 0 0 0 2
271 2 2 1 60 2 1 59 5 0 0 0 0 1 0 2
271 3 3 1 34 2 1 59 5 0 0 0 0 1 0 2
271 1 1 2 57 2 1 59 5 0 0 0 0 1 0 2
272 1 1 1 35 2 1 59 2 0 1 0 0 0 0 2
272 2 2 2 35 2 1 59 2 0 1 0 0 0 0 2
273 1 1 1 35 2 1 59 2 0 1 0 0 0 0 2
273 2 2 2 39 2 1 59 2 0 1 0 0 0 0 2
275 1 1 1 33 2 1 59 2 0 1 0 0 0 0 2
275 2 2 2 29 2 1 59 2 0 1 0 0 0 0 2
276 1 1 1 30 2 4 59 1 1 0 0 0 0 0 2
277 1 1 1 47 2 1 59 4 0 0 0 1 0 0 2
277 2 2 2 48 2 1 59 4 0 0 0 1 0 0 2
277 3 3 2 17 2 1 59 4 0 0 0 1 0 0 2
277 4 3 2 15 2 1 59 4 0 0 0 1 0 0 2
278 1 1 1 78 2 1 84 6 0 0 0 0 0 1 3
278 2 2 2 79 2 1 84 6 0 0 0 0 0 1 3
280 1 1 1 56 2 1 84 5 0 0 0 0 1 0 3
280 2 2 2 53 2 1 84 5 0 0 0 0 1 0 3
280 3 3 2 27 2 1 84 5 0 0 0 0 1 0 3
281 1 1 1 50 2 1 84 4 0 0 0 1 0 0 3
281 4 3 1 17 2 1 84 4 0 0 0 1 0 0 3
281 2 2 2 45 2 1 84 4 0 0 0 1 0 0 3
281 3 3 2 22 2 1 84 4 0 0 0 1 0 0 3
283 1 1 1 51 2 1 84 5 0 0 0 0 1 0 3
283 4 3 1 25 2 1 84 5 0 0 0 0 1 0 3
283 2 2 2 49 2 1 84 5 0 0 0 0 1 0 3
283 3 3 2 27 2 1 84 5 0 0 0 0 1 0 3
285 1 1 1 48 2 1 122 3 0 0 1 0 0 0 4
285 5 3 1 17 2 1 122 3 0 0 1 0 0 0 4
285 2 2 2 41 2 1 122 3 0 0 1 0 0 0 4
285 3 3 2 15 2 1 122 3 0 0 1 0 0 0 4
286 1 1 1 57 2 1 122 5 0 0 0 0 1 0 4
286 4 3 1 25 2 1 122 5 0 0 0 0 1 0 4
286 2 2 2 51 2 1 122 5 0 0 0 0 1 0 4
286 3 3 2 29 2 1 122 5 0 0 0 0 1 0 4
287 1 1 1 43 2 1 122 2 0 1 0 0 0 0 4
287 2 2 2 40 2 1 122 2 0 1 0 0 0 0 4
287 3 3 2 12 2 1 122 2 0 1 0 0 0 0 4
290 1 1 1 46 2 1 102 3 0 0 1 0 0 0 4
290 4 3 1 10 2 1 102 3 0 0 1 0 0 0 4
290 2 2 2 42 2 1 102 3 0 0 1 0 0 0 4
290 3 3 2 15 2 1 102 3 0 0 1 0 0 0 4
291 1 1 1 30 2 4 102 2 0 1 0 0 0 0 4
291 2 2 2 26 2 4 102 2 0 1 0 0 0 0 4
292 1 1 2 61 1 1 59 6 0 0 0 0 0 1 2
295 1 1 1 47 1 4 43 3 0 0 1 0 0 0 2
295 3 3 1 11 1 4 43 3 0 0 1 0 0 0 2
295 2 2 2 43 1 4 43 3 0 0 1 0 0 0 2
297 1 1 1 43 1 4 43 2 0 1 0 0 0 0 2
297 2 2 2 46 1 4 43 2 0 1 0 0 0 0 2
298 1 1 1 40 1 4 56 2 0 1 0 0 0 0 2
298 2 2 2 37 1 4 56 2 0 1 0 0 0 0 2
299 2 3 1 24 1 4 50 5 0 0 0 0 1 0 2
299 1 1 2 60 1 4 50 5 0 0 0 0 1 0 2
300 1 1 1 46 4 4 83 4 0 0 0 1 0 0 3
300 2 2 2 43 4 4 83 4 0 0 0 1 0 0 3
300 3 3 2 13 4 4 83 4 0 0 0 1 0 0 3
My understanding is that R is implemented as copy-on-write.
Take for instance:
X <- 1:1000
y <- x # no copy made. x & y share the reference
y[1] <- 8 # now a copy is made.
If x is growing, the copies take longer and longer, and the script slows down.
I'm not that familiar with macro variables, but I suspect something like this is happening.
If you're working with a list, every time you add a new element to the list, every thing is recopied.
y <- list()
y$this <- 1:5
y$that <- 6:10 # now every thing was recopied.
Therefore it's better to allocate first. It really helps the performance.
y <- vector("list", 2)
y[[1]] <- 1:5
y[[2]] <- 6:10
These slides are really good: a link take a look!
I have this table as a result from another query
STATUS R1 R2 R3 R4 R5 R6 R7 R8 R9
----------------------------------------------------
ACCEPTED 322 241 278 473 575 595 567 449 605
ADECUACIONES 0 0 0 0 2 0 1 0 50
AET 0 0 2 0 0 0 0 0 11
EXECUTED 0 80 1 18 9 57 34 30 20
IN PROCESS 0 0 0 0 0 4 25 2 112
FREQ 0 55 2 76 25 117 7 73 48
INSTALL 1 4 1 10 5 14 2 13 62
WO INSTALL 9 2 51 24 143 17 15 59 16
WOT VL 0 1 0 0 1 0 0 0 0
OTHER 22 7 20 28 44 30 6 6 109
PROG 1 0 1 0 0 2 3 0 0
PTE PROG 0 5 0 0 0 0 3 19 93
TMX 0 0 0 28 4 8 11 3 14
PROJ 0 1 12 26 13 8 0 2 4
What I expect to have is this
STATUS R1 R2 R3 R4 R5 R6 R7 R8 R9 TOTAL
----------------------------------------------------------
ACCEPTED 322 241 278 473 575 595 567 449 605 4105
ADECUACIONES 0 0 0 0 2 0 1 0 50 53
AET 0 0 2 0 0 0 0 0 11 13
EXECUTED 0 80 1 18 9 57 34 30 20 249
IN PROCESS 0 0 0 0 0 4 25 2 112 143
FREQ 0 55 2 76 25 117 7 73 48 403
INSTALL 1 4 1 10 5 14 2 13 62 112
WO INSTALL 9 2 51 24 143 17 15 59 16 336
WOT VL 0 1 0 0 1 0 0 0 0 2
OTHER 22 7 20 28 44 30 6 6 109 272
PROG 1 0 1 0 0 2 3 0 0 7
PTE PROG 0 5 0 0 0 0 3 19 93 120
TMX 0 0 0 28 4 8 11 3 14 68
PROJ 0 1 12 26 13 8 0 2 4 66
TOTAL 355 396 368 683 821 852 674 656 1144 5949
I've been playing with grouping() and rollup(), but I always get duplicated rows and unwanted null values.
If you have problems, grouping_id function will help you.
(You can select grouping_id(col), but also grouping_id(col1, col2, col3, etc..))
But your case is simpler.
It is like:
drop table fg_test_group;
create table fg_test_group (a number, b number, c number, d number);
insert into fg_test_group values (1, 2, 3, 4);
insert into fg_test_group values (2, 2, 3, 4);
insert into fg_test_group values (3, 2, 3, 4);
select nvl(to_char(a), 'total') as a , sum(b), sum(c), sum(d), grouping_id(a)
from fg_test_group
group by rollup (a)
;
where a is Status in your case.
CREATE TABLE TEST1 (STATUS VARCHAR2(10), R1 NUMBER, R2 NUMBER, R3 NUMBER);
INSERT INTO TEST1 VALUES ('ACCEPTED', 322,241,278);
INSERT INTO TEST1 VALUES ('EXECUTED', 0, 80, 1);
INSERT INTO TEST1 VALUES ('FREQ', 0, 55, 2);
COMMIT;
select NVL(TO_CHAR(STATUS), 'total') as STATUS ,SUM(R1) R1, SUM(R2) R2 , SUM(R3) R3, SUM(R1+R2+R3)
from TEST1
group by rollup (STATUS)
;
STATUS R1 R2 R3 SUM(R1+R2+R3)
ACCEPTED 322 241 278 841
EXECUTED 0 80 1 81
FREQ 0 55 2 57
total 322 376 281 979