Skip to content

Instantly share code, notes, and snippets.

@practicingruby
Created July 29, 2008 05:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save practicingruby/3019 to your computer and use it in GitHub Desktop.
Save practicingruby/3019 to your computer and use it in GitHub Desktop.
duration,time,difference
1,20.367,3.367
2,23.967,3.600
3,27.167,3.200
4,32.833,5.666
5,37.933,5.100
6,40.333,2.400
7,42.600,2.267
8,45.767,3.167
9,47.333,1.566
10,57.900,10.567
11,62.700,4.800
12,68.267,5.567
13,70.733,2.466
14,72.133,1.400
15,73.467,1.334
16,77.000,3.533
17,91.567,14.567
18,95.467,3.900
19,108.467,13.000
20,113.733,5.266
21,121.067,7.334
22,123.767,2.700
23,125.567,1.800
24,201.567,76.000
25,202.967,1.400
26,206.900,3.933
27,211.500,4.600
28,217.500,6.000
29,223.067,5.567
30,225.033,1.966
31,233.167,8.134
32,241.767,8.600
33,244.067,2.300
34,248.600,4.533
35,251.400,2.800
36,253.300,1.900
37,277.333,24.033
38,282.600,5.267
39,301.367,18.767
40,305.467,4.100
41,308.133,2.666
42,323.633,15.500
43,340.533,16.900
44,345.667,5.134
45,352.367,6.700
46,391.400,39.033
47,398.267,6.867
48,435.133,36.866
49,464.033,28.900
50,499.333,35.300
51,532.867,33.534
52,538.633,5.766
53,541.600,2.967
54,589.900,48.300
55,591.533,1.633
56,618.733,27.200
57,623.900,5.167
58,637.833,13.933
59,643.333,5.500
60,648.400,5.067
61,650.333,1.933
62,660.467,10.134
63,666.333,5.866
64,670.567,4.234
65,674.067,3.500
66,676.700,2.633
67,681.633,4.933
68,684.400,2.767
require "rubygems"
require "ruport"
table = Table(ARGV[0], :records => true) do |t,r|
min, sec, frames = r.time.match(/(\d+)'(\d+)'(\d+)/)[1..3]
r.time = min.to_i * 60.0 + sec.to_i + frames.to_i / 30.0
t << r
end
table.add_column("difference")
table.each_with_index do |r,i|
if i == 0
r.difference = r["time"] - 17
else
r.difference = table[i]["time"] - table[i-1]["time"]
end
r.difference = "%0.3f" % r.difference
end
table.replace_column("time") { |r| r.time = "%0.3f" % r.time }
table.save_as("times-out.csv")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment