My Recent Pastes (891 and counting)

Pastes by headius (891 and counting)

Pages:

Below are the 15 most recent pasties by headius.

November 29, 2008
12:17PM EDT
by headius

## JRuby trunk
                                              user     system      total        real
near closure, 1000k x100 gets             0.057000   0.000000   0.057000 (  0.056336)
near closure, 1000k x100 gets and sets    0.059000   0.000000   0.059000 (  0.059057)
in closure, 1000k x100 gets               0.062000   0.000000   0.062000 (  0.062147)

November 28, 2008
5:22PM EDT
by headius

describe "A child extending a Ruby class that includes Java interfaces" do
  it "should implement all those interfaces" do
    sup = Class.new { include BeanLikeInterface }
    child = Class.new(sup) { def value; 1; end }

November 28, 2008
5:17PM EDT
by headius

diff --git a/src/org/jruby/java/proxies/JavaInterfaceTemplate.java b/src/org/jruby/java/proxies/JavaInterfaceTemplate.java
index bc6ab52..620998e 100644
--- a/src/org/jruby/java/proxies/JavaInterfaceTemplate.java
+++ b/src/org/jruby/java/proxies/JavaInterfaceTemplate.java
@@ -154,8 +154,7 @@ public class JavaInterfaceTemplate {

November 26, 2008
11:04PM EDT
by headius

[headius @ cnutter:~/projects/jruby-rack]
◆ cat Foo.java
public interface Foo {
  public Runnable getRunnable();
}

November 25, 2008
6:09PM EDT
by headius

◆ ruby bench.rb 
                      Results |
-------------------------------
single                  0.152 |
single colon3           0.151 |

November 25, 2008
5:54PM EDT
by headius

## control
[headius @ cnutter:~/projects/jruby]
◆ jruby -rbenchmark -e "Foo = 1; 10.times { puts Benchmark.measure { 1_000_000.times { 1 } } }"
  0.231000   0.000000   0.231000 (  0.231281)
  0.081000   0.000000   0.081000 (  0.081021)

November 25, 2008
5:41PM EDT
by headius

#!/bin/bash
#
# Provides a function that allows you to choose a JDK.  Just set the environment 
# variable JDKS_ROOT to the directory containing multiple versions of the JDK
# and the function will prompt you to select one.  JAVA_HOME and PATH will be cleaned

November 25, 2008
4:24PM EDT
by headius

        at com.sun.hk2.component.AbstractWombImpl.inject(AbstractWombImpl.java:150)
        at com.sun.hk2.component.ConstructorWomb$1.run(ConstructorWomb.java:90)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.hk2.component.ConstructorWomb.initialize(ConstructorWomb.java:87)
        at com.sun.hk2.component.AbstractWombImpl.get(AbstractWombImpl.java:75)

November 25, 2008
4:19PM EDT
by headius

bash-3.00$ jruby --server bench/bench_fib_recursive.rb 10
  3.059000   0.000000   3.059000 (  3.059312)
  2.056000   0.000000   2.056000 (  2.055544)
  2.055000   0.000000   2.055000 (  2.055455)
  2.055000   0.000000   2.055000 (  2.055505)

November 24, 2008
2:44AM EDT
by headius

Short thoughts on KirinDave's post The Opposite of Momentum, which the anti-Ruby crowd has latched on to as more evidence that Ruby is "falling flat on its face".

Dave's post appears to largely lament the lack of progress in the C implementations, be it their lack of performance, presence of memory leaks, or relatively primitive GC implementations. He briefly mentions alternative implementations, calling Rubinius "the light and hope of the Rubyverse" and summarizing JRuby as "great" before dismissing both.

In Rubinius's case, he may have a point. There have been many setbacks, and after a year of funding six developers it's still not really usable for real apps. The sad news that their team has been cut to two paid developers certainly doesn't help. Most will agree that the Rubinius ideal, that of Ruby implemented in Ruby, is a great goal...perhaps the highest ideal for a Ruby implementation. But in practice, it's turned out to be a lot harder to execute...and impossible to execute in a year with six smart hackers.

November 21, 2008
6:09PM EDT
by headius

[headius @ cnutter:~/projects/duby]
◆ bin/dubyc -e "a = 1; a; 1; puts a"
[headius @ cnutter:~/projects/duby]
◆ javap -c dash_e
Compiled from dash_e

November 17, 2008
4:16PM EDT
by headius

[headius @ cnutter:~/projects/jruby]
◆ ruby -e "1; p (2) %3"
2
[headius @ cnutter:~/projects/jruby]
◆ ruby -e "1; p(2) %3"

November 17, 2008
4:07PM EDT
by headius

def b; 'not yet!'; end
a = "asdf#{b}#{<<FOO}#{b}qwer#{<<BAR}"
#{b = 'welcome to hell'}
and you have no idea
FOO

November 17, 2008
4:05PM EDT
by headius

a = "asdf#{<<FOO}qwer" + <<BAR
Yes, this...
FOO
does what you think it does.
BAR

November 16, 2008
3:42PM EDT
by headius

int
rb_cmpint(val, a, b)
    VALUE val, a, b;
{
    if (NIL_P(val)) {

Next page

Previous page