‣
‣
‣
‣
‣
‣



‣

‣
‣

‣

‣
‣
‣



‣
#!/usr/bin/ruby
#!/usr/bin/ruby
                                h = Hash.new
                                ARGF.each do ...
‣
‣



‣
‣
‣
#!/usr/bin/ruby
#!/usr/bin/ruby
                                h = Hash.new
                                ARGF.each do ...
‣
‣
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
Upcoming SlideShare
Loading in …5
×

Engineer event in Kyoto 10-04-17

4,181 views
4,147 views

Published on

0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,181
On SlideShare
0
From Embeds
0
Number of Embeds
3,687
Actions
Shares
0
Downloads
38
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Engineer event in Kyoto 10-04-17

  1. 1. ‣ ‣ ‣ ‣
  2. 2.
  3. 3. ‣ ‣ ‣
  4. 4. ‣ ‣ ‣
  5. 5.
  6. 6. ‣ ‣
  7. 7. #!/usr/bin/ruby #!/usr/bin/ruby h = Hash.new ARGF.each do |line| ARGF.each do |line| line.chomp! line.chomp! array = line.split(/,/) logs = line.split(/,/) uid = array[0] c = array[1] unless logs.empty? printf("%s,1n", logs[0]) count = 1 if h.key? uid end count = h[uid].to_i + 1 end end h.store uid, count end printf("#{h.length}")
  8. 8. ‣ ‣ ‣ ‣ ‣
  9. 9. #!/usr/bin/ruby #!/usr/bin/ruby h = Hash.new ARGF.each do |line| ARGF.each do |line| line.chomp! line.chomp! array = line.split(/,/) logs = line.split(/,/) uid = array[0] c = array[1] unless logs.empty? printf("%s,1n", logs[0]) count = 1 if h.key? uid end count = h[uid].to_i + 1 end end h.store uid, count end printf("#{h.length}")
  10. 10.
  11. 11.

×