# Ruby

**URL:** https://www.ruby-forum.com/c/ruby/7.md?page=1860

[Latest](https://www.ruby-forum.com/latest.md) · [Categories](https://www.ruby-forum.com/categories.md) · [Tags](https://www.ruby-forum.com/tags.md)

**Page:** 1861

---

## [Ruby Namespaces / Modules](https://www.ruby-forum.com/t/ruby-namespaces-modules/79285)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 4\
**Last updated:** [March 10, 2006, 2:19am UTC](https://www.ruby-forum.com/t/ruby-namespaces-modules/79285 "2006-03-10T02:19:29Z")

</div>

If I’m in the middle of module A::b::C, and I want to reference a class from A::B or from A::b::D, do I need to do ::a::b::Classname (or ::a::b::D::Classname)? It seems a bit repititous to me. A module shouldn’t need…

---

## [Passing self to a c module function](https://www.ruby-forum.com/t/passing-self-to-a-c-module-function/54612)

<div class="topic-metadata">

**Author:** [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Replies:** 1\
**Last updated:** [March 10, 2006, 1:31am UTC](https://www.ruby-forum.com/t/passing-self-to-a-c-module-function/54612 "2006-03-10T01:31:04Z")

</div>

When I write a module function in a C extension, I found that I need to include “VALUE self” as the first argument, just as I do when I write a class method in a C extension. Why is this? Thanks, John

---

## [Rjb and Java 1.5](https://www.ruby-forum.com/t/rjb-and-java-1-5/54615)

<div class="topic-metadata">

**Author:** [@therealadam](https://www.ruby-forum.com/u/therealadam)\
**Replies:** 0\
**Last updated:** [March 10, 2006, 1:18am UTC](https://www.ruby-forum.com/t/rjb-and-java-1-5/54615 "2006-03-10T01:18:57Z")

</div>

I’m trying to use rjb\[1\] to talk to some Java code compiled with Java 1.5 on OS X. I can run simple examples that only use Sun’s code just fine, but when I try to run our code (compiled from within Eclipse, if that m…

---

## [My Ruby talk @ work](https://www.ruby-forum.com/t/my-ruby-talk-work/78807)

<div class="topic-metadata">

**Author:** [@sgware](https://www.ruby-forum.com/u/sgware)\
**Replies:** 15\
**Last updated:** [March 10, 2006, 12:03am UTC](https://www.ruby-forum.com/t/my-ruby-talk-work/78807 "2006-03-10T00:03:07Z")

</div>

I just finished my “Learn Ruby” talk for the programmers here at work. (Game programmers, strong in C/C++). I flew through a massive amount of stuff… leaving continuations and metaprogramming on the table for another …

---

## [Ruby Can Get a Dell's Service Tag](https://www.ruby-forum.com/t/ruby-can-get-a-dells-service-tag/54611)

<div class="topic-metadata">

**Author:** [@rtilley](https://www.ruby-forum.com/u/rtilley)\
**Replies:** 0\
**Last updated:** [March 9, 2006, 11:05pm UTC](https://www.ruby-forum.com/t/ruby-can-get-a-dells-service-tag/54611 "2006-03-09T23:05:00Z")

</div>

I grew tired of having to reboot and enter the BIOS to view the Service Tag or BIOS revision of Dell computers. So, I wrote a small ruby program to do this from within Windows. I thought others might find it useful. h…

---

## ["ruby myscript.rb" Works, "./myscript.rb" Doesn't](https://www.ruby-forum.com/t/ruby-myscript-rb-works-myscript-rb-doesnt/79210)

<div class="topic-metadata">

**Author:** [@nko](https://www.ruby-forum.com/u/nko)\
**Replies:** 11\
**Last updated:** [March 9, 2006, 10:32pm UTC](https://www.ruby-forum.com/t/ruby-myscript-rb-works-myscript-rb-doesnt/79210 "2006-03-09T22:32:44Z")

</div>

I have a script. When I run it via “ruby myscript.rb”, it works great. When I run it via “./myscript.rb”, it complains: : No such file or directory. The top of the file starts with “#!/usr/bin/env ruby”, which works f…

---

## [Error calling block in sub class](https://www.ruby-forum.com/t/error-calling-block-in-sub-class/79115)

<div class="topic-metadata">

**Author:** [@apjanes](https://www.ruby-forum.com/u/apjanes)\
**Replies:** 2\
**Last updated:** [March 9, 2006, 9:02pm UTC](https://www.ruby-forum.com/t/error-calling-block-in-sub-class/79115 "2006-03-09T21:02:41Z")

</div>

I am creating a base collection class that will allow the assignment of multiple code blocks which validate the addition of objects to the collection. The code looks like this: \<\< Code Snippet \>\> class CollectionBas…

---

## [Ruby and .NET](https://www.ruby-forum.com/t/ruby-and-net/79164)

<div class="topic-metadata">

**Author:** [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Replies:** 7\
**Last updated:** [March 9, 2006, 8:47pm UTC](https://www.ruby-forum.com/t/ruby-and-net/79164 "2006-03-09T20:47:20Z")

</div>

I’ve written a couple Ruby programs that run on Linux using ruby-gnome2 as the GUI toolkit. Say I get asked to port them over to Windows (2000 and up). How would I go about slapping a .NET GUI frontend on it? (I’m …

---

## [Re: unicode in ruby](https://www.ruby-forum.com/t/re-unicode-in-ruby/79167)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [March 9, 2006, 8:16pm UTC](https://www.ruby-forum.com/t/re-unicode-in-ruby/79167 "2006-03-09T20:16:43Z")

</div>

All copies of Mac OS X ship with a Developer’s CD. It installs a compiler and much more via a Click and Drool™ interface. :wink: I know, maybe I’m too stupid for simple things (except for Ruby…) :wink: Best reg…

---

## [Ruby float calculations](https://www.ruby-forum.com/t/ruby-float-calculations/79084)

<div class="topic-metadata">

**Author:** [@analoguedragon](https://www.ruby-forum.com/u/analoguedragon)\
**Replies:** 4\
**Last updated:** [March 9, 2006, 6:41pm UTC](https://www.ruby-forum.com/t/ruby-float-calculations/79084 "2006-03-09T18:41:46Z")

</div>

Could someone please explain to me why the following happens: irb(main):001:0\> 0.29 - 0.38 + 0.1 =\> 0.00999999999999998 irb(main):002:0\> 0.29 + (-0.38 + 0.1) =\> 0.00999999999999995 irb(main):003:0\> 0.29 + 0.1 - 0.38 …

---

## [Nuby question: sorting with nils](https://www.ruby-forum.com/t/nuby-question-sorting-with-nils/78993)

<div class="topic-metadata">

**Author:** [@larry](https://www.ruby-forum.com/u/larry)\
**Replies:** 6\
**Last updated:** [March 9, 2006, 5:21pm UTC](https://www.ruby-forum.com/t/nuby-question-sorting-with-nils/78993 "2006-03-09T17:21:56Z")

</div>

if i make an object sortable using \<=\> as so: def \<=\> anItem @date \<=\> anItem.date end and date is nil, it fails. What’s the right way to handle nils in this scenario? thanks.

---

## [New version of Rails Recipes beta book available](https://www.ruby-forum.com/t/new-version-of-rails-recipes-beta-book-available/54593)

<div class="topic-metadata">

**Author:** [@dirtytree](https://www.ruby-forum.com/u/dirtytree)\
**Replies:** 2\
**Last updated:** [March 9, 2006, 4:23pm UTC](https://www.ruby-forum.com/t/new-version-of-rails-recipes-beta-book-available/54593 "2006-03-09T16:23:41Z")

</div>

Folks: For your cooking pleasure, I’m happy to announce that Chef Fowler has added eight new recipes to his book: DRY Up Your Database Config Adding Behavior to Your ActiveRecord Associations Keep An Eye On Your Sess…

---

## [Monitor#synchronize and Thread#wakeup](https://www.ruby-forum.com/t/monitor-synchronize-and-thread-wakeup/54595)

<div class="topic-metadata">

**Author:** [@URABE\_Shyouhei\_aka](https://www.ruby-forum.com/u/URABE_Shyouhei_aka)\
**Replies:** 0\
**Last updated:** [March 9, 2006, 4:11pm UTC](https://www.ruby-forum.com/t/monitor-synchronize-and-thread-wakeup/54595 "2006-03-09T16:11:30Z")

</div>

e$BKNIt$G$9!#e(B e$B0J2\<$N%9%/%j%W%H$r\<B9T$9$k$H!"\<j85$G$Oe(Bt2e$B$N%k!\<%We(B e$B$,0l2s$7$+2s$i$J$$$N$G$9$,!"0U?^$5$l$?5sF0$J$s$Ge(B e$B$7$g$&$+e(B? "loop { t1.wakeup }“e$B$N9T$r%3%a%s%H%”%&%H$9$l$P!"e(B e$B$A$c$s$H…

---

## [The Golden Fibonacci Ratio (#69)](https://www.ruby-forum.com/t/the-golden-fibonacci-ratio-69/78997)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 0\
**Last updated:** [March 9, 2006, 4:01pm UTC](https://www.ruby-forum.com/t/the-golden-fibonacci-ratio-69/78997 "2006-03-09T16:01:51Z")

</div>

Before we get into discussing this week’s solutions, allow me this brief diversion. Here’s a single line from Andrew J.'s program (with some added whitespace): Fib = Hash.new{ |h, n| n \< 2 ? h\[n\] = n : h\[n\] = h\[n - …

---

## [Re: unicode in ruby](https://www.ruby-forum.com/t/re-unicode-in-ruby/78911)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [March 9, 2006, 3:52pm UTC](https://www.ruby-forum.com/t/re-unicode-in-ruby/78911 "2006-03-09T15:52:39Z")

</div>

Dear Michal, hmm, I wonder why C with a hook is called Ccaron in keymaps… But I heared that in Turkish they use both I, I with dot, i, and i without dot. Consequently, I is uppercase form of i without dot … I h…

---

## [Searching for a very fast string parser](https://www.ruby-forum.com/t/searching-for-a-very-fast-string-parser/54564)

<div class="topic-metadata">

**Author:** [@SSMKSM](https://www.ruby-forum.com/u/SSMKSM)\
**Replies:** 6\
**Last updated:** [March 9, 2006, 3:52pm UTC](https://www.ruby-forum.com/t/searching-for-a-very-fast-string-parser/54564 "2006-03-09T15:52:32Z")

</div>

Hello, I want to parse a log file containing several line in the same format. My log files are about 50mb each (350k lines) so i need something quite fast. The current (and fastest) solution i came up with is using S…

---

## [Re: Modular Ruby](https://www.ruby-forum.com/t/re-modular-ruby/78907)

<div class="topic-metadata">

**Author:** [@PeSSSSaS\_Botp](https://www.ruby-forum.com/u/PeSSSSaS_Botp)\
**Replies:** 1\
**Last updated:** [March 9, 2006, 2:38pm UTC](https://www.ruby-forum.com/t/re-modular-ruby/78907 "2006-03-09T14:38:52Z")

</div>

Julian I. Kamil \[mailto:removed\_email\_address@domain.invalid\] : #It’s not done, yet, but when it does, it will allow “client side” Ruby #programming through a browser using an object-oriented application #framework. …

---

## [ANN: uformats 1.2 (Microformats parser for Ruby)](https://www.ruby-forum.com/t/ann-uformats-1-2-microformats-parser-for-ruby/54563)

<div class="topic-metadata">

**Author:** [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Replies:** 1\
**Last updated:** [March 9, 2006, 1:16pm UTC](https://www.ruby-forum.com/t/ann-uformats-1-2-microformats-parser-for-ruby/54563 "2006-03-09T13:16:40Z")

</div>

The parser that we are using at www.reevoo.com for aggregation of hReviews is now open for public use. It started off as an hReview 0.2 parser, but the dependence of hReview on some other microformats led it to grow s…

---

## [Convert String to Hash](https://www.ruby-forum.com/t/convert-string-to-hash/78951)

<div class="topic-metadata">

**Author:** [@nicksnels](https://www.ruby-forum.com/u/nicksnels)\
**Replies:** 7\
**Last updated:** [March 9, 2006, 1:10pm UTC](https://www.ruby-forum.com/t/convert-string-to-hash/78951 "2006-03-09T13:10:32Z")

</div>

Hi, I get a string inputted in my program, which I convert to a hash-like string, like: sql = ‘“table\_alias” =\> \[\],“original\_string” =\> “select \* from table”’ The string has the form of a hash, now I would like to co…

---

## [Newbie: sorting an array of custom objects](https://www.ruby-forum.com/t/newbie-sorting-an-array-of-custom-objects/54557)

<div class="topic-metadata">

**Author:** [@Einar\_HSSSSst](https://www.ruby-forum.com/u/Einar_HSSSSst)\
**Replies:** 11\
**Last updated:** [March 9, 2006, 9:01am UTC](https://www.ruby-forum.com/t/newbie-sorting-an-array-of-custom-objects/54557 "2006-03-09T09:01:05Z")

</div>

Hi, As a project for learning Ruby, I’m writing a simple game. I have some simple objects that I would like to be able to sort ‘automatically’ in an array. In Java, I can implement the Comparable interface to make the …

---

## [The Golden Fibonacci Ratio (#69)](https://www.ruby-forum.com/t/the-golden-fibonacci-ratio-69/76998)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [March 9, 2006, 7:09am UTC](https://www.ruby-forum.com/t/the-golden-fibonacci-ratio-69/76998 "2006-03-09T07:09:27Z")

</div>

Author: Shane E. Quiz 69: The Golden Fibonacci Ratio. I decided for this quiz to try and use the curses library to make screen placement easier. I think it turned out well, though I am sure there are more clever ways o…

---

## [Having a block executed in the context of an instance](https://www.ruby-forum.com/t/having-a-block-executed-in-the-context-of-an-instance/78182)

<div class="topic-metadata">

**Author:** [@exile](https://www.ruby-forum.com/u/exile)\
**Replies:** 22\
**Last updated:** [March 9, 2006, 5:14am UTC](https://www.ruby-forum.com/t/having-a-block-executed-in-the-context-of-an-instance/78182 "2006-03-09T05:14:24Z")

</div>

I’m writing a property driven ui and would like to do things like: button = Button.new do caption = ‘Click Me’ end I’ve read that 2.0 will have this feature, i.e. Class.new will execute it’s block argument in it’s …

---

## [Catch throw?](https://www.ruby-forum.com/t/catch-throw/78814)

<div class="topic-metadata">

**Author:** [@PaatschS\_Bernd](https://www.ruby-forum.com/u/PaatschS_Bernd)\
**Replies:** 2\
**Last updated:** [March 9, 2006, 4:08am UTC](https://www.ruby-forum.com/t/catch-throw/78814 "2006-03-09T04:08:02Z")

</div>

Hello, I just started using catch and throw. Therefore this question might be an easy one. I have multiple ruby files. In one of the files I like to throw and then in the main function in a different file I like t…

---

## [Displaying Marshalled Object from HTTPServlet::FileHandler](https://www.ruby-forum.com/t/displaying-marshalled-object-from-httpservlet-filehandler/78859)

<div class="topic-metadata">

**Author:** [@hackdaddy](https://www.ruby-forum.com/u/hackdaddy)\
**Replies:** 1\
**Last updated:** [March 9, 2006, 3:26am UTC](https://www.ruby-forum.com/t/displaying-marshalled-object-from-httpservlet-filehandler/78859 "2006-03-09T03:26:41Z")

</div>

Hi. I have a series of objects I have marshalled to disk as files. When I browse the marshalled files in the directory browser, I would like them to be able to be loaded by the marshaller and then display information…

---

## [Globals outside of OO scripting](https://www.ruby-forum.com/t/globals-outside-of-oo-scripting/78716)

<div class="topic-metadata">

**Author:** [@rtilley](https://www.ruby-forum.com/u/rtilley)\
**Replies:** 14\
**Last updated:** [March 9, 2006, 2:58am UTC](https://www.ruby-forum.com/t/globals-outside-of-oo-scripting/78716 "2006-03-09T02:58:42Z")

</div>

When writing methods as functions (I know they’re methods pretending to be functions) do you still need to use globals… like this: $global\_var def some\_other\_function … $global\_var end Or, is it OK to use them lik…

---

## [Windows Console I/O in Ruby](https://www.ruby-forum.com/t/windows-console-i-o-in-ruby/54566)

<div class="topic-metadata">

**Author:** [@Matt\_Hulse](https://www.ruby-forum.com/u/Matt_Hulse)\
**Replies:** 2\
**Last updated:** [March 9, 2006, 1:00am UTC](https://www.ruby-forum.com/t/windows-console-i-o-in-ruby/54566 "2006-03-09T01:00:42Z")

</div>

Is there a Ruby equivalent to the WConio Python Module or similar conio type support for windows? (WConio -- Windows CONsole I/O for Python) If not, does anyone have some pointers or documention about porting this mo…

---

## [Best way to start new ruby script?](https://www.ruby-forum.com/t/best-way-to-start-new-ruby-script/54576)

<div class="topic-metadata">

**Author:** [@marcan](https://www.ruby-forum.com/u/marcan)\
**Replies:** 6\
**Last updated:** [March 9, 2006, 12:21am UTC](https://www.ruby-forum.com/t/best-way-to-start-new-ruby-script/54576 "2006-03-09T00:21:04Z")

</div>

I have a long running process that I want to start from a Rails request. But, because it takes so long to execute, I want to start it in a separate process and then return. What is the best way to do that? Thanks /Ma…

---

## [Modular Ruby](https://www.ruby-forum.com/t/modular-ruby/78756)

<div class="topic-metadata">

**Author:** [@Bernhard\_SelvenS\_St](https://www.ruby-forum.com/u/Bernhard_SelvenS_St)\
**Replies:** 3\
**Last updated:** [March 9, 2006, 12:05am UTC](https://www.ruby-forum.com/t/modular-ruby/78756 "2006-03-09T00:05:57Z")

</div>

Hi. Im looking for a framework or some other means of un-/loading ruby code into a live interpreter. Im thinking along the lines of TCLs interp command here, which instanciates a new slave interpreter completely unre…

---

## [Idioms for separating out OS-specific stuff](https://www.ruby-forum.com/t/idioms-for-separating-out-os-specific-stuff/78715)

<div class="topic-metadata">

**Author:** [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Replies:** 5\
**Last updated:** [March 8, 2006, 11:56pm UTC](https://www.ruby-forum.com/t/idioms-for-separating-out-os-specific-stuff/78715 "2006-03-08T23:56:51Z")

</div>

I have a few functions that: get the current user’s login name checks to see what the CPU % of a process is (non the Ruby process, another process). This includes all the threads that the process has forks a new pro…

---

## [FXRuby multiple applications](https://www.ruby-forum.com/t/fxruby-multiple-applications/78414)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 5\
**Last updated:** [March 8, 2006, 11:29pm UTC](https://www.ruby-forum.com/t/fxruby-multiple-applications/78414 "2006-03-08T23:29:14Z")

</div>

i use FXRuby and try to start a applicattion twice with the following code: require “fox12.so” include Fox def start\_fox\_app application = FXApp.new(“FoxTest”, “ruby”) application.init(ARGV) window = FXMainWindow…

[Previous page](https://www.ruby-forum.com/c/ruby/7.md?page=1859)

[Next page](https://www.ruby-forum.com/c/ruby/7.md?page=1861)
