273387-350999 subjects 273787-276979

Using strings to drill down into objects
273604 [Ross.Dawson@] ...
273636 [mortee.lists] I'm not sure what your intent is, but I guess this code won't work.
+ 273639 [mortee.lists] Sorry, that should read
+ 273664 [lojicdotcom@] Are you sure about that?
  273671 [mortee.lists] Sorry, you're right. I've never tried this actually on an undefined
  273705 [Ross.Dawson@] ...
  + 273713 [mortee.lists] OK, that makes more sense. Still, we don't know what you have to start
  + 274203 [pit.capitain] def drill_down(obj, method_names)

Why does this use a block
273612 [jaimrk@ao .c] So I'm new to Ruby and I'm trying to use OptionParser to parse in some
+ 273615 [drbrain@se m] It works both ways.  Blocks are pretty, so people use them.
| 273619 [shortcutter@] There are in fact important differences to both approaches. First,
| 273644 [rick.denatal] I'm pretty sure that I've seen a variant on this in which initialize
+ 273618 [erikveen@gm ] About using blocks in constructors in general...
| 273667 [lojicdotcom@] So, most of your objects are immutable?
| 273691 [erikveen@gm ] Yes. (If possible...)
| 273696 [lojicdotcom@] Have you thought of programming in Haskell? ;)
| 273766 [shortcutter@] Actually programming completely without side effects defies the core
| 273878 [rick.denatal] I'd agree. Multi-paradigm programming is one thing, but this seems
+ 273620 [flori@ni e. ] You might want to use the shortcut
+ 273625 [caduceass@gm] You are asking a bunch of questions here, but I'll try my hand at one of them.
+ 273647 [dolgun@ex it] In ruby, a lot of methods can be called with or without a block.  When a

XMLsimple & probem
273617 [valblade@gm ] <test>
+ 273631 [peter@ru yr ] maybe try &amp;
| 273637 [valblade@gm ] That's works fine thanks!
+ 273640 [mudsweatande] Your xml file must wrap your data in CDATA tags in order for you to
  273642 [valblade@gm ] You're a genious, thanks :)

Re: Class#aliases?
273622 [ed.odanow@wo] btw - is there a difference between "alias" and "alias_method" if
273652 [transfire@gm] Do you mean that you'd like a list of all aliases defined in a class,
274680 [djberg96@gm ] Ryan Davis came up with a rather interesting solution. :)

Dynamically create hash
273626 [matthias@wi ] i would like to dynamically create hashes, so that I can create them by
+ 273627 [sepp2k@go gl] You can do that using eval (or using instance variables), but that's evil.
+ 273628 [jg@co ne ti ] I've no idea why you want this, but I think you want to have an array of
| 273629 [matthias@wi ] Thanks guys, that helped a lot.
+ 273663 [lojicdotcom@] As other posters have mentioned, it's quite possible you don't want to

Should *most* memory be release back to the system?
273630 [mudsweatande] If anyone can explain this I would appreciate it.
273638 [ysantoso-rub] It's your OS (I meant kernel and libc).
+ 273646 [mudsweatande] I do appreciate your help (and no that link is lost to the mists of
| + 273649 [shortcutter@] There are a few things to say to this.
| + 273674 [mental@ry ia] This is not actually a problem specific to Ruby, but applies to the
|   273681 [sylvain.joye] Ruby does not free heaps. It it supposed to do so, but the way it allocates
|   273685 [mental@ry ia] That's true; Ruby tends to use relatively large heap sizes, which
|   273689 [sylvain.joye] Actually, it does not really. The probability to have at least one object
+ 273684 [vjoel@pa h. ] (1) an estimate of how much memory is used by the interpreter for
| 274672 [ysantoso-rub] It's #1.
+ 273763 [dan-ml@da 42] Ah, good ol' archive.org
  273785 [mudsweatande] Thank you everyone. I can now make some relatively informed and ration
  273792 [shortcutter@] Let us know the outcome. :-)

