# Ruby

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

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

---

## [Need help translating Ruby code](https://www.ruby-forum.com/t/need-help-translating-ruby-code/148087)

<div class="topic-metadata">

**Author:** [@kturner](https://www.ruby-forum.com/u/kturner)\
**Replies:** 1\
**Last updated:** [September 9, 2008, 5:01pm UTC](https://www.ruby-forum.com/t/need-help-translating-ruby-code/148087 "2008-09-09T17:01:15Z")

</div>

Hi I am new to Ruby from Python and am still learning some stuff. I have a Ruby program that uses the mechanize library to connect to a Web site and authenticate with a username and password. The issue I have is tha…

---

## [Per suite unit test setup and teardown](https://www.ruby-forum.com/t/per-suite-unit-test-setup-and-teardown/147100)

<div class="topic-metadata">

**Author:** [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Replies:** 7\
**Last updated:** [September 9, 2008, 4:21pm UTC](https://www.ruby-forum.com/t/per-suite-unit-test-setup-and-teardown/147100 "2008-09-09T16:21:13Z")

</div>

I am putting some tests together that need to access an external service which I can use setup() and teardown() to control. The problem is that these methods are run before and after each test, this slows things down …

---

## [Telnet client](https://www.ruby-forum.com/t/telnet-client/147989)

<div class="topic-metadata">

**Author:** [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Replies:** 3\
**Last updated:** [September 9, 2008, 4:17pm UTC](https://www.ruby-forum.com/t/telnet-client/147989 "2008-09-09T16:17:41Z")

</div>

I use ruby wrote a Telnet client application. It works fine until users want to change a user name or telnet to other host. I found all these failed operations are related with “su -” command or login. How can I let r…

---

## [Optimize bigdivrem Part 4](https://www.ruby-forum.com/t/optimize-bigdivrem-part-4/148121)

<div class="topic-metadata">

**Author:** [@TOYOFUKU\_Chikanobu](https://www.ruby-forum.com/u/TOYOFUKU_Chikanobu)\
**Replies:** 0\
**Last updated:** [September 9, 2008, 3:30pm UTC](https://www.ruby-forum.com/t/optimize-bigdivrem-part-4/148121 "2008-09-09T15:30:40Z")

</div>

e$BK-J!$G$9!#e(B big2str\_karatsuba e$B$Ge(B bigdivmod e$B$K$h$j5a$a$?\>&$HM\>$j$Ne(B Bignum e$B$ND9$5$,:GE,$JD9$5$H?)$$0c$o$J$$$h$&$K$7$^$9!#e(B e$B8=:\_$3$N?)$$0c$$$,$"$C$F$b9,$$LdBj$O5/$-$^$;$s$,8=\>u$,K\>$^$7$$e(B e$B…

---

## [Expectations : help](https://www.ruby-forum.com/t/expectations-help/148119)

<div class="topic-metadata">

**Author:** [@micheldogger](https://www.ruby-forum.com/u/micheldogger)\
**Replies:** 0\
**Last updated:** [September 9, 2008, 3:25pm UTC](https://www.ruby-forum.com/t/expectations-help/148119 "2008-09-09T15:25:29Z")

</div>

This worked in previous Expectations releases : def expect\_true &block expect(true, &block) end def expect\_false &block expect(false, &block) end but gives an error in the last release. I’d like to understand… T…

---

## [Re: "Pointer" to an object? (i.e. reflect changes to origina](https://www.ruby-forum.com/t/re-pointer-to-an-object-i-e-reflect-changes-to-origina/148118)

<div class="topic-metadata">

**Author:** [@stickstone](https://www.ruby-forum.com/u/stickstone)\
**Replies:** 1\
**Last updated:** [September 9, 2008, 3:18pm UTC](https://www.ruby-forum.com/t/re-pointer-to-an-object-i-e-reflect-changes-to-origina/148118 "2008-09-09T15:18:20Z")

</div>

Both lambda and proc work as well, incidentally. Actually, from what I’ve read they’re identical in 1.8 (which is what I’m using), but not in 1.9, Not exactly. lambda and Proc are different to each other in both…

---

## [Hash custom sort? Overriding \<=\>? Help!](https://www.ruby-forum.com/t/hash-custom-sort-overriding-help/148012)

<div class="topic-metadata">

**Author:** [@blink](https://www.ruby-forum.com/u/blink)\
**Replies:** 3\
**Last updated:** [September 9, 2008, 3:12pm UTC](https://www.ruby-forum.com/t/hash-custom-sort-overriding-help/148012 "2008-09-09T15:12:28Z")

</div>

This is a pretty ugly hash. The keys are objects. I’m afraid after going down a few paths, it was a bit over my head. Here’s the hash: \[\[#\<Company id: 13, name: “Company Test 1”, created\_at: “2008-09-03 04:05:58”, upd…

---

## [Connecting to SQL Server](https://www.ruby-forum.com/t/connecting-to-sql-server/147710)

<div class="topic-metadata">

**Author:** [@Clinton\_DSJudy](https://www.ruby-forum.com/u/Clinton_DSJudy)\
**Replies:** 2\
**Last updated:** [September 9, 2008, 2:49pm UTC](https://www.ruby-forum.com/t/connecting-to-sql-server/147710 "2008-09-09T14:49:37Z")

</div>

So ActiveRecord has failed me. The sqlserver module isn’t complete, and I’m getting “zombie state” errors, essentially because Rails wants to maintain a connection to SQL server and SQL server is used to ASP.net makin…

---

## [Re: Telnet client](https://www.ruby-forum.com/t/re-telnet-client/148038)

<div class="topic-metadata">

**Author:** [@stickstone](https://www.ruby-forum.com/u/stickstone)\
**Replies:** 2\
**Last updated:** [September 9, 2008, 2:37pm UTC](https://www.ruby-forum.com/t/re-telnet-client/148038 "2008-09-09T14:37:18Z")

</div>

end end It simply get what user input and put it on the telnet server. I am having to guess here, but I imagine that tn is an instance of a Net::Telnet object? You haven’t described exactly what your problem is. I…

---

## [Oniguruma question](https://www.ruby-forum.com/t/oniguruma-question/147837)

<div class="topic-metadata">

**Author:** [@Kenneth\_McDonald](https://www.ruby-forum.com/u/Kenneth_McDonald)\
**Replies:** 3\
**Last updated:** [September 9, 2008, 1:12pm UTC](https://www.ruby-forum.com/t/oniguruma-question/147837 "2008-09-09T13:12:06Z")

</div>

With the following Oniguruma re: print “aabb”.index(/.+?(?\<!a)/) print “\\n” My reasoning tells me I should be getting 3, but I’m getting 0. Basically, the .+ should force the re ‘cursor’ past at least the first a; …

---

## [Postgres (or pg) closes backend on exit](https://www.ruby-forum.com/t/postgres-or-pg-closes-backend-on-exit/148110)

<div class="topic-metadata">

**Author:** [@hanholl](https://www.ruby-forum.com/u/hanholl)\
**Replies:** 0\
**Last updated:** [September 9, 2008, 1:00pm UTC](https://www.ruby-forum.com/t/postgres-or-pg-closes-backend-on-exit/148110 "2008-09-09T13:00:58Z")

</div>

(This is ruby-1.8.\[46\] on Linux). When I strace the following script: #!usr/bin/ruby -w require ‘postgres’ connection = PGconn.connect(nil,nil,nil,nil,‘palga’, ‘palga’, ‘Patologi’) end-of-script I see that it ends …

---

## [Collect](https://www.ruby-forum.com/t/collect/148104)

<div class="topic-metadata">

**Author:** [@sijo](https://www.ruby-forum.com/u/sijo)\
**Replies:** 1\
**Last updated:** [September 9, 2008, 12:26pm UTC](https://www.ruby-forum.com/t/collect/148104 "2008-09-09T12:26:28Z")

</div>

Hi I have to collect mail addresses like below Contact.find\_by\_id(problem.reported\_by\_id).contact\_email\_addresses.find(:all, :conditions =\> \[‘contact\_email\_address\_type\_id=?’,2\]) Executing above what i am getting is …

---

## [Soap4r - where to get it ?!](https://www.ruby-forum.com/t/soap4r-where-to-get-it/148054)

<div class="topic-metadata">

**Author:** [@Gilbert\_R](https://www.ruby-forum.com/u/Gilbert_R)\
**Replies:** 8\
**Last updated:** [September 9, 2008, 12:07pm UTC](https://www.ruby-forum.com/t/soap4r-where-to-get-it/148054 "2008-09-09T12:07:30Z")

</div>

Hi, need soap4r + httpclient to access a microsoft webservice on IIS with NTML authentication i googled but got 404 for = http://dev.ctor.org/soap4r and gem install didn’t work either = gem install soap4r --include…

---

## [Is this a sensible implementation for Array#group\_by?](https://www.ruby-forum.com/t/is-this-a-sensible-implementation-for-array-group-by/148055)

<div class="topic-metadata">

**Author:** [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Replies:** 7\
**Last updated:** [September 9, 2008, 10:49am UTC](https://www.ruby-forum.com/t/is-this-a-sensible-implementation-for-array-group-by/148055 "2008-09-09T10:49:57Z")

</div>

I was looking for a method to split an array into smaller arrays based on some property of the members (set with a code block). I came up with the following and wanted to know what you guys think about a) whether it’…

---

## [CompTree: Parallel Computation Tree](https://www.ruby-forum.com/t/comptree-parallel-computation-tree/148097)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [September 9, 2008, 9:10am UTC](https://www.ruby-forum.com/t/comptree-parallel-computation-tree/148097 "2008-09-09T09:10:45Z")

</div>

= CompTree: Parallel Computation Tree == Synopsis require ‘comp\_tree’ CompTree::Driver.new { |driver| # Define a function named 'area' taking these three arguments. driver.define\_area(:width, :height, :offset) { |wid…

---

## [Oniguruma question](https://www.ruby-forum.com/t/oniguruma-question/148035)

<div class="topic-metadata">

**Author:** [@Kenneth\_McDonald](https://www.ruby-forum.com/u/Kenneth_McDonald)\
**Replies:** 7\
**Last updated:** [September 9, 2008, 8:30am UTC](https://www.ruby-forum.com/t/oniguruma-question/148035 "2008-09-09T08:30:55Z")

</div>

For those adventurous souls who are already using Oniguruma… With the following Oniguruma re: print “aabb”.index(/.+?(?\<!a)/) print “\\n” My reasoning tells me I should be getting 3, but I’m getting 0. Basically, th…

---

## [How to analysis a packet?](https://www.ruby-forum.com/t/how-to-analysis-a-packet/147680)

<div class="topic-metadata">

**Author:** [@slaughter](https://www.ruby-forum.com/u/slaughter)\
**Replies:** 3\
**Last updated:** [September 9, 2008, 6:51am UTC](https://www.ruby-forum.com/t/how-to-analysis-a-packet/147680 "2008-09-09T06:51:28Z")

</div>

Hello all, I need to send SNMP packets and check whether SNMP-Response packets are received. I was looking at rubyforger, which seems to allow me to do this quite easily. However, rubyforger is dependent on ruby pcap …

---

## [\#to\_self](https://www.ruby-forum.com/t/to-self/147948)

<div class="topic-metadata">

**Author:** [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Replies:** 6\
**Last updated:** [September 9, 2008, 3:36am UTC](https://www.ruby-forum.com/t/to-self/147948 "2008-09-09T03:36:34Z")

</div>

Say I have a mixin: module Grumpy def grumpize to\_s.upcase + ‘!!!’ end end class String include Grumpy end “fun”.grumpize #=\> “FUN!!!” Now, class Symbol include Grumpy end :fun.grumpize #=\> “FUN!!!” But,…

---

## [Convert ascii codes in a string to a string of characters](https://www.ruby-forum.com/t/convert-ascii-codes-in-a-string-to-a-string-of-characters/147990)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 4\
**Last updated:** [September 9, 2008, 1:30am UTC](https://www.ruby-forum.com/t/convert-ascii-codes-in-a-string-to-a-string-of-characters/147990 "2008-09-09T01:30:29Z")

</div>

Is there a more efficient way to convert a string such as “abcdef” to “abcdef” ? Currently I am doing the following: a=“abcdef” a.delete!("&#") ar = a.split(’;’) arn = ar.collect { |s| Integer(s) } s = arn.pack(“U…

---

## ["Pointer" to an object? (i.e. reflect changes to original)](https://www.ruby-forum.com/t/pointer-to-an-object-i-e-reflect-changes-to-original/148043)

<div class="topic-metadata">

**Author:** [@carluva](https://www.ruby-forum.com/u/carluva)\
**Replies:** 7\
**Last updated:** [September 9, 2008, 1:15am UTC](https://www.ruby-forum.com/t/pointer-to-an-object-i-e-reflect-changes-to-original/148043 "2008-09-09T01:15:37Z")

</div>

Hi, I’ve already made a post similar to this on the Rails list, so I apologize to anyone who subscribes to both for being repetitive. From what I’ve read, it seems to be impossible to create “pointers” in Ruby, such…

---

## [Code Review: InfiniteRubyRecursion1](https://www.ruby-forum.com/t/code-review-infiniterubyrecursion1/148079)

<div class="topic-metadata">

**Author:** [@curthibbs](https://www.ruby-forum.com/u/curthibbs)\
**Replies:** 0\
**Last updated:** [September 9, 2008, 12:53am UTC](https://www.ruby-forum.com/t/code-review-infiniterubyrecursion1/148079 "2008-09-09T00:53:58Z")

</div>

tfpt review “/shelveset:InfiniteRubyRecursion1;REDMOND\\curth” Comment : Fix recursive behavior in Array.flatten and Hash.to\_s Maintain multiple recursion trackers for different operations

---

## [Verifying MySQL connection options in JRoR](https://www.ruby-forum.com/t/verifying-mysql-connection-options-in-jror/144530)

<div class="topic-metadata">

**Author:** [@weyus](https://www.ruby-forum.com/u/weyus)\
**Replies:** 5\
**Last updated:** [September 8, 2008, 11:48pm UTC](https://www.ruby-forum.com/t/verifying-mysql-connection-options-in-jror/144530 "2008-09-08T23:48:22Z")

</div>

All, I am attempting to deploy a Rails app. via the Goldspike plugin into a Websphere container. I can’t seem to find a definitive place that summarizes the different ways to connect to MySQL from within JRoR, so I …

---

## [Access webservice on IIS with kerberos](https://www.ruby-forum.com/t/access-webservice-on-iis-with-kerberos/148072)

<div class="topic-metadata">

**Author:** [@Gilbert\_R](https://www.ruby-forum.com/u/Gilbert_R)\
**Replies:** 0\
**Last updated:** [September 8, 2008, 11:37pm UTC](https://www.ruby-forum.com/t/access-webservice-on-iis-with-kerberos/148072 "2008-09-08T23:37:49Z")

</div>

Hi, i need to access a webservice running on windows IIs 6.0 with kerberos authentication Is that possible with ruby, what libraries do i need ? yes, i already googled = http://www.google.de/search?hl=de&q=ruby%2Bw…

---

## [Parsing a CSV file column-wise](https://www.ruby-forum.com/t/parsing-a-csv-file-column-wise/147399)

<div class="topic-metadata">

**Author:** [@chrislo](https://www.ruby-forum.com/u/chrislo)\
**Replies:** 14\
**Last updated:** [September 8, 2008, 11:37pm UTC](https://www.ruby-forum.com/t/parsing-a-csv-file-column-wise/147399 "2008-09-08T23:37:49Z")

</div>

Is there a short-cut to parsing a CSV file column-wise using any of the available Ruby CSV libraries ? For example, at the moment I have: require ‘csv’ data = “1,2,3\\n4,5,6\\n7,8,9” CSV::parse(data) # =\> \[\[“1”, “2”…

---

## [Testing the Gateway](https://www.ruby-forum.com/t/testing-the-gateway/148069)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 0\
**Last updated:** [September 8, 2008, 11:37pm UTC](https://www.ruby-forum.com/t/testing-the-gateway/148069 "2008-09-08T23:37:48Z")

</div>

Please ignore. James Edward G. II

---

## [Grammar 0.8](https://www.ruby-forum.com/t/grammar-0-8/147924)

<div class="topic-metadata">

**Author:** [@snowbird122](https://www.ruby-forum.com/u/snowbird122)\
**Replies:** 3\
**Last updated:** [September 8, 2008, 8:59pm UTC](https://www.ruby-forum.com/t/grammar-0-8/147924 "2008-09-08T20:59:54Z")

</div>

Since I was giving a presentation about Grammar at the Lonestar Ruby Conference (which ended today), I thought it was about time to release another version of Grammar. I posted it yesterday here: http://rubyforge.org…

---

## [OpenSSL Test Failure](https://www.ruby-forum.com/t/openssl-test-failure/147785)

<div class="topic-metadata">

**Author:** [@sugie](https://www.ruby-forum.com/u/sugie)\
**Replies:** 4\
**Last updated:** [September 8, 2008, 8:50pm UTC](https://www.ruby-forum.com/t/openssl-test-failure/147785 "2008-09-08T20:50:27Z")

</div>

e$B:XF#$G$9!#e(B e$B7k9=A0$+$i$J$N$G$9$,!"\<+J,$N4D6-e(B(Debian lenny on x86)e$B$G$Oe(Btest-alle$B$,\<:GT$7$^$9!#e(B Failure: test\_client\_session(OpenSSL::TestSSL) \[/home/tadashi/svn/ruby/trunk/test/openssl/test\_ssl.…

---

## [ActiveRecord::StatementInvalid in UserController#login](https://www.ruby-forum.com/t/activerecord-statementinvalid-in-usercontroller-login/148058)

<div class="topic-metadata">

**Author:** [@simonsaid](https://www.ruby-forum.com/u/simonsaid)\
**Replies:** 1\
**Last updated:** [September 8, 2008, 7:31pm UTC](https://www.ruby-forum.com/t/activerecord-statementinvalid-in-usercontroller-login/148058 "2008-09-08T19:31:59Z")

</div>

I am trying to implement the authentication code that is in the book Ruby on Rails Made easy. Everything work fine until I try actually loggin in as a user I get the following error: ActiveRecord::StatementInvalid in…

---

## [Single backslash in a string. How?](https://www.ruby-forum.com/t/single-backslash-in-a-string-how/148034)

<div class="topic-metadata">

**Author:** [@raffuk](https://www.ruby-forum.com/u/raffuk)\
**Replies:** 10\
**Last updated:** [September 8, 2008, 6:21pm UTC](https://www.ruby-forum.com/t/single-backslash-in-a-string-how/148034 "2008-09-08T18:21:31Z")

</div>

Is it possible to have a string with a single backslash? I want var to have the value “\\foo” And when I do something like: var = “\\foo” I get “foo” But when I do: var = “\\foo” I get “\\foo” And when I do: var =…

---

## [Rutema 0.9.0 Released](https://www.ruby-forum.com/t/rutema-0-9-0-released/148053)

<div class="topic-metadata">

**Author:** [@Vassilis\_R](https://www.ruby-forum.com/u/Vassilis_R)\
**Replies:** 0\
**Last updated:** [September 8, 2008, 6:11pm UTC](https://www.ruby-forum.com/t/rutema-0-9-0-released/148053 "2008-09-08T18:11:30Z")

</div>

rutema version 0.9.0 has been released! DESCRIPTION: rutema is a test execution tool with a twist. It allows you to combine test tools while it takes care of logging, reporting, archiving of results and formalizes ex…

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

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