Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Jaws Lt -2010-02-23

3,893 views

Published on

  • Hi there! Get Your Professional Job-Winning Resume Here - Check our website! http://bit.ly/resumpro
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Jaws Lt -2010-02-23

  1. 1. ‣ ‣ ‣ ‣
  2. 2. ‣ ‣
  3. 3. ‣ ‣
  4. 4. ‣ ‣ ‣ ‣ ‣
  5. 5. #!/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}")
  6. 6. ‣ ‣ ‣ ‣
  7. 7.
  8. 8. ‣ ‣ ‣
  9. 9. ‣ ‣ ‣
  10. 10. ‣ ‣ ‣ ‣

×