13415-13883 subjects 13820-14847

Off-topic: General flow of a (specific kind of) CGI
13633 [hal9000@hy e] This is an offtopic post, which I rationalize in the
13645 [neumann@s- i] I've written something similar, but a bit complexer.

A bit of Win32OLE code for you
13634 [hal9000@hy e] I've done a bit of playing with win32ole and thought

Newbie to ruby may questions please help
13639 [akhar@vi eo ] I have been browsing for more than 7 hours now, and I am still hesitating
13654 [matju@sy pa ] I don't know about other platforms, but I created a package for sound

operator +
13641 [luigi.ballab] I suspect this to be a rather stupid question, but I couldn't find the
13646 [decoux@mo lo] Add
+ 13648 [ ericb@eb to] Shouldn't that really be
+ 13649 [luigi.ballab] Hmm. Looks like I kept my example too simple.
  + 13650 [decoux@mo lo] You'll have a problem with -
  | 13651 [ ericb@eb to] Oh, that's what that mirror stuff was about - so you can seperate the
  | 13652 [decoux@mo lo] Just define a constant
  + 13713 [johann@ph si] This is exactly the sort of thing that multimethods solve well.  Is
  + 13728 [decoux@mo lo] It's easy to add this in ruby

13643 [dcorbin@im e] Is there a CPAN equivalent for Ruby?
13644 [majcher@ma c] applications, libraries, and documentation.  It's

SV:  Re: CRAN?
13647 [dennisdecker] #

FREE DOWNLOAD - www.vanethian.com - www.tomatic.it 65906
13653 [vanethian@ho] *** http://www.vanethian.com & http://www.tomatic.it ***

create/init ruby object in C
13656 [chris@at es ] I'm trying to embed ruby into an application, and I'm having a bit of
13657 [decoux@mo lo] This is very quickly written
13660 [chris@at es ] Thanks, a lot!  Especially for the fast response.  That's exactly what

Regexp problem
13658 [agnot_tok@eu] Its time to do some Ruby programming. However, I stumbled on the following
13659 [decoux@mo lo] Probably a problem in regex.c
13661 [matz@ze ab t] Yes, it's a bug.  Thank you for fixing it.  Happy Easter!

read this notice......     902
13662 [aukasricsmn@] jbglyqomtyivwa

Retrieving current signal handler without altering it
13663 [ljz@as as .c] I'd like to retrieve the current handler for a given signal without

