56652-57446 subjects 57093-62885

Ruby and Expect/Tcl
56858 [minhtang@uw ] I am new to ruby, and I would like to know whether there is something
+ 56914 [jfontan@ce g] Some time ago I started a module to use libexpect from ruby but I finished
| 57024 [minhtang@uw ] Thanks alot for the info.
+ 56915 [djberge@qw s] There is an expect module out on the RAA (www.ruby-lang.org/en/raa.html)

Another elementary problem... :-(
56861 [ ted@ph .n t] #!/usr/bin/env ruby
56863 [Juergen.Lind] say
56864 [ted@da ac mm] It worked!  Thanks so much.  When you said "Class method"/"Instance method", the light flickered on.
56890 [christopher.] ####################

Any Documents on HtmlParser
56862 [ganesan-ml@g] I am looking for a Ruby base HTML Parser,
56879 [jean-francoi] <URL:http://www.python.org/doc/current/lib/module-sgmllib.html>

Is %f formatting broken?
56866 [ted@da ac mm] sprintf ("%d days %02d:%02d:%02.6f",@DD,@hh,@mm,@ss)
+ 56868 [matz@ru y- a] But that's how printf(3) works.
| 56871 [ted@da ac mm] You're right...  I know how to get around it, but it's not pretty; primarily because of the leading 0 on the decimal portion of the number. :-(
+ 56872 [spoon-dated-] The '.6' part is the number of digits past the decimal point.
  56873 [ted@da ac mm] <slaps forehead>Yep! ... I should have known that all the way back from my FORTRAN days...

56876 [billarosa@ho] I am a student in Computer Science, I downloaded Ruby for the first time.I
56877 [decoux@mo lo] Well, it really depend on what you want to do. At ruby level, you can

56878 [billarosa@ho] I am a student in Computer Science, I downloaded Ruby for the first time.I

Sort by hash element
56880 [tim@ba es id] If I have an array of hashes, eg
+ 56881 [decoux@mo lo] Well, you can give it a block
+ 56963 [flori@ni e. ] a = [...]

set operation
56882 [xrfang@ho ma] Nice to mee you all here. I'm new to ruby although I have learned many
+ 56883 [tim@ba es id] I don't know what 'in' is used for, but another way to do this might be
| 56885 [nobu.nokada@] array_of_strings.include?(myString)
| 56886 [gsinclair@so] I've often thought that Array#=== should do the same thing as Array#include?
| 56891 [dblack@ca dl] Don't forget that === is the case equality operator, so that would
+ 56884 [decoux@mo lo] Well, you can perhaps use Array#include?

Documentation for REXML
56888 [briqueabraqu] Does anyone have the documentation for the REXML library? I need to

Re: Another elementary problem...
56895 [christopher.] Juergen,
56900 [dblack@ca dl] class A
56981 [gsinclair@so] I've stored this at http://www.rubygarden.org/ruby?ClassMethodsTutorial.

Knowledge Base (Re: set operation)
56898 [xrfang@ho ma] It's very exciting to see that the Ruby community is quite active. Thanks
+ 56899 [dblack@ca dl] You can search the ruby-talk archive at <http://www.ruby-talk.org>.
| 56904 [chrismo@cl b] And also here: http://groups.google.com/groups?q=group%3Acomp%2Elang%2Eruby
+ 56982 [gsinclair@so] Check out the FAQ (http://www.rubygarden.org/iowa/faqtotum) as well.  Also see
  56994 [mikkelfj-ant] Thanks
  56995 [mikkelfj-ant] I should add that the more official link to an article, once the id is know

explicit destroy
56907 [coquelle@en ] Is there a way to explicitly destroy an object ruby ?
+ 56918 [lyle@us rs s] No, you need to get rid of all references to that object and then let
| 56929 [hal9000@hy e] I can see the movie now: _Garbage Collect Another Day_...
| 56934 [dblack@ca dl] sprintf("%.3d", ?\a)  ...
| 56947 [lyle@us rs s] I am so lazy that I just fired up IRB and typed this in instead of
+ 57271 [ysantoso@je ] If you want Jinx to be notified when Bond died, then it's

Thanks! (Re: Another elementary problem...)
56917 [christopher.] Wow, that was great, thanks very much!  There is a lot of great info here. I

56919 [martindemell] Along the lines of +=...

ranges and the 'times' method
56920 [djberge@qw s] 3..5.times{ puts "yo" } -> what do you *think* this will do?
+ 56921 [decoux@mo lo] Well, you want #upto no ?
| + 56922 [decoux@mo lo] return self
| + 56935 [djberge@qw s] Yes, I realize that.  I was just making a point. :)
|   56936 [decoux@mo lo] You want an error, with this
|   56945 [djberge@qw s] Is that a terse way of telling me it's a precedence issue? ;)
|   + 56950 [decoux@mo lo] Well, actually #upto is defined only for Integer and String (I
|   + 56956 [martindemell] There's always each - (3..5).each {|i| p i}
+ 56923 [dcarrera@ma ] I think that it will be parsed as
+ 56924 [jfontan@ce g] You should put the range inside ().

Strings and substrings
56930 [dcarrera@ma ] str = "hello world"
+ 56932 [coquelle@en ] ...
+ 56961 [batsman.geo@] substring starting at index 0, length 0 => empty string
+ 57035 [angus@qu va ] 104 is the ASCII code of 'h'.

DRb & Threads ...
56942 [dmartenson@m] I have a Ruby application that is comprised of two threads. One thread
56985 [m_seki@mv .b] Yes, you need it and work well.
56992 [dmartenson@m] Thanks for the example.

Array#and? and Array#or? methods?
56948 [jdevries@pf ] Is there some reason the following methods on Array aren't included as
+ 56951 [dblack@ca dl] a = [1,2,3,4]
+ 56954 [eban@os ri .] Ruby 1.7 has Enumerable#all? and Enumerable#any? .

Does any have the reference library that was on http://www.rubycentral.com
56958 [paquerette@p] I can't display this site anymore and there online doc was very usefull...
56959 [dcarrera@ma ] They are having DNS problems.  Use
56962 [paquerette@p] I just love you ;o))

