This is how you can use JRuby to connect to an oracle database without requiring Ruby to be installed on the system, but only Java.
At my last entry, a question arose about what is the most efficient way to convert integers between the bases 2 and 10: either using built-in ruby methods (and even do lightweight string-operations) or calculating it manually. I had to find out ;). So I have written a little benchmark program, which does the conversion in three different ways:
- using built-in to_i-magic
- calculating it by hand
- using sprintf
It stops the time each method needs to get the fastest. The result might be surprising. [Update: improved the custom methods]