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
WARNING: null | |
java.lang.NullPointerException | |
at org.jruby.gen.InterfaceImpl124701880.respond(Unknown Source) | |
at com.sun.grizzly.jruby.RailsAdapter.dispatchRailsRequest(RailsAdapter.java:346) | |
at com.sun.grizzly.jruby.RailsAdapter.service(RailsAdapter.java:293) | |
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:147) | |
at org.glassfish.scripting.rails.RailsApplication.service(RailsApplication.java:165) | |
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100) | |
at com.sun.enterprise.v3.services.impl.VsAdapter.service(VsAdapter.java:136) | |
at com.sun.enterprise.v3.services.impl.VirtualHostMapper.service(VirtualHostMapper.java:121) |
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
// Common JavaScript code across your application goes here. | |
$("p").click(function() { | |
$(this).replaceWith("<input type='text' name='testing' />") | |
}); |
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
klass.action_argument_list = Hash.new do |h,k| | |
args = klass.instance_method(k).get_args | |
arguments = args[0] | |
defaults = [] | |
arguments.each {|a| defaults << a[0] if a.size == 2} if arguments | |
h[k] = [arguments || [], defaults] | |
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
class Articles < Application | |
def index | |
display resources | |
end | |
def show | |
display resource | |
end | |
def update(article) |
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
# MRI | |
Results | | |
------------------------ | |
colon2 0.266 | | |
colon3 0.257 | | |
# JRuby | |
Results | |
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
RBench.run(1_000_000) do | |
report("single") { Foo } | |
report("single colon3") { ::Foo } | |
report("colon2") { Foo::Bar::Baz } | |
report("colon3") { ::Foo::Bar::Baz } | |
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
yehuda-katzs-macbook-pro-2:merb-core wycats$ jruby experimentation/experiments/colon23.rb | |
Results | | |
------------------------------- | |
single 0.204 | | |
single colon3 0.183 | | |
colon2 0.226 | | |
colon3 0.340 | | |
yehuda-katzs-macbook-pro-2:merb-core wycats$ ruby experimentation/experiments/colon23.rb | |
Results | | |
------------------------------- |
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 "rbench" | |
module Foo | |
module Bar | |
module Baz | |
end | |
end | |
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 show(id) | |
@post = Post.get(id) | |
display @post | |
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
<java-config classpath-suffix="" system-classpath="" | |
debug-options="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9009"> | |
<jvm-options>-server</jvm-options> | |
<jvm-options>-XX:+UnlockDiagnosticVMOptions</jvm-options> | |
<jvm-options>-XX:+LogVMOutput</jvm-options> | |
<jvm-options>-XX:LogFile=${com.sun.aas.instanceRoot}/logs/jvm.log</jvm-options> | |
<jvm-options>-Djava.endorsed.dirs=${com.sun.aas.installRoot}/lib/endorsed</jvm-options> | |
<jvm-options>-Djava.security.policy=${com.sun.aas.instanceRoot}/config/server.policy</jvm-options> | |
<jvm-options>-Djava.security.auth.login.config=${com.sun.aas.instanceRoot}/config/login.conf | |
</jvm-options> |