[SUMMARY] Itinerary for a Traveling Salesman (#142)
273635 [james@gr yp ] This time, we tried to put the focus on how you solved the quiz, instead of the

Active dutch spoken usergroup
273648 [bkcfscpmcuin] I was wondering if there's any Dutch spoken ruby user group.  I found a

Collaborative filtering
273654 [nick@co ev d] Anyone implemented collaborative filtering with Ruby?

[OT] Re: Should *most* memory be release back to the system?
273655 [ara.t.howard] kind regards.
274671 [ysantoso-rub] Ah, I'm sorry. I have been swamped recently and has not been able to
+ 274699 [znmeb@ce ma ] Is this worth making part of the standard Ruby build on Linux?
| + 274705 [ysantoso-rub] Definitely not. This is just for diagnostic. It's also quite expensive
| | + 274709 [ara.t.howard] that's quite interesting because, while i'm not the memory expert you
| | | 274761 [znmeb@ce ma ] fork() (or clone() in Linux) is cheap ... it's actually *instantiating*
| | | + 274785 [ysantoso-rub] Ara, my knowledge is limited to whatever few ad-hoc experimentations
| | | + 274810 [khaines@en g] This is just a side note, but the sentence above reminded me of it.
| | |   + 274819 [shortcutter@] Did you fork for every request?  If so then it seems there might be a
| | |   | 274828 [khaines@en g] Yeah.  I was just exploring the idea of memory management through fork().
| | |   | 274943 [znmeb@ce ma ] Is that what's known as the "Mongrel Hordes?"
| | |   + 274826 [znmeb@ce ma ] Yeah ... I should have been more explicit. When you do a fork/clone in
| | |     274884 [hramrach@ce ] Well, the memory subsystem is quite underdeveloped on the "general
| | |     274909 [ news@ja .f ] There was a paper a few years ago on the idea of a GC that could
| | |     274989 [hramrach@ce ] You could probably see your memory map and your pagefaults, after all
| | |     274992 [ news@ja .f ] Right - I think the idea was, in fact, to do something clever.
| | + 274723 [jeremy@bi sw] lifetime than a single request. You can let the process exit after
| + 274714 [mental@ry ia] The downside is that using mmap for every allocation can result in
+ 274729 [vjoel@pa h. ] Very interesting. I'd like to use this as a diagnostic.
  274741 [mental@ry ia] Using mmap for individual allocations means that each allocation
  274780 [ysantoso-rub] I suppose all these could be offered as an extension module. At the

question DRb class definition share or not share
273662 [uchenwc@gm i] Just go through ruby cookbook & only tutorial for any DRb stuff. But I
273665 [drbrain@se m] This is exactly right.  DRbUndumped forces the creation of a proxy
273675 [uchenwc@gm i] Thanks Eric, it is much clear to me now! The recipe 16.10 of ruby

Feedback on new Path Library
273669 [probablyCore] I created a new Path library (http://pow.rubyforge.org) that combines
+ 273695 [ciconia@gm i] Congrats. This looks very nice!
+ 273697 [djberg96@gm ] What does this do that pathname2 doesn't do?
  273714 [probablyCore] Well, Pow does have the nested directory structure creation, but other
  273715 [shevegen@li ] I believe these two competing products (hehe ;> ) demonstrate that the
  273716 [drbrain@se m] How is FileUtils cumbersome?
  273795 [probablyCore] First off I totally agree with you here, the FileUtils::DryRun and

how to pack an integer array to string?
273670 [goal1860@ho ] I want to pack an array such as [1,2,3,4]
+ 273672 [fwmailinglis] charset="US-ASCII"
+ 273673 [jeremy@hi eg] % irb
+ 273676 [jqwoods@gm i] irb(main):112:0> [1,2,3,4].to_s
| 274170 [botp@de mo t] # irb(main):112:0> [1,2,3,4].to_s
+ 273728 [goal1860@ho ] I just put eyes on 'pack', not aware that so many workarounds.

WSDL says "cannot find type {}sayHi" - what does this mean?
273677 [kuro@ba is e] I'm new to Ruby (just finished Hello World) and also fairly new to SOAP.

I need some help plz with my ruby project.
273678 [wiz_pendases] First, i need to extend the student class, and its to be enumerable by
273686 [JeremyWoerti] well, to start I noticed a few syntax errors, yield is misspelled, and
273687 [JeremyWoerti] oh, and also, take out the collect on s1.each_grade and try just
274186 [ujihisa@gm i] class Student

Text/Tag Cloud generation
273679 [jamesoyim@ya] I want to generate a ???text cloud???, except there are a couple things out
273753 [globyy3000@h] Tools are listed just a minor scroll down the page
273810 [jamesoyim@ya] Thanks for the reply. I had run across that link in the past, and the
273820 [jan.svitok@g] Isn't a text cloud just a fancy word/phrase frequency table, or am I
+ 273825 [jamesoyim@ya] Really, I am expecting it to be rather slow with how much data I am throwin=
+ 273826 [alex@bl ck e] Actually, no.  The number of different words in a corpus goes up roughly
  273838 [jan.svitok@g] Ok ;-)  What I meant was that for given size of corpus (~10GB) the

Graticule error?
273690 [globyy3000@h] I've been wanting to just play around with graticule but i cant seem to

SQLite and ruby
273692 [unbewusst.se] lastName, firstName, fullLastName
+ 273694 [ciconia@gm i] If you have the sqlite3 libs installed, you can install the sqlite3
| + 273700 [unbewusst.se] already done, thanks ;-)
| + 273704 [unbewusst.se] class Person < Sequel::Model(:devicephonebook)
|   273706 [unbewusst.se] OOOPPPSSS !!!!!
+ 273699 [unbewusst.se] #! /usr/bin/env ruby

