This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
class CompleteNaryTreeGenerator | |
def self.generate_dot(height, degree) | |
puts 'digraph {' | |
# Convenience. | |
d = degree | |
h = height | |
i = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
File.readlines('./tmp/5.log').each.with_index do |line, i| | |
matches = line.match(/\s+MOPED: \S+ (\w+)/i) | |
next if matches.nil? | |
op = matches.to_a.last.downcase | |
t = line.match(/\(([.0-9]+)ms\)$/i).to_a.last | |
puts "#{i},#{op},#{t}" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def rescue_retry(tries = 2, options = {}, &block) | |
raise ArgumentError, 'gimme a block' unless block_given? | |
begin | |
tries -= 1 | |
yield | |
rescue => e | |
if tries > 0 | |
sleep(options[:sleep]) if options[:sleep] | |
retry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2010-01-12 | |
2010-01-13 | |
2010-01-14 | |
2010-01-15 | |
2010-01-16 | |
2010-01-19 | |
2010-01-20 | |
2010-01-21 | |
2010-01-22 | |
2010-01-23 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):003:0> require 'benchmark' | |
=> true | |
irb(main):004:0> numbers = nil | |
=> nil | |
irb(main):005:0> puts Benchmark.measure { numbers = 1_000_000.times.map {|i| i.to_f }; 1 } | |
1.110000 0.000000 1.110000 ( 0.448476) | |
=> nil | |
irb(main):006:0> numbers.length | |
=> 1000000 | |
irb(main):007:0> puts Benchmark.measure { numbers.inject(:+) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adaptive@ubuntu:/opt/adaptiveplanning/hypergraph$ HYPERGRAPH_THREADS=8 TESTS=5k bundle exec ruby -Itest -J-server -J-Xmx40g test/performance/hypergraph_performance_tpc_test.rb | |
uri:classloader:/jruby/kernel/kernel.rb:28: warning: unsupported exec option: close_others | |
Run options: --seed 15672 | |
# Running: | |
### Load Tables | |
5k 933.160000 21.630000 954.790000 (804.721107) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test_helper' | |
require 'benchmark' | |
class HypergraphPerformanceTest < Minitest::Test | |
include Hypergraph::TestHelper::Schema | |
include Hypergraph::TestHelper::Benchmarking | |
include Hypergraph::TestHelper::Profiling | |
def setup | |
suites = (ENV['TESTS'] || '').split |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://chart.apis.google.com/chart?cht=ls&chs=600x120&chds=300,9908&chxt=y&chxs=0,444444,10,1,l,ffffff&chxl=0:|300|5244|9908&chco=0a0a0a&chm=B,f8f8f8,0,0,0|o,0a0a0a,0,-1,8&chls=3&chma=4,4,4,4&chg=0,50&chd=t:6830,4377,1571,6426,9698,7701,7484,3640,6261,2748,1347,7579,3155,2489,3974,6107,4584,3834,7234,5031,2942,3518,9470,3225,6448,6330,8853,3173,9908,1391 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* fucking gist */ | |
.gist .gist-syntax { | |
overflow-x: hidden !important; | |
} | |
.gist .gist-meta { | |
font-family: Verdana; | |
font-size: 8px !important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make Zend Framework barf all over, causing php to bus error. Then go use rails. | |
$x = new Zend_Date(new Zend_Date()); |