openmind ☃   July 31, 2006  ☃  Ruby: binary search block  (, , )

  idx = @array.bsearch_last do |line|
  fields = line.split(',')
  (hhmmss, ms) = fields[1].split('.')
  this_stamp = make_timestamp(fields[0],hhmmss,ms)
  this_stamp <=> make_timestamp("6/26/2006","02:35:04","480")
end

Library here.

blog comments powered by Disqus