56652-57446

56490-57539 subjects 56858-57502

Q: mod_ruby may be NPH?
56652 [kwatch@ly os] I have a trouble with using mod_ruby 1.0.1.
56690 [tom@po os ic] r = Apache.request
+ 56693 [tim@ba es id] I find that I don't need the "exit(Apache::OK) if r.header_only?" stuff and it
| 56773 [tom@po os ic] This is how it's supposed to be - read up on HTTP.
| 56776 [tim@ba es id] I know this. I was querying whether it is cgi.rb that does this for me, since
| 56829 [tom@po os ic] Ok, didn't mean to be rude!  :-)
| 56833 [tim@ba es id] Okay, thanks. I think that is the behaviour I was hoping for, since my scripts
+ 56774 [kwatch@ly os] Oh, great!

Which Ruby Version to install at work
56654 [jim@fr ez .o] I am configuring an install of Ruby for our corporation for all

More RAA.succ ponderings
56661 [simon@si on ] Explains how to build a C*AN, by the guy who built CPAN.

FXRuby on Mandrake 8.2
56665 [coquelle@en ] ...
+ 56666 [decoux@mo lo] What give ldd for these libraries ?
| 56667 [coquelle@en ] ...
| 56668 [decoux@mo lo] Well apparently the error message suggest that it has a problem with
| 56669 [coquelle@en ] ...
| 56670 [decoux@mo lo] Try
| + 56672 [coquelle@en ] ...
| | 56674 [gfb@to es ft] ...
| + 56766 [coquelle@en ] ...
|   + 56768 [coquelle@en ] ...
|   + 56777 [decoux@mo lo] Well, it seems to have a conflict between these 2 versions but why ???
|     56792 [lyle@us rs s] Is it possible that the FOX library (libFOX.so) and the FXRuby extension
|     + 56794 [decoux@mo lo] Yes, this was this.
|     + 56798 [coquelle@en ] ...
+ 56673 [lyle@us rs s] suggests that you may be able to alter your LD_LIBRARY_PATH setting to

ruby -w
56675 [dcarrera@ma ] What does 'ruby -w' do?  Could someone give me an example of the helpful
56715 [nobu.nokada@] What about this patch?

[FAQ] Defining <=>
56696 [cyclists@nc ] Seems like I should take another stab at this one. Thanks to everyone

