Advertisement
Guest User

Untitled

a guest
Nov 17th, 2011
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1.  
  2. daily = []
  3. weekly = []
  4. annually = []
  5.  
  6. times = checkins.map { |i| i.created }
  7. times.each do |time|
  8. daily << (0..23).to_a.map { |i| if(time.hour == i) then 1 else 0 end }
  9. weekly << (0..6).to_a.map { |i| if(time.wday == i) then 1 else 0 end }
  10. annually << (0..365).to_a.map { |i| if(time.yday == i) then 1 else 0 end }
  11. end
  12.  
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement