# Ruby

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

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

---

## [\[ANN\] Composite Primary Keys for ActiveRecord 0.3.2](https://www.ruby-forum.com/t/ann-composite-primary-keys-for-activerecord-0-3-2/99504)

<div class="topic-metadata">

**Author:** [@nicwilliams](https://www.ruby-forum.com/u/nicwilliams)\
**Replies:** 2\
**Last updated:** [July 24, 2006, 11:13am UTC](https://www.ruby-forum.com/t/ann-composite-primary-keys-for-activerecord-0-3-2/99504 "2006-07-24T11:13:54Z")

</div>

\[Cross-posting from Ruby on Rails forum\] ActiveRecords with composite primary keys now seem to happily support find/create/update/destroy options. Url: http://compositekeys.rubyforge.org Background: Rails/ActiveReco…

---

## [\[ BUG \] $0 cannot keep the given string](https://www.ruby-forum.com/t/bug-0-cannot-keep-the-given-string/97333)

<div class="topic-metadata">

**Author:** [@Hidetoshi\_NAGAI](https://www.ruby-forum.com/u/Hidetoshi_NAGAI)\
**Replies:** 5\
**Last updated:** [July 24, 2006, 10:10am UTC](https://www.ruby-forum.com/t/bug-0-cannot-keep-the-given-string/97333 "2006-07-24T10:10:46Z")

</div>

e$B1J0fe(B@e$BCNG=!%6e9)Bg$G$9!%e(B e$B%W%m%0%i%\`L\>$rJ\];}$9$ke(B $0 e$B$G$9$,!$e(B e$B\>u67$K$h$C$F$OBeF~$5$l$?CM$rJ\];}$G$-$^$;$s!%e(B \[1\] % ruby -v -e ‘p \[$0.length, $0\]; $0 = “x”\*100+".rb"; p \[$0.length, $0\]’ ruby…

---

## [Metaprogramming problems](https://www.ruby-forum.com/t/metaprogramming-problems/99536)

<div class="topic-metadata">

**Author:** [@leslieviljoen](https://www.ruby-forum.com/u/leslieviljoen)\
**Replies:** 2\
**Last updated:** [July 24, 2006, 8:51am UTC](https://www.ruby-forum.com/t/metaprogramming-problems/99536 "2006-07-24T08:51:43Z")

</div>

Hello! I am pretty new to metaprogramming, this is my first shot. I want to be able to take some binary data, split it into parts based on a template and make an object with those parts. Basically, I have this templa…

---

## [How to run variable method names?](https://www.ruby-forum.com/t/how-to-run-variable-method-names/99558)

<div class="topic-metadata">

**Author:** [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Replies:** 3\
**Last updated:** [July 24, 2006, 7:53am UTC](https://www.ruby-forum.com/t/how-to-run-variable-method-names/99558 "2006-07-24T07:53:53Z")

</div>

Lets say object has a method called id. How do I do the the following? method\_name = “id” object.method\_name I know the above doesnt work, but I want method\_name to be replaced by its value so it would run id. Than…

---

## [One-Click Installer: MinGW? or VC2005?](https://www.ruby-forum.com/t/one-click-installer-mingw-or-vc2005/98855)

<div class="topic-metadata">

**Author:** [@curthibbs](https://www.ruby-forum.com/u/curthibbs)\
**Replies:** 151\
**Last updated:** [July 24, 2006, 7:47am UTC](https://www.ruby-forum.com/t/one-click-installer-mingw-or-vc2005/98855 "2006-07-24T07:47:25Z")

</div>

The O.-Click Ruby Installer for Windows is at a cross-roads. The C++ compiler situation on Windows has become a complete mess because of subtle incompatibilities and has, consequently, become a big headache for me an…

---

## [Checking for directory (noob mistake?)](https://www.ruby-forum.com/t/checking-for-directory-noob-mistake/99569)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 3\
**Last updated:** [July 24, 2006, 6:48am UTC](https://www.ruby-forum.com/t/checking-for-directory-noob-mistake/99569 "2006-07-24T06:48:46Z")

</div>

I apologize in advance if this is a stupid question, but this is the first time I’m playing around with ruby and I’m kinda stuck. Been going thru the pickaxe as well, but maybe I’m just missing something. I have the f…

---

## [Irb completion](https://www.ruby-forum.com/t/irb-completion/98695)

<div class="topic-metadata">

**Author:** [@Tadayoshi\_F](https://www.ruby-forum.com/u/Tadayoshi_F)\
**Replies:** 21\
**Last updated:** [July 24, 2006, 6:33am UTC](https://www.ruby-forum.com/t/irb-completion/98695 "2006-07-24T06:33:31Z")

</div>

e$B$U$J$P$G$9!#e(B e$BJd40$N:\]$K!"e(B9e0 e$B$O?tCM$HG’\<1$5$l$k$h$&$G$9$,!"e(B9E0 e$B$O$=$&$J$i$J$$$h$&$Ge(B e$B$9!#e(B-9 e$B$N$h$&$J$b$N$b!#2DG=$J$i?tCM$H$7$FG’\<1$5$l$k$HJXMx$@$H;W$$$^$9!#e(B e$B$HBG$A$3$s$GJd40$7$…

---

## [Strip tags?](https://www.ruby-forum.com/t/strip-tags/99480)

<div class="topic-metadata">

**Author:** [@maxbohr](https://www.ruby-forum.com/u/maxbohr)\
**Replies:** 12\
**Last updated:** [July 24, 2006, 6:20am UTC](https://www.ruby-forum.com/t/strip-tags/99480 "2006-07-24T06:20:54Z")

</div>

Is there an easy way to strip html tags from strings? Thanks

---

## [Short cut to do a inspect method for object](https://www.ruby-forum.com/t/short-cut-to-do-a-inspect-method-for-object/99541)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [July 24, 2006, 5:13am UTC](https://www.ruby-forum.com/t/short-cut-to-do-a-inspect-method-for-object/99541 "2006-07-24T05:13:25Z")

</div>

I have a object with following instance variables def initialize(symb) #puts symb @symbol=symb @name=@exchange=@news=@summary=@sector=@industry=@category=@markedBad="" end Is there a quick way to override the inpec…

---

## [When I say method\_defined? I mean it!](https://www.ruby-forum.com/t/when-i-say-method-defined-i-mean-it/99421)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 7\
**Last updated:** [July 24, 2006, 4:26am UTC](https://www.ruby-forum.com/t/when-i-say-method-defined-i-mean-it/99421 "2006-07-24T04:26:17Z")

</div>

I’ve been bitten by this way too many times now. And I’m just plain tired of it. Today’s case: def wrap\_method( sym, &blk ) raise ArgumentError, “method does not exist – #{sym}” unless method\_defined?( sym ) old = …

---

## [Bother checking wether got response from others of your topi](https://www.ruby-forum.com/t/bother-checking-wether-got-response-from-others-of-your-topi/99564)

<div class="topic-metadata">

**Author:** [@hotting](https://www.ruby-forum.com/u/hotting)\
**Replies:** 0\
**Last updated:** [July 24, 2006, 4:22am UTC](https://www.ruby-forum.com/t/bother-checking-wether-got-response-from-others-of-your-topi/99564 "2006-07-24T04:22:25Z")

</div>

I know you must have such headache as I had. But now, aha, I found this website that really worths our focus: http://www.aotol.com It is pretty nice, helping us grasp the latest messages responded to our requests in t…

---

## [Ruby-VPI 0.7](https://www.ruby-forum.com/t/ruby-vpi-0-7/99478)

<div class="topic-metadata">

**Author:** [@Suraj\_NSKurapati](https://www.ruby-forum.com/u/Suraj_NSKurapati)\
**Replies:** 2\
**Last updated:** [July 23, 2006, 10:35pm UTC](https://www.ruby-forum.com/t/ruby-vpi-0-7/99478 "2006-07-23T22:35:24Z")

</div>

\-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ruby-VPI is a Ruby interface to Verilog VPI. It lets you create complex Verilog test benches easily and wholly in Ruby. Website: http://ruby-vpi.rubyforge.org Download…

---

## [Ruby Tk "on top"](https://www.ruby-forum.com/t/ruby-tk-on-top/99438)

<div class="topic-metadata">

**Author:** [@kly](https://www.ruby-forum.com/u/kly)\
**Replies:** 2\
**Last updated:** [July 23, 2006, 10:32pm UTC](https://www.ruby-forum.com/t/ruby-tk-on-top/99438 "2006-07-23T22:32:38Z")

</div>

Hey I’ve been wondering how to make a window fullscreen in Ruby Tk. I came across this which is what I’m using now: require ‘tk’ r = Tk.root r.withdraw r.overrideredirect = true r.deiconify r.geometry = “#{r.winf…

---

## [Symbols vs. strings as hash\_keys - interchangeable or not?](https://www.ruby-forum.com/t/symbols-vs-strings-as-hash-keys-interchangeable-or-not/99450)

<div class="topic-metadata">

**Author:** [@weyus](https://www.ruby-forum.com/u/weyus)\
**Replies:** 9\
**Last updated:** [July 23, 2006, 10:25pm UTC](https://www.ruby-forum.com/t/symbols-vs-strings-as-hash-keys-interchangeable-or-not/99450 "2006-07-23T22:25:51Z")

</div>

All, I have a Rails app where I load a YAML file into a class variable (in my application.rb file so it’s available to all controllers), like so: @@config = YAML.load\_file("#{RAILS\_ROOT}/config/eSimplyConf.yml") and …

---

## [Showing similar values in a table](https://www.ruby-forum.com/t/showing-similar-values-in-a-table/99476)

<div class="topic-metadata">

**Author:** [@raffir](https://www.ruby-forum.com/u/raffir)\
**Replies:** 4\
**Last updated:** [July 23, 2006, 9:38pm UTC](https://www.ruby-forum.com/t/showing-similar-values-in-a-table/99476 "2006-07-23T21:38:08Z")

</div>

I’m working on a project in which Accounts belong to a User. I’d like the User’s Welcome page to show who else has the same Accounts (based on account name) as that user. What I tried to do was place a SQL query insid…

---

## [Converting a text file into an "insert into ..." file](https://www.ruby-forum.com/t/converting-a-text-file-into-an-insert-into-file/99482)

<div class="topic-metadata">

**Author:** [@kublai](https://www.ruby-forum.com/u/kublai)\
**Replies:** 5\
**Last updated:** [July 23, 2006, 8:46pm UTC](https://www.ruby-forum.com/t/converting-a-text-file-into-an-insert-into-file/99482 "2006-07-23T20:46:36Z")

</div>

Hi, I have a csv delimited file that I’d like to ‘insert into some\_table table values …’ file. Thus I have a file where each row is of the sort: value1, value2, value3, value4 and I’d like to convert the file into a…

---

## [Introduction to Foreign Keys?](https://www.ruby-forum.com/t/introduction-to-foreign-keys/99515)

<div class="topic-metadata">

**Author:** [@raffir](https://www.ruby-forum.com/u/raffir)\
**Replies:** 1\
**Last updated:** [July 23, 2006, 8:36pm UTC](https://www.ruby-forum.com/t/introduction-to-foreign-keys/99515 "2006-07-23T20:36:14Z")

</div>

I’m relatively new to Rails and SQL. I’ve been working on an application for a while now, and I feel that I could really benefit from an introduction to using foreign keys both in SQL and Rails. Is such an introductio…

---

## [Infinity](https://www.ruby-forum.com/t/infinity/99448)

<div class="topic-metadata">

**Author:** [@hadley\_wickham](https://www.ruby-forum.com/u/hadley_wickham)\
**Replies:** 14\
**Last updated:** [July 23, 2006, 7:32pm UTC](https://www.ruby-forum.com/t/infinity/99448 "2006-07-23T19:32:50Z")

</div>

irb(main):084:0\> (-1.0/0.0) =\> -Infinity irb(main):086:0\> (1.0/0.0) =\> Infinity but irb(main):087:0\> Infinity NameError: uninitialized constant Infinity from (irb):87 from :0 is it possible to directly access/cr…

---

## [Dividing inside iterations?](https://www.ruby-forum.com/t/dividing-inside-iterations/99489)

<div class="topic-metadata">

**Author:** [@eddiewould](https://www.ruby-forum.com/u/eddiewould)\
**Replies:** 5\
**Last updated:** [July 23, 2006, 4:43pm UTC](https://www.ruby-forum.com/t/dividing-inside-iterations/99489 "2006-07-23T16:43:33Z")

</div>

Hi Learning R… Is it possible to divide values while inside an iteration? for example i’d like to do something like this: h = \[40,20,50,200\] h.each do |num,total| num / 24 = total print “#{total} \\n” end as you’d …

---

## [Xml builder not able to create namespaced elements w/attribu](https://www.ruby-forum.com/t/xml-builder-not-able-to-create-namespaced-elements-w-attribu/99505)

<div class="topic-metadata">

**Author:** [@stepheneb](https://www.ruby-forum.com/u/stepheneb)\
**Replies:** 1\
**Last updated:** [July 23, 2006, 4:39pm UTC](https://www.ruby-forum.com/t/xml-builder-not-able-to-create-namespaced-elements-w-attribu/99505 "2006-07-23T16:39:30Z")

</div>

I’d like to be able to build a xm like this with builder: \<sailuserdata:ESession xmi:version=“2.0” xmlns:xmi=“http:// XMI” xmlns:sailuserdata=“sailuserdata”\> \</sailuserdata:ESession\> XML Builder has a way of making…

---

## [Problem using open-uri for loading from host:8080](https://www.ruby-forum.com/t/problem-using-open-uri-for-loading-from-host-8080/99501)

<div class="topic-metadata">

**Author:** [@stepheneb](https://www.ruby-forum.com/u/stepheneb)\
**Replies:** 0\
**Last updated:** [July 23, 2006, 4:10pm UTC](https://www.ruby-forum.com/t/problem-using-open-uri-for-loading-from-host-8080/99501 "2006-07-23T16:10:39Z")

</div>

open-uri (and the libraries it builds on) don’t seem to be able to load resources from hosts with alternate port numbers. I 'm getting a OpenURI::HTTPError: 500 Internal Server Error when using open-uri to load from t…

---

## [Getting My Documents Folder](https://www.ruby-forum.com/t/getting-my-documents-folder/99481)

<div class="topic-metadata">

**Author:** [@Dave\_Ru](https://www.ruby-forum.com/u/Dave_Ru)\
**Replies:** 3\
**Last updated:** [July 23, 2006, 3:55pm UTC](https://www.ruby-forum.com/t/getting-my-documents-folder/99481 "2006-07-23T15:55:10Z")

</div>

Hi, I’m trying to find the my documents folder for the current user in windows. I know this can be done using Win32API, but I’m a little confused on the syntax. Here’s an article on how to do it in VB . Thanks, …

---

## [\*\_eval](https://www.ruby-forum.com/t/eval/99429)

<div class="topic-metadata">

**Author:** [@erikveen](https://www.ruby-forum.com/u/erikveen)\
**Replies:** 6\
**Last updated:** [July 23, 2006, 11:52am UTC](https://www.ruby-forum.com/t/eval/99429 "2006-07-23T11:52:24Z")

</div>

Can somebody explain me, in detail, the differences between aModule.instance\_eval, aModule.module\_eval and aModule.class\_eval? I’m especially interested in the differences in context. There must be a difference. If I…

---

## [Function for integers to displayed with same number of digit](https://www.ruby-forum.com/t/function-for-integers-to-displayed-with-same-number-of-digit/99469)

<div class="topic-metadata">

**Author:** [@adrian](https://www.ruby-forum.com/u/adrian)\
**Replies:** 5\
**Last updated:** [July 23, 2006, 6:55am UTC](https://www.ruby-forum.com/t/function-for-integers-to-displayed-with-same-number-of-digit/99469 "2006-07-23T06:55:41Z")

</div>

Is there or a function, or anyone know of a hack without using if else statements extensivley to have numbers displayed, such as 1 as 0001, 100 as 0100, 1000 as 1000 etc? Anyhelp is appreciated, thanks!

---

## [Showing part of an array](https://www.ruby-forum.com/t/showing-part-of-an-array/99426)

<div class="topic-metadata">

**Author:** [@bignall](https://www.ruby-forum.com/u/bignall)\
**Replies:** 5\
**Last updated:** [July 23, 2006, 5:11am UTC](https://www.ruby-forum.com/t/showing-part-of-an-array/99426 "2006-07-23T05:11:53Z")

</div>

Let’s say you have an array which might contain: colors = \[“black”,“white”,“red”,“yellow”,“green”\] And you’d like to see the first three elements with a … attached to the end if there are more than 3. “colors\[0,2\].jo…

---

## [An open letter to Rubyists - Naming things](https://www.ruby-forum.com/t/an-open-letter-to-rubyists-naming-things/99310)

<div class="topic-metadata">

**Author:** [@jeffpritchard](https://www.ruby-forum.com/u/jeffpritchard)\
**Replies:** 8\
**Last updated:** [July 23, 2006, 4:28am UTC](https://www.ruby-forum.com/t/an-open-letter-to-rubyists-naming-things/99310 "2006-07-23T04:28:19Z")

</div>

Is it just me, or do other Rubyists find it difficult to remember what a whimsically named module or plug-in was called that they saw on this or some other forum just last week. I’ve only been into Ruby for a few mon…

---

## [Newbie question - variables and memory](https://www.ruby-forum.com/t/newbie-question-variables-and-memory/99462)

<div class="topic-metadata">

**Author:** [@ben-v](https://www.ruby-forum.com/u/ben-v)\
**Replies:** 1\
**Last updated:** [July 23, 2006, 4:02am UTC](https://www.ruby-forum.com/t/newbie-question-variables-and-memory/99462 "2006-07-23T04:02:15Z")

</div>

I may be wrong, but I might have read somewhere that there’s a need to delete variables from memory. In my web environment, can the same variable or instance (@) variable retain the same value across multiple requests…

---

## [Self, looking for a good summary explanation](https://www.ruby-forum.com/t/self-looking-for-a-good-summary-explanation/99428)

<div class="topic-metadata">

**Author:** [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Replies:** 2\
**Last updated:** [July 22, 2006, 11:41pm UTC](https://www.ruby-forum.com/t/self-looking-for-a-good-summary-explanation/99428 "2006-07-22T23:41:11Z")

</div>

Sorry, because I have the books and have / continuing to read, just trying to wrap myself around one aspect of “self”. My understanding is that ‘self’ changes amongst objects depending on program code execution. Thi…

---

## [Re: Ruby on Handhelds](https://www.ruby-forum.com/t/re-ruby-on-handhelds/99457)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [July 22, 2006, 10:37pm UTC](https://www.ruby-forum.com/t/re-ruby-on-handhelds/99457 "2006-07-22T22:37:46Z")

</div>

Dear all, did anybody get one of those foldable infrared or bluetooth external keyboards from Pocketop to work together with a Zaurus (SL\_C3000/SL\_C3100/SLC6000, preferably)? After very many attempts, I managed to g…

---

## [Adding custom behaviors to a text\_field?](https://www.ruby-forum.com/t/adding-custom-behaviors-to-a-text-field/99455)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [July 22, 2006, 10:28pm UTC](https://www.ruby-forum.com/t/adding-custom-behaviors-to-a-text-field/99455 "2006-07-22T22:28:10Z")

</div>

Hello, I’m sure most of you have seen the forms, where people fill the default value of a textbox with the field title, and then when you click it, it empties the field for data to be entered. As I am fairly new to ru…

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

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