143303-145150 subjects 143705-147627

Re: Multiple return and parallel assignement [OT]
143500 [michael.ulm@] I'm still waiting for apologies from K & R for having such hard to

Re: Syck 0.55 -- Object loading, memory leaks
143503 [complangr.3.] Ok, I installed Syck 0.55...

if __FILE_ == $0 executed twice
143515 [han.holl@gm ] As recommended in the pickaxe I often have a section at the end of a
+ 143517 [han.holl@gm ] My apologies for answering myself, but I've discovered that
+ 143528 [gavin@re in ] ...
| 143534 [han.holl@gm ] require. The initial ruby file does not wind up in $"
+ 143540 [Ara.T.Howard] unless defined? $__foo_bar__
| + 143543 [han.holl@gm ] Yes, I also find this strange. $0 should also be included. Maybe
| + 143589 [nobuyoshi.na] 1.9 does.
| | + 143590 [Ara.T.Howard] it just keeps gettin better!  ;-)
| | + 143604 [han.holl@gm ] Does it also put $0 in $" ?
| |   143605 [nobuyoshi.na] No, $0 isn't required.
| |   143610 [han.holl@gm ] Under the if are mostly tests. The files are meant as libraries. It's
| |   143664 [nobuyoshi.na] Another way is put the tests after __END__ line.  See
| |   143669 [han.holl@gm ] I see. While thinking it over, I realize that there would remain a
| + 143591 [rob@te om ju] Another note along this line...I unintentionally discovered the other
|   143690 [hramrach@ce ] ..unless you turn on case sensitivity..
+ 143561 [lists@be tr ] def gen prg, oth
| 143603 [han.holl@gm ] This had my puzzled for a while, until I added '#!/usr/bin/ruby' to
| 143656 [lists@be tr ] Still not here. Under which circumstances do you execute?
| 143667 [han.holl@gm ] I don't understand that at all. Both on FC3 (standard FC3 ruby) and on
+ 143566 [doodpants@ma] Out of curiosity, where is this mentioned in the Pickaxe? I don't
  143592 [gene.tani@gm] p. 337

Tk::BWidget::NoteBook: retrieve current page
143519 [nornagon@gm ] Yet Another Tk Question.
143538 [nagai@ai ky ] Probably you can get the information by calling

UDPSocket#recvfrom is slow
143545 [niklas@gr n.] socket = UDPSocket.new
143546 [ksruby@gm il] You can try Socket.do_not_reverse_lookup = true
143596 [niklas@gr n.] That did the trick. Thanks a lot.

AOP and Ruby
143548 [lmlourenco@i] I'm working with some friends on an AOP comparison across several
+ 143549 [jim@we ri hh] What an interesting project, I wish you luck.
+ 143571 [transfire@gm] After creating numerous implementations of varyng degrees of capability
+ 143572 [caiot1@ib st] ...
+ 143578 [lthiryidontw] Had a sight at Objectteams ruby?

new article
143550 [pat.eyler@gm] Sorry for posting about my own article, but I'm interested in feedback,
+ 143551 [ruby-ml@ma i] I generally am opposed to registering for free content (paid stuff
| + 143552 [gavri.fernan] IBM probably wouldn't mind if you pay them for reading this article.
| + 143553 [Ara.T.Howard] ...
|   143555 [pat.eyler@gm] seconded.
+ 143554 [surrender_it] I think it is a nice article.
| 143557 [pat.eyler@gm] Yeah, out of scope for this one, but it sounds like an interesting problem
| 143567 [surrender_it] I'm waiting for it :)
+ 143563 [james_b@ne r] I just started going through the article, but (as is my inclination) I
| 143564 [pat.eyler@gm] Braino on my part.   I think that I make less use of ruby-doc.org
+ 143568 [ruby.brian@g] Just started with your article, and I wonder why you build a
| 143569 [pat.eyler@gm] boundary conditions for the article, this test doesn't actually
| 143573 [ruby.brian@g] I understand your motivation, but I think it is showing something that
| 143575 [pat.eyler@gm] No worries.  I have thick skin.  :)
+ 144822 [nospam@lu ac] Sorry for the late reply but I didn't have the time to read this article
  + 144827 [pat.eyler@gm] No problems, feedback is always good.
  | 144833 [nospam@lu ac] Oh... sorry. That's my mistake. It is indeed very clear.
  + 144831 [lukfugl@gm i] having read a little about it this is my understanding...
    + 144832 [lukfugl@gm i] /me looks at pate's reply and winces, realizing he guessed wrong.
    + 144834 [pat.eyler@gm] Anti-disclaimer:  the description below is pretty accurate for Ruby
      144855 [Neville.Burn] I'm just reading the PDF and on pg 13 you flesh out the echo() method,
      + 144857 [Neville.Burn] On pg 18 of the PDF now which talks about unit_diff, and I'm unclear
      + 144858 [nospam@lu ac] In fact, you don't need the url parameter. But you're right there's an
        144859 [Neville.Burn] yep ...
        144860 [Neville.Burn] And finally, I'd like to see more detail about Mock fixtures ...
        144873 [pat.eyler@gm] [ ...]