[FAQ] Why isn't 'x++' or 'x--' valid?
56698 [gsinclair@so] [I was very surprised to see this question isn't answered in the FAQ.  I was
56700 [dblack@ca dl] Nothing that vague :-)  See <http://www.ruby-talk.org/2710>.
56707 [gsinclair@so] Silly me, I discovered that there already *is* a FAQ entry about this (in the
56721 [botp@de mo t] Matz indeed suggested long way back that this would be possible but only as
+ 56740 [matz@ru y- a] I guess you're captured by your languages too much.  Neither C nor
+ 56770 [peter@se an ] I seriously doubt that there are C/C++/Java programmers holding back
+ 56780 [rshaw1961@ya] Surely you can just modify this by using a editor to convert ++x to

Combining variables and Regex's
56699 [jason@pe sa ] Howdy folks,
+ 56702 [gfb@to es ft] myString =~ /#{myVariable}_\d\d\d/
| 56714 [emschwar@fc ] but // is a regex delimiter, not a string, right?  Is this just a case
| 56728 [matz@ru y- a] In general, #{} evaluates a Ruby expression inside "double quotish
+ 56703 [dcarrera@ma ] I think that

Default value of property
56708 [tim@ba es id] I have an object, with a method that returns another object, or nil under
+ 56709 [hal9000@hy e] Well... one way would be
| + 56710 [hal9000@hy e] Sorry to reply to myself...
| | 56718 [ahoward@fs .] rescue doesn't normally catch NameErrors
| | 56778 [decoux@mo lo] This is changed in 1.7
| | 56912 [pbrannan@at ] What was the reasoning behind this change?
| | 56913 [decoux@mo lo] If I'm right [ruby-dev:12763], [ruby-dev:12767], etc
| + 56847 [jweirich@on ] This is fine for small scripts ... I've done it myself.  But I would
+ 56711 [ahoward@fs .] how about
  + 56713 [Ephaeton@gm ] Reading something like that reminds me of an idea (yeah, flame
  + 56819 [batsman.geo@] What's wrong about '? :' ?
    56820 [dblack@ca dl] b.meth if b
    56827 [gsinclair@so] Your code is equivalent to batsman's, but the OP wanted a default value thrown
    + 56830 [dblack@ca dl] (b || Class.new.module_eval {
    + 56843 [nobu.nokada@] They are not equivalent when b.meth returns nil/false.

CGI
56716 [dcarrera@ma ] Is there a CGI module for Ruby?  Analogous to CGI.pm in Perl?
+ 56717 [gsinclair@so] Time to look at the Pickaxe (see the recently-posted newcomers' list).  It has
+ 56790 [bruce@co ed ] Yes, we have a cgi library, roughly analogous to CGI.pm.  As Gavin stated, a
  56795 [gsinclair@so] It sure has.  I just added a FAQ based on your answer.  Thanks.

each_with_index & collect_with_index?
56719 [tim@ba es id] Array.each (and others) have an alternative .each_index which passes the index
+ 56730 [matz@ru y- a] We already have this one.
| 56750 [tim@ba es id] I gave one example in another thread, which was the example that I ran into
| 56761 [matz@ru y- a] I prefer this
+ 56733 [ahoward@fs .] a = [42, 'forty-two']
+ 56734 [dblack@ca dl] Yes, there is such a method.  Your notation is a bit off, because it
  + 56781 [martindemell] How about a wiki page of uses for it? I keep thinking it's a nifty
  + 56800 [gmiller@pr m] Doing numerically oriented algorithms I find myself frequently doing
    + 56808 [ahoward@fs .] c = collect %w(0 1 2), %w(zero one two) do |a, b|
    | 56813 [dblack@ca dl] It could get unclean in a hurry, though :-)
    | 56815 [ahoward@fs .] a = collect { |e| do_something_with(e) }
    | 56816 [dblack@ca dl] What I don't like is the idea that #collect and #collect_with_index
    | 56822 [ahoward@fs .] they don't behave differently at all, there are two of them : an instance
    + 56845 [ruby-talk@wh] I'm also always amazed by the uses of inject.  The collect_with_index
      56849 [helgaorg@ya ] (Bear in mind... I'm a newbie ;)
      + 56850 [austin@ha os] One major problem: global.
      + 56851 [dblack@ca dl] (Aw, don't put it that way :-)
        + 56856 [alan@di ik t] Well, how about something like Regexp.last_match, where you can
        | + 56860 [tim@ba es id] This looks very promising, but doesn't allow you to determine which iterator
        | + 56874 [martindemell] The problem is that Enumerable is built around a class-supplied 'each',
        | | 56875 [decoux@mo lo] [[1, 2], [3, 4]].each {|i| i.each {|j| ... }}
        | | 56893 [martindemell] Doh! What *is* the correct thing to do in such a case, without having to
        | | 56896 [decoux@mo lo] I don't think that you can put it in a module, or a class.
        | | 56911 [martindemell] Where would I put it, then? Global is obviously out, and I can't think
        | + 56902 [austin@ha os] I like that, sort of. It still has the problem that a global does;
        |   + 56905 [dblack@ca dl] Not necessarily.... but also, given that all of this is to avoid
        |   + 56906 [decoux@mo lo] Why it's pathologic to iterate on the same object in 2 different threads ?
        + 56859 [helgaorg@ya ] OK... globals = evil... more importantly cryptic code
          56889 [dblack@ca dl] Heh -- I guess you're not interested in membership in Citizens for MWI
          + 56909 [tim@ba es id] I think this has been suggested before, but... why not use something like
          | 56927 [ahoward@fs .] this is all very straight forward using an Enumerable::Iterator, i had to add
          + 56925 [hal9000@hy e] [snippage]
            56939 [dblack@ca dl] Yes, I was reminiscing about that, and realizing that I was
            56953 [ahoward@fs .] is this not what this does?

"Comprehensive Ruby Archive Network"?
56720 [dcarrera@ma ] Is there a Ruby equivalent to CPAN for Perl?
+ 56727 [gsinclair@so] There's the Ruby Application Archive, which has surface-level similarities to
+ 56731 [matz@ru y- a] RAA <http://www.ruby-lang.org/en/raa.html>
+ 56742 [ptkwt@sh ll ] There's the RAA (http://www.ruby-lang.org/en/raa.html) which has links to

Subscribe
56724 [ramloll2001@] subscribe Ramesh Ramloll

Difference between puts and print
56732 [andrew@cy er] What is the difference between 'print' and 'puts' in rubese?  What are the
+ 56736 [dcarrera@ma ] puts "hello"
+ 56737 [gsinclair@so] #puts appends a newline and outputs each argument to a new line
  56745 [sneu@ib p. r] You can also say
  56748 [gsinclair@so] This differs from #puts calls #to_s on its arguments while #p calls #inspect.
  56751 [andrew@cy er] And print is also an 'inspect' type call?  (ie interrogates the string to see
  56752 [gsinclair@so] #inspect.
  56754 [andrew@cy er] Ok, let me see if I have gotten my head around this.
  + 56755 [dcarrera@ma ] I did test it with the interpreter.  print does *not* put spaces by
  | 56757 [andrew@cy er] p var
  | + 56758 [dcarrera@ma ] class Foo
  | + 56759 [dcarrera@ma ] class Foo
  + 56756 [brian@co ln ] ...

socket bug?
56739 [achou@te le ] ...

Ruby Weekly News
56753 [Dave@Pr gm t] Ruby Weekly News: 11/25/2002

New programmer
56760 [jason@ju ct ] programming on Ruby because of all the great things I have heard about it. I
56821 [mikkelfj-ant] Welcome to interesting, challenging and sometimes frustating world of

DL and arrays of pointers
56767 [ oct@zo .o g] it seems to me that it is not straightforward to use DL to wrap a that
56779 [ttate@kt ja ] "struct[...]" creates something like a wrapper class for struct Foo.

RCR: Stack, Queue alias methods in Array
56772 [martindemell] distracting to have to stop and think about which end of the array
+ 56783 [nat.pryce@b1] How about defining these in modules, so that they can be included into
| 56789 [martindemell] They're not really new functionality, though, just aliases for existing
| 56791 [billtj@z. lu] Well, I guess then you can simply use Ruby's built-in 'alias'.  :)
| + 56796 [decoux@mo lo] alias is efficient
| | 56803 [billtj@z. lu] Ooops, sorry.  Yes, in fact in "eval.c" the function "rb_alias" has
| | 56805 [billtj@z. lu] ...... which leads me to ask, why the last time when I asked, given a
| | 56806 [decoux@mo lo] When you call rb_define_method(), ruby create a node NODE_CFUNC. The
| | 56809 [billtj@z. lu] Ah, then it looks that I indeed can get the function pointer from a method
| | 56810 [decoux@mo lo] Sorry to say this but re-read *carefully*
| | 56811 [billtj@z. lu] Oh yes, I knew about that based on your original explanation (47220),
| + 56870 [martindemell] I do :) Just thought it'd be a nice thing to have as standard. And
|   56887 [gsinclair@so] What about Array#first?
|   56894 [martindemell] (!)
+ 56793 [matz@ru y- a] top      "top" returns last item?  probably confusing.
  + 56797 [tsiivola@cc ] But that confusion is exactly the reason why it is needed: unless a builtin
  | 56801 [matz@ru y- a] But still, array is array.  If you see "top" being last without
  | 56865 [martindemell] Well, it may not be intuitively obvious if you're not thinking in terms
  | 56867 [matz@ru y- a] "top" is too generic.  One can think of arbitrary edge of an array,
  | 56897 [martindemell] Yes, but only the first time. Though you're right, it is less intuitive
  | + 56926 [matz@ru y- a] Not for me.  I probably have to answer to the question "why top is
  | | + 56931 [hal9000@hy e] question for you?
  | | | + 56933 [matz@ru y- a] I think Array is too big, and has too much methods unnecessary to
  | | | | 56946 [billtj@y. lu] How about a standard library of data structures which include Stack and
  | | | | 56957 [matz@ru y- a] Great idea.  No one prevent you (or others) from doing it.  But don't
  | | | | + 56965 [billtj@y. lu] So you are not aware of any person who has a library of common data
  | | | | + 56966 [billtj@y. lu] .... also, so who has the authority to make a certain library be part of
  | | | | | 56968 [ tom@u2 .c m] I have a hunch that the best way to get code into the standard
  | | | | + 56973 [austin@ha os] Okay ... let's say that I get this sort of thing created. How would
  | | | |   57004 [matz@ru y- a] 1. you publish your work on RAA and such.
  | | | + 56943 [nat.pryce@b1] If anything, Stack and Queue classes should encapsulate an array.
  | | |   56955 [martindemell] The following quote from Paul Graham made quite an impression on me - I
  | | + 57017 [martindemell] I just realised that the whole reason I wanted this was that it doesn't
  | |   + 57019 [matz@ru y- a] I'm not that optimistic.
  | |   + 57028 [kentda@st d.] Then you really don't want 'top', you want 'peek', as in "get value pop
  | |     57053 [martindemell] But 'peek' really is too generic - it could also mean 'get value shift
  | |     57057 [kentda@st d.] No more than 'top', and it is less confusing, IMHO.
  | |     + 57058 [botp@de mo t] [snipped lots of good args by kent and martin]
  | |     | 57081 [martindemell] true :)
  | |     | 57082 [pbrannan@at ] The C++ standard explicity disallows retrieving an element using pop().
  | |     + 57065 [martindemell] There is really no reason to stop
  | |       57067 [kentda@st d.] Nice one. :-)
  | |       57090 [martindemell] Not unless you know that the argument array reads from left to right
  | + 56928 [matt@li ke .] Actually "Array.push" and "Array.shift" are just as confusing to me as
  + 56869 [martindemell] Oops, so we do. 'dequeue' is the natural opposite, then.

Mysql & ruby 1.6.7 (2002-03-01) [i586-mswin32]
56786 [juergen.lind] I want to use ruby in conjunction with mysql -
56787 [spectra@de i] I've got no experience with Windows, but I know you can get a binary modules
56952 [juergen.lind] Thanx Pablo!

Re: mysql-ruby on MacOSX/darwin
56788 [montana@bu 9] What OSX are using??

active ftp
56799 [beyerlin@ma ] who can i initiate an active ftp connection,
56802 [decoux@mo lo] Well, you have the library 'net/ftp'. You have an example at

Newbie CGI help please.
56817 [montana@bu 9] require??"cgi"
56818 [montana@bu 9] OOps!!
+ 56823 [armin@xs .d ] This works fine on my machine.
+ 56825 [ahoward@fs .] looks like there are some weird binary chars in there or something... try
+ 56826 [jasonu@xm ss] What is your error?  It is very difficult for anyone in this group to help

The names of a method
56824 [kfk@wa se ha] def foo
+ 56832 [matz@ru y- a] caller(0) may help.
| + 56838 [austin@ha os] ...
| | 56839 [ysantoso@je ] YS.
| | 56842 [austin@ha os] that
| + 56937 [kfk@wa se ha] Thanks to you and Bill.
|   + 56941 [dblack@ca dl] dblack@laptop:~/hacking$ cat some\`file
|   + 56944 [STUCKNER@MU ] Shouldn't there be a class to encapsulate what is returned by each array
+ 56837 [billtj@z. lu] I think this has been asked in the past; for example, see the thread

[Solved] mysql-ruby on MacOSX
56828 [beat@bi kh f] Marc Liyanage (http://www.entropy.ch/) gave me the right strings for

FastCGI resolution
56831 [Dave@Pr gm t] I missed the end of the thread on whether FastCGI had been found
+ 57127 [bob.news@gm ] dave,
+ 57420 [idan@id ns .] Idan.
  57423 [dave@pr gp o] Cheers!  Perfect
  57446 [nakahiro@sa ] Regards,

extconf.rb & gcc 3.2
56835 [cyclists@nc ] I'm building a Ruby 1.6.7 extension using extconf.rb and gcc 3.2, the default
56892 [eban@os ri .] GCC 3.2.1 doesn't complain, anymore.

Help on ruby XML/RPC
56836 [mc12@ua be t] can the XML/RPC server detect the client ip address. Is there are any method
56916 [djberge@qw s] I don't know if there's a method to grab the ip specifically, but you should

PayPal developers here?
56841 [hal9000@hy e] Has anyone here ever dealt with PayPal development,

RUDL install problems on win32
56846 [ramloll2001@] I followed the instructions to install RUDL from the
56848 [billk@ct .c ] Wow, what a horrid error message. :(  Guess it could be worse -
56910 [ramloll2001@] Checked the windows excutables search path, its
56940 [billk@ct .c ] Sorry to hear RUDL isn't working for you, but glad GLUT and
57000 [ramloll2001@] Thanks for the dependency walker tool tip. I managed
57001 [martin@ma si] If you have a look here http://froukepc.dhs.org/rudl/download/binary/ you

Helpp: How to install mod_ruby/mod_eruby with Apache!
56857 [usenets@ny .] Since I have 2 apache installed on the system - once from redhat
threads.html
top