# Ruby

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

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

---

## [Basic Tree Data Structure](https://www.ruby-forum.com/t/basic-tree-data-structure/140089)

<div class="topic-metadata">

**Author:** [@jturney](https://www.ruby-forum.com/u/jturney)\
**Replies:** 13\
**Last updated:** [June 12, 2008, 4:51pm UTC](https://www.ruby-forum.com/t/basic-tree-data-structure/140089 "2008-06-12T16:51:51Z")

</div>

class Tree attr\_reader :value def initialize(value) @value = value @children = \[\] end def \<\<(value) subtree = Tree.new(value) @children \<\< subtree return subtree end end t = Tree.new(“Parent”) child1 = t \<\< …

---

## [Rspec and inequalities?](https://www.ruby-forum.com/t/rspec-and-inequalities/139947)

<div class="topic-metadata">

**Author:** [@markthomas](https://www.ruby-forum.com/u/markthomas)\
**Replies:** 5\
**Last updated:** [June 12, 2008, 4:48pm UTC](https://www.ruby-forum.com/t/rspec-and-inequalities/139947 "2008-06-12T16:48:19Z")

</div>

In an old version of rspec, you could do “x.should\_be \< y”, but this throws a NoMethodError now. What’s the proper way to test inequalities (less than/greater than)?

---

## [Downloading specific file](https://www.ruby-forum.com/t/downloading-specific-file/226009)

<div class="topic-metadata">

**Author:** [@twaters](https://www.ruby-forum.com/u/twaters)\
**Replies:** 0\
**Last updated:** [June 12, 2008, 4:07pm UTC](https://www.ruby-forum.com/t/downloading-specific-file/226009 "2008-06-12T16:07:44Z")

</div>

Morning all, I am downloading a file that gets loaded sometime after 10PM and we never know what time it will be put on the server. I have my code look for the file and if it does not match my test then sleep for 180…

---

## [JRuby 1.1.2 jruby.bat's Xbootclasspath causes ClassNotFoundException](https://www.ruby-forum.com/t/jruby-1-1-2-jruby-bats-xbootclasspath-causes-classnotfoundexception/140278)

<div class="topic-metadata">

**Author:** [@Roy\_Andre\_Gundersen](https://www.ruby-forum.com/u/Roy_Andre_Gundersen)\
**Replies:** 0\
**Last updated:** [June 12, 2008, 3:47pm UTC](https://www.ruby-forum.com/t/jruby-1-1-2-jruby-bats-xbootclasspath-causes-classnotfoundexception/140278 "2008-06-12T15:47:31Z")

</div>

Hi I have a Rails-application that serializes/unserializes some Java-objects and stores them on the session between requests, using ObjectOutputStream.writeObject() and ObjectInputStream.readObject(). The serialized …

---

## [Webrick](https://www.ruby-forum.com/t/webrick/132015)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [June 12, 2008, 3:21pm UTC](https://www.ruby-forum.com/t/webrick/132015 "2008-06-12T15:21:39Z")

</div>

Hi, i’m new to ruby and tried some code to get a small application. I used Webrick to get a http server: require ‘webrick’ include WEBrick s = HTTPServer.new(:Port =\> 8000) Add a mime type for \*.rhtml files HTTPUt…

---

## [Can't build openssl(ruby-1.8.7-p17) with VC6](https://www.ruby-forum.com/t/cant-build-openssl-ruby-1-8-7-p17-with-vc6/140271)

<div class="topic-metadata">

**Author:** [@arton](https://www.ruby-forum.com/u/arton)\
**Replies:** 1\
**Last updated:** [June 12, 2008, 2:05pm UTC](https://www.ruby-forum.com/t/cant-build-openssl-ruby-1-8-7-p17-with-vc6/140271 "2008-06-12T14:05:30Z")

</div>

artone$B$G$9!#e(B VC6e$B$rMxMQ$7$?e(Bruby-1.8.7-p17e$B$Ne(Bmakee$BCf$K!"e(Bopenssle$B$G%3%s%Q%$%k%(%i!\<$H$J$j$^e(B e$B$9!#e(B cl -nologo -I. -I../.. -I../.././.. -I../.././../ext/openssl -MD -Zi -O 2b2xg- -G6 …

---

## [Design question on threads](https://www.ruby-forum.com/t/design-question-on-threads/140255)

<div class="topic-metadata">

**Author:** [@Srijayanth\_S](https://www.ruby-forum.com/u/Srijayanth_S)\
**Replies:** 2\
**Last updated:** [June 12, 2008, 1:43pm UTC](https://www.ruby-forum.com/t/design-question-on-threads/140255 "2008-06-12T13:43:38Z")

</div>

Hello, I have a script that launches a bunch of threads. Each thread sleeps for the most part, wakes up, fetches a page, does some parsing, and goes back to sleep again. Really simple. However, on occasion, either th…

---

## [Class (not instance) Initializer](https://www.ruby-forum.com/t/class-not-instance-initializer/140218)

<div class="topic-metadata">

**Author:** [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Replies:** 4\
**Last updated:** [June 12, 2008, 1:43pm UTC](https://www.ruby-forum.com/t/class-not-instance-initializer/140218 "2008-06-12T13:43:38Z")

</div>

I would like to populate a class variable using a method class SomeThing @@some\_data populate\_some\_data def populate\_some\_data end end I expected that prefixing the method with self would work. It doesn’t. … sel…

---

## [Array#shuffle! returns nil?](https://www.ruby-forum.com/t/array-shuffle-returns-nil/140034)

<div class="topic-metadata">

**Author:** [@okkez](https://www.ruby-forum.com/u/okkez)\
**Replies:** 4\
**Last updated:** [June 12, 2008, 1:15pm UTC](https://www.ruby-forum.com/t/array-shuffle-returns-nil/140034 "2008-06-12T13:15:53Z")

</div>

okkez e$B$G$9!#e(B Array#shuffle! e$B$O$I$&$$$&\>l9g$Ke(B nil e$B$rJV$9$N$G$7$g$&$+!)e(B e$B$=$l$H$be(B RDoc e$B$,4V0c$C$F$$$k$N$G$7$g$&$+!)e(B e$B%j%U%!%l%s%9%^%K%e%"%k$K%5%s%W%k$r=q$-$?$$$N$G!"e(B e$B65$($F$$$?$@$1$…

---

## [RubyWeekend Game Contest, June 13-15](https://www.ruby-forum.com/t/rubyweekend-game-contest-june-13-15/140042)

<div class="topic-metadata">

**Author:** [@amin1426](https://www.ruby-forum.com/u/amin1426)\
**Replies:** 7\
**Last updated:** [June 12, 2008, 1:14pm UTC](https://www.ruby-forum.com/t/rubyweekend-game-contest-june-13-15/140042 "2008-06-12T13:14:40Z")

</div>

A bit of short notice, but we’ve having a small game creation contest starting this Friday, June 13 at 20:00 GMT. The contest is called RubyWeekend, as a cheap knock-off of Pygame’s “PyWeek” (just like Rubygame is a c…

---

## [Lib/irb/lc/ja/error.rb encoding](https://www.ruby-forum.com/t/lib-irb-lc-ja-error-rb-encoding/140259)

<div class="topic-metadata">

**Author:** [@Kazuhiro\_NISHIYAMA](https://www.ruby-forum.com/u/Kazuhiro_NISHIYAMA)\
**Replies:** 0\
**Last updated:** [June 12, 2008, 11:06am UTC](https://www.ruby-forum.com/t/lib-irb-lc-ja-error-rb-encoding/140259 "2008-06-12T11:06:10Z")

</div>

e$B@\>;3OB9-$G$9!#e(B \[ruby-core:17232\]e$B$N7o$G$I$l$+$Ke(Bmagic commente$B$r$D$1$l$Pe(B e$BBP1~$7$F$b$i$$$d$9$$$+$J$H;W$C$F!"F|K\\8l$,F~$C$F$$$ke(B e$B%U%!%$%k$rC5$7$F$$$k$He(B lib/irb/lc/ja/error.rb e$B$re(B e$B8+$D$…

---

## [Array inject function problem](https://www.ruby-forum.com/t/array-inject-function-problem/135848)

<div class="topic-metadata">

**Author:** [@inbroker](https://www.ruby-forum.com/u/inbroker)\
**Replies:** 18\
**Last updated:** [June 12, 2008, 10:45am UTC](https://www.ruby-forum.com/t/array-inject-function-problem/135848 "2008-06-12T10:45:27Z")

</div>

Hello Rubyists, I am new to the language and the community. My first problem is this : i used the following code : sum = 0 \[1,3,5\].inject() {|sum, element| sum + element} print sum I expected to get 9 but instea…

---

## [Working with arrays](https://www.ruby-forum.com/t/working-with-arrays/140014)

<div class="topic-metadata">

**Author:** [@owc](https://www.ruby-forum.com/u/owc)\
**Replies:** 10\
**Last updated:** [June 12, 2008, 9:56am UTC](https://www.ruby-forum.com/t/working-with-arrays/140014 "2008-06-12T09:56:28Z")

</div>

Hi, people I know some of ya might find me familiar but, I really am still a novice in ruby thus i’ll need help once in awhile. I’d defeinitely appreciate whatever help that is rendered! =) ok, so back to our topic. I…

---

## [Wide Finder performance](https://www.ruby-forum.com/t/wide-finder-performance/140229)

<div class="topic-metadata">

**Author:** [@Yukihiro\_M](https://www.ruby-forum.com/u/Yukihiro_M)\
**Replies:** 7\
**Last updated:** [June 12, 2008, 8:49am UTC](https://www.ruby-forum.com/t/wide-finder-performance/140229 "2008-06-12T08:49:22Z")

</div>

ã¾ã¤ã‚‚ã¨ ã‚†ãã²ã‚ã§ã™ Tim B.ã®Wide Finder Projectã§Rubyã®çµæžœãŒå¦™ã«ä½Žã„\[1\]ã®ã§è‡ª åˆ†ã§ã‚‚è©¦ã—ã¦ã¿ã¾ã—ãŸã€‚ \[1\] ongoing by Tim Bray · WF XI: Results ã§ã€ç§ãŒæ›¸ã„ãŸã®ã¯ä»¥ä¸‹ã®ã…

---

## [Webrick cpu usage?](https://www.ruby-forum.com/t/webrick-cpu-usage/140156)

<div class="topic-metadata">

**Author:** [@sealedsun](https://www.ruby-forum.com/u/sealedsun)\
**Replies:** 2\
**Last updated:** [June 12, 2008, 8:09am UTC](https://www.ruby-forum.com/t/webrick-cpu-usage/140156 "2008-06-12T08:09:20Z")

</div>

Hey! My application runs on a webrick server. When i open the browser and access the application, the cpu usage is around 40%. While i stay on a page and do nothing, the usage doesn’t go down again. When i close the…

---

## [Delete Duplicates](https://www.ruby-forum.com/t/delete-duplicates/140137)

<div class="topic-metadata">

**Author:** [@tornado](https://www.ruby-forum.com/u/tornado)\
**Replies:** 3\
**Last updated:** [June 12, 2008, 7:16am UTC](https://www.ruby-forum.com/t/delete-duplicates/140137 "2008-06-12T07:16:05Z")

</div>

Hello Sir/Madam, I want to know how can i delete duplicates entries from database using rake task. Regards, Amit K.

---

## [Code Review: RemoveLC](https://www.ruby-forum.com/t/code-review-removelc/140237)

<div class="topic-metadata">

**Author:** [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Replies:** 0\
**Last updated:** [June 12, 2008, 5:40am UTC](https://www.ruby-forum.com/t/code-review-removelc/140237 "2008-06-12T05:40:01Z")

</div>

tfpt review “/shelveset:RemoveLC;REDMOND\\tomat” Removes LanguageContext property from Ruby IDO classes. It’s not needed anymore. Adds a couple of tests for instance variables. Tomas

---

## [Asp.Net MVC with IronRuby with ActiveRecord](https://www.ruby-forum.com/t/asp-net-mvc-with-ironruby-with-activerecord/140236)

<div class="topic-metadata">

**Author:** [@softmind](https://www.ruby-forum.com/u/softmind)\
**Replies:** 0\
**Last updated:** [June 12, 2008, 5:39am UTC](https://www.ruby-forum.com/t/asp-net-mvc-with-ironruby-with-activerecord/140236 "2008-06-12T05:39:52Z")

</div>

Hi, Congrats to John L. and his team for doing a fantastic job with Asp.Net MVC and IronRuby. It would be great if someone works around to implement Asp.Net MVC with IronRuby and Active Record. I would like to go tha…

---

## [Can't require any of the libs](https://www.ruby-forum.com/t/cant-require-any-of-the-libs/140228)

<div class="topic-metadata">

**Author:** [@barby](https://www.ruby-forum.com/u/barby)\
**Replies:** 2\
**Last updated:** [June 12, 2008, 2:12am UTC](https://www.ruby-forum.com/t/cant-require-any-of-the-libs/140228 "2008-06-12T02:12:43Z")

</div>

Hi I tried requiring any of the libs that are included in the ironruby source. I tried putting the libs folder in different places but to no avail. So far i’ve put the libs in. irdir\\libs irdir\\build\\libs irdir\\bu…

---

## [Subtracting arrays](https://www.ruby-forum.com/t/subtracting-arrays/140224)

<div class="topic-metadata">

**Author:** [@leveille](https://www.ruby-forum.com/u/leveille)\
**Replies:** 3\
**Last updated:** [June 12, 2008, 1:49am UTC](https://www.ruby-forum.com/t/subtracting-arrays/140224 "2008-06-12T01:49:53Z")

</div>

I suspect there is a cleaner way to do this with inject or collect. a = \[1,2,3\] b = \[1,1,1\] c = \[\] i = 0 while i \< 3 do c \<\< a\[i\] - b\[i\] i += 1 end p c =\> \[0, 1, 2\] I tried a collect but can’t figure out how t…

---

## [Eventmachine and rev](https://www.ruby-forum.com/t/eventmachine-and-rev/129272)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 9\
**Last updated:** [June 12, 2008, 1:46am UTC](https://www.ruby-forum.com/t/eventmachine-and-rev/129272 "2008-06-12T01:46:58Z")

</div>

What would you say is the difference between rev and eventmachine? Thoughts? (Obviously I can see that both work with 1.9, rev only with 1.9).

---

## [Build issues and ETA for a the next source drop](https://www.ruby-forum.com/t/build-issues-and-eta-for-a-the-next-source-drop/140226)

<div class="topic-metadata">

**Author:** [@John\_LSSIRONRUBY](https://www.ruby-forum.com/u/John_LSSIRONRUBY)\
**Replies:** 0\
**Last updated:** [June 12, 2008, 1:21am UTC](https://www.ruby-forum.com/t/build-issues-and-eta-for-a-the-next-source-drop/140226 "2008-06-12T01:21:48Z")

</div>

Hi Folks, Sorry about the delay in getting out a new drop of the sources - particularly the version of the sources that will run Rails. Right now we have some problems with sync between the two repositories, and a bu…

---

## [Keyword parameters](https://www.ruby-forum.com/t/keyword-parameters/140206)

<div class="topic-metadata">

**Author:** [@glenn](https://www.ruby-forum.com/u/glenn)\
**Replies:** 2\
**Last updated:** [June 12, 2008, 1:04am UTC](https://www.ruby-forum.com/t/keyword-parameters/140206 "2008-06-12T01:04:43Z")

</div>

Hi everyone, I have a question about keyword parameters in Ruby. I know that v1.8.6 doesn’t do this and v1.9 does, and that you can ‘trick’ v1.8.6 into doing it with hashes. My question is whether you can do this co…

---

## [Code Review: Partial1](https://www.ruby-forum.com/t/code-review-partial1/140216)

<div class="topic-metadata">

**Author:** [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Replies:** 0\
**Last updated:** [June 12, 2008, 12:02am UTC](https://www.ruby-forum.com/t/code-review-partial1/140216 "2008-06-12T00:02:25Z")

</div>

tfpt review “/shelveset:Partial1;REDMOND\\tomat” Adds /partial mode to IronRuby unit tests. If specified, the harness will run tests in an app-domain that has restricted permissions. Simple DLR changes: Snippet assemb…

---

## [Array collect - nil can't be coerced into Float (TypeError)](https://www.ruby-forum.com/t/array-collect-nil-cant-be-coerced-into-float-typeerror/140208)

<div class="topic-metadata">

**Author:** [@leveille](https://www.ruby-forum.com/u/leveille)\
**Replies:** 7\
**Last updated:** [June 11, 2008, 10:49pm UTC](https://www.ruby-forum.com/t/array-collect-nil-cant-be-coerced-into-float-typeerror/140208 "2008-06-11T22:49:08Z")

</div>

I have this simple program that has a problem that I just can’t find a solution to: class MyArray def count a = \[50.1,52.0,55.0,60.0\] b = \[0.24,0.1,0.29,0.9\] i = 0 c = \[\] while i \<= 4 do puts c = b.collect {|x|…

---

## [JRuby performance issues on thrift server benchmark](https://www.ruby-forum.com/t/jruby-performance-issues-on-thrift-server-benchmark/140109)

<div class="topic-metadata">

**Author:** [@kevben](https://www.ruby-forum.com/u/kevben)\
**Replies:** 8\
**Last updated:** [June 11, 2008, 10:46pm UTC](https://www.ruby-forum.com/t/jruby-performance-issues-on-thrift-server-benchmark/140109 "2008-06-11T22:46:22Z")

</div>

For those of you unaware of Thrift, it is an open-source language- agnostic distributed messaging system created by Facebook (and currently being incubated as an apache project). I recently re-wrote the ruby libraries…

---

## [Unable to replace rexml/encoding method with new method consistently](https://www.ruby-forum.com/t/unable-to-replace-rexml-encoding-method-with-new-method-consistently/140214)

<div class="topic-metadata">

**Author:** [@cwolfinger](https://www.ruby-forum.com/u/cwolfinger)\
**Replies:** 0\
**Last updated:** [June 11, 2008, 10:43pm UTC](https://www.ruby-forum.com/t/unable-to-replace-rexml-encoding-method-with-new-method-consistently/140214 "2008-06-11T22:43:24Z")

</div>

Hello - Recently we tried to override / replace the rexml/encoding.rb method encoding= in order to see if we could increase performance of the encoding= method by inlining the UTF-8 encoding so it did not hit the re…

---

## [Dchat](https://www.ruby-forum.com/t/dchat/140205)

<div class="topic-metadata">

**Author:** [@joakim](https://www.ruby-forum.com/u/joakim)\
**Replies:** 0\
**Last updated:** [June 11, 2008, 9:26pm UTC](https://www.ruby-forum.com/t/dchat/140205 "2008-06-11T21:26:32Z")

</div>

I’ve got one comoputer on which I start dchats.rb. When I try to connect to it with dchatc.rb on another computer, it takes a while and then it says: /usr/lib/ruby/1.8/drb/drb.rb:736:in open': druby://fatburen70.fatbu…

---

## [Require\_gem is obsolete. Use gem instead](https://www.ruby-forum.com/t/require-gem-is-obsolete-use-gem-instead/140131)

<div class="topic-metadata">

**Author:** [@hcrato](https://www.ruby-forum.com/u/hcrato)\
**Replies:** 3\
**Last updated:** [June 11, 2008, 9:25pm UTC](https://www.ruby-forum.com/t/require-gem-is-obsolete-use-gem-instead/140131 "2008-06-11T21:25:48Z")

</div>

Hi all, I’m trying to run r or ruby command and I’m using Windows Vista Home Premium, Ruby version ruby 1.8.6 (2007-03-13 patchlevel 0) \[i386-mswin32\], java version “1.6.0-oem” Java™ SE Runtime Environment (build 1.6…

---

## [Ruby .read image upside down?](https://www.ruby-forum.com/t/ruby-read-image-upside-down/138994)

<div class="topic-metadata">

**Author:** [@chrismalek](https://www.ruby-forum.com/u/chrismalek)\
**Replies:** 3\
**Last updated:** [June 11, 2008, 8:40pm UTC](https://www.ruby-forum.com/t/ruby-read-image-upside-down/138994 "2008-06-11T20:40:37Z")

</div>

Hi, I’m discorvering a strange issue when reading in an image being sent by a 3D rendering software. The image data is being passed in a parameter called ‘thumbnail’. We read it into a variable in the responding co…

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

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