# Ruby

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

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

---

## [Re: Sorting with Hash](https://www.ruby-forum.com/t/re-sorting-with-hash/94276)

<div class="topic-metadata">

**Author:** [@KroegerS\_Simon\_Sext](https://www.ruby-forum.com/u/KroegerS_Simon_Sext)\
**Replies:** 0\
**Last updated:** [April 27, 2006, 3:23pm UTC](https://www.ruby-forum.com/t/re-sorting-with-hash/94276 "2006-04-27T15:23:25Z")

</div>

Sorry, after reading your post again I guess I haven’t understand your problem. Standard Hashes are not sorted, never. If you call sort on a Hash you get nested arrays. \[\[“a”, 10\], \[“b”, 30\], \[“c”, 20\]\] if you want …

---

## [Re: Sorting with Hash](https://www.ruby-forum.com/t/re-sorting-with-hash/94275)

<div class="topic-metadata">

**Author:** [@KroegerS\_Simon\_Sext](https://www.ruby-forum.com/u/KroegerS_Simon_Sext)\
**Replies:** 0\
**Last updated:** [April 27, 2006, 3:10pm UTC](https://www.ruby-forum.com/t/re-sorting-with-hash/94275 "2006-04-27T15:10:06Z")

</div>

Hi Dinesh! h = { “c” =\> 20, “b” =\> 30, “a” =\> 10 } c = h.keys.sort.map{|k| \[k, h\[k\]\]} puts c puts ‘=======’ puts c\[0\] cheers Simon

---

## [Sorting with Hash](https://www.ruby-forum.com/t/sorting-with-hash/58971)

<div class="topic-metadata">

**Author:** [@udinesh](https://www.ruby-forum.com/u/udinesh)\
**Replies:** 0\
**Last updated:** [April 27, 2006, 2:51pm UTC](https://www.ruby-forum.com/t/sorting-with-hash/58971 "2006-04-27T14:51:21Z")

</div>

Hi all, I have a hash like this and i want to sort. After sorting i want the key and value seperately. like say c=Hash.new h = { “c” =\> 20, “b” =\> 30, “a” =\> 10 } c = h.sort puts c ====\>which will result in a 1…

---

## [(no subject)](https://www.ruby-forum.com/t/no-subject/94273)

<div class="topic-metadata">

**Author:** [@hinnerk\_ries](https://www.ruby-forum.com/u/hinnerk_ries)\
**Replies:** 0\
**Last updated:** [April 27, 2006, 2:39pm UTC](https://www.ruby-forum.com/t/no-subject/94273 "2006-04-27T14:39:57Z")

</div>

hallo, I have an installation problem with openSSL I have installed ruby 1.8.4 in a directory below the home (./configure, sudo make, sudo make install) irb(main):001:0\> require ‘openssl’ LoadError: no such file to …

---

## [Pickaxe 1 & 2 - Worth the upgrade?](https://www.ruby-forum.com/t/pickaxe-1-2-worth-the-upgrade/58956)

<div class="topic-metadata">

**Author:** [@ashiro](https://www.ruby-forum.com/u/ashiro)\
**Replies:** 1\
**Last updated:** [April 27, 2006, 2:23pm UTC](https://www.ruby-forum.com/t/pickaxe-1-2-worth-the-upgrade/58956 "2006-04-27T14:23:24Z")

</div>

Hi all I was just wondering if it would be worth me buying the second edition of Pickaxe? Is there really much difference between it and the first edition? Many thanks for your responses. All the best. Doug

---

## [Object available in one class but not another?](https://www.ruby-forum.com/t/object-available-in-one-class-but-not-another/94263)

<div class="topic-metadata">

**Author:** [@snow-templar](https://www.ruby-forum.com/u/snow-templar)\
**Replies:** 2\
**Last updated:** [April 27, 2006, 1:31pm UTC](https://www.ruby-forum.com/t/object-available-in-one-class-but-not-another/94263 "2006-04-27T13:31:54Z")

</div>

Hi all, Playing around more with rrobots. Method tick in class GoofeyBot is called by module Robot (which is “included” at the beginning of all 4 of my classes). Robot provides (among many other things) an object cal…

---

## [I have some problem with convert to symbol, in Hash object](https://www.ruby-forum.com/t/i-have-some-problem-with-convert-to-symbol-in-hash-object/58946)

<div class="topic-metadata">

**Author:** [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Replies:** 1\
**Last updated:** [April 27, 2006, 12:58pm UTC](https://www.ruby-forum.com/t/i-have-some-problem-with-convert-to-symbol-in-hash-object/58946 "2006-04-27T12:58:02Z")

</div>

I use it functionality: Hash\[str.scan(/store\[(\[^\\s,\]+)\\s\]=\\s\*(\[^,\]+)/).flatten\] =\> {“fax”=\>“80233923293”, “name”=\>“Ilyas store”, “description”=\>“lkjklsdaj”, “phone”=\>“4999-233-2923”} The problem with covert strin…

---

## [Trouble migrating formula from JavaScript to Ruby](https://www.ruby-forum.com/t/trouble-migrating-formula-from-javascript-to-ruby/58952)

<div class="topic-metadata">

**Author:** [@ingoweiss](https://www.ruby-forum.com/u/ingoweiss)\
**Replies:** 1\
**Last updated:** [April 27, 2006, 12:23pm UTC](https://www.ruby-forum.com/t/trouble-migrating-formula-from-javascript-to-ruby/58952 "2006-04-27T12:23:46Z")

</div>

Hi, I am trying (unsuccessfully) to migrate a formula (for calculating distances between lat/lng positions) from JavaScript to Ruby: //JavaScript: dlng = p2\_lng - p1\_lng dlat = p2\_lat - p1\_lat a = (sin(dlat/2))^2 +…

---

## [Re: I have some problem with convert to symbol, in Hash obje](https://www.ruby-forum.com/t/re-i-have-some-problem-with-convert-to-symbol-in-hash-obje/94267)

<div class="topic-metadata">

**Author:** [@PeSSSSaS\_Botp](https://www.ruby-forum.com/u/PeSSSSaS_Botp)\
**Replies:** 0\
**Last updated:** [April 27, 2006, 11:27am UTC](https://www.ruby-forum.com/t/re-i-have-some-problem-with-convert-to-symbol-in-hash-obje/94267 "2006-04-27T11:27:31Z")

</div>

John: I want to convert “name” to :symbol “name”=\>“Ilyas store” —\> :name =\> “Ilyas store” sample only, irb(main):039:0\* h1={“fax”=\>“80233923293”, “name”=\>“Ilyas store”} =\> {“name”=\>“Ilyas store”, “fax”=\>“80233923293…

---

## [Rake task dependeny vs. method call](https://www.ruby-forum.com/t/rake-task-dependeny-vs-method-call/58733)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 18\
**Last updated:** [April 27, 2006, 9:07am UTC](https://www.ruby-forum.com/t/rake-task-dependeny-vs-method-call/58733 "2006-04-27T09:07:51Z")

</div>

In Rake, what’s the signifficant difference between task :strike =\> \[ :coil \] do # … end and task :strike do coil #… end Thanks, T.

---

## [Re: Q about the FasterCSV](https://www.ruby-forum.com/t/re-q-about-the-fastercsv/94264)

<div class="topic-metadata">

**Author:** [@PeSSSSaS\_Botp](https://www.ruby-forum.com/u/PeSSSSaS_Botp)\
**Replies:** 1\
**Last updated:** [April 27, 2006, 9:01am UTC](https://www.ruby-forum.com/t/re-q-about-the-fastercsv/94264 "2006-04-27T09:01:43Z")

</div>

Eric L. \[mailto:removed\_email\_address@domain.invalid\] : In the csv file, line 1,“1” line 2, “2” Is it a bug or expected? imho, a bug.

---

## [X.times dont work](https://www.ruby-forum.com/t/x-times-dont-work/58823)

<div class="topic-metadata">

**Author:** [@eneon](https://www.ruby-forum.com/u/eneon)\
**Replies:** 7\
**Last updated:** [April 27, 2006, 8:13am UTC](https://www.ruby-forum.com/t/x-times-dont-work/58823 "2006-04-27T08:13:40Z")

</div>

Hi In irb i wrote 3.time(puts “dsds”) and it doesn’t work why? Here i pasted log: irb(main):027:0\> 3.times(puts “Hello!”) (irb):27: warning: parenthesize argument(s) for future version Hello! ArgumentError: wrong n…

---

## [Stumped: How do I iterate over regular expression matches?](https://www.ruby-forum.com/t/stumped-how-do-i-iterate-over-regular-expression-matches/58875)

<div class="topic-metadata">

**Author:** [@Xeno\_C](https://www.ruby-forum.com/u/Xeno_C)\
**Replies:** 5\
**Last updated:** [April 27, 2006, 8:00am UTC](https://www.ruby-forum.com/t/stumped-how-do-i-iterate-over-regular-expression-matches/58875 "2006-04-27T08:00:04Z")

</div>

I looked for an iterator, and there may be something, but I don’t recognize it. I also tried: while (x =~ /something/ ) p $1 end and it just printed out the same match over and over. Perl does this very nicely, …

---

## [Ruby 1.8.4 RDoc Seg fault](https://www.ruby-forum.com/t/ruby-1-8-4-rdoc-seg-fault/93890)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 4\
**Last updated:** [April 27, 2006, 7:59am UTC](https://www.ruby-forum.com/t/ruby-1-8-4-rdoc-seg-fault/93890 "2006-04-27T07:59:58Z")

</div>

Got this today: with\_reader.rb: /usr/lib/ruby/1.8/rdoc/parsers/parse\_rb.rb:384: \[BUG\] Segmentation fault T.

---

## [Q about the FasterCSV](https://www.ruby-forum.com/t/q-about-the-fastercsv/58921)

<div class="topic-metadata">

**Author:** [@eric99](https://www.ruby-forum.com/u/eric99)\
**Replies:** 2\
**Last updated:** [April 27, 2006, 7:50am UTC](https://www.ruby-forum.com/t/q-about-the-fastercsv/58921 "2006-04-27T07:50:43Z")

</div>

Hi, I have a csv file, which has the following data, for example: test.csv line 1, “1” line 2, “2” And I use the following code snippet to parse this file, require ‘fastercsv’ FasterCSV.read(“test.csv”) unfortunat…

---

## [Q: how to undefined a class after declaration?](https://www.ruby-forum.com/t/q-how-to-undefined-a-class-after-declaration/58925)

<div class="topic-metadata">

**Author:** [@mikec](https://www.ruby-forum.com/u/mikec)\
**Replies:** 3\
**Last updated:** [April 27, 2006, 7:44am UTC](https://www.ruby-forum.com/t/q-how-to-undefined-a-class-after-declaration/58925 "2006-04-27T07:44:29Z")

</div>

E.g. using irb, I created class A and then class B, later I realized what I wanted was class B to be a subclass of A like ‘class B \< A’. irb would not allow that now that B exists. How do I undefined B so that I can c…

---

## [Open4-0.4.0](https://www.ruby-forum.com/t/open4-0-4-0/94259)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [April 27, 2006, 6:33am UTC](https://www.ruby-forum.com/t/open4-0-4-0/94259 "2006-04-27T06:33:38Z")

</div>

URIS http://rubyforge.org/frs/?group\_id=1024&release\_id=5157 http://www.codeforpeople.com/lib/ruby/ SYNOPSIS open child process with handles on pid, stdin, stdout, and stderr HISTORY 0.4.0: - improved error handli…

---

## [Re: Q about the FasterCSV](https://www.ruby-forum.com/t/re-q-about-the-fastercsv/58922)

<div class="topic-metadata">

**Author:** [@PeSSSSaS\_Botp](https://www.ruby-forum.com/u/PeSSSSaS_Botp)\
**Replies:** 0\
**Last updated:** [April 27, 2006, 5:56am UTC](https://www.ruby-forum.com/t/re-q-about-the-fastercsv/58922 "2006-04-27T05:56:16Z")

</div>

Eric L. \[mailto:removed\_email\_address@domain.invalid\] : test.csv ------------- line 1, “1” line 2, “2” And I use the following code snippet to parse this file, require ‘fastercsv’ FasterCSV.read(“test.csv”) u…

---

## [Rubygem required?](https://www.ruby-forum.com/t/rubygem-required/58871)

<div class="topic-metadata">

**Author:** [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Replies:** 2\
**Last updated:** [April 27, 2006, 5:07am UTC](https://www.ruby-forum.com/t/rubygem-required/58871 "2006-04-27T05:07:07Z")

</div>

Hi, I’m creating RPM packages for: opinion (which includes Rails) ruby 1.8.4 mongrel rake gem\_plugin ruby-postgres (I want to install opinion using postgres on a RHEL system that doesn’t have internet access) Do th…

---

## [Fault-tolerant persistent storage (DB?)](https://www.ruby-forum.com/t/fault-tolerant-persistent-storage-db/58632)

<div class="topic-metadata">

**Author:** [@visq](https://www.ruby-forum.com/u/visq)\
**Replies:** 4\
**Last updated:** [April 27, 2006, 4:45am UTC](https://www.ruby-forum.com/t/fault-tolerant-persistent-storage-db/58632 "2006-04-27T04:45:17Z")

</div>

I’m currently looking for a data storage backend for a little pet project of mine. The catch is - two systems are running the software and need to be able to access data (r/w), and it needs to continue function, if e…

---

## [Trying to stir conversation in the rrobots community](https://www.ruby-forum.com/t/trying-to-stir-conversation-in-the-rrobots-community/58909)

<div class="topic-metadata">

**Author:** [@snow-templar](https://www.ruby-forum.com/u/snow-templar)\
**Replies:** 0\
**Last updated:** [April 27, 2006, 3:00am UTC](https://www.ruby-forum.com/t/trying-to-stir-conversation-in-the-rrobots-community/58909 "2006-04-27T03:00:49Z")

</div>

Hi all, I’m new to ruby, but enjoying learning it a great deal. And rrobots seems like a great way to practice. But the rubyforge forums have been pretty quite since the tournament in december. So, I’ve created a new …

---

## [Magic Quotes in Ruby?](https://www.ruby-forum.com/t/magic-quotes-in-ruby/58903)

<div class="topic-metadata">

**Author:** [@nko](https://www.ruby-forum.com/u/nko)\
**Replies:** 3\
**Last updated:** [April 27, 2006, 1:25am UTC](https://www.ruby-forum.com/t/magic-quotes-in-ruby/58903 "2006-04-27T01:25:33Z")

</div>

(I thought I posted this question just a bit ago but I can’t find it now. Sorry if this is a double-posting) I have some strings in a CGI script of mine that will sometimes contain double-quotation marks (""). These b…

---

## [Randomizing a simple array of strings](https://www.ruby-forum.com/t/randomizing-a-simple-array-of-strings/58886)

<div class="topic-metadata">

**Author:** [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Replies:** 3\
**Last updated:** [April 26, 2006, 11:37pm UTC](https://www.ruby-forum.com/t/randomizing-a-simple-array-of-strings/58886 "2006-04-26T23:37:36Z")

</div>

OK, this is pretty bad for a CS grad to ask, but my brain is worn out today. I building a list of words (storing them in an Array). I want to randomize the order. Can anyone point me to a tutorial or common algorithm…

---

## [Vim 7 ruby omni-complete v0.2](https://www.ruby-forum.com/t/vim-7-ruby-omni-complete-v0-2/93858)

<div class="topic-metadata">

**Author:** [@bowenmark](https://www.ruby-forum.com/u/bowenmark)\
**Replies:** 16\
**Last updated:** [April 26, 2006, 10:50pm UTC](https://www.ruby-forum.com/t/vim-7-ruby-omni-complete-v0-2/93858 "2006-04-26T22:50:20Z")

</div>

Thanks to some outside suggestions and contributions we now have another release. If you missed the original announcement, rbcomplete provides a vim7 omni-completion function (code completion) for vim. It is based on…

---

## [Date-building regexes](https://www.ruby-forum.com/t/date-building-regexes/58827)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 4\
**Last updated:** [April 26, 2006, 10:19pm UTC](https://www.ruby-forum.com/t/date-building-regexes/58827 "2006-04-26T22:19:20Z")

</div>

Hi Does anyone know of a regular expression for building a date? That is one that will match “3”, “30”, “30/”, “30/0” (etc), but not “30/099” or (ideally) “30/02”? I’ve had a quick look into it and it seems pretty …

---

## [Ruby programs to learn from](https://www.ruby-forum.com/t/ruby-programs-to-learn-from/58611)

<div class="topic-metadata">

**Author:** [@Jonathan\_uUttle](https://www.ruby-forum.com/u/Jonathan_uUttle)\
**Replies:** 12\
**Last updated:** [April 26, 2006, 10:10pm UTC](https://www.ruby-forum.com/t/ruby-programs-to-learn-from/58611 "2006-04-26T22:10:04Z")

</div>

Hello, I’m sure that this has been covered before, but I’m horrible at doing searches. I never seem to get the search terms right. It’s often been said that one way to improve upon your programming skills is to study…

---

## [Problem with URI.parse](https://www.ruby-forum.com/t/problem-with-uri-parse/58858)

<div class="topic-metadata">

**Author:** [@kaens](https://www.ruby-forum.com/u/kaens)\
**Replies:** 2\
**Last updated:** [April 26, 2006, 8:27pm UTC](https://www.ruby-forum.com/t/problem-with-uri-parse/58858 "2006-04-26T20:27:16Z")

</div>

Alright, I think I may have stumbled upon a bug, correct me if I’m wrong. I just wrote a script to pull linked-to files of a certain type of of webpages. Granted, I’m still pretty new to Ruby. . . this really has me …

---

## [Re: x.times dont work](https://www.ruby-forum.com/t/re-x-times-dont-work/58825)

<div class="topic-metadata">

**Author:** [@PeSSSSaS\_Botp](https://www.ruby-forum.com/u/PeSSSSaS_Botp)\
**Replies:** 1\
**Last updated:** [April 26, 2006, 7:47pm UTC](https://www.ruby-forum.com/t/re-x-times-dont-work/58825 "2006-04-26T19:47:13Z")

</div>

On Behalf Of Dawid Skomski: irb(main):027:0\> 3.times(puts “Hello!”) (irb):27: warning: parenthesize argument(s) for future version Hello! ArgumentError: wrong number of arguments (1 for 0) from (irb):27:in \`times’ from …

---

## [Re: How i can to parse string](https://www.ruby-forum.com/t/re-how-i-can-to-parse-string/58846)

<div class="topic-metadata">

**Author:** [@KroegerS\_Simon\_Sext](https://www.ruby-forum.com/u/KroegerS_Simon_Sext)\
**Replies:** 1\
**Last updated:** [April 26, 2006, 7:21pm UTC](https://www.ruby-forum.com/t/re-how-i-can-to-parse-string/58846 "2006-04-26T19:21:47Z")

</div>

or Hash\[\*str.split(/=|,/)\] cheers Simon

---

## [Compiling Ruby](https://www.ruby-forum.com/t/compiling-ruby/94231)

<div class="topic-metadata">

**Author:** [@kuppas](https://www.ruby-forum.com/u/kuppas)\
**Replies:** 4\
**Last updated:** [April 26, 2006, 7:19pm UTC](https://www.ruby-forum.com/t/compiling-ruby/94231 "2006-04-26T19:19:44Z")

</div>

Hi, I would like to compile Ruby with minimum features like Base Object, Number, File IO, etc. (ie., I wanted to exclude the unit test, xml, ssl, UI, etc) Thanks, -Kuppa

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

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