backup de julho
[h2N7SspZmY.git] / data / cache / b / b0baed74239a3c0a65ba153f639b58c6.i
bloba1f97c941a594ce7117ba9a9028a50d87df43bb1
1 a:55:{i:0;a:3:{i:0;s:14:"document_start";i:1;a:0:{}i:2;i:0;}i:1;a:3:{i:0;s:6:"p_open";i:1;a:0:{}i:2;i:0;}i:2;a:3:{i:0;s:7:"p_close";i:1;a:0:{}i:2;i:1;}i:3;a:3:{i:0;s:12:"section_edit";i:1;a:4:{i:0;i:-1;i:1;i:0;i:2;i:1;i:3;s:0:"";}i:2;i:1;}i:4;a:3:{i:0;s:6:"header";i:1;a:3:{i:0;s:4:"Ruby";i:1;i:1;i:2;i:1;}i:2;i:1;}i:5;a:3:{i:0;s:12:"section_open";i:1;a:1:{i:0;i:1;}i:2;i:1;}i:6;a:3:{i:0;s:6:"p_open";i:1;a:0:{}i:2;i:19;}i:7;a:3:{i:0;s:5:"cdata";i:1;a:1:{i:0;s:1:"
2 ";}i:2;i:20;}i:8;a:3:{i:0;s:12:"externallink";i:1;a:2:{i:0;s:24:"http://www.ruby-lang.org";i:1;s:4:"Ruby";}i:2;i:21;}i:9;a:3:{i:0;s:5:"cdata";i:1;a:1:{i:0;s:2:": ";}i:2;i:54;}i:10;a:3:{i:0;s:13:"interwikilink";i:1;a:4:{i:0;s:34:"wp>Ruby_%28programming_language%29";i:1;s:4:"Ruby";i:2;s:2:"wp";i:3;s:31:"Ruby_%28programming_language%29";}i:2;i:56;}i:11;a:3:{i:0;s:7:"p_close";i:1;a:0:{}i:2;i:99;}i:12;a:2:{i:0;s:6:"plugin";i:1;a:4:{i:0;s:7:"uparrow";i:1;a:1:{i:0;s:42:"lib/plugins/uparrow/images/tango-small.png";}i:2;i:1;i:3;s:6:"~~UP~~";}}i:13;a:3:{i:0;s:13:"section_close";i:1;a:0:{}i:2;i:103;}i:14;a:3:{i:0;s:12:"section_edit";i:1;a:4:{i:0;i:1;i:1;i:102;i:2;i:1;i:3;s:4:"Ruby";}i:2;i:103;}i:15;a:3:{i:0;s:6:"header";i:1;a:3:{i:0;s:44:"How to process a file with a list of numbers";i:1;i:2;i:2;i:103;}i:2;i:103;}i:16;a:3:{i:0;s:12:"section_open";i:1;a:1:{i:0;i:2;}i:2;i:103;}i:17;a:3:{i:0;s:4:"file";i:1;a:3:{i:0;s:543:"
3 #!/usr/bin/ruby
4 lines = IO.read(ARGV[0]).split("\n");
5 min = lines.inject{ |x, y| [x.to_i, y.to_i].min }
6 max = lines.inject{ |x, y| [x.to_i, y.to_i].max }
7 media = lines.inject{ |x, y| x.to_i + y.to_i }.to_f / lines.size;
8 desvio = Math.sqrt(lines.inject(0){ |x, y| x.to_i + (y.to_i - media) ** 2 } / (lines.size - 1))
9 coef = 2.262 * desvio / Math.sqrt(lines.size)
10 #print sprintf(" & %i & %i & %0.2f & %0.2f \\\\\n", min, max, media, desvio)
11 print sprintf(" & %0.2f & %0.2f & [%0.2f, %0.2f] \\\\\n", media, desvio, media - coef, media + coef)
12 ";i:1;s:4:"ruby";i:2;s:7:"calc.rb";}i:2;i:166;}i:18;a:3:{i:0;s:4:"file";i:1;a:3:{i:0;s:10:"
16 ";i:1;s:4:"text";i:2;s:7:"calc.in";}i:2;i:737;}i:19;a:3:{i:0;s:4:"file";i:1;a:3:{i:0;s:39:"
17 & 99.99 & 99.99 & [99.99, 99.99] \\
18 ";i:1;s:4:"text";i:2;s:8:"calc.out";}i:2;i:775;}i:20;a:2:{i:0;s:6:"plugin";i:1;a:4:{i:0;s:7:"uparrow";i:1;a:1:{i:0;s:42:"lib/plugins/uparrow/images/tango-small.png";}i:2;i:1;i:3;s:6:"~~UP~~";}}i:21;a:3:{i:0;s:13:"section_close";i:1;a:0:{}i:2;i:838;}i:22;a:3:{i:0;s:12:"section_edit";i:1;a:4:{i:0;i:103;i:1;i:837;i:2;i:2;i:3;s:44:"How to process a file with a list of numbers";}i:2;i:838;}i:23;a:3:{i:0;s:6:"header";i:1;a:3:{i:0;s:30:"How to process a list of names";i:1;i:2;i:2;i:838;}i:2;i:838;}i:24;a:3:{i:0;s:12:"section_open";i:1;a:1:{i:0;i:2;}i:2;i:838;}i:25;a:3:{i:0;s:4:"file";i:1;a:3:{i:0;s:402:"
19 #!/usr/bin/ruby
20 lines = IO.read(ARGV[0]).gsub(/.*\*.*\n/, '').gsub(/ \(.\)/, '').split("\n");
21 lines.each { |line|
22 #print line + "\n"
23 line.split(' ').join.each { |word|
24 print '\begin{figure}[!h]
25 \centering
26 \includegraphics[scale=0.42]{'
27 print word + ".jpg"
28 system("touch " + word + ".jpg")
29 print '}
30 \caption{'
31 print "Diagrama de Interação: " + line
32 print '}
33 \end{figure}
35 print "\n\n"
38 ";i:1;s:4:"ruby";i:2;s:9:"figure.rb";}i:2;i:887;}i:26;a:3:{i:0;s:6:"p_open";i:1;a:0:{}i:2;i:1312;}i:27;a:3:{i:0;s:5:"cdata";i:1;a:1:{i:0;s:17:"Removing accents:";}i:2;i:1314;}i:28;a:3:{i:0;s:7:"p_close";i:1;a:0:{}i:2;i:1331;}i:29;a:3:{i:0;s:4:"file";i:1;a:3:{i:0;s:622:"
39 #!/usr/bin/ruby
40 lines = IO.read(ARGV[1]).gsub(/.*\*.*\n/, '').gsub(/ \(.\)/, '').split("\n");
41 lines2 = IO.read(ARGV[0]).gsub(/.*\*.*\n/, '').gsub(/ \(.\)/, '').split("\n");
42 i = 0;
43 lines.each_with_index { |line, index|
44 i = i + 1;
45 #print line + "\n"
46 line.split(' ').join.each { |word|
47 print '\begin{figure}[htbp]
48 \centering
49 \includegraphics[scale=0.42]{'
50 print word + ".jpg"
51 #system("touch " + word + ".jpg")
52 #system("cp int.jpg " + word + ".jpg")
53 print '}
54 \caption{'
55 print "Diagrama de Interação: " + lines2[index]
56 print '}
57 \end{figure}
59 print "\n\n"
60 if i % 10 == 0 then
61 print "\\clearpage\n\n"
62 end
65 ";i:1;s:4:"ruby";i:2;s:10:"figure2.rb";}i:2;i:1338;}i:30;a:3:{i:0;s:4:"file";i:1;a:3:{i:0;s:54:"
67 Consultar Usuário (M)
69 Inicializar Sistema (F)
70 ";i:1;s:4:"text";i:2;s:9:"figure.in";}i:2;i:1991;}i:31;a:3:{i:0;s:4:"file";i:1;a:3:{i:0;s:302:"
71 \begin{figure}[!h]
72 \centering
73 \includegraphics[scale=0.42]{ConsultarUsuario.jpg}
74 \caption{Diagrama de Interação: Consultar Usuário}
75 \end{figure}
78 \begin{figure}[!h]
79 \centering
80 \includegraphics[scale=0.42]{InicializarSistema.jpg}
81 \caption{Diagrama de Interação: Inicializar Sistema}
82 \end{figure}
83 ";i:1;s:5:"latex";i:2;s:10:"figure.out";}i:2;i:2075;}i:32;a:2:{i:0;s:6:"plugin";i:1;a:4:{i:0;s:7:"uparrow";i:1;a:1:{i:0;s:42:"lib/plugins/uparrow/images/tango-small.png";}i:2;i:1;i:3;s:6:"~~UP~~";}}i:33;a:3:{i:0;s:13:"section_close";i:1;a:0:{}i:2;i:2404;}i:34;a:3:{i:0;s:12:"section_edit";i:1;a:4:{i:0;i:838;i:1;i:2403;i:2;i:2;i:3;s:30:"How to process a list of names";}i:2;i:2404;}i:35;a:3:{i:0;s:6:"header";i:1;a:3:{i:0;s:8:"Examples";i:1;i:2;i:2;i:2404;}i:2;i:2404;}i:36;a:3:{i:0;s:12:"section_open";i:1;a:1:{i:0;i:2;}i:2;i:2404;}i:37;a:3:{i:0;s:4:"code";i:1;a:3:{i:0;s:104:"
84 sum = 0.0; 10.times{ |i| sum += IO.read("#{i+1}.out").split("\n")[5].split()[0].to_i }; print sum / 10
85 ";i:1;s:4:"ruby";i:2;N;}i:2;i:2431;}i:38;a:3:{i:0;s:4:"code";i:1;a:3:{i:0;s:78:"
86 10.times{ |i| print IO.read("#{i+1}.out").split("\n")[5].split()[0] + "\n" }
87 ";i:1;s:4:"ruby";i:2;N;}i:2;i:2555;}i:39;a:3:{i:0;s:4:"code";i:1;a:3:{i:0;s:156:"
88 require "net/http"
89 Net::HTTP.new("verdi.softwarelivre.org", 80).get("http://verdi.softwarelivre.org/papers_ng/swiss/get?token=4E0C4F2EC6B29562").body.to_s
90 ";i:1;s:4:"ruby";i:2;N;}i:2;i:2653;}i:40;a:3:{i:0;s:4:"code";i:1;a:3:{i:0;s:50:"
91 "4E0C4F2EC6B29599".to_i(16).succ.to_s(16).upcase
92 ";i:1;s:4:"ruby";i:2;N;}i:2;i:2829;}i:41;a:3:{i:0;s:4:"code";i:1;a:3:{i:0;s:64:"
93 5.times { print "s:#{s = s.to_i(16).succ.to_s(16).upcase}\n" }
94 ";i:1;s:4:"ruby";i:2;N;}i:2;i:2899;}i:42;a:3:{i:0;s:4:"code";i:1;a:3:{i:0;s:487:"
95 #!/usr/bin/ruby
96 require "net/http"
97 s = "4E0C4F2EC6B29561"
98 1000000.times {
99 p = Net::HTTP.new("verdi.softwarelivre.org", 80).get("http://verdi.softwarelivre.org/papers_ng/swiss/get?token=#{s = s.to_i(16).succ.to_s(16).upcase}").body.to_s
100 #print s + "\n\n"
101 #print p + "\n\n"
102 print s + " depleted\n" if !p.match("DepletedToken").nil?
103 print s + " doesn't exist\n" if !p.match("DoesNotExist").nil?
104 print s + " good?\n" if p.match("DepletedToken").nil? && p.match("DoesNotExist").nil?
106 ";i:1;s:4:"ruby";i:2;s:7:"fisl.rb";}i:2;i:2983;}i:43;a:3:{i:0;s:4:"code";i:1;a:3:{i:0;s:52:"
107 rand("10000000000000000".to_i(16)).to_s(16).upcase
108 ";i:1;s:4:"ruby";i:2;N;}i:2;i:3498;}i:44;a:3:{i:0;s:4:"file";i:1;a:3:{i:0;s:509:"
109 #!/usr/bin/ruby
110 require "net/http"
111 1000000.times {
112 p = Net::HTTP.new("verdi.softwarelivre.org", 80).get("http://verdi.softwarelivre.org/papers_ng/swiss/get?token=#{s = rand("10000000000000000".to_i(16)).to_s(16).upcase}").body.to_s
113 #print s + "\n\n"
114 #print p + "\n\n"
115 print s + " depleted\n" if !p.match("DepletedToken").nil?
116 print s + " doesn't exist\n" if !p.match("DoesNotExist").nil? && s.to_i(16) % 1000 == 0
117 print s + " good?\n" if p.match("DepletedToken").nil? && p.match("DoesNotExist").nil?
119 ";i:1;s:4:"ruby";i:2;s:8:"fisl2.rb";}i:2;i:3570;}i:45;a:3:{i:0;s:4:"code";i:1;a:3:{i:0;s:116:"
120 "2a 2t 38 3b 2t 2t 38 w 2x 2u w 3d 33 39 w 30 2x 2z 2t w 36 39 2q 3d w 38 33 33 x".split.map{|c|c.to_i(36).chr}*""
121 ";i:1;s:4:"ruby";i:2;N;}i:2;i:4108;}i:46;a:3:{i:0;s:4:"file";i:1;a:3:{i:0;s:734:"
122 p = Net::HTTP.new("gog.gateit.net", 80).get("http://gog.gateit.net/books/").body.to_s
123 p.lines.each{|l| m = l.match(/a href="([^\"]*)"/); print m.captures[0].to_s + "\n\n\n" if m}.length
124 p2 = Net::HTTP.new("gog.gateit.net", 80).get("http://gog.gateit.net/books/Wrox.XML.Problem.Design.Solution.Jun.2006.ISBN.0471791199.pdf").body.to_s
125 p2.lines.each{|l| m = l.match(/a href="([^\"]*)"/); print m.captures[0].to_s + "\n\n\n" if m}.length
126 p3 = Net::HTTP.new("ebooks-it.org", 80).get("http://ebooks-it.org/?do_search=1&search=Wrox.XML.Problem.Design.Solution.Jun.2006.ISBN.0471791199.pdf&x=0&y=0").body.to_s
127 p3.lines.to_a.map{|l| m = l.match(/a href="([^\"]*)"/); print m.captures[0].to_s + "\n\n\n" if m; m.captures[0] if m}.compact[28]
128 ";i:1;s:4:"ruby";i:2;s:8:"books.rb";}i:2;i:4244;}i:47;a:3:{i:0;s:4:"file";i:1;a:3:{i:0;s:993:"
129 #!/usr/bin/ruby
130 lines = IO.read(ARGV[0]).split("\n");
131 res = 0;
132 mat = Array.new
133 lines.each{|l|
134 l.split.each_cons(4) { |n| a = n.inject{|a, x| a.to_i * x.to_i}; res = [res, a].max; print ";#{a}\n" }
135 mat << l.split
136 print ":#{l}\n"};
137 printf "?#{res}\n";
138 print "mat: #{mat}\n";
139 mat = mat.transpose;
140 mat.each{|l|
141 l.each_cons(4) { |n| a = n.inject{|a, x| a.to_i * x.to_i}; res = [res, a].max; print ";#{a}\n" }
142 print ":#{l}\n"};
143 printf "?#{res}\n";
144 mat.each_index{|i|
145 if(i >= mat.size - 3) then break end
146 mat[i].each_index{ |j|
147 if(j >= mat[i].size - 3) then break; end
148 a = 1; 4.times{|d| a *= mat[i + d][j + d].to_i;}; res = [res, a].max; print ":#{a}\n";
149 if(a == 1788696) then
150 print "here: #{i}, #{j}\n";
154 printf "?#{res}\n";
155 mat.each_index{|i|
156 if(i >= mat.size - 3) then break end
157 mat[i].each_index{ |j|
158 if(j >= mat[i].size - 3) then break; end
159 a = 1; 4.times{|d| a *= mat[i + 3 - d][j + d].to_i;}; res = [res, a].max; print ":#{a}\n";
162 printf "?#{res}\n";
163 ";i:1;s:4:"ruby";i:2;s:5:"11.rb";}i:2;i:5007;}i:48;a:3:{i:0;s:4:"file";i:1;a:3:{i:0;s:495:"
164 #!/usr/bin/ruby
165 res = 0
166 resi = 0
167 dp = Array.new(1000000, 0)
168 dp[1] = 1
169 1000000.times {|i| t = i + 1;
170 r = 0;
171 while(t >= 1000000 or dp[t] == 0) do
172 if(t % 2 == 1) then
173 t = (3 * t + 1) / 2;
174 r += 2;
175 else
176 t /= 2;
177 r += 1;
180 dp[i + 1] = r + dp[t]
181 res = [res, dp[i + 1]].max;
182 if(res == dp[i + 1]) then
183 resi = i + 1;
185 if(i % 1000 == 0) then
186 print "#{i + 1}: dp: #{dp[i + 1]} res: #{res}: resi = #{resi}\n"
188 #if(i > 13) then break end
190 print "resi: #{resi}\n"
191 ";i:1;s:4:"ruby";i:2;s:5:"14.rb";}i:2;i:6026;}i:49;a:3:{i:0;s:4:"file";i:1;a:3:{i:0;s:344:"
192 #!/usr/bin/ruby
193 lines = IO.read(ARGV[0]).split("\n");
194 mat = Array.new
195 lines.each_index{|i|
196 mat[lines.size - i - 1] = lines[i].split.map{|c| c.to_i}
199 mat.each_index{|r|
200 i = r + 1
201 if(i == mat.size) then break end
202 print ":b#{mat[i]}\n"
203 mat[i].each_index{|j|
204 mat[i][j] += [mat[i - 1][j], mat[i - 1][j + 1]].max
206 print ":#{mat[i]}\n"
208 ";i:1;s:4:"ruby";i:2;s:5:"18.rb";}i:2;i:6547;}i:50;a:3:{i:0;s:4:"file";i:1;a:3:{i:0;s:333:"
209 #!/usr/bin/ruby
210 lines = IO.read(ARGV[0]).split("\",\"");
211 lines[0].delete!("\"")
212 lines[-1].delete!("\"")
213 lines.sort!
214 res = 0
215 lines.each_index{|i|
216 l = lines[i]
217 p = 0
218 l.bytes.each{|b|
219 #print "#{b}: #{b.to_i - 'A'[0].to_i + 1}\n"
220 p += b.to_i - 'A'[0].to_i + 1 if b.to_i > 0
222 res += p * (i + 1)
224 print "#{res}, #{p}:#{l}\n"
226 ";i:1;s:4:"ruby";i:2;s:5:"22.rb";}i:2;i:6917;}i:51;a:2:{i:0;s:6:"plugin";i:1;a:4:{i:0;s:7:"uparrow";i:1;a:1:{i:0;s:42:"lib/plugins/uparrow/images/tango-small.png";}i:2;i:1;i:3;s:6:"~~UP~~";}}i:52;a:3:{i:0;s:13:"section_close";i:1;a:0:{}i:2;i:7270;}i:53;a:3:{i:0;s:12:"section_edit";i:1;a:4:{i:0;i:2404;i:1;i:0;i:2;i:2;i:3;s:8:"Examples";}i:2;i:7270;}i:54;a:3:{i:0;s:12:"document_end";i:1;a:0:{}i:2;i:7270;}}