# Ruby

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

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

---

## [Wsdl2ruby](https://www.ruby-forum.com/t/wsdl2ruby/113641)

<div class="topic-metadata">

**Author:** [@sirtyman](https://www.ruby-forum.com/u/sirtyman)\
**Replies:** 2\
**Last updated:** [September 4, 2007, 6:45am UTC](https://www.ruby-forum.com/t/wsdl2ruby/113641 "2007-09-04T06:45:50Z")

</div>

Hi, How can I create a wsdl class using wsdl2ruby. I run it as follows: wsdl2ruby.rb --wsdl http://10.10.5.175:8080/wsExtInterface/v2\_1/services/WsGroup?wsdl --type client --force But nothing happened. So, I have lo…

---

## [Ruby FX problem](https://www.ruby-forum.com/t/ruby-fx-problem/113702)

<div class="topic-metadata">

**Author:** [@coolwong](https://www.ruby-forum.com/u/coolwong)\
**Replies:** 4\
**Last updated:** [September 4, 2007, 6:15am UTC](https://www.ruby-forum.com/t/ruby-fx-problem/113702 "2007-09-04T06:15:50Z")

</div>

How can i build scroll bar in my GUI project??? How to use the FXScrollWindow???

---

## [Array of hashes: finding hash with min value for key](https://www.ruby-forum.com/t/array-of-hashes-finding-hash-with-min-value-for-key/113684)

<div class="topic-metadata">

**Author:** [@cghost](https://www.ruby-forum.com/u/cghost)\
**Replies:** 3\
**Last updated:** [September 4, 2007, 5:00am UTC](https://www.ruby-forum.com/t/array-of-hashes-finding-hash-with-min-value-for-key/113684 "2007-09-04T05:00:35Z")

</div>

I’m trying to write a proggy to help me figure out how long it will take to pay off a credit card based on a payment value. The card can have multiple sections with different owed amounts and aprs. Since the credit c…

---

## [Credit card Calculating](https://www.ruby-forum.com/t/credit-card-calculating/113700)

<div class="topic-metadata">

**Author:** [@cghost](https://www.ruby-forum.com/u/cghost)\
**Replies:** 0\
**Last updated:** [September 4, 2007, 3:47am UTC](https://www.ruby-forum.com/t/credit-card-calculating/113700 "2007-09-04T03:47:02Z")

</div>

I posted a question earlier about hashes. Link: Array of hashes: finding hash with min value for key - Ruby - Ruby-Forum Stephan answered my question most elegantly. I say this because the code I put together is a b…

---

## [Reformat with Hpricot?](https://www.ruby-forum.com/t/reformat-with-hpricot/112817)

<div class="topic-metadata">

**Author:** [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Replies:** 1\
**Last updated:** [September 4, 2007, 2:47am UTC](https://www.ruby-forum.com/t/reformat-with-hpricot/112817 "2007-09-04T02:47:31Z")

</div>

Rubies: Here’s how to indent with REXML: doc = Document.new(’’) indent\_spaces = 2 doc.write($stdout, indent\_space) That produces: How can Hpricot “pretty print” like that??

---

## [I don't get how the method is added in this case](https://www.ruby-forum.com/t/i-dont-get-how-the-method-is-added-in-this-case/113693)

<div class="topic-metadata">

**Author:** [@overworked\_phd](https://www.ruby-forum.com/u/overworked_phd)\
**Replies:** 4\
**Last updated:** [September 4, 2007, 2:40am UTC](https://www.ruby-forum.com/t/i-dont-get-how-the-method-is-added-in-this-case/113693 "2007-09-04T02:40:14Z")

</div>

I have the following #!/usr/bin/ruby -w require ‘net/http’ h=Net::HTTP.new(‘www.pragmaticprogrammer.com’,80) response=h.get(‘/index.html’,nil) if(response.message==“OK”) puts response.body.scan(/\<img src=“(.\*?)”/m)…

---

## [Inconsistent results using Iconv](https://www.ruby-forum.com/t/inconsistent-results-using-iconv/113620)

<div class="topic-metadata">

**Author:** [@rsl](https://www.ruby-forum.com/u/rsl)\
**Replies:** 4\
**Last updated:** [September 4, 2007, 12:49am UTC](https://www.ruby-forum.com/t/inconsistent-results-using-iconv/113620 "2007-09-04T00:49:27Z")

</div>

Howdy. I’m working with Iconv and discovered that this code require “iconv” \[“Ã¦gis”, “straÃŸe”, “kierkegÃ¥rd”, “joÃ£o”, “bjÃ¸rk”\].each do |word| puts “#{word} =\> #{Iconv.iconv(‘ascii//translit’, ‘utf-8’, word)}” end …

---

## [G3d](https://www.ruby-forum.com/t/g3d/113691)

<div class="topic-metadata">

**Author:** [@Benjohn\_B](https://www.ruby-forum.com/u/Benjohn_B)\
**Replies:** 1\
**Last updated:** [September 3, 2007, 11:54pm UTC](https://www.ruby-forum.com/t/g3d/113691 "2007-09-03T23:54:23Z")

</div>

I’ve just bumped in to this: http://g3d-ruby.rubyforge.org/ I don’t see mention of this in the archives, so I thought I’d post a link here, what with all the recent talk of game and graphics libraries for Ruby (Sorry…

---

## [Hopefully my last range date question](https://www.ruby-forum.com/t/hopefully-my-last-range-date-question/113686)

<div class="topic-metadata">

**Author:** [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Replies:** 0\
**Last updated:** [September 3, 2007, 10:54pm UTC](https://www.ruby-forum.com/t/hopefully-my-last-range-date-question/113686 "2007-09-03T22:54:14Z")

</div>

require ‘rubygems’ require ‘ruport’ require ‘ruport/util’ require ‘date’ require ‘optparse’ opts = OptionParser.new do |opts| opts.on("-h", “–help”, “Displays this help.”) do |a| puts opts end opts.on("-s", “–st…

---

## [I write Ruby Tk application on Window XP](https://www.ruby-forum.com/t/i-write-ruby-tk-application-on-window-xp/113637)

<div class="topic-metadata">

**Author:** [@kimngan](https://www.ruby-forum.com/u/kimngan)\
**Replies:** 2\
**Last updated:** [September 3, 2007, 7:22pm UTC](https://www.ruby-forum.com/t/i-write-ruby-tk-application-on-window-xp/113637 "2007-09-03T19:22:04Z")

</div>

I write Ruby Tk application on Window XP, use ActiveTc18.4.14.0, namely Tk::TkTable vÃ Tk::Iwidgets::Dialog. After that packaged by Rubyscript2exe, when run the application there is an error report : â€œPackage canâ€…

---

## [WebServices & WSDL](https://www.ruby-forum.com/t/webservices-wsdl/113457)

<div class="topic-metadata">

**Author:** [@sirtyman](https://www.ruby-forum.com/u/sirtyman)\
**Replies:** 4\
**Last updated:** [September 3, 2007, 7:21pm UTC](https://www.ruby-forum.com/t/webservices-wsdl/113457 "2007-09-03T19:21:23Z")

</div>

Hi guys, Here is a part of my code (part o my class): @soaps\<\<SOAP::WSDLDriverFactory.new("http://#{@Address}:#{@wsPort}/#{wsdl}").create\_rpc\_driver() def method\_missing(m,\*args) @soaps.each do |soap| begin resul…

---

## [SQLIte3 DL driver deprecated, how to use native?](https://www.ruby-forum.com/t/sqlite3-dl-driver-deprecated-how-to-use-native/113268)

<div class="topic-metadata">

**Author:** [@Eddie\_Catflap](https://www.ruby-forum.com/u/Eddie_Catflap)\
**Replies:** 3\
**Last updated:** [September 3, 2007, 6:19pm UTC](https://www.ruby-forum.com/t/sqlite3-dl-driver-deprecated-how-to-use-native/113268 "2007-09-03T18:19:09Z")

</div>

Hi. I’m writing what’s pretty much my first piece of code using Ruby. Very happy with it so far and have managed to cobble together a bit of code to archive a large amount of text (basically a message board archive)…

---

## [Seeing the source](https://www.ruby-forum.com/t/seeing-the-source/113543)

<div class="topic-metadata">

**Author:** [@mangoosta](https://www.ruby-forum.com/u/mangoosta)\
**Replies:** 40\
**Last updated:** [September 3, 2007, 5:52pm UTC](https://www.ruby-forum.com/t/seeing-the-source/113543 "2007-09-03T17:52:06Z")

</div>

Hello. I’m new to Ruby (and also to scripting languages). I’d like to know if, since Ruby is a scripting language, there’s a way to hide the code when deploying an application. I’d users to be unable to see the source…

---

## [Have you tried RMagick 2.0.0 beta?](https://www.ruby-forum.com/t/have-you-tried-rmagick-2-0-0-beta/196453)

<div class="topic-metadata">

**Author:** [@timhunter](https://www.ruby-forum.com/u/timhunter)\
**Replies:** 0\
**Last updated:** [September 3, 2007, 4:56pm UTC](https://www.ruby-forum.com/t/have-you-tried-rmagick-2-0-0-beta/196453 "2007-09-03T16:56:54Z")

</div>

The RMagick 2.0.0 beta release has been available for about a month now (http://rubyforge.org/frs/?group\_id=12). If you’ve installed it please let me know what your experience has been. I need to hear from users who h…

---

## [Idiomatic way to assign if not nil?](https://www.ruby-forum.com/t/idiomatic-way-to-assign-if-not-nil/113230)

<div class="topic-metadata">

**Author:** [@jay-levitt](https://www.ruby-forum.com/u/jay-levitt)\
**Replies:** 20\
**Last updated:** [September 3, 2007, 4:50pm UTC](https://www.ruby-forum.com/t/idiomatic-way-to-assign-if-not-nil/113230 "2007-09-03T16:50:49Z")

</div>

I know I can use “a ||= b” to assign b to a if a is nil. But what about an equivalent to a = b if b Does that exist in a DRYer form?

---

## [RMagick 1.14.1 win32 gem with fix for RubyGems 0.9.4](https://www.ruby-forum.com/t/rmagick-1-14-1-win32-gem-with-fix-for-rubygems-0-9-4/113663)

<div class="topic-metadata">

**Author:** [@timhunter](https://www.ruby-forum.com/u/timhunter)\
**Replies:** 0\
**Last updated:** [September 3, 2007, 4:40pm UTC](https://www.ruby-forum.com/t/rmagick-1-14-1-win32-gem-with-fix-for-rubygems-0-9-4/113663 "2007-09-03T16:40:47Z")

</div>

I’ve uploaded a new version of the RMagick 1.14.1 binary gem for Win32. This version has a fix for the “NoMethodError” problems that occur when using RubyGems 0.9.3 and later. See \[http://rubyforge.org/forum/forum.php…

---

## [Blocking UDP recv() interaction with select()](https://www.ruby-forum.com/t/blocking-udp-recv-interaction-with-select/113626)

<div class="topic-metadata">

**Author:** [@zvilius](https://www.ruby-forum.com/u/zvilius)\
**Replies:** 2\
**Last updated:** [September 3, 2007, 4:30pm UTC](https://www.ruby-forum.com/t/blocking-udp-recv-interaction-with-select/113626 "2007-09-03T16:30:43Z")

</div>

I want to use Ruby for a UDP server application under Windows XP. I intend to use two threads: one for a simple UI, and a separate thread for the UDP server (with blocking calls). As a proof of concept I wrote the fol…

---

## [SQLite 3 and Ruby Wierd errors](https://www.ruby-forum.com/t/sqlite-3-and-ruby-wierd-errors/113138)

<div class="topic-metadata">

**Author:** [@ssyed](https://www.ruby-forum.com/u/ssyed)\
**Replies:** 3\
**Last updated:** [September 3, 2007, 3:46pm UTC](https://www.ruby-forum.com/t/sqlite-3-and-ruby-wierd-errors/113138 "2007-09-03T15:46:35Z")

</div>

Hi, I created a sqlite3 database and I get the wierdest error: Sometimes it will say that I don’t have a table named ‘account’ (Even though I do have this table) and other times it just loads perfectly! Any Idea why …

---

## [How does ruby handle overloading?](https://www.ruby-forum.com/t/how-does-ruby-handle-overloading/113595)

<div class="topic-metadata">

**Author:** [@pongba](https://www.ruby-forum.com/u/pongba)\
**Replies:** 12\
**Last updated:** [September 3, 2007, 1:35pm UTC](https://www.ruby-forum.com/t/how-does-ruby-handle-overloading/113595 "2007-09-03T13:35:22Z")

</div>

Matz once replied on Cedric’s blog that I am not against “method overloading”, but it very easily leads to optional static typing in the language, which changes the language very drastically, since you need to specify…

---

## [Bug in % (Float)?](https://www.ruby-forum.com/t/bug-in-float/113340)

<div class="topic-metadata">

**Author:** [@chuck](https://www.ruby-forum.com/u/chuck)\
**Replies:** 24\
**Last updated:** [September 3, 2007, 12:30pm UTC](https://www.ruby-forum.com/t/bug-in-float/113340 "2007-09-03T12:30:10Z")

</div>

Modulo should be a fairly simple operation, however I’m finding some very odd results and am wondering what is going on… For instance: irb(main):001:0\> 1 % 0.1 =\> 0.1 Shouldn’t 1 % 0.1 be 0.0 and not 0.1? Also, look…

---

## [How to extend a method?](https://www.ruby-forum.com/t/how-to-extend-a-method/113599)

<div class="topic-metadata">

**Author:** [@Ye\_Dingding](https://www.ruby-forum.com/u/Ye_Dingding)\
**Replies:** 3\
**Last updated:** [September 3, 2007, 11:12am UTC](https://www.ruby-forum.com/t/how-to-extend-a-method/113599 "2007-09-03T11:12:53Z")

</div>

Class A attr\_accessor :a def initialize self.a = ‘a’ end end I want to extend class A and add a new instance variable b. How can i do this? Class A attr\_accessor :b def initialize How can i initialize the varia…

---

## [Hash.new with a block?](https://www.ruby-forum.com/t/hash-new-with-a-block/113633)

<div class="topic-metadata">

**Author:** [@7stud](https://www.ruby-forum.com/u/7stud)\
**Replies:** 5\
**Last updated:** [September 3, 2007, 10:03am UTC](https://www.ruby-forum.com/t/hash-new-with-a-block/113633 "2007-09-03T10:03:48Z")

</div>

Hi, In the code: h = Hash.new {|hash, key| hash\[key\] = \[\]} what method is yielding the values hash, key to the code block? It doesn’t seem like it could be new() since new() isn’t called when you lookup a key in a …

---

## [Dispatching when function name is stated as a symbol](https://www.ruby-forum.com/t/dispatching-when-function-name-is-stated-as-a-symbol/113460)

<div class="topic-metadata">

**Author:** [@ronaldfischer](https://www.ruby-forum.com/u/ronaldfischer)\
**Replies:** 6\
**Last updated:** [September 3, 2007, 9:34am UTC](https://www.ruby-forum.com/t/dispatching-when-function-name-is-stated-as-a-symbol/113460 "2007-09-03T09:34:46Z")

</div>

Can someone point out an elegant way to solve the following problem? I have a module with a function f and additional functions g1, g2, …, which basically looks like this: module M def f(&cb) … x=cb.call # DO SOME…

---

## [\[BUG\] non-initialized struct](https://www.ruby-forum.com/t/bug-non-initialized-struct/113583)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 5\
**Last updated:** [September 3, 2007, 7:54am UTC](https://www.ruby-forum.com/t/bug-non-initialized-struct/113583 "2007-09-03T07:54:31Z")

</div>

e$B0J2\<$N$h$&$K$9$k$He(B \[BUG\] e$B$,=P$^$9!#e(B % ./ruby -ve ’ S = Struct.new(:a) s = Marshal.dump(S.new(1)) class Object remove\_const :S end class S end p Marshal.load(s)’ ruby 1.9.0 (2007-09-01 patchlevel 0) …

---

## [2 Way encryption for password](https://www.ruby-forum.com/t/2-way-encryption-for-password/113588)

<div class="topic-metadata">

**Author:** [@mobileamusement](https://www.ruby-forum.com/u/mobileamusement)\
**Replies:** 4\
**Last updated:** [September 3, 2007, 7:33am UTC](https://www.ruby-forum.com/t/2-way-encryption-for-password/113588 "2007-09-03T07:33:24Z")

</div>

Hi I’m creating a password database (a dangerous thing to do, I know!) normally I’d hash the passwords for storage in the DB, but in this case I need to be able to also reverse them to their original state. I’m famil…

---

## [Calendar events](https://www.ruby-forum.com/t/calendar-events/113572)

<div class="topic-metadata">

**Author:** [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Replies:** 7\
**Last updated:** [September 3, 2007, 3:44am UTC](https://www.ruby-forum.com/t/calendar-events/113572 "2007-09-03T03:44:18Z")

</div>

i want a simply get the amount of days inbetween a range of dates. IE: 1/25 - 2/3 is 8 days difference. My initial approach the the problem was to create a huge variable setup: jan = 31 #31 = days in january feb = 2…

---

## [Extract a range start/end?](https://www.ruby-forum.com/t/extract-a-range-start-end/113614)

<div class="topic-metadata">

**Author:** [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Replies:** 10\
**Last updated:** [September 3, 2007, 1:50am UTC](https://www.ruby-forum.com/t/extract-a-range-start-end/113614 "2007-09-03T01:50:07Z")

</div>

if i have a list of dates in an array such as: 4/2/07 4/3/07 4/4/07 4/5/07 4/6/07 4/7/07 4/8/07 ect. how would i…based on option parse…pull a starting point and end point of to extract that data range. IE: op…

---

## [Ruby Central down?](https://www.ruby-forum.com/t/ruby-central-down/113580)

<div class="topic-metadata">

**Author:** [@MSEdward\_SEdS\_Bora](https://www.ruby-forum.com/u/MSEdward_SEdS_Bora)\
**Replies:** 7\
**Last updated:** [September 3, 2007, 1:46am UTC](https://www.ruby-forum.com/t/ruby-central-down/113580 "2007-09-03T01:46:07Z")

</div>

\-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Is Ruby Central down? I was trying to point some folks at the Regional Ruby Conference page and it reports Service Temporarily Unavailable The server is temporarily unab…

---

## [How to find and install rubygems on Cygwin](https://www.ruby-forum.com/t/how-to-find-and-install-rubygems-on-cygwin/113618)

<div class="topic-metadata">

**Author:** [@wpvanpaassen](https://www.ruby-forum.com/u/wpvanpaassen)\
**Replies:** 3\
**Last updated:** [September 3, 2007, 12:38am UTC](https://www.ruby-forum.com/t/how-to-find-and-install-rubygems-on-cygwin/113618 "2007-09-03T00:38:03Z")

</div>

I’m a newbie as far as Ruby goes, and I want to install rubygems in Cygwin. I have Ruby installed, but I don’t know what I need to install gems. This message shows that it can’t find, or I don’t have the files neede…

---

## [How can I debug a JRuby class that is invoked from a Java ap](https://www.ruby-forum.com/t/how-can-i-debug-a-jruby-class-that-is-invoked-from-a-java-ap/113609)

<div class="topic-metadata">

**Author:** [@luis](https://www.ruby-forum.com/u/luis)\
**Replies:** 3\
**Last updated:** [September 2, 2007, 11:32pm UTC](https://www.ruby-forum.com/t/how-can-i-debug-a-jruby-class-that-is-invoked-from-a-java-ap/113609 "2007-09-02T23:32:55Z")

</div>

I am using JRuby (through the standard JRE 6 support) to add some Ruby classes to a big existing Java application. This application is started as usual as any Java app (by running a main method), and it eventually cal…

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

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