[Rake] Don't know how to build task
143558 [brian.takita] When I run rake, I get the following error.
143559 [langstefan@g] I guess the task is called pkg/Test_Suite_Runner-0.1.0.gem

Re: Don't know how to build task
143562 [brian.takita] Thats it. s.name must equal beginning of the gem file name.

Trouble doing local instal of rubygems
143565 [twa@po t. om] Nothing I've tried helps and I'll never get access to /usr/lib/ruby .
143640 [greg7224@gm ] Have you tried following the instructions on the RubyGems web page?
143646 [jim@we ri hh] The main reason people want to install in a non-standard location is that

Writing about Ruby (Re: new article)
143574 [james_b@ne r] My own experience in writing abut Ruby, especially in the common case
143576 [pat.eyler@gm] I'm also very interested in this, as (I think) are several other people.  I
+ 143581 [surrender_it] is'nt this the maybe this is something that should go into the "Why
+ 143583 [james_b@ne r] James

Warning in ruby-1.8.3-preview1
143580 [surrender_it] Sorry if this is a ruby-core thing but I'm not subscribed there.
143585 [gotoyuzo@no ] The main target of ext/openssl is OpenSSL-0.9.7.
143597 [surrender_it] ah, nice to hear, thank you.

should change method name "Tk::BWidget::NoteBook#raise"? (Re: Tk::BWidget::NoteBook: retrieve current page)
143586 [nagai@ai ky ] I'm very sorry but I forgot method conflict between this and
143607 [nagai@ai ky ] I decide to keep compatibility.

143602 [pascal.guich] ...
+ 143623 [mailinglists] Hmm, i tested the latest release on SUSE 9.2, Mandrake 10.1, Ubunto and
+ 143666 [mailing2005@] I used the old version ( before 2005-04-27 ) under gentoo without any

Browsing with Cookies
143611 [jim@ji va fl] I am writing an app that takes in some basic data and then scours some
+ 143616 [johnl@jo nl ] your application anyway.  It parses HTML and handles context, unlike
| 143619 [warrenbrown@] Jim,
+ 143631 [markus@re li] I posted a solution to this as an example in the rails wiki; see
| 143840 [jim@ji va fl] For those in the future who stumble upon this thread, it was a hacked to
+ 143942 [nakahiro@sa ] I know you already found the way...  But FYI and ADV.

