151534-166486 subjects 151903-154944

^ Dynamically changing class methods
151715 [henrikbrink ] Im making an application that loads and uses the methods of a class
+ 151716 [batkins57 gm] How are you removing the method?
+ 151717 [dblack wobbl] class MyClass
+ 151719 [Ara.T.Howard] irb(main):001:0> class Foo;def foo;end;end
| 151755 [henrikbrink ] I can see now why my code didn't work, and i must say... doh!
+ 151757 [vjoel path.b] Aside from the suggestions so far, you might want to take a look at

^ Problems with Net::HTTP.get
151723 [pythonmailin] I've been happily writing a smaller program in Ruby (I can't write bigger
151748 [brockweaver ] Are you behind a proxy? If so there's an overload for HTTP.get...
151765 [pythonmailin] No, I'm not. I've even started Packetyzer, a sniffer based on Ethereal and
151778 [mrcode netro] There is a known problem caused by the ZoneAlarm firewall software on
+ 151787 [pythonmailin] I do not use ZoneAlarm, I've got Panda. Hmm, disabling it does not help. I
| 151792 [pythonmailin] Many thanks Ryan, with the firewall uninstalled it works without problems.
| 151797 [mrcode netro] No problem, I'm glad I could help.
| + 151817 [w3gat nwlaga] I've used Macafee, AVG Virus scan with firewall and Norton and have had
| + 151847 [matt.mower g] I was using Kerio Personal Firewall on WinXP-SP1 and don't remember
| + 151856 [pythonmailin] I've first installed Agnitum Outpost Free (1.0) and that worked with Ruby.
| + 151934 [w_a_x_man ya] At http://www.ruby-talk.org/cgi-b in/scat.rb/ruby/ruby-talk/147717
| + 151957 [james_b neur] I have ZoneAlarm freebie version on multiple machines, a mix of Win2k
+ 151822 [w_a_x_man ya] Just tried the o.p.'s program under windoze 2000 with ZoneAlarm active.

^ Nested methods and define_method (was Re: Yet Another useless Ruby 2 Idea)
151728 [meta pobox.c] Well, I disagree with prohibiting nested methods.
151736 [dblack wobbl] $ ruby -ve 'def x; def y; 1; end; end; x; p y'

^ Ruby and IDL
151733 [shalev simpl] I'm trying to find any sort of Ruby/IDL bindings, compiler, or

^ Dear RubyGems: Perhaps a better way to override require...
151735 [transfire gm] I may have found a much better way to override Kernel#require. Here's
151743 [chadfowler g] Tom, what problem are you trying to solve?  I mean, I see that you're
151768 [transfire gm] I have a library that allows one to require individual methods by name.
151774 [chadfowler g] Ahh, I get it.  The point (that I missed) wasn't the actual
151783 [mrcode netro] This does seem better, but only if everytime someone overrides require in
+ 151853 [transfire gm] That's what I expected too. But when I tried, it didn't work so well.
| 151859 [jim weirichh] Were you modifying the string in-place?  If so, try it without destructively
+ 151855 [ mfp acm.org] batsman@tux-chan:/tmp$ cat gfdhoidhi.rb
  + 151860 [jim weirichh] [... solution using define_method elided ...]
  | 151893 [halostatue g] Very clever. Probably worth doing in the future. ;)
  + 151902 [transfire gm] Although, there still needs to be a way to selectively bypass. For
  | 152159 [transfire gm] Learned something new pertaining to this today. You can override
  | + 152160 [transfire gm] Sigh, on second thought, Kernel.require likely bypasses Gems too. Not
  | + 152182 [surrender_it] def require file
  |   152193 [transfire gm] Basicially my original idea, but w/o the module. Good idea. Thanks.
  + 151970 [vjoel path.b] Do you mean because of support for yielding from the define_method

^ Dynamically added methods
151739 [strass stras] I'm pretty new to ruby so I will ask some dumb questions, sorry if it's
+ 151749 [halostatue g] Use OpenStruct.
+ 151764 [shalev simpl] class YourObject
  151793 [strass stras] In fact, I'd like to mimic the behaviour of ActiveRecord.
  + 151823 [zdennis mkte] To create methods on the class itself so all instances of that class get
  + 151845 [bob.news gmx] => true
    151864 [zdennis mkte] OpenStruct uses the method_missing magic as pointed out in my last post,

