151551-166486 subjects 151903-154944
Problems with Net::HTTP.get
151723 [pythonmailin] I've been happily writing a smaller program in Ruby (I can't write bigger
151748 [brockweaver@] ...
151765 [pythonmailin] No, I'm not. I've even started Packetyzer, a sniffer based on Ethereal and
151778 [mrcode@ne ro] 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@ne ro] No problem, I'm glad I could help.
| + 151817 [w3gat@nw ag ] 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@ne r] 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@po ox c] Well, I disagree with prohibiting nested methods.
151736 [dblack@wo bl] $ ruby -ve 'def x; def y; 1; end; end; x; p y'
Ruby and IDL
151733 [shalev@si pl] 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@ne ro] 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@we ri hh] Were you modifying the string in-place? If so, try it without destructively
+ 151855 [ mfp@ac .o g] batsman@tux-chan:/tmp$ cat gfdhoidhi.rb
+ 151860 [jim@we ri hh] [... 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@pa h. ] Do you mean because of support for yielding from the define_method
Dynamically added methods
151739 [strass@st as] I'm pretty new to ruby so I will ask some dumb questions, sorry if it's
+ 151749 [halostatue@g] Use OpenStruct.
+ 151764 [shalev@si pl] class YourObject
151793 [strass@st as] In fact, I'd like to mimic the behaviour of ActiveRecord.
+ 151823 [zdennis@mk e] To create methods on the class itself so all instances of that class get
+ 151845 [bob.news@gm ] => true
151864 [zdennis@mk e] OpenStruct uses the method_missing magic as pointed out in my last post,
Namespace of method arguments (Ruby 2 Idea?)
151741 [rm_rails@ch ] In the Programming Ruby book in the section of namespaces, I see
151750 [halostatue@g] On 8/11/05, email@example.com
151742 [balony@gm il] Im working with xmprpc/client and the server Im working against
+ 151779 [dave@bu t. d] You can use iconv or you can run an external pipe through GNU recode.
| 151790 [balony@gm il] I'm running on a windows system, that could be a problem?
| + 151805 [jmital@ar cn] require 'iconv'
| | 151807 [dave.burt@gm] The One-Click Installer still doesn't include Iconv (the developers are
| + 151809 [phasis@bc in] def encode(str)
+ 152049 [lists@be tr ] 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@bu t. d] 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@we ri hh] 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@we ri hh] [... proc based solution elided ...]
151843 [dave@bu t. d] 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@bu t. d] You're very welcome. It's always interesting considering the GoF's abstract
What am I doing wrong?
151752 [mreed@th re ] After installing pathname2 on my Windows box went so well, I decided to
151754 [threeve.org@] irb -r rubygems -r pathname2
151759 [mreed@th re ] Thanks, that worked . . . as does using "-r ubygems", which is a nice "nroff
151813 [jim@we ri hh] If you consistently use rubygems and can control your own environment, it is
151906 [mreed@th re ] Which seem to boil down to "set RUBYOPT". Except that doesn't work
151929 [jim@we ri hh] 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@mk e] 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@gm ] Francis,
| + 152334 [ruby@ml ic m] Hmmm... Isn't this question similarly nonsensical as the one to find out
| | 152553 [zimba.tm@gm ] Benedikt,
| + 152336 [francisramme] Yes launching Eclipse is slow. But you have to do that only once
| 152340 [fxn@ha hr f.] 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@mk e] 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@wo bl] You need to put EOS on a line by itself.
| 151785 [sunh11373@ho] ...
| 151796 [ezra@ya im -] ...
| 151799 [sunh11373@ho] Thanks, it works now. maybe I should trun the EOL mark on from now on.
| + 151814 [daniels@pr n] EOS must be the ONLY thing on the line - it's not allowed to have
| + 151846 [bob.news@gm ] Having the editor remove trailing white space automatically when saving is
| 151873 [gavin@re in ] ...
| 151935 [daryl@br nd ] Please see http://compsoc.dur.ac.uk/whitespace/index.php for a
| 152030 [james@gr yp ] Or the Whiteout Ruby Quiz, for our version: ;)
+ 151769 [threeve.org@] Works fine for me.
+ 151771 [mreed@th re ] 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@gm .d ] 1. 7bit,
[ANN] Jim Weirich's 10 Things Java Programmers Should Know About Ruby is in the "Why Ruby" repository
151775 [curt@hi bs 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@gu n] Anybody over at comp.lang.ruby who has a really trivial task for this
151835 [cmills@fr es] I assume this isn't a troll.
151839 [noreply@gu n] 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@wo bl] sessionId2 = /sessionId=([-\w]+)/.match(str).captures
+ 151819 [w_a_x_man@ya] puts /sessionId=(.*?)"/.match(sessionId)
+ 151820 [twifkak@co c] - session_id2 = session_id.match(/sessionId=(.*)"/)
+ 151826 [florgro@gm i] Others suggested more complex ways, but String# can take a capture
151830 [w_a_x_man@ya] puts input.split(/sessionId=(.*?)"/)
[ANN] LibInject 0.1.0: Small Pieces Smooshed Together
151824 [sera@fh an .] I've just released the first version of LibInject, which is a developer
151838 [jim@we ri hh] class Command
gem error i get (OSX10.2.8 stilll)
151836 [julian@co et] Out of interest, this is the error I get at the moment if I do "gem
153039 [chadfowler@g] Chad Fowler
154043 [julian@co et] Okay...
154111 [meta@po ox c] You know, you're probably not going to get a great deal of help from
154112 [julian@co et] Not all Mac service providers are pretty quick to upgrade though,
154194 [ezra@ya im -] I am running a rails app on Tiger server on a brand new xserve.
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@co et] Hey guys,
151870 [r_mueller@im] For compiling these ext-libs look at your ext/Setup file in the source
151875 [julian@co et] Should they all be on?
+ 151880 [r_mueller@im] this depends on what you want to do with ruby?
| 151884 [julian@co et] 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@co et] 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@ca ar] I have a large program which needs to be able to use Postgres OR MySQL.
+ 151866 [bob.news@gm ] My guess is that it's unrelated to your change of the Array class. Did
| 151868 [leslie@ca ar] @entries = Array.new
| 151879 [dblack@wo bl] I wonder whether there's another Array class, inside a module
+ 151867 [reyn.vlietst] heh, daars min afrikaaners op ruby-talk :)
| 151872 [leslie@ca ar] heh. van waaraf is jy?
| 151886 [david@va ln ] Religious indentation is your best friend, putting a comment next to an "end" to
+ 151882 [david@va ln ] If the Array redefinition is nested in a module, you are shadowing the builtin
151931 [leslie@ca ar] It's a web script, so I never noticed this warning in a class below the
+ 151937 [ruby.brian@g] class Array
| 151939 [david@va ln ] Yup, alias does indeed seem to be a better solution here. There might be a
+ 151940 [david@va ln ] Ah wait, it seems whatever is running the web script is doing some voodoo with
+ 152039 [pit@ca it in] You can see that you don't have an Array instance, but an instance of an
Another newbie question
151877 [lsumnler@gm ] I am trying to write a small little program that will currently run in
+ 151883 [david@va ln ] puts ">>>Please enter dollar amount:"
| 151889 [dblack@wo bl] ...
+ 151890 [dooby@d1 .k ] 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@d1 .k ] 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@ya im -] $ sudo gem install highline
+ 151899 [lsumnler@gm ] Thanks everyone for your responses. At this time, and with my level of
151900 [julian@co et] You'd probably want
+ 151910 [dblack@wo bl] 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@wo bl] ...
| + 151954 [ruby.brian@g] Quite true, blush ;)
| + 151967 [dooby@d1 .k ] raise 'almost certain' # :-)
| 151981 [dblack@wo bl] ...
| 152047 [dooby@d1 .k ] I wasn't referring to your 'separator' note.
+ 152036 [rio4ruby@ru ] Or you could use Rio (http://rio.rubyforge.org)
152135 [lsumnler@gm ] 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@va ln ] For some strange reason, I get "Pre: ruby-talk ML" in my webmail client as the
151897 [bradley.kite] I'm a relatively new Ruby programmer, I am curious as to what Ruby is
+ 151898 [julian@co et] Hey,
+ 151904 [enebo@ac .o ] (I apologize in advance to any other Perl fans in advance)
+ 151909 [bob.news@gm ] 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@co et] The bottleneck is usually the database, tho... no? :-)
| | 151921 [bradley.kite] Compared with - say - slashdot?
| | + 151930 [adrianh@qu e] 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@qu e] 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@qu e] Depends when you start counting.
| | | + 151946 [chriscodes@g] Very true.
| | | 151980 [adrianh@qu e] I agree.
| | + 151962 [khaines@en g] Performance is a consideration, but it is only one of many. I switched to
| | 151997 [rick@no ne .] In my experience, you should choose a language that you are productive and
| + 151968 [flori@ni e. ] 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@gm ] 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@gm ] It was in the white space but apparently my news client had deleted it.
| | | 152280 [flori@ni e. ] Not in the whitespaces, it's written black on white. This is my first
| | + 152181 [julian@co et] And there we have it, irrefutable proof that sarcasm often ends up on
| + 152022 [julian@co et] So use perl already.
+ 151916 [mailinglists] Why ?
| + 151922 [adrianh@qu e] As somebody who does this on a regular basis I'd have to disagree :-)
| | + 151932 [brockweaver@] ...
| | | + 151933 [jm5379@gm il] 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@qu e] 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@qu e] 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@qu e] 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@co et] 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@qu e] Why? Rather nice VM to play with
| | + 152233 [snowzone5@ho] my point was there doesn't need to be a perl6.
| | | 152242 [adrianh@qu e] 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@qu e] There was a joke instigated by Simon Cozens - a Perl developer - put
| | 152267 [jeremy@ch os] Didn't it include a report of Matz thanking Parrot for all the Ruby
| + 152219 [adrianh@qu e] Curiously enough this number isn't radically more than there are in
+ 151995 [zedshaw@ze s] Wow, that C program is really fast, especially with the -O3 option.
| 152011 [sigzero@gm i] He could easily have done that with Tcl. Oh wait, you were being
+ 152048 [gobelli@hp .] I think the performance issues will be fixed with the new virtual
+ 152227 [igouy@ya oo ] 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@ya oo ] Others find worth where you fail.
152312 [halostatue@g] That's only because they're uninformed or blinkered by the false
152316 [igouy@ya oo ] "false presentation" - another baseless accusation?
+ 152318 [wilsonb@gm i] I hate to bring up the actual thread topic.. but isn't the original
| 152402 [igouy@ya oo ] Do you think startup time is large compared to a runtime of nearly a
+ 152319 [halostatue@g] Isaac,
| 152412 [igouy@ya oo ] 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@ya oo ] -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@] ...
| | 152604 [julian@co et] 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@co et] 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@gm i] I've paid attention to some of the discussions on the shootout here,
+ 152429 [igouy@ya oo ] Interesting questions Matthew.
| 152445 [khaines@en g] [List of questions that don't answer the prior questions deleted.]
| 152497 [igouy@ya oo ] Sometimes it's none of those things, sometimes it takes a couple of
| 152503 [khaines@en g] "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@ct .c ] It's Usenet. There's one in every crowd.
| + 152602 [igouy@ya oo ] ...
+ 152430 [igouy@ya oo ] Interesting questions Matthew.
152444 [ogilthorpe@d] I don't think that you answered either of my questions. If you have and
+ 152456 [sy1234@gm il] Just to help to others who might be interested in past benchmarking
+ 152466 [igouy@ya oo ] I was trying to answer "I don't think that I've learned much from the
152575 [desmarm@gm i] Before we go any further, I want to be clear about a couple of things.
152590 [igouy@ya oo ] -snip-
152598 [ogilthorpe@d] Aha! It appears that this is where we'll have to agree to disagree. For
152606 [igouy@ya oo ] The specific implementation and version is given at the bottom of the