source: research/2008-displacement/README @ 2286

Last change on this file since 2286 was 2286, checked in by Sam Hocevar, 14 years ago
  • More scripts for part 3.
  • Implemented main.c as a seccomp bytecode for CPUShare.
File size: 10.6 KB
Line 
1# List all my 4chan images
2find ~/4chan/unsorted-4chan/http* -name '1[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].???' | rev | sort -k2 -t. | rev > 4chan-list.txt
3
4# Put all my 4chan images in 100 separate /tmp directories
5for x in $(seq -w 00 09); do echo $x; mkdir -p /tmp/4chan/$x; cp $(find ~/4chan/unsorted-4chan/http* -name '1[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'$x'.???') /tmp/4chan/$x; done
6
7# Condorcet voting for phase 2 results
8#  - raster + E
9#  - raster + E_min
10#  - serpentine + E
11#  - serpentine + E_min
12for x in part2/*txt ; do grep '^.1' $x | awk '{ print $3,$5 }' >| $x.clean; done ; ./vote part2/*clean | sort -rnk3 | head -30 ; rm -f part2/*clean
13for x in part2/*txt ; do grep '^.1' $x | awk '{ print $3,$9 }' >| $x.clean; done ; ./vote part2/*clean | sort -rnk3 | head -30 ; rm -f part2/*clean
14for x in part2/*txt ; do grep '^.2' $x | awk '{ print $3,$5 }' >| $x.clean; done ; ./vote part2/*clean | sort -rnk3 | head -30 ; rm -f part2/*clean
15for x in part2/*txt ; do grep '^.2' $x | awk '{ print $3,$9 }' >| $x.clean; done ; ./vote part2/*clean | sort -rnk3 | head -30 ; rm -f part2/*clean
16
17# Get phase 3 and phase 4 stuff
18ssh canard.zoy.org "cd test-20080329; tar cz *raster.txt *serp.txt" | tar xz
19for x in *-raster.txt; do y="$x"; y="${y%%-raster.txt}"; y="${y%%.tiff}"; y="${y##usc-sipi}"; \mv "$x" part3/"$y".txt; done
20for x in *-serp.txt; do y="$x"; y="${y%%-serp.txt}"; y="${y%%.tiff}"; y="${y##usc-sipi}"; \mv "$x" part4/"$y".txt; done
21
22# Condorcet voting for part 3 and 4
23for x in part3/*txt ; do cat $x | awk '{ print $2,$4 }' >| $x.clean; done ; ./vote part3/*clean | sort -rnk3 | head -20 ; rm -f part3/*clean
24for x in part3/*txt ; do cat $x | awk '{ print $2,$8 }' >| $x.clean; done ; ./vote part3/*clean | sort -rnk3 | head -20 ; rm -f part3/*clean
25for x in part4/*txt ; do cat $x | awk '{ print $2,$4 }' >| $x.clean; done ; ./vote part4/*clean | sort -rnk3 | head -20 ; rm -f part4/*clean
26for x in part4/*txt ; do cat $x | awk '{ print $2,$8 }' >| $x.clean; done ; ./vote part4/*clean | sort -rnk3 | head -20 ; rm -f part4/*clean
27
28# Mean voting for part 3 and 4
29cat part3/aerials2.1.01.txt | while read x k y ; do echo "$k $(grep $k part3/* | awk '{ a+=$4; dx+=$10; dy+=$12; n+=1 } END { print a/n, dx/n, dy/n }')"; done | sort -nk2 | head -20
30cat part3/aerials2.1.01.txt | while read x k y ; do echo "$k $(grep $k part3/* | awk '{ a+=$8; dx+=$10; dy+=$12; n+=1 } END { print a/n, dx/n, dy/n }')"; done | sort -nk2 | head -20
31cat part4/aerials2.1.01.txt | while read x k y ; do echo "$k $(grep $k part4/* | awk '{ a+=$4; dx+=$10; dy+=$12; n+=1 } END { print a/n, dx/n, dy/n }')"; done | sort -nk2 | head -20
32cat part4/aerials2.1.01.txt | while read x k y ; do echo "$k $(grep $k part4/* | awk '{ a+=$8; dx+=$10; dy+=$12; n+=1 } END { print a/n, dx/n, dy/n }')"; done | sort -nk2 | head -20
33
34# Clever stuff (or not)
35cat part3/aerials2.1.01.txt | grep K | while read x k y ; do grep $k part3/* | awk '{ dx+=$10; dy+=$12; n+=1 } END { print dx/n, dy/n }' | read dx dy; echo "$k $(grep $k part3/* | awk 'BEGIN { dx='$dx'; dy='$dy' } { x=dx-$10; y=dy-$12; t+=2.^-5*(x*x+y*y); a+=t*$4; n+=t } END { print a/n, n }')"; done | sort -nk2 | head -20
36cat part3/aerials2.1.01.txt | grep K | while read x k y ; do grep $k part3/* | awk '{ dx+=$10; dy+=$12; n+=1 } END { print dx/n, dy/n }' | read dx dy; echo "$k $(grep $k part3/* | awk 'BEGIN { dx='$dx'; dy='$dy' } { x=dx-$10; y=dy-$12; t+=2.^-5*(x*x+y*y); a+=t*$8; n+=t } END { print a/n, n }')"; done | sort -nk2 | head -20
37cat part4/aerials2.1.01.txt | grep K | while read x k y ; do grep $k part4/* | awk '{ dx+=$10; dy+=$12; n+=1 } END { print dx/n, dy/n }' | read dx dy; echo "$k $(grep $k part4/* | awk 'BEGIN { dx='$dx'; dy='$dy' } { x=dx-$10; y=dy-$12; t+=2.^-5*(x*x+y*y); a+=t*$4; n+=t } END { print a/n, n }')"; done | sort -nk2 | head -20
38cat part4/aerials2.1.01.txt | grep K | while read x k y ; do grep $k part4/* | awk '{ dx+=$10; dy+=$12; n+=1 } END { print dx/n, dy/n }' | read dx dy; echo "$k $(grep $k part4/* | awk 'BEGIN { dx='$dx'; dy='$dy' } { x=dx-$10; y=dy-$12; t+=2.^-5*(x*x+y*y); a+=t*$8; n+=t } END { print a/n, n }')"; done | sort -nk2 | head -20
39
40###
41###
42###
43###
44###  Stuff below here is deprecated or unsorted
45###
46###
47###
48###
49
50#% find ~/4chan/unsorted-4chan/http* -name '1[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].???' | rev | sort -k2 -t. | rev | xargs -n 1 ./main | tee fs-4chan.txt
51#% find ~/4chan/unsorted-4chan/http* -name '1[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].???' | rev | sort -k2 -t. | rev | xargs -n 1 ./main-jajuni | tee jajuni-4chan.txt
52#% cat /tmp/4chanlist.txt | xargs -n 1 ./main | tee -a fs-4chan.txt
53
54# Lena
55set hidden3d
56set grid
57unset colorbox
58splot "lena-min.txt" with lines lc 7 notitle
59set terminal epslatex color size 2.5,2 blacktext
60set tmargin screen 0.75
61set bmargin screen 0.25
62set lmargin screen 0.05
63set rmargin screen 0.95
64set output "lena-min.tex"
65splot "lena-min.txt" with lines lc 7 notitle
66unset output
67set term pop
68
69# Dans gnuplot
70set xrange [-.1:.4]
71set yrange [.45:-.05]
72set grid
73plot "fs-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
74     "fs-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
75     "fs-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI", \
76     "fs-jylam.txt" using 6:7 lc 4 pt 7 ps .08 title "Jylam", \
77     "merge.txt" using 5:6 lc 7 ps .2 with lines
78#plot "fs-textures.txt" using 6:7 lc 3 pt 7 ps .2, "fs-aerials.txt" using 6:7 lc 3 pt 7 ps .2, "fs-misc.txt" using 6:7 lc 7 pt 7 ps .2, "fs-4chan.txt" using 6:7 lc 1 pt 7 ps .2
79
80# Histogramme de la tache Floyd-Steinberg
81sed -ne 's/.* for //p' fs-*txt | ./xy2d >| histo-fs.txt
82# Et ensuite dans gnuplot:
83set xrange [-.1:.4]
84set yrange [.4:-.1]
85set grid
86set lmargin screen 0.05
87set bmargin screen 0.15
88set tmargin screen 0.95
89set rmargin screen 0.95
90unset colorbox
91set pm3d explicit map interpolate 1.8,1.8
92set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
93unset key
94#splot "histo-fs.txt" notitle
95set terminal epslatex color size 1.8,1.8 blacktext
96set output "fs-histo.tex"
97splot "histo-fs.txt" notitle
98unset output
99set term pop
100
101set xrange [-.1:.9]
102set yrange [.95:-.05]
103set grid
104plot "jajuni-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
105     "jajuni-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
106     "jajuni-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI"
107
108# Histogramme de la tache JaJuNi
109sed -ne 's/.* for //p' jajuni*txt | ./xy2d-jajuni >| histo-jajuni.txt
110# Et ensuite dans gnuplot:
111set xrange [-.1:.9]
112set yrange [.9:-.1]
113set grid
114set lmargin screen 0.05
115set bmargin screen 0.15
116set tmargin screen 0.95
117set rmargin screen 0.95
118unset colorbox
119set pm3d explicit map interpolate 1.8,1.8
120set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
121unset key
122#splot "histo-jajuni.txt" notitle
123set terminal epslatex color size 1.8,1.8 blacktext
124set output "jajuni-histo.tex"
125splot "histo-jajuni.txt" notitle
126unset output
127set term pop
128
129# Test de merde
130set xrange [0:5]
131set yrange [0:5]
132set grid
133plot "fs-uscsipi.txt" using 2:4 lc 1 pt 7 ps .5, "fs-4chan.txt" using 2:4 lc 7 pt 7 ps .5, "fs-tobefred.txt" using 2:4 lc 3 pt 7 ps .5
134
135# Ostromoukhov
136set xrange [-.2:.2]
137set yrange [.3:-.1]
138set grid
139plot "ostro-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
140     "ostro-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
141     "ostro-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI"
142
143# Histogramme de la tache Ostro
144sed -ne 's/.* for //p' ostro*txt | ./xy2d-ostro >| histo-ostro.txt
145# Et ensuite dans gnuplot:
146set xrange [-.2:.2]
147set yrange [.3:-.1]
148set grid
149set lmargin screen 0.05
150set bmargin screen 0.15
151set tmargin screen 0.95
152set rmargin screen 0.95
153unset colorbox
154set pm3d explicit map interpolate 1.8,1.8
155set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
156unset key
157splot "histo-ostro.txt" notitle
158set terminal epslatex color size 1.8,1.8 blacktext
159set output "ostro-histo.tex"
160splot "histo-ostro.txt" notitle
161unset output
162set term pop
163
164# Optimum
165set xrange [-.5:.2]
166set yrange [.6:-.1]
167set grid
168plot "optimum-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
169     "optimum-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
170     "optimum-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI"
171
172# Histogramme de la tache Optimum
173sed -ne 's/.* for //p' optimum*txt | ./xy2d-optimum >| histo-optimum.txt
174# Et ensuite dans gnuplot:
175set xrange [-.5:.2]
176set yrange [.6:-.1]
177set grid
178set lmargin screen 0.05
179set bmargin screen 0.15
180set tmargin screen 0.95
181set rmargin screen 0.95
182unset colorbox
183set pm3d explicit map interpolate 1.8,1.8
184set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
185unset key
186splot "histo-optimum.txt" notitle
187set terminal epslatex color size 1.8,1.8 blacktext
188set output "optimum-histo.tex"
189splot "histo-optimum.txt" notitle
190unset output
191set term pop
192
193# Serpentine Optimum
194set xrange [-.3:.3]
195set yrange [.5:-.1]
196set grid
197plot "serpopt-4chan.txt" using 6:7 lc 1 pt 7 ps .08 title "4chan", \
198     "serpopt-tobefred.txt" using 6:7 lc 3 pt 7 ps .08 title "tobefred", \
199     "serpopt-uscsipi.txt" using 6:7 lc 2 pt 7 ps .08 title "USC-SIPI"
200
201# Histogramme de la tache Serpentine Optimum
202sed -ne 's/.* for //p' serpopt*txt | ./xy2d-serpopt >| histo-serpopt.txt
203# Et ensuite dans gnuplot:
204set xrange [-.3:.3]
205set yrange [.6:-.1]
206set grid
207set lmargin screen 0.05
208set bmargin screen 0.15
209set tmargin screen 0.95
210set rmargin screen 0.95
211unset colorbox
212set pm3d explicit map interpolate 1.8,1.8
213set palette model RGB defined(0 "white", 1 "blue", 2 "red", 3 "yellow")
214unset key
215splot "histo-serpopt.txt" notitle
216set terminal epslatex color size 1.8,1.8 blacktext
217set output "serpopt-histo.tex"
218splot "histo-serpopt.txt" notitle
219unset output
220set term pop
221
222# Combinaison jajuni / floyd-steinberg
223set xrange [-.1:.4]
224set yrange [.9:-.1]
225set grid
226plot "fs-4chan.txt" using 6:7 lc 2 pt 7 ps .1 title "Floyd-Steinberg", "jajuni-tobefred.txt" using 6:7 lc 1 pt 7 ps .1 title "Jarvis-Judice-Ninke"
227
228######################## Trucs en cours ########################
229
230# Lancés sur canard:
231boat.png elaine.png texture[2345].png
232
233# Lancés sur poulet :
234./main /var/www/net/tobefred/www/htdocs/media/romane_bohringer.jpg | tee out-bohringer.txt ; ./main /var/www/net/tobefred/www/htdocs/media/juliette_binoche_05.jpg | tee out-binoche.txt ; ./main /var/www/net/tobefred/www/htdocs/media/kate_beckinsale02.jpg | tee out-beckinsale.txt
235
236#### Pour les out-*
237scp canard.zoy.org:out-'*'.txt .
238for x in out-*.txt; do sort -k7 $x | head -20 ; done | cut -f1 -d: | sort | uniq -c | sort -n
239
240###
241### Conversion du vieux format de résultats (deprecated)
242cat -n $x | sed 's/^  *[0-9]*\([0-9]\)[[:space:]]*/[\1] /; s/....###/###/; s/\[[27]/[1/; s/\[[38]/[2/; s/\[[49]/[3/; s/\[[50]/[4/'
243
244#
Note: See TracBrowser for help on using the repository browser.