# Ruby

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

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

---

## [Objects or variables?](https://www.ruby-forum.com/t/objects-or-variables/117834)

<div class="topic-metadata">

**Author:** [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Replies:** 3\
**Last updated:** [October 21, 2007, 9:55am UTC](https://www.ruby-forum.com/t/objects-or-variables/117834 "2007-10-21T09:55:59Z")

</div>

I’m going by “Why’s (poignant) Guide to Ruby”: starmonkey = ratchet.attach( captive\_monkey, captive\_star ) The ratchet gets an attach message. What needs to be attached? The method arguments: the captive\_monkey and th…

---

## [Float::MIN Not an actual minimum?](https://www.ruby-forum.com/t/float-min-not-an-actual-minimum/117839)

<div class="topic-metadata">

**Author:** [@christian](https://www.ruby-forum.com/u/christian)\
**Replies:** 0\
**Last updated:** [October 21, 2007, 9:30am UTC](https://www.ruby-forum.com/t/float-min-not-an-actual-minimum/117839 "2007-10-21T09:30:15Z")

</div>

I was curious as to why it would be possible to perform operations that did not result in zero, on a number smaller than Float::MIN. To me Float::MIN should be the smallest representable number that is not 0, yet on …

---

## [1.9 Prime class change request](https://www.ruby-forum.com/t/1-9-prime-class-change-request/117777)

<div class="topic-metadata">

**Author:** [@C\_Erler](https://www.ruby-forum.com/u/C_Erler)\
**Replies:** 1\
**Last updated:** [October 21, 2007, 8:08am UTC](https://www.ruby-forum.com/t/1-9-prime-class-change-request/117777 "2007-10-21T08:08:26Z")

</div>

In mathn.rb, please remove the method Prime.cache and its aliases, since it is an exposed implementation detail. If we later switch to a faster algorithm that doesn’t use a cache, backward compatibility issues will b…

---

## [The level of Ruby programmers vs PHP's](https://www.ruby-forum.com/t/the-level-of-ruby-programmers-vs-phps/117674)

<div class="topic-metadata">

**Author:** [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Replies:** 17\
**Last updated:** [October 21, 2007, 7:38am UTC](https://www.ruby-forum.com/t/the-level-of-ruby-programmers-vs-phps/117674 "2007-10-21T07:38:06Z")

</div>

i asked the same question on Ruby: how do you write some code to print out the variable’s name automatically as well as its content. In here, I got some helpful discussions and solutions. And this is what happen inste…

---

## [Snippits 0.5.0 Released](https://www.ruby-forum.com/t/snippits-0-5-0-released/117832)

<div class="topic-metadata">

**Author:** [@kuzb](https://www.ruby-forum.com/u/kuzb)\
**Replies:** 0\
**Last updated:** [October 21, 2007, 4:18am UTC](https://www.ruby-forum.com/t/snippits-0-5-0-released/117832 "2007-10-21T04:18:02Z")

</div>

snippits version 0.5.0 has been released! http://ben.kudria.net/code/snippits This is Ruby program that will type text for you. It uses ‘snippits’, small text files with a simple syntax to determine what to type…

---

## [LiveConsole 0.1.0 -- eval code against a running program with IRB](https://www.ruby-forum.com/t/liveconsole-0-1-0-eval-code-against-a-running-program-with-irb/117824)

<div class="topic-metadata">

**Author:** [@Pete\_E](https://www.ruby-forum.com/u/Pete_E)\
**Replies:** 2\
**Last updated:** [October 21, 2007, 2:13am UTC](https://www.ruby-forum.com/t/liveconsole-0-1-0-eval-code-against-a-running-program-with-irb/117824 "2007-10-21T02:13:01Z")

</div>

I quit my job, and that can only mean one thing: time to release a new gem. About: LiveConsole is a library for providing IRB over a TCP connection . If you add it to your application, you can run arbitrary code ag…

---

## [Using TkPhotoImage](https://www.ruby-forum.com/t/using-tkphotoimage/117809)

<div class="topic-metadata">

**Author:** [@Ed\_Redman](https://www.ruby-forum.com/u/Ed_Redman)\
**Replies:** 1\
**Last updated:** [October 21, 2007, 1:42am UTC](https://www.ruby-forum.com/t/using-tkphotoimage/117809 "2007-10-21T01:42:38Z")

</div>

I am trying to convert a set of cards from a tcl/tk program that uses data to create the image. I have been able to use a gif file to create the image but would like to data as the tcl program does. Here is the image …

---

## [What's the ruby way of grouping elements of an array?](https://www.ruby-forum.com/t/whats-the-ruby-way-of-grouping-elements-of-an-array/117741)

<div class="topic-metadata">

**Author:** [@ssk](https://www.ruby-forum.com/u/ssk)\
**Replies:** 5\
**Last updated:** [October 21, 2007, 1:18am UTC](https://www.ruby-forum.com/t/whats-the-ruby-way-of-grouping-elements-of-an-array/117741 "2007-10-21T01:18:06Z")

</div>

Hi, I thought this would be a common need but I couldn’t find a method. Let’s say I have an array of objects. I want to group the elements by a property of objects. people.group\_by do |person| person.age end The a…

---

## [Mind giving a little help?](https://www.ruby-forum.com/t/mind-giving-a-little-help/117458)

<div class="topic-metadata">

**Author:** [@superfly](https://www.ruby-forum.com/u/superfly)\
**Replies:** 12\
**Last updated:** [October 21, 2007, 12:54am UTC](https://www.ruby-forum.com/t/mind-giving-a-little-help/117458 "2007-10-21T00:54:38Z")

</div>

Hello everyone! I posted a topic a few days go and got an answer, and I think this would be the best place to ask my next question. I’m going to type out my ending goal of this program so you can get an idea of what …

---

## [Mms2r 1.1.11 Released](https://www.ruby-forum.com/t/mms2r-1-1-11-released/117826)

<div class="topic-metadata">

**Author:** [@mike-moscow](https://www.ruby-forum.com/u/mike-moscow)\
**Replies:** 0\
**Last updated:** [October 21, 2007, 12:41am UTC](https://www.ruby-forum.com/t/mms2r-1-1-11-released/117826 "2007-10-21T00:41:18Z")

</div>

mms2r version 1.1.11 has been released! http://mms2r.rubyforge.org/ DESCRIPTION: MMS2R is a library that decodes the parts of an MMS message to disk while stripping out advertising injected by the cellphone carrier…

---

## [Combinations listing](https://www.ruby-forum.com/t/combinations-listing/117570)

<div class="topic-metadata">

**Author:** [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Replies:** 19\
**Last updated:** [October 21, 2007, 12:21am UTC](https://www.ruby-forum.com/t/combinations-listing/117570 "2007-10-21T00:21:26Z")

</div>

Making an form of an anagram solver. My approach would be the code listed below but there has to be a cleaner way to do it. ################ puts "Word: " @@word = gets.chomp @@res = @@word.split(’’) def letters5 …

---

## [Ruby Online](https://www.ruby-forum.com/t/ruby-online/117786)

<div class="topic-metadata">

**Author:** [@superfly](https://www.ruby-forum.com/u/superfly)\
**Replies:** 7\
**Last updated:** [October 20, 2007, 8:31pm UTC](https://www.ruby-forum.com/t/ruby-online/117786 "2007-10-20T20:31:36Z")

</div>

I have a code that I would just like to place on a webpage. Do I NEED ruby on rails to do that? Can I just copy the code I have paste it in some special HTML code and it’ll work? All this program does is puts out word…

---

## [Capture code in a block](https://www.ruby-forum.com/t/capture-code-in-a-block/117769)

<div class="topic-metadata">

**Author:** [@Kristoph](https://www.ruby-forum.com/u/Kristoph)\
**Replies:** 2\
**Last updated:** [October 20, 2007, 7:40pm UTC](https://www.ruby-forum.com/t/capture-code-in-a-block/117769 "2007-10-20T19:40:42Z")

</div>

Greetings, How might I capture the code in a block so that I can serialize it for later use? So for example … file = CodeFile.new( ‘something.rb’) file.capture do puts ‘Hello World’ end … which prompts a file to b…

---

## [Read tables from SQL code](https://www.ruby-forum.com/t/read-tables-from-sql-code/117790)

<div class="topic-metadata">

**Author:** [@mihai](https://www.ruby-forum.com/u/mihai)\
**Replies:** 2\
**Last updated:** [October 20, 2007, 7:12pm UTC](https://www.ruby-forum.com/t/read-tables-from-sql-code/117790 "2007-10-20T19:12:33Z")

</div>

hi, i have a SQL code like this one: SELECT Select\_List FROM Table\_List \[WITH (BUFFERING = lExpr)\] \[WHERE Conditions\] \[GROUP BY Column\_List\] \[UNION Clause\] \[HAVING Conditions\] \[ORDER BY Column\_List\] \[INTO Claus…

---

## [Main-2.1.0](https://www.ruby-forum.com/t/main-2-1-0/117816)

<div class="topic-metadata">

**Author:** [@ara.t.howard](https://www.ruby-forum.com/u/ara.t.howard)\
**Replies:** 0\
**Last updated:** [October 20, 2007, 6:57pm UTC](https://www.ruby-forum.com/t/main-2-1-0/117816 "2007-10-20T18:57:21Z")

</div>

NAME main.rb SYNOPSIS a class factory and dsl for generating command line programs real quick URI http://rubyforge.org/projects/codeforpeople/ http://codeforpeople.com/lib/ruby/ INSTALL gem install main HISTORY …

---

## [Class instance variable idiom](https://www.ruby-forum.com/t/class-instance-variable-idiom/117544)

<div class="topic-metadata">

**Author:** [@pedz](https://www.ruby-forum.com/u/pedz)\
**Replies:** 26\
**Last updated:** [October 20, 2007, 6:42pm UTC](https://www.ruby-forum.com/t/class-instance-variable-idiom/117544 "2007-10-20T18:42:41Z")

</div>

I am using this technique for class instance variables: class \<\< self def set\_foo(s) @foo = s end alias :foo= :set\_foo def foo @foo end end Then to reference foo from an instance of the class (or subclass), I d…

---

## [Is it always the norm to skip 'return'?](https://www.ruby-forum.com/t/is-it-always-the-norm-to-skip-return/117713)

<div class="topic-metadata">

**Author:** [@tito](https://www.ruby-forum.com/u/tito)\
**Replies:** 23\
**Last updated:** [October 20, 2007, 6:12pm UTC](https://www.ruby-forum.com/t/is-it-always-the-norm-to-skip-return/117713 "2007-10-20T18:12:16Z")

</div>

Hello, I have a question about skipping the ‘return’ keyword in a Ruby method. For example: def self.encrypted\_password(password, salt) string\_to\_hash = password + salt Digest::SHA1.hexdigest(string\_to\_hash) end B…

---

## [Logon](https://www.ruby-forum.com/t/logon/117810)

<div class="topic-metadata">

**Author:** [@jacques](https://www.ruby-forum.com/u/jacques)\
**Replies:** 0\
**Last updated:** [October 20, 2007, 5:06pm UTC](https://www.ruby-forum.com/t/logon/117810 "2007-10-20T17:06:22Z")

</div>

How do i log on to the coupa server ? Its set up And runs on the server i dont no how to acess it from a nother computer on the same network. please help Regards Jacques

---

## [Rope Data Structures](https://www.ruby-forum.com/t/rope-data-structures/112743)

<div class="topic-metadata">

**Author:** [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Replies:** 8\
**Last updated:** [October 20, 2007, 3:04pm UTC](https://www.ruby-forum.com/t/rope-data-structures/112743 "2007-10-20T15:04:59Z")

</div>

Greetings All, I have been plugging away a a parser for ruby Endo’s DNA from this years International Functional Programming Completion. (http://www.icfpcontest.org/) Most teems who have put up there reviews have ta…

---

## [Contributor Request Failed](https://www.ruby-forum.com/t/contributor-request-failed/117804)

<div class="topic-metadata">

**Author:** [@adam](https://www.ruby-forum.com/u/adam)\
**Replies:** 0\
**Last updated:** [October 20, 2007, 3:03pm UTC](https://www.ruby-forum.com/t/contributor-request-failed/117804 "2007-10-20T15:03:14Z")

</div>

I sent a request to removed\_email\_address@domain.invalid to become a IronRuby Contributor. I got the following error. Any ides? Delivery to the following recipient failed permanently: removed\_email\_address@domain…

---

## [Ruby/Informix 0.6.2](https://www.ruby-forum.com/t/ruby-informix-0-6-2/117801)

<div class="topic-metadata">

**Author:** [@Gerardo\_SSGSSS\_mez](https://www.ruby-forum.com/u/Gerardo_SSGSSS_mez)\
**Replies:** 0\
**Last updated:** [October 20, 2007, 2:33pm UTC](https://www.ruby-forum.com/t/ruby-informix-0-6-2/117801 "2007-10-20T14:33:25Z")

</div>

This is a maintenance release that fixes a compilation error on the Microsoft Windows platform. Thanks to Joe Lanotte \<joe.lanotte at comcast dot net\> for his report. A precompiled binary gem for Windows is also provi…

---

## [Hash map during the creation of a new class instance?](https://www.ruby-forum.com/t/hash-map-during-the-creation-of-a-new-class-instance/117800)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [October 20, 2007, 2:25pm UTC](https://www.ruby-forum.com/t/hash-map-during-the-creation-of-a-new-class-instance/117800 "2007-10-20T14:25:49Z")

</div>

Hi, Is it possible to use a hash map during the creation of a new class instance? E.g. Test\_Case\_1.new(test = {:name =\> ‘case\_1’}) If so, what would the syntax be in the class initialisation method class Test\_Case\_…

---

## [Require with absolute path](https://www.ruby-forum.com/t/require-with-absolute-path/117795)

<div class="topic-metadata">

**Author:** [@molla5](https://www.ruby-forum.com/u/molla5)\
**Replies:** 1\
**Last updated:** [October 20, 2007, 12:06pm UTC](https://www.ruby-forum.com/t/require-with-absolute-path/117795 "2007-10-20T12:06:37Z")

</div>

Hi, I am trying to require the xml builder library using the require statement as follows: require ‘C:/builder-2.1.2/lib/builder.rb’ builder.rb in turn has two requires inside using relative paths: require ‘builder/…

---

## [The difference between for-loop and each](https://www.ruby-forum.com/t/the-difference-between-for-loop-and-each/117745)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [October 20, 2007, 11:30am UTC](https://www.ruby-forum.com/t/the-difference-between-for-loop-and-each/117745 "2007-10-20T11:30:57Z")

</div>

Hopefully (I’m sure) somebody can shed a light on this. This caught me by surprise test.rb: TEST = \[\] def procs &block TEST \<\< block end #for n in \[1,2,3\] do \[1,2,3\].each do |n| procs do puts “#{n}” end end T…

---

## [Regarding access Native code using Ruby](https://www.ruby-forum.com/t/regarding-access-native-code-using-ruby/117792)

<div class="topic-metadata">

**Author:** [@Anjali\_CG](https://www.ruby-forum.com/u/Anjali_CG)\
**Replies:** 0\
**Last updated:** [October 20, 2007, 9:58am UTC](https://www.ruby-forum.com/t/regarding-access-native-code-using-ruby/117792 "2007-10-20T09:58:35Z")

</div>

Hi, How can we access the native code (DLL functions) in Ruby (Like the JNI in Java)? Can I find some sample code anywhere? Thanks and Regards, Anjali

---

## [Memory corruption](https://www.ruby-forum.com/t/memory-corruption/117776)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 1\
**Last updated:** [October 20, 2007, 7:51am UTC](https://www.ruby-forum.com/t/memory-corruption/117776 "2007-10-20T07:51:24Z")

</div>

Wondering if anybody’s had memory corruption with mingw before. This works fine for VC and for Linux (it’s just some base rails code). Anyway somehow or other it gets corrupted and inserts random bytes into a “Buffer…

---

## [Create matrix with random numbers](https://www.ruby-forum.com/t/create-matrix-with-random-numbers/117760)

<div class="topic-metadata">

**Author:** [@jasonb](https://www.ruby-forum.com/u/jasonb)\
**Replies:** 3\
**Last updated:** [October 20, 2007, 6:56am UTC](https://www.ruby-forum.com/t/create-matrix-with-random-numbers/117760 "2007-10-20T06:56:47Z")

</div>

I would like to start evaluating Ruby’s capabilities in processing large linear systems and matrices and I would like to know if there is a simple way to ‘randomly’ populate various matrices regardless of size or type…

---

## [ANN: Sequel 0.3 Released](https://www.ruby-forum.com/t/ann-sequel-0-3-released/117784)

<div class="topic-metadata">

**Author:** [@ciconia](https://www.ruby-forum.com/u/ciconia)\
**Replies:** 0\
**Last updated:** [October 20, 2007, 5:55am UTC](https://www.ruby-forum.com/t/ann-sequel-0-3-released/117784 "2007-10-20T05:55:24Z")

</div>

Sequel version 0.3 has just been released. This release includes support for retrieving tuples as arrays instead of hashes, a more mature model implementation with support for composite primary keys and caching, and a…

---

## [Main-2.0.0](https://www.ruby-forum.com/t/main-2-0-0/117672)

<div class="topic-metadata">

**Author:** [@ara.t.howard](https://www.ruby-forum.com/u/ara.t.howard)\
**Replies:** 6\
**Last updated:** [October 20, 2007, 5:42am UTC](https://www.ruby-forum.com/t/main-2-0-0/117672 "2007-10-20T05:42:33Z")

</div>

NAME main.rb SYNOPSIS a class factory and dsl for generating command line programs real quick URI http://rubyforge.org/projects/codeforpeople/ http://codeforpeople.com/lib/ruby/ INSTALL gem install main DESCRIP…

---

## [Iterating through a block; declaring an index/counter within that block](https://www.ruby-forum.com/t/iterating-through-a-block-declaring-an-index-counter-within-that-block/117779)

<div class="topic-metadata">

**Author:** [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Replies:** 1\
**Last updated:** [October 20, 2007, 5:28am UTC](https://www.ruby-forum.com/t/iterating-through-a-block-declaring-an-index-counter-within-that-block/117779 "2007-10-20T05:28:17Z")

</div>

Where does “food” come from in the example below? The declaration is within the block? The varaible food exists only within the block? What is (are) the value(s) for “food”? Read the following aloud to yourself. \['…

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

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