Skip to content

Instantly share code, notes, and snippets.

From 7d0e281d713b2f0c70b57206a9388d9cbe158e6e Mon Sep 17 00:00:00 2001
From: Douglas Campos <[email protected]>
Date: Tue, 7 Jun 2011 20:49:30 -0300
Subject: [PATCH] allowing blocks with arity > 2
---
src/org/jruby/RubyEnumerable.java | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/src/org/jruby/RubyEnumerable.java b/src/org/jruby/RubyEnumerable.java
qmx@gondor ~/tmp » jruby threads.rb
starting thread 1
starting thread 0
starting thread 2
starting thread 3
starting thread 4
ending thread 2
ending thread 3
ending thread 1
ending thread 0
require 'java'
x = java.util.concurrent.Executors.new_cached_thread_pool
x.execute { puts "hello" }
ruby-1.8.7-p352 :001 > def one_arg(a); puts "one"; end
=> nil
ruby-1.8.7-p352 :002 > def one_arg(a,b); puts "two"; end
=> nil
ruby-1.8.7-p352 :003 > one_arg(1)
ArgumentError: wrong number of arguments (1 for 2)
from (irb):3:in `evaluate'
from org/jruby/RubyKernel.java:1011:in `eval'
from /Volumes/v2/git/jruby/lib/ruby/1.8/irb.rb:158:in `eval_input'
from /Volumes/v2/git/jruby/lib/ruby/1.8/irb.rb:271:in `signal_status'
From acf44a7936dd7611bc8cd64b07b5fced357f5202 Mon Sep 17 00:00:00 2001
From: Douglas Campos <[email protected]>
Date: Sat, 12 Nov 2011 02:42:40 -0200
Subject: [PATCH] generating shared lib
patch adapted from http://code.google.com/p/leveldb/issues/detail?id=27
---
Makefile | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
public class MyTest {
public void test(){}
}
@qmx
qmx / gist:1407191
Created November 29, 2011 23:43 — forked from anonymous/gist:1406238
yammer moving away from scala
Originally:
https://gist.github.com/7565976a89d5da1511ce
Hi Donald (and Martin),
Thanks for pinging me; it's nice to know Typesafe is keeping tabs on this, and I
appreciate the tone. This is a Yegge-long response, but given that you and
Martin are the two people best-situated to do anything about this, I'd rather
err on the side of giving you too much to think about. I realize I'm being very
critical of something in which you've invested a great deal (both financially
@qmx
qmx / mersenne-twister.js
Created February 4, 2012 03:45 — forked from banksean/mersenne-twister.js
a Mersenne Twister implementation in javascript. Makes up for Math.random() not letting you specify a seed value.
/*
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
so it's better encapsulated. Now you can have multiple random number generators
and they won't stomp all over eachother's state.
If you want to use this as a substitute for Math.random(), use the random()
method like so:
var m = new MersenneTwister();
@qmx
qmx / jruby_head_jdk6_u29.log
Created February 7, 2012 04:47
GC stress tests
jruby 1.7.0.dev (ruby-1.9.3-p28) (2012-01-29 60a764e) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java]
["0.9", "74080"]
["1.1", "90516"]
["1.1", "90520"]
["1.1", "95176"]
["1.1", "95240"]
["1.2", "99816"]
["1.2", "99960"]
["1.2", "104496"]
["1.2", "104352"]
@qmx
qmx / qmx.pub
Created February 19, 2012 01:29
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEA6qifkgtTFMK81wuUZPDyVfI06xdFdqPwJCu9MdvKQlTB5orCbWgaXbcqrA1iYjMceCMUKZY+jBSQZNvxq6nMB6fXXAKEd5mS5fnuPts5SZE3yWl123NOPZs7pqYDoYJbVYiQ2NLyKT+gszX5mvYsXR3UrohhHMwyyD1MafSUPLlbefCa5NLfYKcmilj8qDlepSz9R8sPfdyWWUXsKcIoD4o3L774c5gmSs7KFPY+eVgDayfjf+MoAUPtGArawusZyCrmfS7OfOy5fVK8oaN0iZFttTU78Z6o2SdAiNgdQMk9Ed1MPjqnWBwko+VcNWiMijqPPQloNRHTr3vtV8w6UB1O9ewpLdBjkdDoEXncZiLAsqU863zW4Sz5QVUSuU0UmC0SR7tjfWv18ZBAjDWmayfl8oY6ojmOK72W6YGHpRkd6NQWKR+h8hc2HUCznTTGFBY34pcGQRGj2jyclU3eabMBvOGB3orVtBYP9XSSdw89RNumhGQ6iJiLrk+Rjp0BxzVvHZnOB/i3aayL6dbOUS22IO23nn/QoduQ/ft6hlMhvOduakqRflt8dKLvujDIUSs9q+tNBja8mXig+b0f/cuTB1zB05hequXyk7z46n/Ynuc/8BDq77wZloQl4/eG8N5oFQj1nQQ+8+C+THp19EltwkWvfZjRfrBmGp+vDR0= [email protected]