# Ruby

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

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

---

## [Deleting an item with ajax](https://www.ruby-forum.com/t/deleting-an-item-with-ajax/114164)

<div class="topic-metadata">

**Author:** [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Replies:** 3\
**Last updated:** [September 19, 2007, 11:00pm UTC](https://www.ruby-forum.com/t/deleting-an-item-with-ajax/114164 "2007-09-19T23:00:13Z")

</div>

hi again, I managed to work out how to create a new item via ajax and the form\_remote\_tag, however don’t know how to delete an item from the table. here’s the code so far, doesn’t work, keeps on popping up saying null…

---

## [Finding string matches, in order, in a file](https://www.ruby-forum.com/t/finding-string-matches-in-order-in-a-file/114881)

<div class="topic-metadata">

**Author:** [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Replies:** 18\
**Last updated:** [September 19, 2007, 10:10pm UTC](https://www.ruby-forum.com/t/finding-string-matches-in-order-in-a-file/114881 "2007-09-19T22:10:05Z")

</div>

Hi, I’ve got files I want to parse. I’m using a string scan routine that populates an array. I need to pull the entries of that array out, in order, eventually. I’m getting an array all right, but, I don’t understand…

---

## [Re: IP to Country (#139)](https://www.ruby-forum.com/t/re-ip-to-country-139/115028)

<div class="topic-metadata">

**Author:** [@jameskelly](https://www.ruby-forum.com/u/jameskelly)\
**Replies:** 0\
**Last updated:** [September 19, 2007, 9:24pm UTC](https://www.ruby-forum.com/t/re-ip-to-country-139/115028 "2007-09-19T21:24:05Z")

</div>

I am extremely pleased with my solution this week: ruby IPToCountry.rb 121.121.121.121 MY 0.000000 0.000000 0.000000 ( 0.000000) Wrapping the code in 100.times {…} ruby IPToCountry.rb 121.121.121.121 MY MY … …

---

## [Spam from leaked (?) user details](https://www.ruby-forum.com/t/spam-from-leaked-user-details/115022)

<div class="topic-metadata">

**Author:** [@mschwab](https://www.ruby-forum.com/u/mschwab)\
**Replies:** 3\
**Last updated:** [September 19, 2007, 8:43pm UTC](https://www.ruby-forum.com/t/spam-from-leaked-user-details/115022 "2007-09-19T20:43:58Z")

</div>

I get a disturbing amount of email spam addressed to the email address I used only to register here - rubfor@etc. How have people got hold of these details?

---

## ["ri intern" not working?](https://www.ruby-forum.com/t/ri-intern-not-working/114965)

<div class="topic-metadata">

**Author:** [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Replies:** 3\
**Last updated:** [September 19, 2007, 7:52pm UTC](https://www.ruby-forum.com/t/ri-intern-not-working/114965 "2007-09-19T19:52:45Z")

</div>

strange that ri intern is not giving the String#intern but ri superclass will give the Class#superclass have to use ri String#intern (using ri from InstantRails 1.7)

---

## [Errors, trying to edit and write some text files](https://www.ruby-forum.com/t/errors-trying-to-edit-and-write-some-text-files/114567)

<div class="topic-metadata">

**Author:** [@shadowcipher](https://www.ruby-forum.com/u/shadowcipher)\
**Replies:** 7\
**Last updated:** [September 19, 2007, 7:50pm UTC](https://www.ruby-forum.com/t/errors-trying-to-edit-and-write-some-text-files/114567 "2007-09-19T19:50:45Z")

</div>

Hi, I’m a total ruby noob but i’ve obtained this script from another forum over at Tracks. I’m trying to extract some info from a plain text feed of my upcoming calendar events and write specific info to three differe…

---

## [Ruby and paths](https://www.ruby-forum.com/t/ruby-and-paths/115002)

<div class="topic-metadata">

**Author:** [@Fibre\_O](https://www.ruby-forum.com/u/Fibre_O)\
**Replies:** 2\
**Last updated:** [September 19, 2007, 7:35pm UTC](https://www.ruby-forum.com/t/ruby-and-paths/115002 "2007-09-19T19:35:42Z")

</div>

Hello iahve just installed Ruby grom sources. Here i a command I have executed: $ruby -v ruby 1.8.6 (2007-03-13 patchlevel 0) \[i686-linux\] Unfortunately I am not able to start up the irb: $irb -v /usr/bin/irb:10:in…

---

## [How to compute Sunrise / Sunset?](https://www.ruby-forum.com/t/how-to-compute-sunrise-sunset/114991)

<div class="topic-metadata">

**Author:** [@joep](https://www.ruby-forum.com/u/joep)\
**Replies:** 11\
**Last updated:** [September 19, 2007, 5:59pm UTC](https://www.ruby-forum.com/t/how-to-compute-sunrise-sunset/114991 "2007-09-19T17:59:52Z")

</div>

I need to compute sunrise/set times in ruby for a given long lat. Does anyone know any way to do this? Are there any modules or helper classes out there?? thanks!

---

## [Replace multiple patterns of a string in single pass](https://www.ruby-forum.com/t/replace-multiple-patterns-of-a-string-in-single-pass/114972)

<div class="topic-metadata">

**Author:** [@vellingiri](https://www.ruby-forum.com/u/vellingiri)\
**Replies:** 2\
**Last updated:** [September 19, 2007, 5:00pm UTC](https://www.ruby-forum.com/t/replace-multiple-patterns-of-a-string-in-single-pass/114972 "2007-09-19T17:00:40Z")

</div>

Dear Friends, How can I replace multiple patterns of a string in single pass. by Vellingiri

---

## [Open uri buf read overflow](https://www.ruby-forum.com/t/open-uri-buf-read-overflow/114999)

<div class="topic-metadata">

**Author:** [@animate123](https://www.ruby-forum.com/u/animate123)\
**Replies:** 0\
**Last updated:** [September 19, 2007, 4:34pm UTC](https://www.ruby-forum.com/t/open-uri-buf-read-overflow/114999 "2007-09-19T16:34:25Z")

</div>

I’m using open-uri to open approx 3500 web pages to check to see if they have active contect. I’m using open uri to do it, but after about 2346 pages have been open I get a buf\_read error and the program crashes. Afte…

---

## [Unsubscribe](https://www.ruby-forum.com/t/unsubscribe/114997)

<div class="topic-metadata">

**Author:** [@nick\_314](https://www.ruby-forum.com/u/nick_314)\
**Replies:** 0\
**Last updated:** [September 19, 2007, 4:29pm UTC](https://www.ruby-forum.com/t/unsubscribe/114997 "2007-09-19T16:29:33Z")

</div>

unsubscribe

---

## [Is there a select and map for hashes instead of arrays?](https://www.ruby-forum.com/t/is-there-a-select-and-map-for-hashes-instead-of-arrays/114839)

<div class="topic-metadata">

**Author:** [@jeff](https://www.ruby-forum.com/u/jeff)\
**Replies:** 7\
**Last updated:** [September 19, 2007, 4:18pm UTC](https://www.ruby-forum.com/t/is-there-a-select-and-map-for-hashes-instead-of-arrays/114839 "2007-09-19T16:18:30Z")

</div>

Hash#select and Hash#map return arrays. In some cases I want to get hashes back instead. I can take the returned arrays and transform them back into hashes, but it would be nice to avoid the extra step. Plus, it jus…

---

## [Https authentication & storing https page in string](https://www.ruby-forum.com/t/https-authentication-storing-https-page-in-string/114992)

<div class="topic-metadata">

**Author:** [@dhanukanaveen](https://www.ruby-forum.com/u/dhanukanaveen)\
**Replies:** 2\
**Last updated:** [September 19, 2007, 4:06pm UTC](https://www.ruby-forum.com/t/https-authentication-storing-https-page-in-string/114992 "2007-09-19T16:06:24Z")

</div>

Hi, I have to write a ruby script which will give me the dynamic page on a https as a string. First I have to login in the https page. I am doing this using WATIR. Then I want the dynamic page to be stored in a stri…

---

## [Cropping text strings](https://www.ruby-forum.com/t/cropping-text-strings/114826)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 9\
**Last updated:** [September 19, 2007, 3:51pm UTC](https://www.ruby-forum.com/t/cropping-text-strings/114826 "2007-09-19T15:51:20Z")

</div>

Hello, This statement here can return a very long paragraph \<%=h openjob.ProblemDesc %\> Is there a way to trim it to say the first 50 characters? In VBScript I would use Left(). (I am working in ruby on rails if that…

---

## [1.class vs method1.class](https://www.ruby-forum.com/t/1-class-vs-method1-class/114990)

<div class="topic-metadata">

**Author:** [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Replies:** 2\
**Last updated:** [September 19, 2007, 3:30pm UTC](https://www.ruby-forum.com/t/1-class-vs-method1-class/114990 "2007-09-19T15:30:13Z")

</div>

so 1.class will give Fixnum… but when i define a method def foo puts “ha” end how can i invoke foo.class as it is taking what foo returns… as then invoke class on that.

---

## [Indenting strings - elegant alternatives?](https://www.ruby-forum.com/t/indenting-strings-elegant-alternatives/114979)

<div class="topic-metadata">

**Author:** [@ronaldfischer](https://www.ruby-forum.com/u/ronaldfischer)\
**Replies:** 7\
**Last updated:** [September 19, 2007, 3:29pm UTC](https://www.ruby-forum.com/t/indenting-strings-elegant-alternatives/114979 "2007-09-19T15:29:13Z")

</div>

Just in case someone would like to contribute ideas of elegant code: PROBLEM: Given a string of lines (for example, “abc\\nde\\nfgh\\n”) and a number n, produce a string of the same lines, but each line indented by n spa…

---

## [Is it possible to change TCP/IP settings of your computer us](https://www.ruby-forum.com/t/is-it-possible-to-change-tcp-ip-settings-of-your-computer-us/114982)

<div class="topic-metadata">

**Author:** [@zoat](https://www.ruby-forum.com/u/zoat)\
**Replies:** 1\
**Last updated:** [September 19, 2007, 1:55pm UTC](https://www.ruby-forum.com/t/is-it-possible-to-change-tcp-ip-settings-of-your-computer-us/114982 "2007-09-19T13:55:48Z")

</div>

Hi, I would like to have easier and fast way to change the TCP/IP settings of my computer. As my job requires in order to connect to each customer network. For example to change it to a specified IP/Gateway/Subnet Ma…

---

## [Regexp help](https://www.ruby-forum.com/t/regexp-help/114933)

<div class="topic-metadata">

**Author:** [@nuby2ruby](https://www.ruby-forum.com/u/nuby2ruby)\
**Replies:** 7\
**Last updated:** [September 19, 2007, 1:38pm UTC](https://www.ruby-forum.com/t/regexp-help/114933 "2007-09-19T13:38:44Z")

</div>

K, so I suck at regular expressions. I just don’t seem to understand them. What I want to do is determine if a string includes 2 special characters a semi-colon and a question mark. Here’s my example that I’m trying …

---

## [Iterate over a series of alphabetically increasing strings](https://www.ruby-forum.com/t/iterate-over-a-series-of-alphabetically-increasing-strings/114976)

<div class="topic-metadata">

**Author:** [@vellingiri](https://www.ruby-forum.com/u/vellingiri)\
**Replies:** 3\
**Last updated:** [September 19, 2007, 1:16pm UTC](https://www.ruby-forum.com/t/iterate-over-a-series-of-alphabetically-increasing-strings/114976 "2007-09-19T13:16:37Z")

</div>

Dear Friends, How could i do iterate over a series of alphabetically increasing strings. by Vellingiri.

---

## [Faster Alternatives for Recursion in Ruby -Assignment](https://www.ruby-forum.com/t/faster-alternatives-for-recursion-in-ruby-assignment/114866)

<div class="topic-metadata">

**Author:** [@rubynut](https://www.ruby-forum.com/u/rubynut)\
**Replies:** 9\
**Last updated:** [September 19, 2007, 1:02pm UTC](https://www.ruby-forum.com/t/faster-alternatives-for-recursion-in-ruby-assignment/114866 "2007-09-19T13:02:34Z")

</div>

I have the following assignment to be done.I have written the recursive API and a loop based solution but what is the faster alternative for these two that can figure into that “fastfunk(n)” method. Thanks for your he…

---

## [What is the uses of inject()](https://www.ruby-forum.com/t/what-is-the-uses-of-inject/114971)

<div class="topic-metadata">

**Author:** [@vellingiri](https://www.ruby-forum.com/u/vellingiri)\
**Replies:** 4\
**Last updated:** [September 19, 2007, 1:00pm UTC](https://www.ruby-forum.com/t/what-is-the-uses-of-inject/114971 "2007-09-19T13:00:34Z")

</div>

Hello friends, Can anybody tell me the answer. what is the uses of inject(). Give some example. by Vellingiri.

---

## [Re: Parse XML that isn't well formed](https://www.ruby-forum.com/t/re-parse-xml-that-isnt-well-formed/114975)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [September 19, 2007, 12:31pm UTC](https://www.ruby-forum.com/t/re-parse-xml-that-isnt-well-formed/114975 "2007-09-19T12:31:27Z")

</div>

Hi looking at the xml that you have presented, there is no root element to the document - this is why the xml is being rejected - you can only have a single root element in the document - you could try something like …

---

## [Convert a line with whitespaces into a string containing lin](https://www.ruby-forum.com/t/convert-a-line-with-whitespaces-into-a-string-containing-lin/114966)

<div class="topic-metadata">

**Author:** [@vellingiri](https://www.ruby-forum.com/u/vellingiri)\
**Replies:** 3\
**Last updated:** [September 19, 2007, 12:01pm UTC](https://www.ruby-forum.com/t/convert-a-line-with-whitespaces-into-a-string-containing-lin/114966 "2007-09-19T12:01:24Z")

</div>

Dear Friends, Any one answer for this questons. convert a line with whitespaces into a string containing line breaks Thank you.

---

## [Convert numbers from one base to another](https://www.ruby-forum.com/t/convert-numbers-from-one-base-to-another/114969)

<div class="topic-metadata">

**Author:** [@vellingiri](https://www.ruby-forum.com/u/vellingiri)\
**Replies:** 0\
**Last updated:** [September 19, 2007, 11:58am UTC](https://www.ruby-forum.com/t/convert-numbers-from-one-base-to-another/114969 "2007-09-19T11:58:52Z")

</div>

Hai friends, Could you anyone tell me the answer, Convert numbers from one base to another. By Vellingiri.

---

## [Sort the input roman letters](https://www.ruby-forum.com/t/sort-the-input-roman-letters/114963)

<div class="topic-metadata">

**Author:** [@vellingiri](https://www.ruby-forum.com/u/vellingiri)\
**Replies:** 2\
**Last updated:** [September 19, 2007, 11:53am UTC](https://www.ruby-forum.com/t/sort-the-input-roman-letters/114963 "2007-09-19T11:53:14Z")

</div>

Dear Friends, Sort the input roman letters. ( 1 - 100). Roman letters are case insensitive. note: duplicates should not be ommitted. Read the data in one stroke, so that a file can be given as input: For doubt in ro…

---

## [Tk Ruby / Fx Ruby / Wx Ruby](https://www.ruby-forum.com/t/tk-ruby-fx-ruby-wx-ruby/114644)

<div class="topic-metadata">

**Author:** [@jayson](https://www.ruby-forum.com/u/jayson)\
**Replies:** 11\
**Last updated:** [September 19, 2007, 11:51am UTC](https://www.ruby-forum.com/t/tk-ruby-fx-ruby-wx-ruby/114644 "2007-09-19T11:51:23Z")

</div>

I have looked at these three GUI’s for Ruby, and would like to know which the community feels is the better of these three (or is there a better one that I haven’t listed). I am building small applications with UI’s t…

---

## [Read and workout the program after you have to post](https://www.ruby-forum.com/t/read-and-workout-the-program-after-you-have-to-post/114968)

<div class="topic-metadata">

**Author:** [@vellingiri](https://www.ruby-forum.com/u/vellingiri)\
**Replies:** 0\
**Last updated:** [September 19, 2007, 11:51am UTC](https://www.ruby-forum.com/t/read-and-workout-the-program-after-you-have-to-post/114968 "2007-09-19T11:51:00Z")

</div>

Dear Friends, Given a string containing an Excel-like range specifier like this: “C5:E8”, generate an array of all the cells in the array. In this case, the output should be something like this… \[“C5”, “C6”, “C7”, “…

---

## [Rake TestTask running its block anytime rake is invoked](https://www.ruby-forum.com/t/rake-testtask-running-its-block-anytime-rake-is-invoked/114958)

<div class="topic-metadata">

**Author:** [@scudco](https://www.ruby-forum.com/u/scudco)\
**Replies:** 1\
**Last updated:** [September 19, 2007, 10:40am UTC](https://www.ruby-forum.com/t/rake-testtask-running-its-block-anytime-rake-is-invoked/114958 "2007-09-19T10:40:45Z")

</div>

– require ‘rake/testtask’ Rake::TestTask.new do |t| chdir ‘./…/’ puts pwd end desc “print working directory” task :pwd do puts “Working Directory #{pwd}” end $ rake -T cd ./…/ /Users/scudco/projects rake chdi…

---

## [File encryption/decryption needed](https://www.ruby-forum.com/t/file-encryption-decryption-needed/114854)

<div class="topic-metadata">

**Author:** [@learningruby](https://www.ruby-forum.com/u/learningruby)\
**Replies:** 3\
**Last updated:** [September 19, 2007, 10:02am UTC](https://www.ruby-forum.com/t/file-encryption-decryption-needed/114854 "2007-09-19T10:02:59Z")

</div>

Hi Folks, Yesterday, in my ruby application, I was needed to encrypt/decrypt a file. I searched for a 2-way encryption technique and ended up with ezcrypto gem. I thought to give it a test. I was able to enc…

---

## [Thread deadlock](https://www.ruby-forum.com/t/thread-deadlock/225969)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 8\
**Last updated:** [September 19, 2007, 6:16am UTC](https://www.ruby-forum.com/t/thread-deadlock/225969 "2007-09-19T06:16:34Z")

</div>

I wanted to create a thread pool. I know I could have used a SizedQueue in the thread pool, but I wanted to later on change the thread queue to a priority queue. With ruby 1.8.6 (2007-03-13 patchlevel 0) \[i386-cygwin…

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

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