Newbie Question: Global variable vs. Top-level variable
143615 [sam.s.kong@g] This morning, a question came into my mind (I'm still a newbie).
143618 [logancapaldo] If you're writing a short script with no methods (or very few) its a
143636 [vjoel@pa h. ] ...and the scope is the _file_ in which that variable appears.

Omitting frames in RDoc html output
143620 [gfb@to es ft] Is there an easy way to omit "Files" frame when generating html with
143624 [mailinglists] And it is wasting screen space ... but i think the answer is no. You

143621 [eric_mahurin] I made some slight interface changes to some methods (to
143661 [vikkous@gm i] I am very interested in Cursor for use in Reg. It seems like the sort
143771 [vikkous@gm i] This is the right way, with the pattern on the left side of === and
143895 [eric_mahurin] I think you'd have to rewrite it from scratch in Ruby or do
143903 [neoneye@gm i] I have made a regexp lib where you can supply your own
143961 [eric_mahurin] Possibly.  From what I could tell this is pure ruby.  So it
143983 [neoneye@gm i] Yes, its far from the same speed as C.
144029 [eric_mahurin] I still don't have a first release of grammar.  But, you can
144036 [neoneye@gm i] Have you any unittests for your syntax/grammar code ?
144051 [eric_mahurin] Not yet.

ANN: ZenHacks 1.0.0 released
143628 [ryand-ruby@z] ZenHacks version 1.0.0 has been released!

143630 [aartist@gm i] How I can zerofy the day and month. I like to add 0 in the beginning.
+ 143632 [markus@re li] Does Time.at(time.to_i).strftime('%d/%m/%Y') do what you want?
| 143635 [aartist@gm i] Thanks that does the trick.
| + 143643 [markus@re li] The code you posted works, but it may not be doing what you think it
| | 143650 [aartist@gm i] Markus, , you are right on the point.
| | + 143651 [drbrain@se m] No.
| | + 143693 [acharlieblue] You really don't want to do that. You would be changing the meaning of
| |   143697 [jim@we ri hh] I like to say it like this:  Languages like Java and C++ encourage you to
| + 143645 [acharlieblue] That method works for me.
+ 143641 [heron@jp .n ] Try something like
| 143642 [ruby.brian@g] or
| 143929 [chneukirchen] irb(main):002:0> "%0*d" % [3, 10]
| 143954 [ruby.brian@g] Thanks,
+ 143659 [tylere@gm il] I think the real problem here is that maybe you aren't quite comfortable

Multilevel hash
143637 [aartist@gm i] $Q{$date}{$song_played} += 1
+ 143638 [vjoel@pa h. ] irb(main):001:0> mh = Hash.new {|h,k| h[k] = {} }
| 143644 [vjoel@pa h. ] irb(main):010:0> mh0 = Hash.new {|h,k| h[k] = Hash.new(0)}
+ 143639 [surrender_it] => {"key"=>{"key2"=>1}}

Help with user input
143647 [vfoley@gm il] I would like to write a small script in which a user enters a small
143648 [greg7224@gm ] This is really low tech but it might work.  do character based input,

[BLOG] A different perspective on Ruby.
143655 [ruby-ml@ma i] This has perhaps been aired here already, if so, apologies.
+ 143658 [james_b@ne r] First, an OT question: Is there a Firefox extension that lets me
| + 143662 [martindemell] I use a bookmarklet in my bookmarks toolbar for this.
| | 143672 [surrender_it] for *just a second* I've been thinking you used a toolbar to collect
| + 143704 [ruby-ml@ma i] Ah, yes. I forgot to append a disclaimer about the language.
+ 143668 [lucsky@ma .c] Some valid points ? I think this guy does not know what he's talking
| + 143670 [denrober@gm ] He is 18 and just out of high school and thinks he knows everything.
| + 143674 [surrender_it] I think this is a bad written rant, but I agree that I'd like implicit
+ 143673 [andrew@wa ro] Despite the fucking swearing, he did come up with a list of almost everything
| 143971 [jlsysinc@al ] I thought so.   Specifically I think he nailed some things which aren't
+ 143675 [halostatue@g] I haven't seen it, and I see very little valid on that page.

Invoking a Class block on an Instance
143665 [gavin@re in ] ...
143671 [pit@ca it in] executing a code block in the context of an object is normally done via
143692 [gavin@re in ] ...

Ruby Weekly News 16th - 22nd May 2005
143676 [timsuth@ih g] Ruby Weekly News 16th - 22nd May 2005

Pasting code with tab indentation to irb
143677 [listen@ma cr] dear list,
143719 [discordantus] IRB.CurrentContext.io = IRB::StdioInputMethod.new

setting environment variables using windows batch file
143679 [ahmads_786@y] ...
+ 143680 [halostatue@g] Simply put, you can't do this. #exec and #system start new copies of
+ 143682 [ruby.brian@g] it should be possible if you can invert your problem. If you start the

Re: A different perspective on Ruby.
143681 [gsinclair@gm] Good point.  That bugs me too.  abs is a *function*, not logically a
+ 143683 [ruby.brian@g] Why not 5.sqrt instead. Better to ask the object to do something, that
| + 143686 [cameron.mcbr] I would also agree.  This did make me ponder when I initially found
| + 143728 [glenn.parker] Hmmm, prefix, postfix, or infix?  Functional or object-oriented?
|   + 143730 [joevandyk@gm] I think the guy's point was "omg, they said everything was an object!
|   | 143736 [news@al m. p] Looks like a nice summary of his whole rant. ;)
|   | 143790 [gene.tani@gm] ===========8<
|   | 143821 [Mail@Jo as H] actually he seems to like both languages cause in the ruby rant he
|   | 143827 [ruby-ml@ma i] Yes, I already posted this. Something like this is all
|   + 143764 [logancapaldo] Just to get offtopic, factorial is one.
|   | + 143797 [glenn.parker] Touch?!
|   | + 143800 [itsme213@ho ] Method vs. non-method
|   + 143769 [jim@we ri hh] Factorial !
|   | 143815 [glenn.parker] Indeed, but this may be the exception that proves the rule.
|   | 143816 [jim@we ri hh] As long as we are only talking asthetics, then I agree that either choice
|   | + 143822 [Mail@Jo as H] oh no! its not at all!
|   | | 143837 [threeve.org@] I assume by "third square root" that you mean cube root?  To me, third
|   | | 143852 [furufuru@cc ] Use Opera! :-)  Shift+G toggles between the user and author modes.
|   | + 143985 [discordantus] 'mathn' tries to patch the sqrt functionality, but doesn't get it
|   + 143785 [bob.news@gm ] +1
|   + 143829 [chr_mail@gm ] Pretty much all non alphabetical unitary operators are typically
+ 143684 [flori@ni e. ] What about 5.-@ ?
| 143823 [Mail@Jo as H] what should that do?
| 143826 [flori@ni e. ] 5.__send__ :-@
+ 143685 [martindemell] I'd say conceptually abs belongs with floor, ceil, round and truncate.
| 143729 [ruby-talk@wh] And where do you stand in regard to .succ?
| 143775 [martindemell] succ is definitely a method rather than a function, IMO - I can't see
| 143779 [discordantus] Which is strange, since zero and .succ are the basis of mathematics,
+ 143687 [jim@fr ez .o] My take is that there are a few methods that apply to floats
+ 143691 [matz@ru y- a] The definition of abs is not questionable; it returns self, negated
  + 143695 [ news@ja .f ] matz@ruby-lang.org says...
  | 143723 [jim@fr ez .o] I think if you read Matz' post carefully, you will see that he
  + 143749 [jgoalby@gm i] I may be missing something, but why does it matter what the return
    143752 [ruby-ml@ma i] irb(main):018:0> class Fixnum

