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
# The Computer Language Benchmarks Game | |
# http://shootout.alioth.debian.org/ | |
# transliterated from Mario Pernici's Python program | |
# contributed by Rick Branson | |
# made 'functional' by Sam Rawlins | |
require "rubygems" | |
require "gmp" |
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
ruby-1.9.1-p378 > g_one = GMP::Z(1) | |
=> 1 | |
ruby-1.9.1-p378 > a = b = GMP::Z(0) | |
=> 0 | |
ruby-1.9.1-p378 > a += g_one | |
=> 1 | |
ruby-1.9.1-p378 > a | |
=> 1 | |
ruby-1.9.1-p378 > b | |
=> 0 |
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
In ruby-1.8.7 | |
C:\sam>irb | |
irb(main):001:0> class A | |
irb(main):002:1> @a | |
irb(main):003:1> def initialize(a) | |
irb(main):004:2> @a=a | |
irb(main):005:2> end | |
irb(main):006:1> def coerce(other) | |
irb(main):007:2> if other.is_a? Integer |
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
C:\sam\code\rubinius>rake | |
(in C:/sam/code/rubinius) | |
Unable to build using the running Ruby executable. | |
To resolve this issue: | |
* Use 'C:/Ruby191/bin/ruby.exe.exe' to build. |
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
craig:~ sam$ CC=/usr/local/gcc-4.4.5/bin/gcc rvm install --trace 1.9.2-gcc_4.4.5 | |
--trace 1.9.2-gcc_4.4.5 | |
rvm 1.2.9 by Wayne E. Seguin ([email protected]) [http://rvm.beginrescueend.com/] | |
+ [[ -z '' ]] | |
+ export 'PS4=+[${BASH_SOURCE}] : ${LINENO} : ${FUNCNAME[0]:+${FUNCNAME[0]}() $ }' | |
+ PS4='+[${BASH_SOURCE}] : ${LINENO} : ${FUNCNAME[0]:+${FUNCNAME[0]}() $ }' | |
+[/Users/sam/.rvm/scripts/cli] : 705 : __rvm_parse_args() $ [[ -z install ]] | |
+[/Users/sam/.rvm/scripts/cli] : 707 : __rvm_parse_args() $ [[ 0 -eq 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
<html> | |
<head> | |
<script type='text/javascript' src='https://www.google.com/jsapi'></script> | |
<script type='text/javascript'> | |
google.load('visualization', '1', {packages:['corechart']}); | |
google.setOnLoadCallback(drawChart); | |
function drawChart() { | |
var data_bench_right_shift = new google.visualization.DataTable(); | |
data_bench_right_shift.addColumn('string', 'Bench'); | |
data_bench_right_shift.addColumn('number', 'ruby-1.9.2-p180-gcc460'); |
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 './rebase-or-no/lib/kjira4r' | |
release = ARGV.shift | |
env = ARGV.shift | |
j = KJira4R.new(USER, PASS) | |
mem8928 = j.getIssue("MEM-8928") # A standard "Install KC x on KC y" ticket | |
new_issue = mem8928.dup # Cloning for ease in custom fields, components, etc. | |
new_issue.created=nil |
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
Apr 12, 2012 3:55:57 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent | |
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/amd64/server:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/amd64:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/../lib/amd64:/opt/oracle/instantclient_11_2:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib | |
Apr 12, 2012 3:55:58 PM org.apache.coyote.http11.Http11BaseProtocol init | |
INFO: Initializing Coyote HTTP/1.1 on http-8080 | |
Apr 12, 2012 3:55:58 PM org.apache.catalina.startup.Catalina load | |
INFO: Initialization processed in 564 ms | |
Apr 12, 2012 3:55:58 PM org.apache.catalina.core.StandardService start | |
INFO: Starting service Catalina | |
Apr 12, 2012 3:55:58 PM org.apache.catalina.core.StandardEngine start | |
INFO: Starting Servlet Engine: Apache Tomcat/5.5.16 |
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 'rubygems' | |
require 'capybara' | |
require 'capybara/dsl' | |
require 'highline/import' | |
require 'uri' | |
class AdHoccer | |
include Capybara::DSL | |
def initialize(url, recipient) |
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
number = 1234567 | |
# Chaining methods more than once-ish is confusing; the developer has to keep | |
# in mind wtf is going on: | |
number.to_s.reverse.split(//).each_slice(3).map(&:join).join(',').reverse | |
# Commenting the state of each chain helps: | |
number.to_s. # String, e.g. "1234567" | |
reverse. # reverse it, e.g. "7654321" | |
split(//). # split on every character, e.g. ["7", "6", "5", "4", "3", "2", "1"] |
OlderNewer