45702-124366 subjects 46130-47617

Q's about rubydbc
45883 [ rtan@vt ed ] I just downloaded the ruby design by contract code, and I have a couple
+ 45890 [andy@to ls e] Sadly, no.  I whipped that up as an experiment a while ago,
+ 45895 [justinj@mo i] I'd be interested to know if anybody is using this too.
  45897 [andy@to ls e] I think so, despite the fact that I haven't used it much myself :-)

Re: Emacs is dead, ...
45887 [michael_s_ca] It's been thought of, a lot.  I've heard/read threads for years about

Re: GridFlow 0.6.0 (fwd)
45893 [matju@sy pa ] Here is a new release of GridFlow (a multi-dimensional dataflow processing

How to copy string from in a file from some string onward?
45910 [keuler@po ta] All-
+ 45912 [dblack@ca dl] /#{x}.*/.match(y)[0]   # =>"jumped over the lazy dogs back."
+ 45913 [alan@di ik t] x = y.slice(Regexp.new("#{z}.*$"))
| 45916 [keuler@po ta] Thanks Alan, Dave!
+ 45917 [batsman.geo@] x = y[(y =~ /#{z}/)..-1]
  + 45936 [keuler@po ta] Dang, that's compact! Thanks!
  + 45963 [behrends@cs ] Does not work reliably if 'z' contains special regular expression

OT: Editors, Tabs & Spaces (Re: Style question)
45914 [tsiivola@cc ] Hmmm. I believe emacs can be made to EAT UP little innocent spaces and

Para o educador a psicologia ? muito mais que uma ferramenta de trabalho
45924 [promocao@se ] ...

45925 [adavies@op u] ftp = Net::FTP.new('www.4gigs.com', user, pass, )
45955 [J.Hawkeswort] I think what you are asking for is outside the remit of ftp.
+ 45956 [J.Hawkeswort] Whoops - incomplete message.  As I was saying
| 45962 [tsiivola@cc ] puts (Net::FTP.methods - Object.methods).sort,
+ 46116 [adavies@op u] Thank you for your help.

How to make a virtual 2nd column!!!
45938 [keuler@po ta] All-
+ 45941 [dblack@ca dl] # Very quick, home-rolled text wrapper (there are others out
+ 45944 [pabs@pa lo r] #!/usr/bin/env ruby
| 45970 [dblack@ca dl] $ ruby -ve 'ARGV.each {|f| p File.readlines(f)}' file1 file2
+ 45978 [rubel@cr c. ] You might want to look into FormatR ;)

Problem reading $stdin on Windows
45939 [patrick.benn] Using the rubycentral/1.6.6 install of Ruby, I'm having problems reading
45943 [nobu.nokada@] Once I've heard same issue occurs also with Perl in that way.

Any way to disable command-line expansion?
45940 [patrick.benn] Is there any way (windows / Ruby 1.6.6) to disable the automatic
45945 [nobu.nokada@] Or if you run cygwin ruby from non-cygwin shell, add "noglob" to

win32ole and excel
45942 [martin@ma si] @app = WIN32OLE.new("excel.application")
+ 45967 [masaki.suket] Try to specify full path of racetemplate.xls.
+ 46162 [mikkelfj-ant] file
  46191 [masaki.suket] Oops, the ie.rb sample is not correct. I'll repack win32ole-
  46227 [mikkelfj-ant] this
  46295 [masaki.suket] FYI, The "method_missing" is because of the trick of Win32OLE.
  46336 [mikkelfj-ant] Right - I see that now.
  46407 [masaki.suket] I am not sure but I hope to fix.
  46483 [mikkelfj-ant] I think they generate wrapper code from the typelib. So the wrapper uses
  46519 [masaki.suket] FYI, sample/olegen.rb creates wrapper code from the typelib.
  46704 [mikkelfj-ant] Well, I tried patch, but I've never done that before and got
  + 46811 [masaki.suket] Hmmm...
  + 46812 [masaki.suket] <mikkelfj-anti-spam@bigfoot.com>
    46823 [mikkelfj-ant] You should remove "-anti-spam"
    + 46824 [hal9000@hy e] to
    | 46828 [mikkelfj-ant] I'm not sure - I think I am.
    + 46889 [masaki.suket] I understand what is the problem now.
      47119 [masaki.suket] Done. Please try Win32OLE 0.5.0.
      47156 [mikkelfj-ant] Works on my test script :-)

How to format the 2nd field in a record with word wrap?
45946 [keuler@po ta] All-
46020 [gsinclair@so] I'll throw my hat in the ring as well!

45947 [pabs@pa lo r] I find myself converting the results of option parsing into a hash.  I
45949 [pit@ca it in] I used a similar approach, too, and found it very useful. Otherwise I
45968 [djberge@qw s] Let's take it a step further.  Scrap the current implementation and make
46035 [gsinclair@so] That doesn't sound like a great idea to me, unless *all* the methods of Hash
46048 [djberge@qw s] I disagree.  Why must *all* the options be *useful*?  I'm sure more than one
+ 46049 [hgs@dm .a .u] Doesn't it need to be an ordered hash, for the case where successive
| + 46075 [charleshixsn] Sounds like a tree is what you are really after.  Or a hash that has
| | 46083 [pbrannan@at ] Or an array of pairs (which can be generated from a hash, if necessary)
| + 46093 [pabs@pa lo r] The conversation here seems to be assuming I was talking about replacing
+ 46058 [nobu.nokada@] GetoptLong doesn't act like a Hash, but does as an Enumerable.

"gets" blocking process not thread (in Windows only)
45948 [mfp@cs mu OZ] The problem with my program is that (in Windows) gets seems to block the entire
+ 45983 [Laurent.Jull] I don't know if this relates in any way with what Curt Hibbs is trying
| 45987 [hal9000@hy e] I think this *may* be unrelated.
| 45990 [curt@hi bs c] It might be related. The one of the test cases I am currently using does not
+ 46029 [nobu.nokada@] This limitation comes from that the current implementation uses
  + 46056 [pbrannan@at ] What issues are there with using rb_f_select() instead?
  | 46333 [nobu.nokada@] I meant that rb_f_select() is implemented with select().
  | 46335 [pbrannan@at ] Could rb_f_select() be changed to work in terms of
  | 46343 [nobu.nokada@] I heard it's not guaranteed to work with sockets, and
  | 46419 [pbrannan@at ] I wonder what "not guaranteed" means.
  | 47186 [nobu.nokada@] It means, it depends on the implementation and MAY work.  It just
  + 46294 [mfp@cs mu OZ] Is this a problem in the cygwin as well as the vc++ compiled versions of ruby?
    46334 [nobu.nokada@] Under cygwin, apparently once you type any key and "gets" block

tail - latest incarnation
45984 [djberge@v5 h] Here's the latest incarnation I've come up with, stealing bits of code from James Hranicky and

vim indenteation for ruby
45998 [lists@de on ] Hey,
+ 45999 [lists@de on ] found the culprit.
| + 46001 [hal9000@hy e] There's obviously no real standard. That is
| | 46028 [alwagner@tc ] Yes, that's true.  I received the same revelation.
| + 46003 [ned@bi e- om] Yes, it is; I'd add "set et".
|   46007 [gsinclair@so] There's no good reason.  It should be removed.
|   46011 [gsinclair@so] While we're on the subject, comments shouldn't be forcibly continued when
|   46016 [rawlins@cs u] Oh God! can I not save=20
|   46021 [gsinclair@so] Oh, I realise that, but it shouldn't be in the standard ftplugin.
+ 46050 [martine@cs w] (and :set noet, but that's the default, I think)
  46066 [tom.hurst@cl] Note the automatic indenting is set by shiftwidth, which is set to 2 in
  46171 [lists@de on ] I don't mind tab being represented by two spaces, I prefer 3, but sw

Checking whether a process exists (unix)
46004 [harryo@zi .c] To check whether a process with a given ID is still running on unix, I would
+ 46006 [harryo@zi .c] As usual, I just realised that I've misunderstood the problem.  Given the way
| 46008 [harryo@zi .c] Ignore my previous ramblings.  I've worked it out.
| 46025 [djberg96@at ] command called "Sys/ProcTable".  It's available on the RAA and works for
+ 46057 [pbrannan@at ] When kill() doesn't actually kill a process, it seems to raise an

.irbrc (was Re: ftp)
46022 [gsinclair@so] Very nice.  I've appropriated it.  Thanks!

Style: where to require in libs?
46023 [comp.lang.ru] When writing libraries for other programs to use
46026 [gotoken@no w] [1] and [2] have the same effect for ruby interpreter at all because
+ 46045 [meier@me st ] =2E..and make debugging harder. But aren't we all doing unit testing? :)
| 46081 [gotoken@no w] By the way, unit testing is big fun but useful only if that testing is
+ 46079 [comp.lang.ru] - - So require is not just a "smart" include, but something that
  46092 [gotoken@no w] Yes.  require doesn't "insert" code there.  require only loads a

IO.readlines is slow ?
46030 [ADATE@kc rr ] arr = IO.readlines("test1.txt")
+ 46031 [ned@bi e- om] On my machine it takes 0.1 seconds or so to read a 4Mb file made
| 46038 [nobu.nokada@] It would depend on the version.
| 46052 [ned@bi e- om] Hmm... quite right... Ruby 1.6.7 is three or four times as slow as the
+ 46033 [gsinclair@so] Fair enough to enquire about performance, especially relative to similar
+ 46043 [pierre.baill] oct@carafon:~$ ls -la sample.txt
| 46053 [ned@bi e- om] $ time ruby -e 'a=File.open("bigfile").sysread(4194304).split("\n")'
+ 46085 [briqueabraqu] Just to report, I have a similar problem: on my system (Ruby 1.66,
| + 46086 [ned@bi e- om] This is a file on your local disk?
| | 46087 [briqueabraqu] Yes. EMACS takes less than 2 seconds to open it.
| + 46088 [Dave@pr gm t] I believe this is a known problem on 1.6.6: I believe the installer
+ 46089 [lyle@us rs s] I hope this isn't a big step-out on my part, but ISTR that there is
+ 46103 [ADATE@kc rr ] Thank you all for pointing me in the right direction.

Pagetemplate queries
46037 [waisun.chia@] Just started out with PageTemplate 0.3.2 with mod_ruby 0.9.9 and ruby
46106 [alex@pr ss r] No, the package doesn't have built-in support for 'include' type directives.
46268 [waisun.chia@] Thanks for the hint. I'll try it out right away..

How to Load Script from a C Extension?
46072 [billtj@z. lu] Is it possible to load (and execute) a Ruby script from within a C
+ 46076 [billtj@z. lu] My current temporary solution is to open the Ruby script file in C, get it
| 46108 [ptkwt@sh ll ] Why call Ruby from the C side?  It seems to me to be easier to call your C
| + 46120 [decoux@mo lo] Well, probably it exist different problems with different solutions :-)
| + 46298 [billtj@y. lu] Yes, in my application, initially it is a Ruby script that calls my C
|   46303 [erik@ba fo s] Why go ruby->C->ruby?  Why not do
|   46316 [billtj@y. lu] I am not too clear regarding the meaning of "send the parsed data to
+ 46080 [nobu.nokada@] Perhaps, the code in that several lines is something wrong.
| 46084 [billtj@z. lu] I checked the code and it appears that all those lines are just global
| + 46102 [nobu.nokada@] Could you show me the code fragment and backtrace?  And what's
| | 46300 [billtj@y. lu] My environment is
| + 46117 [decoux@mo lo] It's best to use rb_load_protect(), this give you the possibility to catch
+ 46134 [alv@po zt .o] rb_require("conf.rb");
  46308 [billtj@y. lu] Yes, in my C extension Init_xxx function, I have a rb_require right after
  46314 [decoux@mo lo] You have a bug. Post your source or nobody will be able to help you

Modifying files.
46074 [khabibiuf@ho] I'm trying to modify a file that has tab delimited fields.  I want to
+ 46077 [tom@li ux ri] You should be looking to write out the file again with modifications
+ 46078 [ned@bi e- om] f.join("\t")
+ 46082 [nobu.nokada@] File.open("blah.txt.new", "w") do |b|
  46153 [gsinclair@so] Should be b.print f.join("\t") ?
  46158 [nobu.nokada@] Yes, sorry, it's untested.

yet another vim/ruby question
46090 [rawlins@cs u] I was somewhat confused as to who the current maintainer of the ruby
+ 46094 [ned@bi e- om] I believe Doug Kearns <mailto:djkea2@mugca.its.monash.edu.au> took it
+ 46302 [hgs@dm .a .u] I believe that my mods to the Ruby syntax file introduced folding.
  46351 [djkea2@mu ca] No, it looks like this problem has always been there, so unfortunately
  46352 [cparrish@co ] Ops I suddenly feel like I deleted some files I shouldn't have Does this mean that there is a better Ruby syntax file somewhere that I should add to my system? Does anyone have a web page on hints and tips to coding ruby apps with VIM? For instance is there a way to run ruby apps from within vim? (I just figured out how to use ant from within vim hence the question).
  46354 [djkea2@mu ca] questions.

JRuby changes breaking code?
46091 [adamon@ma la] I am running the sample code straight out of Ruby Developer's Guide,
46112 [ndrsbngtssn@] I don't know which version of JRuby that Ruby Developer's Guide refers
46118 [ndrsbngtssn@] A few minutes later: It turned out it wasn't a bug in JRuby at all. But
46176 [adamon@ma la] Thanks!  Much obliged.

Overriding Assignment
46095 [raganwald@ya] Is it possible to override the assignment operator?
+ 46098 [ned@bi e- om] What would be the receiver?
+ 46099 [ned@bi e- om] It works, but you're just not calling it the right way (though this is
  46927 [raganwald@ya] Thanks for your help. As you guessed, that wasn't what I wanted,

ANN: The GUtopIa Project
46101 [transami@tr ] I should say, given that Ruby is arguably the best programming language

Upgrading to 1.7.2 !
46104 [ADATE@kc rr ] I am thinking of  upgrading our Windows NT servers from Ruby 1.6.7

Ruby on the Sharp Zaurus PDA
46105 [ian@ca ib n.] The Sharp Zaurus is a really cool StrongArm powered PDA that comes
+ 46111 [vincent.fiac] Argh ! There's currently a contest organized by Sharp. The goal is to
| 46115 [ian@ca ib n.] Very cool!
+ 46135 [jerome@go an] I talked to matz about this a few weeks ago and he invited me to ruby-
  46282 [ian@ca ib n.] Well, no porting is really necessary to get the basic package
  46531 [mike_thomas@] Just FYI,
  46548 [kero@ch ll .] I maintain the ipkg for ruby for iPAQ, good to hear it works on Zaurus as
  46583 [henryso@pa i] Do you compile this directly on ARM-based hardware or do you

embed or swig?
46107 [ptkwt@sh ll ] I'm working a C++ project for a contract I'm doing.  Originally, the
+ 46121 [transami@tr ] i am not too fimiliar with swig. but it's starting to sound like one of
+ 46122 [jim@fr ez .o] You are doing just what I would have done.
+ 46126 [hal9000@hy e] This sounds very interesting to me... can you
  46139 [ptkwt@sh ll ] First take a look at Swig at: http://www.swig.org
  + 46141 [list@NO PA c] Wait a minute.  Do you really mean that, after you've written your C++
  | + 46145 [hal9000@hy e] Well, from what I see on the SWIG site, it appears
  | | 46150 [list@NO PA c] /me drools copiously
  | + 46172 [ptkwt@sh ll ] Well, that is a bit simplified, though there are cases where that would
  | + 46173 [vor_lord@ho ] That is not simplifying at all for basic functionality.  Certainly depending
  | | 46190 [transami@tr ] i was just reading over a little of the swig docs and HOLY CODING! from
  | | + 46194 [robert.calco] I'm working on a wxWindows port for Ruby (called, predictably, wxRuby),
  | | | + 46197 [robert.calco] Sincerely,
  | | | + 46205 [transami@tr ] i discover your sight about a week or so ago. have been meaning to chat
  | | |   46211 [robert.calco] I want to make sure the wxRuby port is sufficiently well-thought out to take
  | | |   46247 [rich@in oe h] mine,
  | | + 46243 [leon@ug s. a] As a matter of fact, I attempted to swig a ParaGUI binding for Ruby
  | |   + 46288 [ptkwt@sh ll ] You definately should try it again.  From what I understand swig 1.3.12
  | |   + 46355 [transami@tr ] will you give it another go? i, for one, am very interested in seeing a
  | + 46388 [pi_ml@so rc ] I saw this thread on the Ruby Weekly News and was surprised, that some Ruby
  + 46143 [hal9000@hy e] "Curiouser and curiouser," said Alice.

Cannot enter Thai Character in TkEntry
46110 [titasak@he l] I am trying to input a Thai character into TkEntry but failed when I enter english

Deprecation and Unicode
46125 [danny@fr uk ] There's a nice article at
+ 46127 [ned@bi e- om] Actually, we've pretty much beat this to death in the past few days.
| + 46129 [gehlker@fa t] I think you have it. Unicode is formally a 31 bit character set but the
| | + 46180 [cjs@cy ic ne] Been here before, just the other day. Unicode is *not* a 31-bit
| | + 46186 [matz@ru y- a] I think "Unicode" here should be replaced by "ISO 10646".
| + 46159 [nobu.nokada@] I guess you mean UTF-16, one of variable length encodings, it
| + 46179 [cjs@cy ic ne] Right.
+ 46178 [cjs@cy ic ne] I'd be careful with this article; it's got errors in it. I'm not going
+ 46183 [nobu.nokada@] What methods do you mean? open3?
  + 46187 [kentda@st d.] Just want to chime in and let you know that I agree with Danny. Now,
  | 46213 [nobu.nokada@] I forgot it, thank you.
  + 46188 [danny@fr uk ] Yes, names like that. But I didn't mean to open a flamewar on naming
    46189 [decoux@mo lo] Well, it depend what you call "official" but actually you have

Assoc Class (Hash Pairs)
46128 [transami@tr ] i've been thinking about posting this as an RCR.
+ 46137 [harryo@zi .c] This piques my interest, but I'm at a loss to see what one would DO with one
| + 46138 [hal9000@hy e] Interesting idea. Some comments...
| | 46148 [transami@tr ] z = ordhash[0]['a']
| | + 46152 [hal9000@hy e] Yes, but that's my point: It's not a hash any more. It's
| | | 46269 [charleshixsn] Generally the right way to implement an ordered "hash" is with a tree.
| | | 46276 [hal9000@hy e] of
| | | 46470 [charleshixsn] That sounds like a balanced tree to me.  I think I saw a Ruby implementation
| | | 46525 [alwagner@tc ] <sniip>
| | | 46547 [charleshixsn] Humh... the closest I could come to that was a Red-Black Tree (RBTree,
| | + 46160 [list@NO PA c] z = { 1 => 'bar', 'foo' => String }
| |   46163 [transami@tr ] i'll take a look at this ZigZag. thanks.
| + 46144 [transami@tr ] i recall having a need for it some time ago, but i don't recall off hand
|   46149 [list@NO PA c] This way, the parent won't know it has a child, and the child won't
+ 46196 [dblack@ca dl] I *think* you can do everything you need in this area in Ruby as it
| 46204 [transami@tr ] thanks david, that was very helpful. i had forgotten that hashes could
| 46209 [dblack@ca dl] It's an interesting thing to think about, in part because it raises
| 46214 [transami@tr ] i think i understand what your getting at.
| + 46216 [dblack@ca dl] You could argue that an array is basically a hash whose keys are
| + 46218 [gsinclair@so] Hashes don't have "elements".  They map Objects to Objects.  That is their
|   46241 [vjoel@PA H. ] h = {:a=>1, :b=>2}
|   46257 [gsinclair@so] their
|   46263 [ned@bi e- om] class Association
+ 46299 [pbrannan@at ] A pair is a real object; it's called an array (with length=2).