Iterator Question
13665 [flifson@cs u] For a non numeric iterator is there a way to find out how many times the iterator has looped so far?
+ 13666 [Dave@Pr gm t] array.each_with_index do |element, index|
| + 13671 [flifson@cs u] I was not aware of the each_with_index call, it'll no doubt help a lot in the future.
| + 13684 [flifson@cs u] Sorry I should've added this to my previous post. Is each_with_index a very new feature. It's not mentioned in the Ruby Language Reference Manual (Ver 1.4). If so, what other undocumented features am I missing out on?
| + 13685 [decoux@mo lo] pigeon% grep each_with_index ruby-man-1.4/*.html
|   13688 [flifson@cs u] Just found it as well.. oops egg on my face... apologies
+ 13667 [gnhurst@hu s] can't find a way to do it without the i's. Any ideas?
  13668 [gnhurst@hu s] oh, and that should be i==0, not i=0

Re: Infinity, NaN
13669 [matju@sy pa ] But IMHO special value logic *has* to be essentially unusable. It's for

Question on gsub with a block
13670 [matt@li ke .] First, is there any better way to read a whole file into a string
+ 13672 [dblack@ca dl] page = template.gsub(/<!--\s+(\S+)\s+-->/) { send($1) }
+ 13686 [neumann@s- i] template = File.readlines(@template).to_s
  13697 [   xm@w3 .r ] /skipped/

CONFIG["prefix"] ?
13673 [ray@ha kf o.] Just a quick one here, Ive asked a few people individually but
13691 [matz@ze ab t] No.  TOPDIR might be nil, since sub! returns nil if no match found.

gathering user input
13674 [will_conant@] Because I don't know much about terminals, this may be a naive question, but
13675 [henryso@ea t] Though I haven't actually used it in the context of Ruby, this is the sort of
13690 [kjana@os xa ] Or, you just need echo-less non buffered input, use ruby-termios

interating for separate values...
13676 [skidrow@no n] I know that in ruby I can do this..
+ 13677 [rise@kn ve y] It's a change from the Perl-ish pseudocode. :)
| + 13680 [dblack@ca dl] Or even just take a chance and try:  ri step  :-)
| + 13683 [skidrow@no n] semantics,
|   13694 [Dave@Pr gm t] It's a little utility that gives you documentation on Ruby methods and
+ 13678 [Dave@Pr gm t] Iteration in Ruby is controlled by the object being iterated over, so
| 13681 [matju@sy pa ] why is #step defined in Integer, and not in Numeric, and neither in Float?
| 13692 [matz@ze ab t] Because I felt it to be a operation of integers.  But probably not.
| 13693 [Dave@Pr gm t] Done.
+ 13679 [chris@at es ] 0.step(100, 5) { |i| puts i }

methods and types
13682 [karoshijish@] I have been using mostly java for the last 5 or 6 years and did
+ 13687 [billk@ct .c ] As one who felt strongly about how beneficial static typing (compile-
+ 13689 [berndlor@t- ] If all you know about a function is the name of the arguments,
  13706 [karoshijish@] How could any function that does any sort of useful work not be
  13709 [Dave@Pr gm t] Possibly the issue is broader than this.
  + 13715 [spwhite@ch r] The way I think of this is "easy in, easy out". The data goes into the
  + 13726 [matz@ze ab t] More than 10 years ago, I was an evangelist of OOP with static typing.
  + 13729 [matt@li ke .] I'm curious about this.  Coming from a mainly C/C++/Perl background, it
    + 13733 [karoshijish@] I am busily learning ruby, and I see some things that I like or
    | + 13755 [Dave@Pr gm t] And that sounds like an eminently sensible plan :)
    | + 13757 [jimm@er s. o] Thank you. That went directly into my .sig quotes file.
    + 13749 [Dave@Pr gm t] I find I do a couple of things differently. First, because method and
      13751 [ndrsbngtssn@] This may be an instance of some design pattern about
      13752 [Dave@Pr gm t] I think that's a good refinement of the process. Ruby allows you to

SV:  methods and types
13695 [dennisdecker] #  How do you design programs when you can't specify types?  If all

cookie trouble in cgi.rb
13696 [majcher@ma c] While playing with CGI::Cookie this weekend, I discovered that, used

Tizek.com is in dire need of a development team...
13698 [developers@t] There is no pay (yet) but once we get going income will be generated through advertisements on the site and various other services which we will offer, and there will surely be enough to go around.

Introduction to non-blocking networking and select()?
13699 [terje@el e. ] I've recently discovered ruby, and while I'm amazed at how fun the language
13701 [decoux@mo lo] Look at IO::select

ANN: German Ruby article in the iX magazine (5/2001)
13700 [wys@he bl ng] Did my best to give Ruby a first positive appearance in the german
+ 13702 [sma@3p us .d] IMHO you did a great job.  Your article made my eventually looking at
| 13704 [Dave@Pr gm t] gew?nschte Gr鲞e
| 13708 [sma@3p us .d] Dave,
| + 13710 [sma@3p us .d] I found my problem.  I was assuming that "p" and "print" have the same
| | 13828 [fvdelius@gm ] I have no problems with german umlauts even when I use "p" instead of
| | 13841 [skilchen@sw ] "Felix von Delius" <fvdelius@gmx.de> schrieb im Newsbeitrag
| + 13711 [Dave@Pr gm t] This might be a mail-news gateway issue. I see it fine on the mailing
+ 13771 [alex@ho up r] you definitely did a great job, it's an easy-to-read article, that

Ruby on a JVM - good or bad idea?
13703 [sma@3p us .d] I've a question which might be asked a few times already, but I didn't
+ 13705 [elderburn@mi] IMO it would.  As Stephanie pointed out, Java is 'ubiquitous'. In the IT
| + 13717 [matju@sy pa ] I think the most difficult part of writing a "Ruby for Java" interpreter
| | + 13719 [Dave@Pr gm t] How would you handle singleton methods efficiently: would every method
| | | + 13727 [decoux@mo lo] I don't agree with you. The most difficult part is to have a j*v*
| | | | + 13730 [billk@ct .c ] Sounds like a job for a C-to-Java translator?  ;-)
| | | | | + 13734 [schneik@us i] # From: "ts" <decoux@moulon.inra.fr>
| | | | | + 13777 [sma@3p us .d] Don't think so.  The only one I know (from Novocode) creates code
| | | | |   13783 [bkelly@at .e] Ah.  Well I admit it may be a silly idea.  But what I'd envisioned
| | | | |   13822 [sma@3p us .d] If we're already talking about silly ideas.  An easier solution, if
| | | | + 13833 [matju@sy pa ] MetaRuby possible; Jruby's base classes could be written according to a
| | | + 13782 [sma@3p us .d] I think, for the start, we should try to simply interpret Ruby code on
| | | + 13829 [matju@sy pa ] Given Ruby's multiple-inheritance, side-inheritance, dynamic method
| | + 13781 [sma@3p us .d] Why do you think this would be advantageous?  I noticed there's
| |   13838 [matju@sy pa ] Because you can reuse that parser for parsing without executing, and then
| |   13852 [decoux@mo lo] yes,
| |   14428 [matju@sy pa ] Wrong, there are two of them, and I didn't know it before this post.
| |   14441 [Dave@Pr gm t] Not wishing to pour cold water on this flamefest, but... if you have
| |   14729 [matju@sy pa ] You already added a small note about it, in the errata, last February, on
| |   14734 [hfulton@au t] <Dave@PragmaticProgrammer.com>
| + 13778 [sma@3p us .d] I'd be interested in something like JRuby as a backdoor to introduce
|   13780 [glen@en bl d] I use Jython frequently and love it! I can express myself in Python where it is
+ 13707 [slove@av la ] Hey,

Dir methods
13714 [johann@ph si] It would be nice if Dir implemented a method "in_directory", implemented
13723 [matz@ze ab t] In the latest development snapshot (1.7.0),
13788 [johann@ph si] Aha!  You *have* been borrowing Guido's time machine.  I knew it.

Ruby threading implementation docs?
13716 [ljohnson@re ] Has anything been written down (in English) about Ruby's threads
13718 [chris@at es ] Chapter 11 of "Programming Ruby" is called "Threads and Processes".
13725 [johnson2@hi ] Thanks; I've got my (well-read) copy of Programming Ruby and agree that it
13732 [matz@ze ab t] There's none such (except eval.c itself).  Sorry.
13756 [ljohnson@re ] it

eb.fm 响亮的名字,精彩的世界!
13722 [eb.fm@33 9. ] ...

Msg 13722
13724 [hal9000@hy e] Hmmm.
13731 [matz@ze ab t] No, it's Chinese, which I cannot read.

RCR: trivial but useful add-ons
13735 [gnhurst@hu s] I was browsing the older messages from last year, and
+ 13737 [matz@ze ab t] I don't feel their nessesity right now.  But three separate RCR can be
| + 13738 [   xm@w3 .r ] Two RCR's will do, I think - and I'll agree with both of them.
| + 13743 [Tjabo.Kloppe] I'ld like Numeric.odd?, even? and so on.
|   + 13748 [wmwilson01@h] By the way all, I'm still around... going through a marital separation, so
|   + 13754 [Dave@Pr gm t] Dave
+ 13772 [neumann@s- i] String#ltrim

RUBY NEWSGROUP FAQ -- Welcome to comp.lang.ruby!  (Revised 2001-02-17)
13736 [schneiker@ju] RUBY NEWSGROUP FAQ -- Welcome to comp.lang.ruby!  (Revised 2001-02-17)

compiling ruby executable
13739 [jim@fr ez .o] I need to deliver a ruby script to a site that does not have
13753 [jim@fr ez .o] compiling ruby executable
+ 13901 [gnhurst@hu s] There can be several ways to make stand-alone executable from Ruby
| 13936 [ben_tilly@op] Actually this has not been used with Perl for a long time.
+ 14144 [feldt@ce ch ] Maybe this is too late since I've been out of town but anyway...

Wrapping objects
13740 [ndrsbngtssn@] I'm developing a simple persistence mechanism for Ruby
13741 [decoux@mo lo] Look at #append_features and #extend_object
13773 [ndrsbngtssn@] Thank you,

Ruby like CLOS
13742 [cliffw@rd nt] While ruby is a great OOP language I have for some time been trying to find
13762 [ronjeffries@] Yes

range in regexp
13744 [decoux@mo lo] ruby make something strange with regexp
+ 13750 [decoux@mo lo] I've forgotten 5 :-(
+ 13760 [matz@ze ab t] Hmm, I think both sould be invalid, whereas Perl consider them as [-z0-9].
+ 13763 [decoux@mo lo] perl give a warning (with -w) in this case, but (personnally) I prefer

Almost OT
13745 [jilanik@ti .] I am trying to understand Ruby logic, seeing inside ruby.h
13746 [sharpd@ci co] #ifdef HAVE_PROTOTYPES
13747 [decoux@mo lo] See the macro _

Slashdot: "Programming Ruby" book review by Chromatic
13758 [wmwilson01@h] Well, the title says it all

Odd Hash Behavior (long)
13759 [SAT@MU TI EC] Could someone explain the following behavior?
13761 [dblack@ca dl] ... =>
13764 [SAT@MU TI EC] If I call aTestHash['B'].add_one again and then print out aTestHash['C']
13765 [decoux@mo lo] This is very quickly written (verify it)
13766 [SAT@MU TI EC] I am kind of new to Ruby, could you explain the change to the hash class in
13768 [decoux@mo lo] I'll try but personnally I'm not good in english :-)
13769 [SAT@MU TI EC] Guy, thanks so very much!

P        ROTE  CT   YOURSELF!!!

13770 [NotHere@gm .] I'm looking for a way to check the existence of a certain email via the

upgrading ruby
13774 [jim@fr ez .o] I just downloaded ruby-1.6.3. I have the following version installed
13785 [matz@ze ab t] Just compile and install it.

Problems with racc rule definitions
13775 [neumann@s- i] Following racc-rule raises an error during parsing (not during 'racc parser.y'),
13795 [aamine@cd xd] Please tell me an entire part of error. I cannot answer
13807 [neumann@s- i] As you perhaps noticed, it is (or will be) a XPath parser.
13810 [aamine@cd xd] Ahh, I'm sorry, I did not take the point of your question.
13816 [neumann@s- i] Does "xmlscan" implement XPath, and where can I get it?
13832 [aamine@cd xd] ...

SV:  Re: RCR: trivial but useful add-ons
13776 [dennisdecker] #  > I was browsing the older messages from last year, and

13779 [SAT@MU TI EC] Is anyone interested in developing a standard API for database access in

Web Applications
13784 [newsgroups@e] Has someone made a framework for web applications?
+ 13786 [bryan_zarnet] I'm currently working on something like this --
| 13787 [avi@be a4 co] If you haven't already, you might also want to take a look at iowa
| 13789 [hal9000@hy e] Avi,
| 13790 [avi@be a4 co] It depends what you mean by "its own server"... yes, iowa applications are
+ 13792 [   xm@w3 .r ] /skipped/
  13800 [newsgroups@e] Well, there's not a lot of information on IntelliSite available...

13793 [karl_lopes@y] Just wondering if anyone has seen this before, and
+ 13809 [rise@kn ve y] It should be possible to use  to kill the process that's keeping the
+ 13814 [rise@kn ve y] Sorry, my reply should have read "you may be able to use Ctl-Alt-Del to
  + 13818 [schneik@us i] #
  + 13819 [mmare@xs al ] I had exactly the same problem. Killing the winoldapp with Ctl-Alt-Del

RE: generic method
13794 [wys@he bl ng] Will/shouldn't this proposal (as TS puts it: "my toy") make its way into

module syntax
13796 [murphyv@st d] module Foo
13797 [ ericb@eb to] def Foo::Bar::instance_method
13798 [decoux@mo lo] It's in the ToDo

Interesting post on slashdot.
13799 [spwhite@ch r] Any comments on this style of programming? It sounds like an interesting
13827 [matju@sy pa ] I use a technique I called side-inheritance which I will describe as

Re: IOWA Re: Web Applications
13801 [newsgroups@e] IOWA is surely an interesting development, but it lacks the most
13804 [avi@be a4 co] That's a very interesting statement... I don't know if this is the forum
13811 [ben_tilly@op] some
+ 13813 [SAT@MU TI EC] IMO, the problem with the template toolkit is that the source documents for
+ 13817 [avi@be a4 co] It depends very much on what your goals are.  Yes, there is a need for
  + 13824 [ben_tilly@op] With that said, my needs are for data delivery, and that data
  | 13826 [ben_tilly@op] The markups are generally easily recognizable in the editor, and
  | 13839 [gnhurst@hu s] This topic interests me...
  + 13830 [newsgroups@e] The widget toolkit is there, it's called "HTML". And it has lot's of
    13840 [avi@be a4 co] I consider mixing logic - loops, print statements, anything - with HTML, a
    13895 [newsgroups@e] I've seen so many cases where i don't see a way to get around
    13896 [avi@be a4 co] In the simple case, just by having the web designer block off <span>
    13905 [newsgroups@e] ok, so you have

13802 [pbranna@no p] I've recently had the need to find the length of a Ruby array from within
+ 13803 [decoux@mo lo] RARRAY(ary)->len
+ 13805 [chris@at es ] Perhaps you'll just have to access the data directly then...
+ 13806 [decoux@mo lo] There are not exactly the same, rb_ary_length() is

local vars in case
13808 [tjunier@pc s] [0,1].each {|n|
13812 [decoux@mo lo] add this line, perhaps you'll better understand what ruby do
+ 13815 [tjunier@pc s] I see.
+ 13831 [matz@ze ab t] That's what's happening.
  + 13854 [kosako@so ne] From Yukihiro Matsumoto
  + 13856 [decoux@mo lo] I've quickly look at your patch, but do it solve this ?
  | + 13857 [kosako@so ne] From Guy Decoux <200104191053.f3JArsH28644@orsay1.moulon.inra.fr>
  | | 13872 [matz@ze ab t] dyna-var-link should be formed at the compile time.  Plus, I'm still
  | + 13858 [decoux@mo lo] Explain me the result :-)
  |   13909 [kosako@so ne] From Guy Decoux <200104191131.f3JBVKl29014@orsay1.moulon.inra.fr>
  + 13866 [decoux@mo lo] 1) at compile time, when ruby create a NODE_EVSTR to store in this node
    + 13871 [matz@ze ab t] No, same thing happens with eval(), and this won't for for it.
    | 13873 [matz@ze ab t] Oops, I meant "won't work for it".
    + 13916 [decoux@mo lo] Well, if I've well understood the best that you can do is to store the