Vim and Ruby
56960 [brailsmt@ya ] There was a recent post to the vim ML about including ruby support in
+ 56989 [cparrish@co ] Are there any rpms of ruby support in VIM? I had to recompile.
+ 56990 [gsinclair@so] That's nice.  I remember spending a while compiling it in myself, and I haven't
  56998 [brailsmt@ya ] Do you mean ideas for scripts using ruby and vim?  I have posted two
  57011 [gsinclair@so] haven't

call-by-reference problem again
56967 [xrfang@ho ma] I encountered the call-by-reference problem, which was discussed before
+ 56970 [billtj@y. lu] In general, for the Ruby built-in classes such as String, the methods are
| 56972 [Dave@Pr gm t] That's not really the point. A ! method modifies the state of an
| + 56974 [xrfang@ho ma] In my class, I read some string from a text file, and store it in a
| | + 56977 [dblack@ca dl] str.replace("")
| | + 56986 [billtj@y. lu] I assumed that changing the state of an object using instance variables is
| + 56978 [xrfang@ho ma] Another problem about reference is that,
|   + 56979 [dblack@ca dl] It depends what you mean by "modify d".  I have a hunch you might be
|   + 56987 [billtj@y. lu] I don't think your statement above is right.  In Ruby, if you have
|   | 57014 [xrfang@ho ma] In my test the Arrays are all pointing to the same object, but the
|   | 57419 [billtj@y. lu] Can you give me the code where arrays are behaving differently from
|   | 57426 [xrfang@ho ma] I modified my code, I'm afraid that I can't find it. It is like the
|   | 57459 [batsman.geo@] Yes, because they are all the same array :)
|   | 57469 [xrfang@ho ma] I think it is explained already in the discussion. I am clear now, but I
|   | 57483 [austin@ha os] a=b=c=d=e=[1, 2, 3]
|   | 57491 [batsman.geo@] But it is not! :-)
|   | 57502 [xrfang@ho ma] I thought this problem over, and I admit I'm wrong, what I see the
|   + 57016 [bulatz@in eg] it's because you use self-modifying methods in one case and create new
+ 56975 [dblack@ca dl] What's happening here is that you've got a local variable, str, and
+ 56976 [billk@ct .c ] I'm confident the gurus can give more precision in their replies,
+ 57013 [bulatz@in eg] def test!(str)
  57033 [nemo@he lo r] ruby is not created with ability to modify parameters in mind. so you
  57050 [bulatz@in eg] ya, ya, of course :)  i'm not so dumb ;)

56969 [RembrandtAka] Could it be that the results of the MD5-Digest algorithm implemented in
+ 56971 [sebastian_ka] You forgot about the newline character that 'echo' produces by default.
| 56983 [RembrandtAka] Yes, you're right. What a stupid mistake...
+ 56984 [huber@al m. ] irb(main):004:0> MD5.md5("hello\n")
+ 56988 [spcoltri@om ] hrothgar ~ % echo hello | md5

