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
<arturaz> >> Java::SpacemuleModulesConfigObjects::FormulaCalc.rubyCalc(3) | |
<arturaz> NameError: no method 'rubyCalc' for arguments (org.jruby.RubyFixnum) on Java::SpacemuleModulesConfigObjects::FormulaCalc | |
<arturaz> available overloads: | |
<arturaz> (org.jruby.RubyFixnum) | |
<arturaz> NameError: no method 'calc' for arguments (org.jruby.RubyString,org.jruby.RubyHash) on Java::SpacemuleModulesConfigObjects::FormulaCalc | |
<arturaz> available overloads: (org.jruby.RubyString,org.jruby.RubyHash) | |
<arturaz> WAT? |
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
?> Pmg.Runner.ensurePool( | |
?> galaxy.id.to_java(:int), galaxy.ruleset, | |
?> galaxy.pool_free_zones.to_java(:int), | |
?> max_zone_iterations.to_java(:int), | |
?> galaxy.pool_free_home_ss.to_java(:int), | |
?> max_home_ss_iterations.to_java(:int) | |
>> ) | |
TypeError: cannot convert instance of class org.jruby.java.proxies.ConcreteJavaProxy to int | |
from (irb):37:in `evaluate' | |
from org/jruby/RubyKernel.java:1091:in `eval' |
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
def iterator = { | |
val rubyIter = raw.directEntrySet().iterator() | |
new Iterator[(IRubyObject, IRubyObject)] { | |
def hasNext = rubyIter.hasNext | |
def next() = { | |
val key = rubyIter.next.asInstanceOf[IRubyObject] | |
val value = raw.fastARef(key) | |
(key, value) | |
} |
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
# Check-in a database connection back into the pool, indicating that you | |
# no longer need this connection. | |
# | |
# +conn+: an AbstractAdapter object, which was obtained by earlier by | |
# calling +checkout+ on this pool. | |
def checkin(conn) | |
synchronize do | |
conn.run_callbacks :checkin do | |
conn.expire | |
@queue.signal |
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
class RaidSpawner | |
# It's a regular planet. | |
KEY_PLANET = 'planet' | |
# It's a battleground planet. | |
KEY_BATTLEGROUND = 'battleground' | |
# Apocalypse is raging in the galaxy. | |
KEY_APOCALYPSE = 'apocalypse' | |
def initialize(planet) | |
@planet = planet |
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
def checkin(conn) | |
synchronize do | |
conn.run_callbacks :checkin do | |
conn.expire | |
@queue.signal | |
end | |
release conn | |
end | |
end |
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
Author: Arturas Slajus <[email protected]> 2012-04-18 23:08:34 | |
Committer: Arturas Slajus <[email protected]> 2012-04-18 23:08:34 | |
Parent: f0cc63550a0bb0ca4f60a8a8fc1682d196d57087 (Merge remote-tracking branch 'origin/stable2' into stable2) | |
Branches: remotes/origin/stable2, stable2 | |
Follows: many_scopes | |
Precedes: | |
Use EM instead of celluloid-io for now. | |
----------------------------------- Gemfile ----------------------------------- |
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
spacegame@gnat:~/web/current/www$ bundle show authlogic | |
fatal: Not a git repository (or any of the parent directories): .git | |
fatal: Not a git repository (or any of the parent directories): .git | |
fatal: Not a git repository (or any of the parent directories): .git | |
/home/spacegame/web/shared/bundle/ruby/1.9.1/bundler/gems/authlogic-a087ad0cba3c |
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
private void nearest( | |
final int index, final float x, final float y, final int depth, | |
final Result result | |
) { | |
if (index == -1) return; | |
final Node node = nodes[index]; | |
// final Node node = (Node) unsafe.getObject( | |
// nodes, Unsafe.ARRAY_OBJECT_BASE_OFFSET + | |
// Unsafe.ARRAY_OBJECT_INDEX_SCALE * index | |
// ); |
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 'java' | |
require 'libssrckdtree-j-1.0.2.jar' | |
GenericPoint = Java::com.savarese.spatial.GenericPoint | |
KDTree = Java::com.savarese.spatial.KDTree | |
def generate_points(tree, size) | |
size.times do | |
x = rand(100) | |
y = rand(100) |