Reliable multicasting
273693 [lerno@dr go ] Does anyone know if anyone of the reliable multicasting protocols
+ 273702 [gwtmp01@ma .] rb_spread: <http://rbspread.sourceforge.net/>
| 273751 [lerno@dr go ] Ah, I should have mentioned I did check out spread, but its not a
+ 273703 [ara.t.howard] check out spread, there are ruby bindings for it.

How to delete specific characters from a string?
273707 [hs@db in .c ] Is there really no method that allows me to delete N characters starting
+ 273708 [bbxx789_05ss] str = "hello world"
| 273712 [hs@db in .c ] Thanks. Very elegant.
| + 273735 [wayneeseguin] ...
| | + 273741 [mortee.lists] What's your point? Your code probably won't do what it seems to intend
| | | 273798 [james@gr yp ] indices.each do |index|
| | | 273801 [wayneeseguin] ...
| | + 273794 [wayneeseguin] ...
| |   273796 [wayneeseguin] ...
| + 273797 [james@gr yp ] => "muppet"
+ 273709 [mike@st k. a] bash-3.2$ irb
+ 273710 [bob@pr ul .c] Look at the String#slice method.  This is usually used via the []
+ 273711 [unbewusst.se] with String#slice ???

IRB - ignoring comments (toggling)
273717 [shevegen@li ] i think i have asked this ~a year or so ago already,

range max
273718 [m.kasperkiew] If i try this
+ 273721 [m_goldberg@a] I'm afraid that's the way the Enumerable mixin works.
| 273729 [m.kasperkiew] thanks Morton,
| + 273732 [mortee.lists] You think this has anything to do with the quality of the language?...
| + 273734 [lojicdotcom@] On Oct 11, 11:11 pm, Marek Kasperkiewicz <m.kasperkiew...@gmail.com>
| + 273738 [ara.t.howard] class Lang < String
|   273748 [vjoel@pa h. ] nil.succ.succ.succ.succ
|   273750 [ara.t.howard] shhh.  don't tell!
+ 273727 [lojicdotcom@] On Oct 11, 9:30 pm, Marek Kasperkiewicz <m.kasperkiew...@gmail.com>
| 273800 [ymendel@po o] I was thinking Range#last, but that has the same problem as Range#end
| + 273812 [shortcutter@] I believe not. #max *has* to use <=> for a proper result.  Although it
| + 273823 [lojicdotcom@] Actually, what you want is simply N. It's a nonsensical request from a
|   + 273839 [mortee.lists] Ehhh... it's actually quite probable that the OP was indeed just insult
|   | 273889 [lojicdotcom@] I think you're assuming we're assuming :) Rather than put words into
|   | 273890 [ara.t.howard] 0 ... 1
|   | 273895 [lojicdotcom@] Wrong. (0...1).max_int -> 0 (see code in other post)
|   | 273897 [ara.t.howard] you code does not return the max, it returns the 'end', and
|   | 273903 [lojicdotcom@] Fixed now :)
|   | + 273907 [luutrunghieu] File Not Found
|   | + 273913 [ara.t.howard] but #include? is not
|   |   273914 [lojicdotcom@] Dude, you totally missed your cue about point #3. You were supposed to
|   + 273848 [ara.t.howard] that is not true.  any object can be used in a range in ruby.  it
|     + 273892 [lojicdotcom@] I'm not unfamiliar with the domain of the Range class. Let's not get
|     | 273898 [lojicdotcom@] Actually, I think the following would be better for those rare people
|     | 273900 [lojicdotcom@] D'oh! Old code failed for (0...0)
|     | 273912 [ara.t.howard] p ( -1 .. -4 ).max
|     | 273915 [lojicdotcom@] Are you complaining about my version of max or the built in? I can't
|     | 273999 [ara.t.howard] not complaining about anything.  over the years people have posted
|     + 274063 [rick.denatal] Actually as discussed not long ago, this is actually too strong a
+ 273901 [luutrunghieu] text
+ 273905 [luutrunghieu] sfsfa

