This file contains hidden or 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 'rubygems' | |
require 'test/unit' | |
def equi(list) | |
left = 0 | |
right = list.inject { |x, y| x + y } | |
equilibrium_indicies = [] | |
list.each_with_index do |val, i| | |
right -= val |
This file contains hidden or 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
# Used to graph results from autobench | |
# | |
# Usage: ruby autobench_grapher.rb result_from_autobench.tsv | |
# | |
# This will generate three svg & png graphs | |
require "rubygems" | |
require "scruffy" | |
require 'csv' | |
require 'yaml' |
This file contains hidden or 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 | |
require 'pp' | |
DEBUG = false | |
stats = {} | |
stats['Firefox-3.5'] = { :hits => 0, :percent => 0 } | |
stats['Firefox-3.0'] = { :hits => 0, :percent => 0 } |
This file contains hidden or 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 | |
require 'rubygems' | |
require 'nokogiri' | |
require 'hpricot' | |
s = %q{<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><html><body><input type="text" name="test" value="\" /><div id="footer"></div></body></html>} | |
selector = '#footer' | |
inner_html = 'testing' |
NewerOlder