[SUMMARY] Tiling Turmoil (#33)
143688 [james@gr yp ] The quiz mentioned a mathematical proof (by Solomon Golomb), that could be used

Re: [ANN] cursor-0.6
143694 [eric_mahurin] Thanks for the interest.  If you want to help out, let me know.

Re: Tiling Turmoil (#33)
143696 [atgeirr@ma h] I am a bit late with my solution, but it's my first Ruby Quiz, and my
143712 [greg7224@gm ] I have some ideas about the first 2 but I'll leave it to the experts to
143718 [Ara.T.Howard] i think it's often better to implement your own copy method since dup only
144001 [atgeirr@ma h] As far as I can understand, dup would actually work here, since the
+ 144009 [dbatml@gm .d] #clone works like #dup, but it keeps more properties of the original
+ 144027 [james@gr yp ] Yes, in instances where you're just dealing with simple numbers, dup

Distributed Ruby method_missing NameError == boo (test case included)
143698 [curtis.schof] Distributed ruby seems to have issue with dispatch doen via
143733 [drbrain@se m] This is by design, see #check_insecure_method.  DRb only lets you
144121 [curtis.schof] Beautiful. Thank for the complete info. I was thinking about how

[OT] Language corrections
143699 [joevandyk@gm] Every so often, I see a post that either starts or ends with
+ 143701 [pjpizza@rs e] heh, I count only 1 spelling error and 2 grammatical errors in your post. 8D
| + 143703 [sroberts@un ] Not on ruby-talk, please, its way off-topic.
| + 143707 [joevandyk@gm] Speling mistakes are intentional.  Grammar mistakes aren't, but I'm
+ 143709 [Ara.T.Howard] on a related note (seriously) - can anyone translate some burning japanese
+ 143750 [surrender_it] please *do* fix my errors even if I don't explicitly re-state it in any
| 143759 [listen@ma cr] <cry> me too </cry>
+ 143754 [hal9000@hy e] The irony, of course, is that many of the worst speakers of English

Locks with IO and Thread
143700 [nolivier@al ] I consider the following piece of code, supposed to run under a GNU/Linux system.
143706 [guslist@fr e] Guillaume.

metaclass in python, role in perl and AOP in ruby
143702 [lthiryidontw] * Python
143751 [surrender_it] it would mimic AspectJ. Or, if we just install the supposed :pre :post
+ 143765 [logancapaldo] How about we don't worry about Ruby mimicing anything? Just let it do
| + 143767 [james_b@ne r] I sort of figured most modern languages get where they are because
| + 143784 [surrender_it] actually I was trying to say this :/
+ 143930 [chneukirchen] Everything mimics Common Lisp, but most things do it worse. :-)