^ Namespace of method arguments (Ruby 2 Idea?)
151741 [rm_rails che] In the Programming Ruby book in the section of namespaces, I see
151750 [halostatue g] On 8/11/05, rm_rails@cheapcomplexdevices.com

^ UTF-8 encoding
151742 [balony gmail] Im working with xmprpc/client and the server Im working against
+ 151779 [dave burt.id] You can use iconv or you can run an external pipe through GNU recode.
| 151790 [balony gmail] I'm running on a windows system, that could be a problem?
| + 151805 [jmital aracn] require 'iconv'
| | 151807 [dave.burt gm] The One-Click Installer still doesn't include Iconv (the developers are
| + 151809 [phasis bclin] def encode(str)
+ 152049 [lists bertra] I convert utf16 to utf8 using the workaround below. Having a

^ Re: Head First Design Patterns - Strategy Pattern [was: Java/C# "interface" in Ruby ?]
151744 [Peter.Fitzgi] Ok, ok, I'll give more detail on what I'm up to.
+ 151761 [joevandyk gm] I have no idea if it's appliable in this case, but Ruby's standard
+ 151788 [dave burt.id] This looks like exactly what mixins are for - you can put the implementation
  + 151789 [Peter.Fitzgi] How do I change the mixed-in method at runtime ?
  | 151811 [dave.burt gm] You could mean a few things by this.
  + 151812 [jim weirichh] Although Peter's demo didn't illustrate it, the key to the strategy pattern is
    151827 [dave.burt gm] While the solution I gave is able to do that, thanks to Ruby's ease of
    151837 [jim weirichh] [... proc based solution elided ...]
    151843 [dave burt.id] You can put state in procs, too - using local variables rather than instance
    151895 [Peter.Fitzgi] Wow, Jim, Dave, Thank you for your advice.
    151923 [dave burt.id] You're very welcome. It's always interesting considering the GoF's abstract

^ What am I doing wrong?
151752 [mreed theree] After installing pathname2 on my Windows box went so well, I decided to
151754 [threeve.org ] irb -r rubygems -r pathname2
151759 [mreed theree] Thanks, that worked . . . as does using "-r ubygems", which is a nice "nroff
151813 [jim weirichh] If you consistently use rubygems and can control your own environment, it is
151906 [mreed theree] Which seem to boil down to "set RUBYOPT".  Except that doesn't work
151929 [jim weirichh] My understanding is that -r does not honor the override of the require

^ Setting up Eclipse for Ruby
151758 [francisramme] I'm having some problems setting up Eclipse for Ruby. I installed the
+ 151762 [adrian.dimul] nightly build did.
| 151770 [francisramme] The link to the nightlyBuild doesn't seem to be working.
| 151780 [adrian.dimul] Yes, sorry for not verifying. It worked 2 days ago, needless to say... I
| 151781 [zdennis mkte] RDT 0.5.0 does not work with Eclipse 3.1/. Please use the nightly builds
| 152088 [francisramme] I succeeded setting up RDT 0.5.0 with Eclipse 3.0 (not 3.1) and it
| 152332 [zimba.tm gma] Francis,
| + 152334 [ruby ml.icem] Hmmm...  Isn't this question similarly nonsensical as the one to find out
| | 152553 [zimba.tm gma] Benedikt,
| + 152336 [francisramme] Yes launching Eclipse is slow. But you have to do that only once
|   152340 [fxn hashref.] From my experience using Eclipse in Mac OS X, Eclipse 3.1 running on
+ 151763 [Daniel.Berge] Did you setup an installed interpreter?
  151767 [francisramme] Yes I did set it to C:\ruby\bin\  (and that is the correct location ;-)
  151782 [zdennis mkte] I believe you need to point it to your ruby executable for version. That

^ How do I use heredocs
151760 [sunh11373 ho] I have a simple test program.
+ 151766 [dblack wobbl] You need to put EOS on a line by itself.
| 151785 [sunh11373 ho] The message messed up but I am sure that the EOS is on its own line by itself and I even checked with a HEX editor=2e Here is the file atached=2e
| 151796 [ezra yakima-] charset=US-ASCII;
| 151799 [sunh11373 ho] Thanks, it works now. maybe I should trun the EOL mark on from now on.
| + 151814 [daniels pron] EOS must be the ONLY thing on the line - it's not allowed to have
| + 151846 [bob.news gmx] Having the editor remove trailing white space automatically when saving is
|   151873 [gavin refine] charset=US-ASCII;
|   151935 [daryl brandy] Please see http://compsoc.dur.ac.uk/whitespace/index.php for a
|   152030 [james graypr] Or the Whiteout Ruby Quiz, for our version:  ;)
+ 151769 [threeve.org ] Works fine for me.
+ 151771 [mreed theree] Your program is failing because you have 12 spaces after the "EOS".

