# Ruby

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

[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:** 1693

---

## [And and or priority](https://www.ruby-forum.com/t/and-and-or-priority/66484)

<div class="topic-metadata">

**Author:** [@elgato](https://www.ruby-forum.com/u/elgato)\
**Replies:** 20\
**Last updated:** [September 5, 2006, 5:51pm UTC](https://www.ruby-forum.com/t/and-and-or-priority/66484 "2006-09-05T17:51:05Z")

</div>

OMG! Why the and and or operators have the same priority? Unlike && and || and also unlike the most of, or maybe all, other languages and conventions? (Yes, long time spent on that now, who would expect such a curios…

---

## [Static typing ain't so bad, after all](https://www.ruby-forum.com/t/static-typing-aint-so-bad-after-all/65931)

<div class="topic-metadata">

**Author:** [@maz](https://www.ruby-forum.com/u/maz)\
**Replies:** 48\
**Last updated:** [September 5, 2006, 5:50pm UTC](https://www.ruby-forum.com/t/static-typing-aint-so-bad-after-all/65931 "2006-09-05T17:50:53Z")

</div>

I was debugging someone else’s code the other day (it was htmltools, actually) and I was in the middle of some function trying to figure out what it does. That’s when I noticed that I had no clue what the passed in …

---

## [Superclass mismatch](https://www.ruby-forum.com/t/superclass-mismatch/67595)

<div class="topic-metadata">

**Author:** [@Gareth\_A](https://www.ruby-forum.com/u/Gareth_A)\
**Replies:** 2\
**Last updated:** [September 5, 2006, 5:30pm UTC](https://www.ruby-forum.com/t/superclass-mismatch/67595 "2006-09-05T17:30:19Z")

</div>

Hi, I’m getting a “superclass mismatch for class TooManyAnswersError” with the following code. Other topics I’ve found talk about code being reloaded, which I’m sure isn’t happening here. =========== class Questio…

---

## [Re: Happy Numbers (#93)](https://www.ruby-forum.com/t/re-happy-numbers-93/67602)

<div class="topic-metadata">

**Author:** [@davidtl](https://www.ruby-forum.com/u/davidtl)\
**Replies:** 0\
**Last updated:** [September 5, 2006, 4:34pm UTC](https://www.ruby-forum.com/t/re-happy-numbers-93/67602 "2006-09-05T16:34:54Z")

</div>

Modified my first solution to make it thread safe. Also include the solution for finding happiest between 1 and 1,000,000. class Integer def digits(base = 10) return \[self\] if self \< base self.divmod(base).inject { …

---

## [Simple Questions on Ruby](https://www.ruby-forum.com/t/simple-questions-on-ruby/65351)

<div class="topic-metadata">

**Author:** [@dreamn11](https://www.ruby-forum.com/u/dreamn11)\
**Replies:** 10\
**Last updated:** [September 5, 2006, 4:30pm UTC](https://www.ruby-forum.com/t/simple-questions-on-ruby/65351 "2006-09-05T16:30:53Z")

</div>

I am Win32 Programmer looking for answers on Ruby How do you invoke a .rb file from the irb shell? If i wish you deploy my ruby code into Production server…whats the RunTime I have to install 1st? If I write Ruby CGI …

---

## [The real difference between Mutex and Sync](https://www.ruby-forum.com/t/the-real-difference-between-mutex-and-sync/67512)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 7\
**Last updated:** [September 5, 2006, 4:14pm UTC](https://www.ruby-forum.com/t/the-real-difference-between-mutex-and-sync/67512 "2006-09-05T16:14:49Z")

</div>

As I’ve mentioned before, Sync and Mutex are very similar, and Mutex is very simple. Their locking algorithm (for exclusive locking) is essentially identical. And in some detailed examinations of Mutex’s behavior, th…

---

## [Method \`inspect' called on terminated object](https://www.ruby-forum.com/t/method-inspect-called-on-terminated-object/67600)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [September 5, 2006, 4:04pm UTC](https://www.ruby-forum.com/t/method-inspect-called-on-terminated-object/67600 "2006-09-05T16:04:48Z")

</div>

e$B0J2\<$N$h$&$K!“e(BSymbol.all\_symbols e$BFb$K2x$7$2$J%\*%V%8%’%/%H$,$”$k$h$&$G$9!#e(B % ./ruby -ve ‘p Symbol.all\_symbols’ ruby 1.9.0 (2006-09-05) \[i686-linux\] -e:1:in inspect': methodinspect’ called on terminated obj…

---

## [Times is a method?](https://www.ruby-forum.com/t/times-is-a-method/67502)

<div class="topic-metadata">

**Author:** [@gaurav\_bagga](https://www.ruby-forum.com/u/gaurav_bagga)\
**Replies:** 13\
**Last updated:** [September 5, 2006, 4:00pm UTC](https://www.ruby-forum.com/t/times-is-a-method/67502 "2006-09-05T16:00:46Z")

</div>

Fixnum.ancestors.each do |x| p “------------------------------------:#{x}---------------------------------” x.methods.each do |y| p y if y =~ /^t/ end end hi all, i was trying this code and thought of getting all…

---

## [Re: Binary Search Using Lambda](https://www.ruby-forum.com/t/re-binary-search-using-lambda/67596)

<div class="topic-metadata">

**Author:** [@jasonmorrison](https://www.ruby-forum.com/u/jasonmorrison)\
**Replies:** 0\
**Last updated:** [September 5, 2006, 2:58pm UTC](https://www.ruby-forum.com/t/re-binary-search-using-lambda/67596 "2006-09-05T14:58:35Z")

</div>

As an aside, I would be warry of building functions that return array indices, or -1 if they fail. In ruby, -1 is a valid array index, referring to the last element in the array. Might be better to return nil to avo…

---

## [Does an instance know his own name?](https://www.ruby-forum.com/t/does-an-instance-know-his-own-name/67399)

<div class="topic-metadata">

**Author:** [@glub](https://www.ruby-forum.com/u/glub)\
**Replies:** 5\
**Last updated:** [September 5, 2006, 2:44pm UTC](https://www.ruby-forum.com/t/does-an-instance-know-his-own-name/67399 "2006-09-05T14:44:29Z")

</div>

If a class has built checks and raises an exception if it finds something wrong, how can I tell which instance had the error? I know there’s an object\_id, but can I know the name of the objects own instance variable? …

---

## [Conditional test : going crazy](https://www.ruby-forum.com/t/conditional-test-going-crazy/67575)

<div class="topic-metadata">

**Author:** [@Zouplaz](https://www.ruby-forum.com/u/Zouplaz)\
**Replies:** 3\
**Last updated:** [September 5, 2006, 1:50pm UTC](https://www.ruby-forum.com/t/conditional-test-going-crazy/67575 "2006-09-05T13:50:16Z")

</div>

Hello, I’m goind crazy with this piece of code response = @http.get(url, headers) raise “url #{url} unreachable on host #{@host}:#{@port} - code #{response.code}” if response.code != 200 The exception is raised even …

---

## [RSA Java/Ruby](https://www.ruby-forum.com/t/rsa-java-ruby/67487)

<div class="topic-metadata">

**Author:** [@jverger](https://www.ruby-forum.com/u/jverger)\
**Replies:** 5\
**Last updated:** [September 5, 2006, 1:10pm UTC](https://www.ruby-forum.com/t/rsa-java-ruby/67487 "2006-09-05T13:10:03Z")

</div>

Hi all, I’ve been reading in this list about crypting with RSA but I don’t get it to work. I beg your help. I believe one of the problems I’m having is that the different values (.e , .n , .d ) are being given in dec…

---

## [RuPy 2007 - Python & Ruby Conference](https://www.ruby-forum.com/t/rupy-2007-python-ruby-conference/67585)

<div class="topic-metadata">

**Author:** [@Jakub\_Piotr\_N](https://www.ruby-forum.com/u/Jakub_Piotr_N)\
**Replies:** 0\
**Last updated:** [September 5, 2006, 12:41pm UTC](https://www.ruby-forum.com/t/rupy-2007-python-ruby-conference/67585 "2006-09-05T12:41:59Z")

</div>

RuPy 2007 Python & Ruby Conference Poznan, Poland April 7-8, 2007 RuPy is a Python & Ruby conference. It will be held at Adam Mickiewicz University, in Poznan, Poland, so it is relatively accessible from both the …

---

## [Ext/tk/tkutil](https://www.ruby-forum.com/t/ext-tk-tkutil/67496)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 7\
**Last updated:** [September 5, 2006, 12:17pm UTC](https://www.ruby-forum.com/t/ext-tk-tkutil/67496 "2006-09-05T12:17:57Z")

</div>

e$B$J$+$@$G$9!#e(B 1.9e$B$Ge(Bext/tk/tkutile$B$,%3%s%Q%$%k%(%i!\<$K$J$j$^$9!#$H$j$"$($:5!3#e(B e$BE\*$KJQ49$7$?%Q%C%A$G$9!#e(B e$B$A$J$\_$K!“e(Brb\_str\_set\_len()e$B$O$”$k$h$&$G$9$,!"e(Brb\_ary\_set\_len()e$B$Oe(B e$BDI2C$5$…

---

## [Sitedir is not included in $LOAD\_PATH (Ruby 1.8.5 on NetBSD)](https://www.ruby-forum.com/t/sitedir-is-not-included-in-load-path-ruby-1-8-5-on-netbsd/67573)

<div class="topic-metadata">

**Author:** [@veer](https://www.ruby-forum.com/u/veer)\
**Replies:** 0\
**Last updated:** [September 5, 2006, 11:01am UTC](https://www.ruby-forum.com/t/sitedir-is-not-included-in-load-path-ruby-1-8-5-on-netbsd/67573 "2006-09-05T11:01:47Z")

</div>

sitedir is not included in $LOAD\_PATH (Ruby 1.8.5 on NetBSD) I didn’t use pkgsrc. ============= RUBY 1.8.5 ================ irb(main):001:0\> $LOAD\_PATH =\> \["/1.8", “/1.8/i386-netbsdelf3.0.1”, “”, “/home/vee/lib/ruby/…

---

## [Trying to work with Threads](https://www.ruby-forum.com/t/trying-to-work-with-threads/67545)

<div class="topic-metadata">

**Author:** [@SSMKSM](https://www.ruby-forum.com/u/SSMKSM)\
**Replies:** 1\
**Last updated:** [September 5, 2006, 7:08am UTC](https://www.ruby-forum.com/t/trying-to-work-with-threads/67545 "2006-09-05T07:08:48Z")

</div>

Hello, I was doing a quick test with Threads in my Win32 box and something strange occured. The point here is to input text without interrupting the counter. I plan to use a similar method to display text incoming fr…

---

## [Why does the derived class instance need to be duplicated wi](https://www.ruby-forum.com/t/why-does-the-derived-class-instance-need-to-be-duplicated-wi/67260)

<div class="topic-metadata">

**Author:** [@Lionel\_MAIAUX](https://www.ruby-forum.com/u/Lionel_MAIAUX)\
**Replies:** 1\
**Last updated:** [September 5, 2006, 6:53am UTC](https://www.ruby-forum.com/t/why-does-the-derived-class-instance-need-to-be-duplicated-wi/67260 "2006-09-05T06:53:10Z")

</div>

Hello, Is there any reason to duplicate the derived class instance when using TkComposite ? Examples : 1/ tk/sample/scrollframe : there are 3 frames instantiated for a Tk::ScrollFrame object : self (derived from TkF…

---

## [\[ANN\] FlexMock 0.4.0 Released](https://www.ruby-forum.com/t/ann-flexmock-0-4-0-released/67546)

<div class="topic-metadata">

**Author:** [@jimweirich](https://www.ruby-forum.com/u/jimweirich)\
**Replies:** 0\
**Last updated:** [September 5, 2006, 4:27am UTC](https://www.ruby-forum.com/t/ann-flexmock-0-4-0-released/67546 "2006-09-05T04:27:58Z")

</div>

= FlexMock 0.4.0 Released FlexMock is a flexible mocking library for use in Ruby’s Test::Unit test framework. Version 0.4.0 enhances FlexMock with the ability to stub and mock methods in existing objects. == New Fea…

---

## [Unloading objects?](https://www.ruby-forum.com/t/unloading-objects/67347)

<div class="topic-metadata">

**Author:** [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Replies:** 1\
**Last updated:** [September 5, 2006, 4:22am UTC](https://www.ruby-forum.com/t/unloading-objects/67347 "2006-09-05T04:22:56Z")

</div>

I’m tinkering with various aspects of dynamic programming this morning, and am curious to know if there is anyway to ‘unload’ a piece of ruby code? Example, I execute: load “room.rb” To load up by room class. What …

---

## [Silly question about irb initialization file](https://www.ruby-forum.com/t/silly-question-about-irb-initialization-file/67543)

<div class="topic-metadata">

**Author:** [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Replies:** 0\
**Last updated:** [September 5, 2006, 4:20am UTC](https://www.ruby-forum.com/t/silly-question-about-irb-initialization-file/67543 "2006-09-05T04:20:51Z")

</div>

I’m reading along in the Pickaxe book and on page 193 it seems to explain that if I have: ‘IRB.conf\[:RC\] = false’ in my irb initialization file then irb won’t read my initialization file. This is confusing.

---

## [How do I create an instance of a class in another rb file](https://www.ruby-forum.com/t/how-do-i-create-an-instance-of-a-class-in-another-rb-file/67530)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 7\
**Last updated:** [September 5, 2006, 4:06am UTC](https://www.ruby-forum.com/t/how-do-i-create-an-instance-of-a-class-in-another-rb-file/67530 "2006-09-05T04:06:50Z")

</div>

Hi I have two rb files in the same folder. The first file is one.rb and defines an instanciable class named ‘One’. The second file is two.rb and needs to create an instance of class ‘One’ as defined in one.rb. How d…

---

## [Encapsulation and good practices](https://www.ruby-forum.com/t/encapsulation-and-good-practices/67542)

<div class="topic-metadata">

**Author:** [@FSSenault](https://www.ruby-forum.com/u/FSSenault)\
**Replies:** 0\
**Last updated:** [September 5, 2006, 3:32am UTC](https://www.ruby-forum.com/t/encapsulation-and-good-practices/67542 "2006-09-05T03:32:46Z")

</div>

Hi. I’m working on a small project of mine (a system to collect and easily graph data via a “smart” wrapper around rrdtool), and I’m thinking about the design (while the whole stuff is already in production, how typi…

---

## [Ordered contrast for String or Array](https://www.ruby-forum.com/t/ordered-contrast-for-string-or-array/67357)

<div class="topic-metadata">

**Author:** [@Trans](https://www.ruby-forum.com/u/Trans)\
**Replies:** 11\
**Last updated:** [September 5, 2006, 3:20am UTC](https://www.ruby-forum.com/t/ordered-contrast-for-string-or-array/67357 "2006-09-05T03:20:44Z")

</div>

I have two strings: “aabc” and “aacd”. I want to get an “ordered contrast” to see the difference in their spellings. Eg. “aabc”.ordered\_contrast( “aacc” ) =\> " cc" In the example a space represents a matching string,…

---

## [Apache 2.2 and dispatch.cgi woes](https://www.ruby-forum.com/t/apache-2-2-and-dispatch-cgi-woes/67540)

<div class="topic-metadata">

**Author:** [@Golo](https://www.ruby-forum.com/u/Golo)\
**Replies:** 0\
**Last updated:** [September 5, 2006, 3:12am UTC](https://www.ruby-forum.com/t/apache-2-2-and-dispatch-cgi-woes/67540 "2006-09-05T03:12:44Z")

</div>

Hi all, I have a RAIL/Activerecord/Postgres application working with webRick. I have configured apache to have a virtual host on a separate port. But, when I launch the application with apache cgi using ruby dispat…

---

## [Kernel.=== in case statements, even though I never called it](https://www.ruby-forum.com/t/kernel-in-case-statements-even-though-i-never-called-it/67534)

<div class="topic-metadata">

**Author:** [@weirdbro](https://www.ruby-forum.com/u/weirdbro)\
**Replies:** 3\
**Last updated:** [September 5, 2006, 2:24am UTC](https://www.ruby-forum.com/t/kernel-in-case-statements-even-though-i-never-called-it/67534 "2006-09-05T02:24:41Z")

</div>

I was profiling a script I wrote, and the method with the greatest amount of time used was Kernel.=== . I was surprised, not only since I didn’t use this method in my code, but my code had nothing involving modules. W…

---

## [Net::HTTP.post\_form got 200 but no INSERT INTO. How come? Ho](https://www.ruby-forum.com/t/net-http-post-form-got-200-but-no-insert-into-how-come-ho/67501)

<div class="topic-metadata">

**Author:** [@Arie\_Kusuma\_A](https://www.ruby-forum.com/u/Arie_Kusuma_A)\
**Replies:** 2\
**Last updated:** [September 5, 2006, 2:10am UTC](https://www.ruby-forum.com/t/net-http-post-form-got-200-but-no-insert-into-how-come-ho/67501 "2006-09-05T02:10:41Z")

</div>

Hello, I’m playing around with net/http and open-uri Ruby Libraries… I’m trying to post to my own rails simple new action method. Here’s my irb : irb(main):013:0\> res = Net::HTTP.post\_form(URI.parse(“http://localhos…

---

## [Off topic: What is "top posting"?](https://www.ruby-forum.com/t/off-topic-what-is-top-posting/67171)

<div class="topic-metadata">

**Author:** [@bpauly](https://www.ruby-forum.com/u/bpauly)\
**Replies:** 81\
**Last updated:** [September 5, 2006, 1:52am UTC](https://www.ruby-forum.com/t/off-topic-what-is-top-posting/67171 "2006-09-05T01:52:40Z")

</div>

What is “top posting” and why is it considered bad form?

---

## [Invoking External Program](https://www.ruby-forum.com/t/invoking-external-program/67439)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 2\
**Last updated:** [September 5, 2006, 1:20am UTC](https://www.ruby-forum.com/t/invoking-external-program/67439 "2006-09-05T01:20:36Z")

</div>

Hi I’ve been able to launch an external program and read standard output using the following code. IO.popen(“program.exe”, ‘r+’) do |io| io.puts “command line input” io.close\_write puts io.read end How would I a…

---

## [Re: Does an instance know his own name?](https://www.ruby-forum.com/t/re-does-an-instance-know-his-own-name/67461)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [September 5, 2006, 1:16am UTC](https://www.ruby-forum.com/t/re-does-an-instance-know-his-own-name/67461 "2006-09-05T01:16:36Z")

</div>

I think the problem with an instance knowing his own name is the possibility of an instance having more than one name. How whould the instance now, which name you want ? The object id on the other hand is afaik sort o…

---

## [RuPy 2007 - Python & Ruby Conference](https://www.ruby-forum.com/t/rupy-2007-python-ruby-conference/67526)

<div class="topic-metadata">

**Author:** [@Jakub\_Piotr\_N](https://www.ruby-forum.com/u/Jakub_Piotr_N)\
**Replies:** 0\
**Last updated:** [September 5, 2006, 12:30am UTC](https://www.ruby-forum.com/t/rupy-2007-python-ruby-conference/67526 "2006-09-05T00:30:32Z")

</div>

RuPy 2007 Python & Ruby Conference Poznan, Poland April 7-8, 2007 RuPy is a Python & Ruby conference. It will be held at Adam Mickiewicz University, in Poznan, Poland, so it is relatively accessible from both the …

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

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