Mapping output to an FXText window
56980 [helgaorg@ya ] I'm attempting to map output of a 'system' call
56991 [lyle@us rs s] You might want to take a look at the inputs.rb example program that
+ 56993 [jason@pe sa ] ...
+ 56996 [nobu.nokada@] Sorry, but not yet.

Fast Ruby web server
56997 [mikkelfj-ant] I was just looking at Tiki which recommended esehttpd in the documentation.
57186 [ruby-talk@wh] Thanks a lot for the link.  I've been playing with this web server for

Re: Array#and? and Array#or? methods
57002 [jdevries@pf ] ...
57038 [batsman.geo@] I didn't know detect until I read about it in the reply to your first

Shoeboxes and Bindings
57005 [jweirich@on ] Sorry for the long post.  I've been observing several threads recently
57009 [gsinclair@so] Nice commentary, Jim.  I've thrown it on the Wiki at
57010 [botp@de mo t] I second that, sir Gavin. Many thanks, too.

inf-ruby.el broken in version 1.7.3?
57006 [jdevries@pf ] I use emacs and run an inferior irb process within emacs (inf-ruby.el).
57023 [matz@ru y- a] It works for me.  Could you give me more info?
57040 [jdevries@pf ] version of irb that doesn't work: 0.9 (02/07/03)
57051 [matz@ru y- a] Hmm, it might be a Windows port bug.  Can anybody reproduce this

[ANN] Spreadsheet/Excel 0.0.1
57007 [djberg96@ho ] I am happy to announce that Spreadsheet/Excel 0.0.1 has been released into
57008 [botp@de mo t] Great Scott! This is even a lot better than vba programming inside excel.
57079 [montana@bu 9] Where do you get it at?
57080 [montana@bu 9] Sorry.

simple regexp question
57015 [xrfang@ho ma] if string=~/pattern/ then ...
+ 57018 [gsinclair@so] Funny that.  My copy of "Ruby in a Nutshell" says that '!~' is an operator
+ 57020 [matz@ru y- a] I guess "string !~ /pattern/" does.
+ 57021 [martindemell] Since method names can include !, this gets read as
| 57036 [michael_s_ca] Not to mention that adding a bit of whitespace around binary
+ 57022 [alan@di ik t] Perhaps your pattern isn't doing what you think it should or the string
+ 57039 [batsman.geo@] This is read as 'string! ~/pattern/', so ruby tries to call method '!'

57025 [ohmmokzim@ho] I am a beginner.

use of FXSwitcher ?
57026 [coquelle@en ] ...

use of FXSwitcher ? --correct! (sorry)
57027 [coquelle@en ] ...
+ 57029 [decoux@mo lo] Try
+ 57188 [lyle@us rs s] Guy has already pointed out the misspelling of "initialize", which is a

can we ADD connection to FXShutterItem.button
57030 [coquelle@en ] ...
57190 [lyle@us rs s] 1. The shutter item's button sends a SEL_COMMAND message

Shared library paths on linux
57031 [blackrob@je ] I'd like to build the shared library version of ruby on linux, but I don't

A lesson learned
57032 [gsinclair@so] Folks,
+ 57042 [enric@1s ar ] If you have time, read "Code Complete" from Steve McConnell
+ 57047 [mikkelfj-ant] and D. Knuth: "early optimization is the root of all evil".
+ 57049 [mwilson13@co] I really appreciated this lesson learned about the development process

ruby DBD::Pg disconnection
57034 [geniusj@bl e] A pretty simple problem (to describe).  Basically what's happening is I

57037 [xrfang@ho ma] anyone used exerb? I tired with my program it worked fine. However, if I use
57074 [davem1957@ya] I had the same problem. I worked around it on my windows system by

FXRuby compile error
57041 [khindenburg@] (kvh@rachael)-(15:49)-(~/FXRuby-1.0.16)> ruby install.rb setup
+ 57054 [coquelle@en ] ...
+ 57192 [lyle@us rs s] Please check the "Things That Can Go Wrong" section of the build

UTF-8 "bug": not in accordance with the unicode-3 specs
57043 [paul@fl or a] I noticed the following while reading article on UTF-8
57056 [matz@ru y- a] Array#pack("U") and String#unpack("U") are UTF-8 packer/unpacker, so
57345 [akr@m1 n. rg] Is there a way to detect the warnings from Ruby script?
57347 [matz@ru y- a] Currently, no.  Probably I have to design warning API.
57348 [akr@m1 n. rg] I see.

