louismullie / bind-it Goto Github PK
View Code? Open in Web Editor NEWBindIt is a tool to facilitate the creation of Java bindings in Ruby.
License: Other
BindIt is a tool to facilitate the creation of Java bindings in Ruby.
License: Other
I have several modules using bind-it (opennlp and self-made module).
For the options like log_file or jvm_args the first module to load is the only one to work.
So the logs of differents modules go in the same file
and I need set options like -Xmx2G knowing how many modules I will load
I need to use bind-it on Windows 10, but can not install it on windows.
Very odd issue here. I used bind-it
to load stanford-nlp-core
for a 48-hour hackathon and had no problems. A day later, I went to load the project and received this error:
/Users/username/.rvm/gems/ruby-2.1.3/gems/bind-it-0.2.7/lib/bind-it/jar_loader.rb:45:in `load': wrong argument type nil (expected String) (TypeError)
from /Users/username/.rvm/gems/ruby-2.1.3/gems/bind-it-0.2.7/lib/bind-it/jar_loader.rb:45:in `init_rjb'
from /Users/username/.rvm/gems/ruby-2.1.3/gems/bind-it-0.2.7/lib/bind-it/jar_loader.rb:38:in `load_jar_rjb'
from /Users/username/.rvm/gems/ruby-2.1.3/gems/bind-it-0.2.7/lib/bind-it/jar_loader.rb:27:in `load'
from /Users/username/.rvm/gems/ruby-2.1.3/gems/bind-it-0.2.7/lib/bind-it/binding.rb:63:in `load_jar'
from /Users/username/.rvm/gems/ruby-2.1.3/gems/bind-it-0.2.7/lib/bind-it/binding.rb:71:in `block in load_default_jars'
from /Users/username/.rvm/gems/ruby-2.1.3/gems/bind-it-0.2.7/lib/bind-it/binding.rb:68:in `each'
from /Users/username/.rvm/gems/ruby-2.1.3/gems/bind-it-0.2.7/lib/bind-it/binding.rb:68:in `load_default_jars'
from /Users/username/.rvm/gems/ruby-2.1.3/gems/bind-it-0.2.7/lib/bind-it/binding.rb:55:in `bind'
from /Users/username/.rvm/gems/ruby-2.1.3/gems/stanford-core-nlp-0.5.1/lib/stanford-core-nlp.rb:125:in `bind'
from /Users/username/.rvm/gems/ruby-2.1.3/gems/stanford-core-nlp-0.5.1/lib/stanford-core-nlp.rb:140:in `load'
from ./bin/job_runner:41:in `<main>'
I'm pretty perplexed here. Is this an Rjb error? Tried forcing Rjb to 1.5.1, 1.4.9, 1.4.3, no change.
no method 'write' for arguments (org.jruby.RubyString) on Java::JavaIo::PrintStream
Running Treat on Windows output an error from this line:
puts sect.do(:chunk, :segment, :tokenize, :parse)
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bind-it-0.2.7/lib/bind-it/jar_loader.rb:64:in `new': \dev\null (The system cannot find the path specified) (FileNotFoundException)
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bind-it-0.2.7/lib/bind-it/jar_loader.rb:64:in `set_java_logging'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bind-it-0.2.7/lib/bind-it/jar_loader.rb:46:in `init_rjb'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bind-it-0.2.7/lib/bind-it/jar_loader.rb:38:in `load_jar_rjb'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bind-it-0.2.7/lib/bind-it/jar_loader.rb:27:in `load'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bind-it-0.2.7/lib/bind-it/binding.rb:63:in `load_jar'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bind-it-0.2.7/lib/bind-it/binding.rb:71:in `block in load_default_jars'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bind-it-0.2.7/lib/bind-it/binding.rb:68:in `each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bind-it-0.2.7/lib/bind-it/binding.rb:68:in `load_default_jars'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bind-it-0.2.7/lib/bind-it/binding.rb:55:in `bind'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/stanford-core-nlp-0.5.1/lib/stanford-core-nlp.rb:125:in `bind'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/loaders/bind_it.rb:42:in `load'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/loaders/stanford.rb:8:in `load'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/workers/processors/parsers/stanford.rb:24:in `parse'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/delegatable.rb:66:in `call_worker'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/delegatable.rb:40:in `block (2 levels) in add_workers'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:41:in `do_task'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:49:in `block in do_task'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:48:in `each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:48:in `do_task'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:49:in `block in do_task'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:48:in `each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:48:in `do_task'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:49:in `block in do_task'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:48:in `each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:48:in `do_task'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:22:in `block in apply'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:6:in `each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/treat-2.0.9/lib/treat/entities/entity/applicable.rb:6:in `apply'
from treat.rb:25:in `<main>'
I think this is because the Windows version of /dev/null is NIL. The following line fixed it, in jar_loader.rb between lines 60 and 61:
if self.log_file == '/dev/null' and Gem.win_platform?
self.log_file = 'NIL'
end
I'm still a Ruby newbie, so I didn't want to submit a pull request. There's probably a better way of doing this, but the above works for my setup.
The patching of method_missing
here:
bind-it/lib/bind-it/rjb_proxy.rb
Line 30 in af6395f
leads to an order of magnitude slowdown when using the stanford core nlp gem. As a quick benchmark, without this code, I can get tokens at a rate roughly of 2.5/s, with that code, it drops to 0.4/s.
What was the scenario that led to having to patch that code? Are there scenarios where it's safe to remove?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.