# Ruby

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

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

---

## [\[Feature:1.9\] How about IPAddr#\<=\> to take care of mask\_addr?](https://www.ruby-forum.com/t/feature-1-9-how-about-ipaddr-to-take-care-of-mask-addr/173366)

<div class="topic-metadata">

**Author:** [@Nobuhiro\_IMAI](https://www.ruby-forum.com/u/Nobuhiro_IMAI)\
**Replies:** 6\
**Last updated:** [September 28, 2009, 3:26am UTC](https://www.ruby-forum.com/t/feature-1-9-how-about-ipaddr-to-take-care-of-mask-addr/173366 "2009-09-28T03:26:39Z")

</div>

e$B$$$^$$$G$9!#e(B #1877 e$B$O$"$j$,$H$&$4$6$$$^$7$?!#e(B IPAddr e$B$N%$%s%9%?%s%9$,%O%C%7%e$N%-!\<$K=PMh$k$h$&$K$J$C$?$N$G!"4JC1$Je(B Access Control List e$B$r=q$$$F$\_$?$N$G$9$,!"e(B RUBY\_DESCRIPTION =\> “ruby 1.9…

---

## [Checkbox - Dynamically assign id using for loop](https://www.ruby-forum.com/t/checkbox-dynamically-assign-id-using-for-loop/176246)

<div class="topic-metadata">

**Author:** [@raheel](https://www.ruby-forum.com/u/raheel)\
**Replies:** 0\
**Last updated:** [September 27, 2009, 11:49pm UTC](https://www.ruby-forum.com/t/checkbox-dynamically-assign-id-using-for-loop/176246 "2009-09-27T23:49:48Z")

</div>

Does anyone have sample ruby code on how to dynamically assign an id to a checkbox using a for loop in the view? Also, how will I read the values checked in the controller? Thanks.

---

## [Is it possible to eliminate the temporary variable](https://www.ruby-forum.com/t/is-it-possible-to-eliminate-the-temporary-variable/176236)

<div class="topic-metadata">

**Author:** [@alex-osu3](https://www.ruby-forum.com/u/alex-osu3)\
**Replies:** 3\
**Last updated:** [September 27, 2009, 11:20pm UTC](https://www.ruby-forum.com/t/is-it-possible-to-eliminate-the-temporary-variable/176236 "2009-09-27T23:20:46Z")

</div>

Hi all, I use the following script to read a file and create a 2D array. What bothers me is that I have to use a temporary variable. I wonder if there is a better way to read a file and create a 2D array. Thanks, Li …

---

## [Push and Pop on a Priority Queue appears to change nature of Array](https://www.ruby-forum.com/t/push-and-pop-on-a-priority-queue-appears-to-change-nature-of-array/176224)

<div class="topic-metadata">

**Author:** [@masonkessinger](https://www.ruby-forum.com/u/masonkessinger)\
**Replies:** 5\
**Last updated:** [September 27, 2009, 9:59pm UTC](https://www.ruby-forum.com/t/push-and-pop-on-a-priority-queue-appears-to-change-nature-of-array/176224 "2009-09-27T21:59:25Z")

</div>

I’m stumped. Worked on this problem for over three hours. I created an array: current\_state = \[3, 1, 6, 5, 2, 0, 4, 7, 8\] and puts "Current\_state.index(0) = " + current\_state.index(0).to\_s displays a 5, as would …

---

## [I can't install any GUI via gems, please help](https://www.ruby-forum.com/t/i-cant-install-any-gui-via-gems-please-help/176227)

<div class="topic-metadata">

**Author:** [@alexanderl](https://www.ruby-forum.com/u/alexanderl)\
**Replies:** 6\
**Last updated:** [September 27, 2009, 9:30pm UTC](https://www.ruby-forum.com/t/i-cant-install-any-gui-via-gems-please-help/176227 "2009-09-27T21:30:09Z")

</div>

Hello! I am new at the forum, but i have a huge problem. For the last weeks i have been learning some about ruby, i bought a book and coded like hell(i mainly develop in C# otherwise). It’s been going on very good so …

---

## [Something like an interpreter](https://www.ruby-forum.com/t/something-like-an-interpreter/176241)

<div class="topic-metadata">

**Author:** [@malev05](https://www.ruby-forum.com/u/malev05)\
**Replies:** 0\
**Last updated:** [September 27, 2009, 8:52pm UTC](https://www.ruby-forum.com/t/something-like-an-interpreter/176241 "2009-09-27T20:52:41Z")

</div>

Hi, I’ve seen this screencasthttp://www.engineyard.com/blog/community/scotland-on-rails/the-ruby-object-model/in where the presenter is editing ruby code in an editor, and everty time he save’s the file, the code ex…

---

## [Help: soap4r ntlm wsdl2ruby](https://www.ruby-forum.com/t/help-soap4r-ntlm-wsdl2ruby/176238)

<div class="topic-metadata">

**Author:** [@tomtt](https://www.ruby-forum.com/u/tomtt)\
**Replies:** 0\
**Last updated:** [September 27, 2009, 7:49pm UTC](https://www.ruby-forum.com/t/help-soap4r-ntlm-wsdl2ruby/176238 "2009-09-27T19:49:04Z")

</div>

hi, it seems i cant figure out how to connect to a windows ntlm webserivce: wsdl\_url = ‘http://localhost/VS/mscrmservices/2006/crmservice.asmx?wsdl’ proxy = SOAP::WSDLDriverFactory.new(wsdl\_url).create\_rpc\_driver …

---

## [More than one initializer](https://www.ruby-forum.com/t/more-than-one-initializer/176231)

<div class="topic-metadata">

**Author:** [@jphastings](https://www.ruby-forum.com/u/jphastings)\
**Replies:** 3\
**Last updated:** [September 27, 2009, 6:04pm UTC](https://www.ruby-forum.com/t/more-than-one-initializer/176231 "2009-09-27T18:04:30Z")

</div>

Hi all, I have a module containing two classes the first is ‘item’ the second is ‘search’. Lets use twitter as an example: module MyTwitter class Item attribute\_reader :id, :tweet def initialize(text) @tweet = tex…

---

## [\[ruby19\] Thread $B@ZBX$($,0\[\>o$KCY$$!)(B](https://www.ruby-forum.com/t/ruby19-thread-b-zbx-0-o-kcy-b/175801)

<div class="topic-metadata">

**Author:** [@Hidetoshi\_NAGAI](https://www.ruby-forum.com/u/Hidetoshi_NAGAI)\
**Replies:** 11\
**Last updated:** [September 27, 2009, 10:21am UTC](https://www.ruby-forum.com/t/ruby19-thread-b-zbx-0-o-kcy-b/175801 "2009-09-27T10:21:08Z")

</div>

e$B1J0f!wCNG=!%6e9)Bg$G$9!%e(B e$BK;$7$/$F;C$/J|CV$7$F$$$F!$:#F|!$5W$7$V$j$KF0$+$7$F$\_$?$N$G$9$,!$e(B e$B:#$Ne(B 1.9 e$B$C$F!$e(BThread e$B@ZBX$($,$b$N$9$4$/CY$/$J$C$F$$$?$j$7$^$9$+!)e(B ruby 1.9.2dev (2009-09-19) \[i…

---

## [\[Bug:1.9\] overridden method is not called with delegate](https://www.ruby-forum.com/t/bug-1-9-overridden-method-is-not-called-with-delegate/176223)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [September 27, 2009, 5:54am UTC](https://www.ruby-forum.com/t/bug-1-9-overridden-method-is-not-called-with-delegate/176223 "2009-09-27T05:54:49Z")

</div>

e$B0J2\<$N$h$&$K!"e(BObject e$B$He(B Array e$B$Ke(B m e$B$H$$$&%a%=%C%I$rDj5A$7!"e(B \[\] e$B$KBP$7e(B delegate e$B7PM3$Ge(B m e$B$r8F$V$H!"e(BArray e$B$G$J$/e(B Object e$B$Ke(B e$BDj5A$5$l$?e(B m e$B$,8F$P$l$F$7$^$$$^$…

---

## [SSL and OpenSSL::SSL::SSLServer accept()](https://www.ruby-forum.com/t/ssl-and-openssl-sslserver-accept/176183)

<div class="topic-metadata">

**Author:** [@born\_in\_USSR](https://www.ruby-forum.com/u/born_in_USSR)\
**Replies:** 2\
**Last updated:** [September 27, 2009, 3:47am UTC](https://www.ruby-forum.com/t/ssl-and-openssl-sslserver-accept/176183 "2009-09-27T03:47:14Z")

</div>

i need to make secure connection between this rubyserver and web-browser ruby code: require “openssl” require ‘socket’ port = 443 ctx = OpenSSL::SSL::SSLContext.new() ctx.ciphers = “ADH” tcps = TCPServer.new(port…

---

## [Roulette & rand](https://www.ruby-forum.com/t/roulette-rand/176141)

<div class="topic-metadata">

**Author:** [@semiho](https://www.ruby-forum.com/u/semiho)\
**Replies:** 21\
**Last updated:** [September 27, 2009, 2:15am UTC](https://www.ruby-forum.com/t/roulette-rand/176141 "2009-09-27T02:15:16Z")

</div>

Hi, I’m trying to teach my self ruby so i decided to write a simple roulette that picks a rand number (0 to 36) then decides if its red or black. but after i’ve written a version of the code i realized that the code w…

---

## [How to position 4 images in fxruby main window](https://www.ruby-forum.com/t/how-to-position-4-images-in-fxruby-main-window/176221)

<div class="topic-metadata">

**Author:** [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Replies:** 0\
**Last updated:** [September 27, 2009, 12:38am UTC](https://www.ruby-forum.com/t/how-to-position-4-images-in-fxruby-main-window/176221 "2009-09-27T00:38:39Z")

</div>

Please suggest how chart4.rb can be modified, to position the 4 image in the four corners of the main window. Desired layout shown below. |-----------------| | chart1 | chart2 | |-----------------| | chart3 | char…

---

## [ERB: import function](https://www.ruby-forum.com/t/erb-import-function/128959)

<div class="topic-metadata">

**Author:** [@alvarobp](https://www.ruby-forum.com/u/alvarobp)\
**Replies:** 4\
**Last updated:** [September 27, 2009, 12:16am UTC](https://www.ruby-forum.com/t/erb-import-function/128959 "2009-09-27T00:16:39Z")

</div>

I want to import rhtml files into another using ERB. I wrote a function: def import(fn) e = “” File.open(fn) do |f| e = ERB.new(f.read) end e.result end This function does what I want, reads the template file and…

---

## [\[Bug #2075\](Closed) ext/json/ext/generator/generator.c $B$N%I%-%e%a%s%H$X$N\>.$5$J%Q%C%A(B](https://www.ruby-forum.com/t/bug-2075-closed-ext-json-ext-generator-generator-c-b-n-i-e-a-s-h-x-n-5-j-q-c-a-b/176216)

<div class="topic-metadata">

**Author:** [@Yui\_NARUSE](https://www.ruby-forum.com/u/Yui_NARUSE)\
**Replies:** 0\
**Last updated:** [September 26, 2009, 10:47pm UTC](https://www.ruby-forum.com/t/bug-2075-closed-ext-json-ext-generator-generator-c-b-n-i-e-a-s-h-x-n-5-j-q-c-a-b/176216 "2009-09-26T22:47:33Z")

</div>

e$B%A%1%C%He(B #2075 e$B$,99?7$5$l$^$7$?!#e(B (by Yui NARUSE) e$B%9%F!\<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B Applied in changeset r25114. http://redmine.ruby-lang.org/issues…

---

## [\[Feature #2102\] String#inspect as default\_internal encoding](https://www.ruby-forum.com/t/feature-2102-string-inspect-as-default-internal-encoding/175571)

<div class="topic-metadata">

**Author:** [@Yui\_NARUSE](https://www.ruby-forum.com/u/Yui_NARUSE)\
**Replies:** 2\
**Last updated:** [September 26, 2009, 10:38pm UTC](https://www.ruby-forum.com/t/feature-2102-string-inspect-as-default-internal-encoding/175571 "2009-09-26T22:38:11Z")

</div>

Feature #2102: String#inspect as default\_internal encoding http://redmine.ruby-lang.org/issues/show/2102 e$B5/I\<\<Te(B: Yui NARUSE e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal e$B%+%F%4%je(B: M17N String#inspect e$B…

---

## [Java code to Ruby code](https://www.ruby-forum.com/t/java-code-to-ruby-code/173166)

<div class="topic-metadata">

**Author:** [@little\_kostas](https://www.ruby-forum.com/u/little_kostas)\
**Replies:** 2\
**Last updated:** [September 26, 2009, 7:46pm UTC](https://www.ruby-forum.com/t/java-code-to-ruby-code/173166 "2009-09-26T19:46:08Z")

</div>

Hello guys, I am trying to “translate” some java code to ruby code for a project in my univercity. My professor gave me this java code an i want to give him the same sunctionality in ruby. Here is the code: //Classe…

---

## [Wxruby - painting in device context](https://www.ruby-forum.com/t/wxruby-painting-in-device-context/176197)

<div class="topic-metadata">

**Author:** [@Haris\_BogdanoviS\_S](https://www.ruby-forum.com/u/Haris_BogdanoviS_S)\
**Replies:** 3\
**Last updated:** [September 26, 2009, 7:05pm UTC](https://www.ruby-forum.com/t/wxruby-painting-in-device-context/176197 "2009-09-26T19:05:44Z")

</div>

Hi. I’m trying to paint in DC context: --------------------------------------------------- frame = Frame.new(nil, -1, “”) frame.paint { |dc| dc.draw\_line(50, 50, 100, 100) # for this …

---

## [How to remove duplicate elements in a 2D array](https://www.ruby-forum.com/t/how-to-remove-duplicate-elements-in-a-2d-array/176165)

<div class="topic-metadata">

**Author:** [@alex-osu3](https://www.ruby-forum.com/u/alex-osu3)\
**Replies:** 19\
**Last updated:** [September 26, 2009, 6:37pm UTC](https://www.ruby-forum.com/t/how-to-remove-duplicate-elements-in-a-2d-array/176165 "2009-09-26T18:37:03Z")

</div>

Hi all, I have a 2D array as follow: arr=\[ \[ 'a',1,2,3\], \['b',4,5,6\], \['c',3,2,1\], \['a',1.3,2.2,3,3\], ... \['a', 2,1,3\], … \[‘a’,2.1,1.5,3\] \] As you can see there are several rows containing element ‘a’, and…

---

## [Use of murmur hash in st.c](https://www.ruby-forum.com/t/use-of-murmur-hash-in-st-c/176202)

<div class="topic-metadata">

**Author:** [@nobu](https://www.ruby-forum.com/u/nobu)\
**Replies:** 1\
**Last updated:** [September 26, 2009, 4:20pm UTC](https://www.ruby-forum.com/t/use-of-murmur-hash-in-st-c/176202 "2009-09-26T16:20:41Z")

</div>

e$B$J$+$@$G$9!#e(B String#hashe$B$K$Oe(BMurmurHashe$B$r;H$C$F$$$^$9$,!"e(Bstrhashe$B$O$^$@e(BFNV-1ae$B$Ne(B e$B$^$^$G$9!#e(Bst.ce$B$be(BMurmure$B$KE}0l$7$F$$$$$N$G$O$J$$$+$H;W$$$^$9!#e(B Index: include/ruby/intern.h …

---

## [Backporting Enumerator.new { ... } to Ruby 1.8.7](https://www.ruby-forum.com/t/backporting-enumerator-new-to-ruby-1-8-7/176172)

<div class="topic-metadata">

**Author:** [@Shot\_SPiotr\_S.S](https://www.ruby-forum.com/u/Shot_SPiotr_S.S)\
**Replies:** 11\
**Last updated:** [September 26, 2009, 4:16pm UTC](https://www.ruby-forum.com/t/backporting-enumerator-new-to-ruby-1-8-7/176172 "2009-09-26T16:16:52Z")

</div>

Hello, good people of ruby-talk. Iâ€™m trying to backport my code from Ruby 1.9 to Ruby 1.8.7 so that I can profile it sanely with ruby-prof or zenprofile (neither of which works sensibly under Ruby 1.9 as of now). Un…

---

## [AOT + War?](https://www.ruby-forum.com/t/aot-war/176095)

<div class="topic-metadata">

**Author:** [@superwick](https://www.ruby-forum.com/u/superwick)\
**Replies:** 5\
**Last updated:** [September 26, 2009, 2:50am UTC](https://www.ruby-forum.com/t/aot-war/176095 "2009-09-26T02:50:34Z")

</div>

Can you use AOT compilation and a war together to deploy a rails app (for obfuscation via class files instead of including raw ruby source in the jar)? If so, is this possible with default warbler, or do we need to d…

---

## [Need help to position image in fxruby Main window](https://www.ruby-forum.com/t/need-help-to-position-image-in-fxruby-main-window/176192)

<div class="topic-metadata">

**Author:** [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Replies:** 0\
**Last updated:** [September 26, 2009, 12:55am UTC](https://www.ruby-forum.com/t/need-help-to-position-image-in-fxruby-main-window/176192 "2009-09-26T00:55:47Z")

</div>

Please suggest how chart4.rb can be modified, to position the 4 image in the four corners of the main window. Desired layout shown below. |------------------------| | chart1 | chart2 | |------------------------| …

---

## [C extension with progress bar](https://www.ruby-forum.com/t/c-extension-with-progress-bar/176076)

<div class="topic-metadata">

**Author:** [@simi](https://www.ruby-forum.com/u/simi)\
**Replies:** 3\
**Last updated:** [September 25, 2009, 11:01pm UTC](https://www.ruby-forum.com/t/c-extension-with-progress-bar/176076 "2009-09-25T23:01:04Z")

</div>

Hi, I have a ruby extension which shows a progress bar window. The progress bar shows the progress of a loop in the ruby code.For each iteration of the loop I call an extension method that sets the current progress t…

---

## [Broken rake](https://www.ruby-forum.com/t/broken-rake/176037)

<div class="topic-metadata">

**Author:** [@jimgroom](https://www.ruby-forum.com/u/jimgroom)\
**Replies:** 3\
**Last updated:** [September 25, 2009, 10:32pm UTC](https://www.ruby-forum.com/t/broken-rake/176037 "2009-09-25T22:32:23Z")

</div>

I’m attempting to run some migrations on an empty database and I’m getting an error from rake. This is reported as a Warbler problem (http://kenai.com/jira/browse/WARBLER-4), but I’ve uninstalled it and I still have …

---

## [Nil.hour error from ActiveRecord](https://www.ruby-forum.com/t/nil-hour-error-from-activerecord/176178)

<div class="topic-metadata">

**Author:** [@jimgroom](https://www.ruby-forum.com/u/jimgroom)\
**Replies:** 0\
**Last updated:** [September 25, 2009, 9:40pm UTC](https://www.ruby-forum.com/t/nil-hour-error-from-activerecord/176178 "2009-09-25T21:40:53Z")

</div>

I’m attempting to connect using the jdbc adapter and I get this error You have a nil object when you didn’t expect it! The error occurred while evaluating nil.hour /Users/jim/Library/JRuby/1.3.1/lib/ruby/gems/1.8/gems…

---

## [Deserialize marshal.dump file in c#](https://www.ruby-forum.com/t/deserialize-marshal-dump-file-in-c/176157)

<div class="topic-metadata">

**Author:** [@marcelocavaco](https://www.ruby-forum.com/u/marcelocavaco)\
**Replies:** 1\
**Last updated:** [September 25, 2009, 9:26pm UTC](https://www.ruby-forum.com/t/deserialize-marshal-dump-file-in-c/176157 "2009-09-25T21:26:50Z")

</div>

how deserialize marshal.dump file in C# ??? it is possible?

---

## [Full stracktrace in ruby 1.9](https://www.ruby-forum.com/t/full-stracktrace-in-ruby-1-9/176162)

<div class="topic-metadata">

**Author:** [@freakguard](https://www.ruby-forum.com/u/freakguard)\
**Replies:** 2\
**Last updated:** [September 25, 2009, 9:25pm UTC](https://www.ruby-forum.com/t/full-stracktrace-in-ruby-1-9/176162 "2009-09-25T21:25:39Z")

</div>

I’m getting stacktraces like: expected Foo, got #\<NoMethodError: undefined method bar=' for nil:NilClass\> spec/models/foobar\_spec.rb:79:inblock (6 levels) in \<top (required)\>’ but it would be way more useful to get the…

---

## [IRB tab-completion fails for directories in ruby 0.9.1](https://www.ruby-forum.com/t/irb-tab-completion-fails-for-directories-in-ruby-0-9-1/176099)

<div class="topic-metadata">

**Author:** [@sclarke](https://www.ruby-forum.com/u/sclarke)\
**Replies:** 4\
**Last updated:** [September 25, 2009, 7:24pm UTC](https://www.ruby-forum.com/t/irb-tab-completion-fails-for-directories-in-ruby-0-9-1/176099 "2009-09-25T19:24:30Z")

</div>

I recently upgraded from Ruby 0.8.6 to 0.9.1, and was trying out some old scripts to make sure they worked. The scripts were typically run in IRB and performed some calculations with data saved in a networked drive. B…

---

## [Bad version number in .class file](https://www.ruby-forum.com/t/bad-version-number-in-class-file/176164)

<div class="topic-metadata">

**Author:** [@azraelnewtype](https://www.ruby-forum.com/u/azraelnewtype)\
**Replies:** 3\
**Last updated:** [September 25, 2009, 5:25pm UTC](https://www.ruby-forum.com/t/bad-version-number-in-class-file/176164 "2009-09-25T17:25:04Z")

</div>

I’m creating a simple script, using rrd4j (https://rrd4j.dev.java.net/). When I try to run it, I get the following error: (eval):1:in \`include\_class’: cannot link Java class org.rrd4j.DsType, probable missing dependen…

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

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