^ how to format text when posting to this group
151773 [sunh11373 ho] Just posted a message and the format got messed up. All line reurns are gone.
+ 151828 [halostatue g] Make sure you post as plain-text only.
+ 152272 [ jupp gmx.de] 1. 7bit,

^ [ANN] Jim Weirich's 10 Things Java Programmers Should Know About Ruby is in the "Why Ruby" repository
151775 [curt hibbs.c] A while back I created the Why Ruby repository on RubyForge as a place

^ Re: Noob wants Q&D pointer, regexp replacement.
151791 [noreply gunn] Anybody over at comp.lang.ruby who has a really trivial task for this
151835 [cmills frees] I assume this isn't a troll.
151839 [noreply gunn] Thanks, but I'm afraid you missed the point. _William_ is trolling at

^ Regular Expression question
151815 [tuyet.ctn ms] How do I extract CYZ-EdEi8QBzG2f3m7prHw99 from the sessionId text
+ 151818 [dblack wobbl] sessionId2 = /sessionId=([-\w]+)/.match(str).captures[0]
+ 151819 [w_a_x_man ya] puts /sessionId=(.*?)"/.match(sessionId)[1]
+ 151820 [twifkak comc] - session_id2 = session_id.match(/sessionId=(.*)"/)[1]
+ 151826 [florgro gmai] Others suggested more complex ways, but String#[] can take a capture
  151830 [w_a_x_man ya] puts input.split(/sessionId=(.*?)"/)[1]

^ [ANN] LibInject 0.1.0: Small Pieces Smooshed Together
151824 [sera fhwang.] I've just released the first version of LibInject, which is a developer
151838 [jim weirichh] class Command

^ gem error i get (OSX10.2.8 stilll)
151836 [julian coret] Out of interest, this is the error I get at the moment if I do "gem
153039 [chadfowler g] Chad Fowler
154043 [julian coret] Okay...
154111 [meta pobox.c] You know, you're probably not going to get a great deal of help from
154112 [julian coret] Not all Mac service providers are pretty quick to upgrade though,
154194 [ezra yakima-] I am running a rails app on Tiger server on a brand new xserve.

^ Re: no clue
151840 [joevandyk gm] (original attempt.. was too slow)
+ 151841 [joevandyk gm] Whoops!
+ 151928 [w_a_x_man ya] h={}
| 151978 [joevandyk gm] Why would this approach be faster?
| 151989 [w_a_x_man ya] data = []; DATA.each{|x| data << x.chomp}
| 152021 [w_a_x_man ya] iter = 20_000
| 152076 [joevandyk gm] What is DATA?  Does it have anything to do with __END__ at the bottom?
+ 151998 [SimonKroeger] This may not be exactly an improvement but at least ..hmm..
  152051 [SimonKroeger] data.each{ |j, line|
  152078 [joevandyk gm] Thank you!  I must say that the logic in the 'index' one confuses me though.
  152089 [SimonKroeger] data.each{ |j, line|
  + 152093 [joevandyk gm] Ah, ok.  In my application, there's a bunch more than 3 possible keys
  | + 152096 [Ara.T.Howard] binary.
  | | 152105 [joevandyk gm] Thanks!  I shall study this code (there's a few new idioms that I
  | | + 152129 [Ara.T.Howard] #<PlayerData:0xb75cc0b4 @to_s=nil, @data=[400, 1.0, 2.0, 3.0, 42], @to_bin=nil>
  | | | + 152158 [joevandyk gm] Why do you use 'class << self' here?
  | | | | + 152161 [julian coret] Hey Joe,
  | | | | + 152162 [Ara.T.Howard] to define class methods.  in the context of a class think of it like
  | | | |   152248 [joevandyk gm] Isn't
  | | | |   152265 [Ara.T.Howard] not when you end up using 'attr' type meta-programming, having class methods
  | | | + 152262 [joevandyk gm] So, say I want to use a class similar to this called
  | | |   152270 [Ara.T.Howard] exactly right.
  | | |   152275 [joevandyk gm] Wow... that's really impressive.  Thanks again, you've been extremely helpful.
  | | + 152137 [vjoel path.b] If this is going across a network, you might want 'NgggN' instead, so
  | |   152139 [Ara.T.Howard] joel is absolutely correct here - the would be a very anoying thing to debug
  | + 152112 [SimonKroeger] More different keys aren't a problem to this algorithm, but still there
  + 152098 [dblack wobbl] This message is in MIME format.  The first part should be readable text,
    152114 [SimonKroeger] *g*

^ Weird debugger error?
151849 [olczyk2002 y] when I start the debugger, set a breakpoint in my code and run,

^ 10.2.8 saga continued
151862 [julian coret] Hey guys,
151870 [r_mueller im] For compiling these ext-libs look at your ext/Setup file in the source
151875 [julian coret] Should they all be on?
+ 151880 [r_mueller im] this depends on what you want to do with ruby?
| 151884 [julian coret] I want to run rubygems.
| 152177 [r_mueller im] try "ruby setup.rb" inside the rubygems directory. try "which ruby" order "type
+ 151881 [threeve.org ] the ./configure script should turn on the ones appropriate for your
  151885 [julian coret] That is about the most help ANYONE has been in ages. Thanks! This is
  151901 [steven.jenki] I don't know anything about MacOS, but I've seen cases where configure

^ Array redefinition problem
151865 [leslie camar] I have a large program which needs to be able to use Postgres OR MySQL.
+ 151866 [bob.news gmx] My guess is that it's unrelated to your change of the Array class.  Did
| 151868 [leslie camar] @entries = Array.new
| 151879 [dblack wobbl] I wonder whether there's another Array class, inside a module
+ 151867 [reyn.vlietst] heh, daars min afrikaaners op ruby-talk :)
| 151872 [leslie camar] heh. van waaraf is jy?
| 151886 [david vallne] Religious indentation is your best friend, putting a comment next to an "end" to
+ 151882 [david vallne] If the Array redefinition is nested in a module, you are shadowing the builtin
  151931 [leslie camar] It's a web script, so I never noticed this warning in a class below the
  + 151937 [ruby.brian g] class Array
  | 151939 [david vallne] Yup, alias does indeed seem to be a better solution here. There might be a
  + 151940 [david vallne] Ah wait, it seems whatever is running the web script is doing some voodoo with
  + 152039 [pit capitain] You can see that you don't have an Array instance, but an instance of an

^ Another newbie question
151877 [lsumnler gma] I am trying to write a small little program that will currently run in
+ 151883 [david vallne] puts ">>>Please enter dollar amount:"
| 151889 [dblack wobbl] This message is in MIME format.  The first part should be readable text,
+ 151890 [dooby d10.ka] STDOUT.sync=true
| + 151892 [ruby.brian g] Or use the readline library, there you can even supply the prompt and
| + 151896 [batkins57 gm] STDOUT.sync = true   isn't necessary in that snippet.  Even though you
| | 151905 [dooby d10.ka] That's not a feature of Ruby 1.8.2
| | 151926 [batkins57 gm] That's strange - it doesn't hang on Windows for me.
| + 151950 [ezra yakima-] $ sudo gem install highline
+ 151899 [lsumnler gma] Thanks everyone for your responses.  At this time, and with my level of
  151900 [julian coret] You'd probably want
  + 151910 [dblack wobbl] I doubt it, unless you've got some reason to expect the input to
  + 151912 [ruby.brian g] + puts "Please enter dollar amount:"
  | 151949 [dblack wobbl] This message is in MIME format.  The first part should be readable text,
  | + 151954 [ruby.brian g] Quite true, blush ;)
  | + 151967 [dooby d10.ka] raise 'almost certain'  # :-)
  |   151981 [dblack wobbl] This message is in MIME format.  The first part should be readable text,
  |   152047 [dooby d10.ka] I wasn't referring to your 'separator' note.
  + 152036 [rio4ruby rub] Or you could use Rio (http://rio.rubyforge.org)
    152135 [lsumnler gma] Thank you all.

^ Bug in HTTPS.Post with headers via Proxy?
151878 [ScrapOnly ho] I'm toying around with the eBay XML API - of course I tried in Ruby first.

^ [OFF-TOPIC] webmail acting up.
151887 [david vallne] For some strange reason, I get "Pre: ruby-talk ML" in my webmail client as the

^ Ruby Performance
151897 [bradley.kite] I'm a relatively new Ruby programmer, I am curious as to what Ruby is
+ 151898 [julian coret] Hey,
+ 151904 [enebo acm.or] (I apologize in advance to any other Perl fans in advance)
+ 151909 [bob.news gmx] Just out of curiosity: did you also benchmark these Ruby idioms (which I
| 151914 [bradley.kite] Those idioms are around 21 seconds each in Ruby.
| + 151918 [julian coret] The bottleneck is usually the database, tho... no? :-)
| | 151921 [bradley.kite] Compared with - say - slashdot?
| | + 151930 [adrianh quie] I'm sure with sufficient effort somebody could run Amazon with a
| | | + 151945 [mailinglists] I think it's biggest advantage is that is is so long out there, that
| | | | + 151955 [adrianh quie] There are certainly bits of Perl I dislike, and there is much that is
| | | | + 151961 [snowzone5 ho] i think python has been out there as long as perl has? seems to me i
| | | |   151985 [adrianh quie] Depends when you start counting.
| | | + 151946 [chriscodes g] Very true.
| | |   151980 [adrianh quie] I agree.
| | + 151962 [khaines enig] Performance is a consideration, but it is only one of many.  I switched to
| |   151997 [rick nooner.] In my experience, you should choose a language that you are productive and
| + 151968 [flori nixe.p] my $num = 2 ** 65;
| | + 152042 [l.d.u.n.c.a.] Now I want to see you do the chimney sweep dance! Dance! Dance!
| | | 152043 [caldridge gm] GED/J d-- s:++>: a-- C++(++++) ULU++ P+ L++ E---- W+(-) N+++ o+ K+++ w---
| | + 152179 [bob.news gmx] Amazing how you extract "every thinkable way" from an eight liner.  Wow!
| |   + 152180 [ruby.brian g] It seems I saw some irony somewhere ...
| |   | 152189 [bob.news gmx] It was in the white space but apparently my news client had deleted it.
| |   | 152280 [flori nixe.p] Not in the whitespaces, it's written black on white. This is my first
| |   + 152181 [julian coret] And there we have it, irrefutable proof that sarcasm often ends up on
| + 152022 [julian coret] So use perl already.
+ 151916 [mailinglists] Why ?
| + 151922 [adrianh quie] As somebody who does this on a regular basis I'd have to disagree :-)
| | + 151932 [brockweaver ] I'm not much of a Perl guy, so I don't know what TIMTOWTDI stands for.
| | | + 151933 [jm5379 gmail] TIMTOWTDI - there is more than one way to do it
| | | + 151986 [greg.kujawa ] There Is More Than One Way To Do It.
| | + 151942 [mailinglists] Maybe your collegues are maybe better motivated, better paid and
| |   151951 [adrianh quie] I'd say a group of poorly motivated, poorly paid and badly educated
| |   151956 [Ara.T.Howard] i dunno - works for us ;-)
| + 151938 [snowzone5 ho] what do you mean by 'larger' (ie. # of lines of code)
|   151947 [mailinglists] I mean complexer algorithms, more options and influces from the outside
+ 151920 [adrianh quie] Well, non-idiomatic integer arithmatic might run twice as slowly :-)
| 151941 [mailinglists] Yes thats also going to piss me off. I thought they got a few paid
| 151948 [adrianh quie] I do. Parrot is an interesting platform for dynamic languages that's
| 152002 [surrender_it] first, let me state that I do have great hopes for parrot, I think perl6
| + 152066 [snowzone5 ho] i hope parrot dies on the vine...but it doesn't look like it's going to
| | + 152097 [julian coret] what's time toadie?
| | | 152103 [l.d.u.n.c.a.] 'tim toadie' is how the anagram
| | | 152136 [snowzone5 ho] one of my favorite larry wall quotes (dealing with tim toadie) is
| | + 152188 [adrianh quie] Why? Rather nice VM to play with
| |   + 152233 [snowzone5 ho] my point was there doesn't need to be a perl6.
| |   | 152242 [adrianh quie] Speak for yourself :-) I like Perl 5. I'm sure Larry Wall quite likes
| |   + 152234 [snowzone5 ho] it started off as an april's fools joke on slashdot (about combining
| |     152241 [adrianh quie] There was a joke instigated by Simon Cozens - a Perl developer - put
| |     152267 [jeremy chaos] Didn't it include a report of Matz thanking Parrot for all the Ruby
| + 152219 [adrianh quie] Curiously enough this number isn't radically more than there are in
+ 151995 [zedshaw zeds] Wow, that C program is really fast, especially with the -O3 option.
| 152011 [sigzero gmai] He could easily have done that with Tcl. Oh wait, you were being
+ 152048 [gobelli hpg.] I think the performance issues will be fixed with the new virtual
+ 152227 [igouy yahoo.] That's even more simplistic than the benchmark programs on the Computer
  152229 [halostatue g] And, like Mr Kite's test, none of the Alioth shootout benchmarks are
  152296 [igouy yahoo.] Others find worth where you fail.
  152312 [halostatue g] That's only because they're uninformed or blinkered by the false
  152316 [igouy yahoo.] "false presentation" - another baseless accusation?
  + 152318 [wilsonb gmai] I hate to bring up the actual thread topic.. but isn't the original
  | 152402 [igouy yahoo.] Do you think startup time is large compared to a runtime of nearly a
  + 152319 [halostatue g] Isaac,
  | 152412 [igouy yahoo.] Just a few days ago, you made claims which are baseless.
  + 152323 [daniel.amela] Austin 'lead' quite an involved and lengthy discussion about
    152399 [igouy yahoo.] -snip-
    + 152404 [halostatue g] Only as an uncritical booster who doesn't actually listen. Just like now, no?
    | + 152411 [w_a_x_man ya] Doug Bagley, the creator of the original "Great Computer Language
    | | 152413 [brockweaver ] I feel a lot of love on this thread.
    | | 152604 [julian coret] thank god someone did.
    | + 152416 [joevandyk gm] Please, tell us how you *really* feel.  I feel like there's some
    |   + 152418 [martinelzen ] Actually, one aspect I've been missing in this whole ... 'debate', is the
    |   | 152580 [snowzone5 ho] unfortunately, ruby has enough 'hardness' built into too. at this
    |   | 153191 [julian coret] It's like the difference between thinking in objects vs thinking in
    |   + 152452 [halostatue g] Darn. I was aiming for the "perfectly clear that I have no patience
    + 152409 [desmarm gmai] I've paid attention to some of the discussions on the shootout here,
      + 152429 [igouy yahoo.] Interesting questions Matthew.
      | 152445 [khaines enig] [List of questions that don't answer the prior questions deleted.]
      | 152497 [igouy yahoo.] Sometimes it's none of those things, sometimes it takes a couple of
      | 152503 [khaines enig] "Real questions"?  A real question is a question that someone asks.  It's
      | 152568 [bradley.kite] [in reply to no single post in particular]
      | + 152572 [billk cts.co] It's Usenet.  There's one in every crowd.
      | + 152602 [igouy yahoo.] ...
      + 152430 [igouy yahoo.] Interesting questions Matthew.
        152444 [ogilthorpe d] I don't think that you answered either of my questions.  If you have and
        + 152456 [sy1234 gmail] Just to help to others who might be interested in past benchmarking
        + 152466 [igouy yahoo.] I was trying to answer "I don't think that I've learned much from the
          152575 [desmarm gmai] Before we go any further, I want to be clear about a couple of things.
          152590 [igouy yahoo.] -snip-
          152598 [ogilthorpe d] Aha! It appears that this is where we'll have to agree to disagree.  For
          152606 [igouy yahoo.] The specific implementation and version is given at the bottom of the