too clever?
57044 [xrfang@ho ma] Sometime, I think ruby is too clever. It automatically expand cmdline.
57045 [ oct@zo .o g] My shell does the "*.doc" expansion if I forget to protect the *.

Crash on 1.7 on Win32 [Was: TkOptionMenuButton]
57046 [phlip_cpp@ya] That does its (perfectly useless) thing on Linux, but on Windows it

57048 [winmillon@ho] World Events are affecting the way we live.

root directory
57052 [emmanuel.tou] Right now I need in an application to recurse from the current dir to the
+ 57064 [emmanuel.tou] def root?()
+ 57094 [vjoel@PA H. ] irb(main):004:0> File.dirname('/usr/local')
  57101 [emmanuel.tou] irb(main):001:0> File.split("/home")
  57103 [nobu.nokada@] No, File#split just returns File#dirname and File#basename, and
  57114 [emmanuel.tou] well, if we remove the final "/" it will be ok then?

57055 [winmillon@ho] World Events are affecting the way we live.

Ruby Memory Profile
57059 [squidster@te] I'm writing quite a quiet a resource hungry program (current about
57442 [drbrain@se m] You mean memory consumption increases by 2MB/sec?  Perhaps you've
57466 [squidster@te] Yeah. 2MB/s.

loop starting not from beginning
57060 [botp@de mo t] File.open("test") do |f|
57061 [phlipcpp@ya ] File.open("test") do |f|
+ 57062 [decoux@mo lo] #slice don't take a block as argument :-)
| 57085 [phlipcpp@ya ] Apologies to the newbie, but I think ... each ... of the rest of us can
| + 57086 [batsman.geo@] In
| | 57106 [botp@de mo t] Many thanks to Phlip, Guy, Nobu, and Batsman for the enlightenment.
| | 57109 [botp@de mo t] def Fp (file,skip)
| | 57111 [nobu.nokada@] Fp("input.txt", 4) {|line| p line}
| | 57112 [botp@de mo t] This is neat. Very Ruby, imho.
| + 57115 [decoux@mo lo] You have just asked what is wrong with something that you've not taken the
+ 57063 [nobu.nokada@] I'm not sure what trouble you've experienced, perhaps the file

inwoking irb from the middle of things
57066 [Radek@Hn li ] i know that i can inwoke irb from middle of program, the smallest
+ 57069 [decoux@mo lo] Well, probably you can also look at debug.rb and see if you can modify it
| 57075 [radek@hn li ] I got a help from NaHi
+ 57073 [nobu.nokada@] Irb works in separated binding.
+ 57479 [nakahiro@sa ] $ cat catch.rb

exit() called in ruby_run()
57068 [agentiamaya@] I've been working on Visual C and Ruby, I embed ruby into an
57070 [decoux@mo lo] It's normal
57071 [agentiamaya@] My program in ruby just create a file; I want use this file in my program in
57072 [decoux@mo lo] Can you post your program, if it has only few lines or send me in

57076 [winmillon@ya] World Events are affecting the way we live.

webunit and multipart/form-data?
57077 [armin@xs .d ] I am unit-testing a simple CGI-app that uses

DSN-less connection (Re: exerb)
57078 [xrfang@ho ma] Thanks David.
+ 57334 [chrismo@cl b] should
+ 57464 [davem1957@ya] Correct. I just happened to be using a DSN in that sample. Here is a

57083 [winmillon@ya] World Events are affecting the way we live.

57084 [winmillon@ya] World Events are affecting the way we live.
57087 [batsman.geo@] [SPAM]
+ 57088 [spectra@de i] Well... this is one of the new strains of spam. SA, which we have installed in
| + 57104 [tim@ba es id] I installed SpamAssassin yesterday, and it's caught all of these. I didn't
| + 57116 [tom.hurst@cl] SpamAssassin 2.50 should come with a bayesian filter -- it'll just need
+ 57091 [alan@di ik t] That's funny, my local SA happily filtered those messages.  It might

DollarUnderscore again
57089 [martindemell] Sorry if you see this twice on the ng - the mailing list rejected my
57095 [simon@si on ] $_  The last string read by gets or readline in the current scope.
57098 [martindemell] Thanks!

57092 [4m3li4@in o.] Dear Netter,