how to choose a belt (gurtel) gift
273719 [hsz228@ho ma] HOW TO CHOOSE AND BUY A BELT AS A GIFT???

sort double-dimensional array by column
273722 [tiberiu.moto] I have a [m X n] double-dimensional array in Ruby and I'm trying to
+ 273724 [jqwoods@gm i] If I understand what you're after, I'd say in the 2nd & 3rd conditions,
| 273873 [tiberiu.moto] inverse -1 and 1). I didn't read the Array.sort doc properly and
+ 273736 [mortee.lists] What about this one?
  273874 [tiberiu.moto] Thanks mortee. That sort of worked. Unfortunately, it puts those
  273880 [mortee.lists] Yes. Your code seemed like you want to fall back to the 7th column for

Ignore printout
273725 [fredjoha@gm ] I am using a compiled C-code in my Ruby program. The problem is that
+ 273740 [mortee.lists] You may try to redirect $stdout while the C code runs - I'm not sure
+ 273742 [drbrain@se m] You will need to reopen STDOUT to /dev/null
  + 273758 [fredjoha@gm ] Then I have two more questions to that :)
  | + 273799 [ed.odanow@wo] Only as an remark - on Windows you should use
  | + 273819 [drbrain@se m] In your case you want to reopen STDOUT because somebody using your
  + 273759 [fredjoha@gm ] $stdout.reopen(File.new('/dev/null','w'))
  + 273767 [fredjoha@gm ] Well, this does the trick (note the 'clone' instruction on line 1). It
    273786 [mortee.lists] I'd guess that when you reopen a stream, then it as an object remains

Child < Parent < Test::Unit::TestCase
273730 [lojicdotcom@] I just ran into a problem with Test::Unit exhibited by the two files
273737 [george.ogata] I don't know if it's advisable or not, but one way is to undefine
273768 [lojicdotcom@] Thanks! I just looked through testcase.rb, and your suggestion seems
273771 [lojicdotcom@] Using a Module class variable helps a bit, but it still doesn't feel

ruby tk drawing a line
273739 [redman@ac es] I have a question concerning ruby/tk and drawing lines on a canvas.
+ 273747 [vjoel@pa h. ] Does the same thing happen without the fill param?
+ 273749 [nagai@ai ky ] You write so many new lines at here.

continuous input until semicolon reached
273743 [shuaib.zahda] I am doing a program in which I want to allow my user to keep keying in
+ 273752 [globyy3000@h] while gets.chomp != ";"
| 273756 [yermej@gm il] I don't think this does what you think it does. String#chomp takes a
| + 273757 [yermej@gm il] which isn't completely correct either, but the general idea is there
| + 274641 [shuaib.zahda] I used this code and it works but I have a question and I need to
|   274659 [thomas.adam2] Yes.
+ 273779 [sepp2k@go gl] gets(";")
+ 274668 [bbxx789_05ss] str = "text here;"

[OT] Re: Reliable multicasting
273754 [ara.t.howard] maybe it can be done - but it seems any reliable multicasting =20
273806 [lerno@dr go ] Well, apparently in JGroups there is no daemon, everything seems to =20

Syntax error when redefining >> operator to take a block
273755 [jqwoods@gm i] I'm trying to redefine the >> operator for a particular class such that
+ 273793 [shortcutter@] Redefining operator behavior cannot change Ruby's syntax.  >> is with
| 273853 [jqwoods@gm i] I don't understand why it's invalid syntax. I'm new to Ruby and am
| 273881 [shortcutter@] I cannot be different because - as I have said before - a method /
| 273885 [dangerwillro] Generally, you don't need to try and create or override operators in
+ 273899 [celtic@sa ry] I think the problem is summed up shortly in another reply, but --
  + 273954 [jqwoods@gm i] Thanks guys, I now understand much better what's going on with my
  + 273957 [rick.denatal] c.>> { |x| puts x } # outputs "inside >>"
    273963 [shortcutter@] Yeah, and that's why operators are special in a way when it comes to

SQLite3::SQLException: no such function: get_zy_string
273774 [unbewusst.se] require 'sqlite3'
273814 [ghalsey@ya o] #sql statements need to terminate with a ;
273835 [unbewusst.se] yes, i know, but i forgot...