From 29637c966fce216182c0e3d8f17d0ab281edfb67 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Tue, 21 Feb 2012 09:34:59 +0100 Subject: fixed output, removed obsolete files --- dtrain/binning.rb | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100755 dtrain/binning.rb (limited to 'dtrain/binning.rb') diff --git a/dtrain/binning.rb b/dtrain/binning.rb deleted file mode 100755 index 674f3246..00000000 --- a/dtrain/binning.rb +++ /dev/null @@ -1,35 +0,0 @@ -bins = [] -bin_sz = 0 -1.upto(3).each { |i| - bin_sz = STDIN.gets.strip.split(",")[1].to_i - bins.push [[i], bin_sz] -} - -cur_bin = [] -cur_bin_sz = 0 -while line = STDIN.gets - count, countcount = line.strip.split "," - count = count.to_i - countcount = countcount.to_i - if (cur_bin_sz + countcount) > bin_sz - bins.push [cur_bin, cur_bin_sz] - cur_bin = [] - cur_bin_sz = countcount - else - cur_bin.push count - cur_bin_sz += countcount - end -end -bins.push [cur_bin, cur_bin_sz] - -c = 0 -e = 0 -bins.each { |i| - puts "#{e} | #{i[0].size}: #{i[0][0]}.. #{i[1]}" if i[0].size > 0 - c += 1 if i[0].size > 0 - e += 1 -} -puts "#{c} bins (#{bins.size})" -puts "bin sz #{bin_sz}" - - -- cgit v1.2.3