160652-164058

160371-161878 subjects 160711-163481

^ RubyConf Presentations!
160652 [ezra yakima-] Hey again listers-

^ RubyGems install problem
160655 [untz san.rr.] Ezra,
160665 [untz san.rr.] Ezra,
160667 [ezra yakima-] Unssee-
160668 [untz san.rr.] Ezra,
160670 [ezra yakima-] Unssee-

^ [Rails] Javascript / DHTML menu
160656 [chris_dempse] I'm at the point in a Rails application I'm working on where I need to put
160669 [dave burt.id] Do you really need Javascript?

^ Re: Catch a ride from RubyConf to Anaheim on Sunday?
160657 [kennethkunz ] Thanks Ted... I'll check into that.

^ Factory function like Array() for your own classes
160664 [sean.ohalpin] I was quite surprised today to find out that you can define both a
+ 160666 [Ara.T.Howard] not a bad idea
+ 160671 [dave burt.id] In Ruby, so we're told, methods begin with a lower-case letter. Now,
| 160672 [sean.ohalpin] It doesn't ~need~ an alias. It's just quite handy sometimes when you
| 160673 [Ara.T.Howard] i'm with you - i do it all the time in my own code ;-)
+ 160675 [transfire gm] Yep. Yep. Yep. I've sugegsted it before. But some people don't like it,
| 160680 [dave burt.id] Like this?
| 160683 [bob.news gmx] I'd prefer
| 160684 [bob.news gmx] => nil
| 160687 [sean.ohalpin] Indeed - I mentioned it above ("aliasing :[] to new") and have been
| 160721 [transfire gm] automate it fora all classes --but b/c it just adds additional overhead
+ 160876 [sean.ohalpin] Ah! I see the light! :)
+ 161370 [gavin refine] A language-comparison-aside...

^ IRB tab completion problem on OS X Tiger
160674 [untz san.rr.] Ezra,

^ Ruby/DL union! method syntax
160685 [greg.kujawa ] I read the Ruby/DL docs on using the struct! method and have an
160936 [ttate ttsky.] You should pass a signature and labels like struct!.
161055 [greg.kujawa ] Oh I see. Thanks for the reply. I thought that a union was defined as

^ rbXPCOM ... no updates since 2001 ???
160686 [jeff.darklig] Hey all,
160792 [leavengood g] I agree regarding Ruby and Mozilla/Firefox, and have had similar
+ 160818 [wilsonb gmai] The world also needs a solid XulRunner <-> Ruby binding, an idea that
| 160825 [curt.hibbs g] No one has yet attempted it. Although, everytime the subject of mozilla and
+ 160831 [martindemell] Whiskey? :)
  + 160834 [jeff.darklig] yep, that sounds about right ... firewatir =3D=3D whiskey! ;)
  + 160842 [lyndon.samso] how about watirfox, what-a-fox...
  | 160847 [botp delmont] #especially if we can get the world to give up on javascript
  + 160878 [leavengood g] Hehehe, that is quite good actually, but I was thinking something more

^ RubyConf Coverage by OPML
160688 [muness gmail] Looking for a single source coverage of the conference and not finding
160689 [sera fhwang.] Thanks for that, Muness. I just stole a bunch of them for the feed
160691 [james_b neur] The link should be

^ [ANN] rcairo 1.0.0
160693 [kou cozmixng] I released rcairo 1.0.0.
160824 [kou cozmixng] In <20051016.012318.110525344.kou@cozmixng.org>

^ Re RubyConf Presentation Audio
160694 [ezra yakima-] Hey lists-
160722 [fabjcn yahoo] Many thanks to you for putting the conference presentations online.

^ comp.lang.ruby FAQ
160695 [hal9000 hype] RUBY NEWSGROUP FAQ -- Welcome to comp.lang.ruby!  (Revised 2005-4-14)

^ comp.lang.ruby FAQ
160696 [hal9000 hype] RUBY NEWSGROUP FAQ -- Welcome to comp.lang.ruby!  (Revised 2005-4-14)

^ How to get non-unique elements from an array?
160697 [sam.s.kong g] I need to get non-unique elements from an array.
+ 160698 [p.capriotti ] a = [0,1,2,3,4,5,2,3]
| 160706 [sam.s.kong g] Thank you for the insight.
| + 160707 [bob.news gmx] => [0, 1, 2, 3, 4, 5, 2, 3]
| | 160714 [SimonKroeger] Yeah,
| + 160708 [bob.news gmx] ...
+ 160700 [james graypr] => [0, 1, 2, 3, 4, 5, 2, 3]
+ 160701 [neoneye gmai] How about?
+ 160739 [para.hsu gma] How about this ?
| 160744 [bob.news gmx] a needs to be sorted for this to work.  As far as I remember that was not a
| 160749 [Ara.T.Howard] class Array
| 160771 [bob.news gmx] Did you mean to provide this as an example that you actually need to count?
| 160775 [Ara.T.Howard] no - i meant you have to count - merely note that a element has been seen and,
| 160779 [bob.news gmx] More precisely speaking: for every even number it's added half that many
+ 160764 [dblack wobbl] a.uniq.find_all {|x| a.find_all {|y| y == x }.size > 1 }
+ 160808 [lyndon.samso] Not very elegant, but a different approach...
| 160809 [lyndon.samso] Funny, doesnt work when an item in the array > 10...
| 160812 [explosiv0SX ] You could just sort the array, then iterate. If the previous
| 160820 [joevandyk gm] irb(main):031:0> a
| 160823 [zdennis mkte] irb(main):013:0> a = [1,2,5,4,3,5,3]
| 160829 [mvette13 gma] Zach, if an element repeats more that once, itll double up in the output
+ 160830 [martindemell] h1 = {}
+ 160837 [relm 3tlk.ne] eval(a.inspect.gsub(/\b(\d+),(?!.*\b\1\b)/,'')).uniq
+ 160894 [pauldacus gm] Young grasshoppers... let us never forget the power of the REGEX!  Let
| 160897 [neoneye gmai] no need to sort.. :-)
| 160910 [leavengood g] Both are interesting solutions, but you are returning the unique
| 160916 [neoneye gmai] Sorry should be without the delete..
| + 160925 [jeff.darklig] How 'bout
| + 160935 [pauldacus gm] That '?!' zero width lookahead regex is nice, Simon.
+ 160908 [pauldacus gm] Well, until someone catches the horrible gaff on my last try by solving
+ 160944 [sam.s.kong g] I'm the OP.
  + 160949 [leavengood g] It works, but is considerably slower (I've included a few other recent
  + 160953 [pauldacus gm] That is a good one.
  | 160968 [leavengood g] Thanks for this. I was wondering if my method of benchmarking might be
  | + 160970 [leavengood g] On second thought, Mark's may have been the best overall. Either way,
  | | + 160990 [lyndon.samso] user system total real
  | | + 160999 [zdennis mkte] Mine isn't the shortest, but it's the fastest I've seen thus far! Twice
  | |   + 161000 [zdennis mkte] Oh wait... I just saw Ryan's other email... he didn't forget and I'm not
  | |   + 161005 [phasis bclin] Here is my code
  | + 160988 [pauldacus gm] Awesome!  What seemed like a fairly simple question... not so!  I'm
  | + 161007 [sam.s.kong g] I must confess that I love this group...:-)
  |   161119 [leavengood g] Yes it is pretty fast, see below.
  |   + 161125 [zdennis mkte] Could someone explain to my dense brain....how some of these solutions
  |   | 161138 [jeff.darklig] Because the big array was done once, and the little array was done many times?
  |   + 161135 [Ara.T.Howard] a couple of observations: zach's method destroys the array at each iteration
  |     + 161144 [Ara.T.Howard] user     system      total        real
  |     | 161147 [james graypr] Yippy!  <laughs>  I had almost forgot I contributed...
  |     + 161154 [pauldacus gm] name	real
  |     + 161180 [leavengood g] Thanks a lot for this Ara, you make some excellent points. I did think
  |     + 161241 [sylvain.joye] I think you could improve this one a bit by simply doing
  + 160959 [mvette13 gma] Hey Sam,
    161247 [pauldacus gm] For those still the slightest bit interested... I found two slightly
    161255 [pauldacus gm] Well... it was a short run.  At least I keep my streak alive... Still,
    161274 [pauldacus gm] Welp, can't leave well enough alone:  I fixed Sylv's code to count true
    + 161276 [dblack wobbl] All right, all right, I surrender :-)
    + 161281 [pauldacus gm] Kneel before ZHOD!  Lyndon is King of Speed...
      + 161283 [pauldacus gm] Sorry David :-)  But remember:  Yours was slow, but at least it worked!
      + 161292 [lyndon.samso] Just goes to show Matz's Bignum impl is very efficient...
        161296 [pauldacus gm] Ruby DOES kick butt!
        161302 [ruby-ml magi] Absolutely! The algorithm is very important and often it is the case

^ Ruby projects
160699 [narf968 gmai] I keep a list of projects I thought would be fun to work on some day
+ 160702 [james graypr] I hear that.  Me too.
| + 160703 [thomas eduli] Indeed.  In fact, this list of projects would have been _ideal_ to me a
| + 161505 [narf968 gmai] Logic gate simulator would be almost trivial to do. I want to be able
|   + 161513 [james graypr] If you (or anyone else) have the details on this, please send them
|   | 161519 [leavengood g] I agree. Another quiz idea, eh James? ;)
|   | + 161526 [w3gat nwlaga] simulators at the time.  But once I finished it, my
|   | | 161528 [james graypr] Now we *have* to do it as a Ruby Quiz!  :D
|   | + 161533 [sean.ohalpin] Might be fun to translate from Scheme.
|   |   161585 [hal9000 hype] Actually, this reminds me of something.
|   + 161618 [narf968 gmai] I think the underlying idea behind the lemonade stand is supply and
+ 160705 [narf968 gmai] I forgot: human brain simulator.
  160725 [nugend gmail] If you can swing that one, I think you get a Nobel prize.
  160939 [ jupp gmx.de] in economy?

^ Help! define_method leaking procs...
160704 [jamis 37sign] A plea for help, here... The rails core team is hacking like mad this
+ 160710 [ryand-ruby z] Someone on IRC made this claim a while ago so I looked into it. Doing
| + 160712 [matz ruby-la] Since define_method creates reference to the block (a closure) which
| + 160713 [eric_mahurin] I demonstrated some example code with a memory leak with
|   160717 [ruby-ml magi] I still do not think this is a memory leak. It is, perhaps, memory
|   160719 [eric_mahurin] So you definition of "memory leak" says that it is not a memory
|   + 160723 [ysantoso-rub] Stop right there. I want to remind people that you can't use VmSize as
|   | + 160726 [ysantoso-rub] ysantoso@jenny:/tmp$ gcc -W -Wall ./leak.c -o leak && ./leak immed && ./leak not_immed
|   | + 160727 [wilsonb gmai] Has anyone tried throwing DTrace at this problem?  I don't have any
|   | + 160728 [eric_mahurin] a=(1..i).to_a;self.class.send(:define_method,:"f#{i}"){i*i}};GC.start;
|   |   160729 [ysantoso-rub] That is still not a valid way to detect leak as that still depends on
|   |   160730 [eric_mahurin] a=(1..i).to_a;self.class.send(:define_method,:"f#{i}"){i*i}};GC.start;
|   |   + 160732 [Ara.T.Howard] [ahoward@localhost ~]$ for i in $(seq 0 18);do
|   |   | 160733 [Ara.T.Howard] and even wrapping in a method doesn't seem to help
|   |   | + 160735 [ysantoso-rub] I think that's because the symbol table grows exponentially.
|   |   | + 160748 [eric_mahurin] The other leaking examples were technically quadratic (O(n**2))
|   |   |   160751 [Ara.T.Howard] you are correct : never send email at 1am ;-)
|   |   + 160734 [ysantoso-rub] Be careful, 1. there is no evidence yet that ruby is not freeing every
|   |     + 160746 [eric_mahurin] Just because a process frees all its memory before it
|   |     | + 160747 [decoux moulo] No please.
|   |     | | 160753 [eric_mahurin] The above paragraph doesn't even blame ruby.  This thread
|   |     | | 160755 [decoux moulo] This is really the first time that you use a language which has closure ?
|   |     | | 160768 [Ara.T.Howard] can you show us what you mean guy?
|   |     | + 160750 [Ara.T.Howard] by your definition the code i was working with last week is 'leaky':  it
|   |     + 160774 [ysantoso-rub] agreement with what you thought you knew for the most part.
|   |       160861 [rhkramer gma] Thanks for the reply--it will probably take me a little while to digest this.
|   + 160770 [ruby-ml magi] Yes. As far as I knew, this was the only sensible definition.
|     160772 [eric_mahurin] Try a google on "memory leak".  The first several defintions
+ 160805 [lyndon.samso] Have you thought about a ruby leak detector?
  160898 [jamis 37sign] We have identified and fixed the leak, and all is well now. Thanks,
  160903 [eric_mahurin] Would you mind showing us a snippet of code that demonstrates
  160907 [jamis 37sign] Well... here's a small script that duplicates the problem, but it

^ Anonymous methods, blocks etc. (Cont. 'default block params')
160709 [ruby-ml magi] Listening in on the Roundtable (thanks to the brave recording crew and
+ 160773 [robert_kuzel] are there any non obvious issue why blocks, anonymous methods and
| + 160778 [wilsonb gmai] I agree. It seems to me that once Ruby has 'real deal' anonymous
| | 160801 [ruby-ml magi] The hurdle for this, I assume (apart from having to rewrite a lot of
| + 161067 [chneukirchen] myproc = myobj.method :mymethod
+ 161077 [sean.ohalpin] Short answer - yes. An anonymous function would mean you're not
  161085 [halostatue g] Except that Matz still plans on making anonymous functions have closure
  + 161101 [transfire gm] I agree that a *true* anonymous function is needed, but also think it
  | + 161115 [sean.ohalpin] I'm surprised more people don't seem to think real anonymous functions
  | | 161133 [halostatue g] Keeps local scope at the time that the closure is created.
  | | + 161139 [sean.ohalpin] I see that there is a difference in what either of us means by an
  | | | 161159 [daniel.schie] Why not use lambda/function?
  | | | + 161168 [ruby-ml magi] I originally suggested
  | | | + 161174 [transfire gm] Let me try to convey this once more: the closure issue is not simply a
  | | + 161145 [transfire gm] I would have to agree with matz actually.
  | |   161210 [sean.ohalpin] Well, I'm glad ~someone~ likes it :)
  | + 161184 [eric_mahurin] v1.9 already has the ability to do the opposite which kind of
  |   161211 [sean.ohalpin] Maybe if we say it often enough? ;)
  |   161263 [halostatue g] Doubtful. I think to convince matz, real examples would need to be
  |   + 161269 [transfire gm] The easist is the old gotcha. Programmer has code (doesn't much matter
  |   | 161295 [halostatue g] Dumb programmer. This part isn't nearly sufficient to justify a new
  |   | 161396 [transfire gm] Dumb example. But I wasn't foging for "gold". Surely you can
  |   | 161405 [halostatue g] I'm not wanting to extrapolate. Consider me the conservative here,
  |   | 161487 [transfire gm] It's all relative Austin. How *really useful and important* is
  |   | + 161501 [halostatue g] Don't try that game with me, Trans. You can't play it that well. You're
  |   | | 161591 [transfire gm] *Convince* Matz? Hah! Haven't you noticed he's a like rock? But thank
  |   | | 161595 [matz ruby-la] I know I am very conservative about language changes, and am aware of
  |   | | 161621 [transfire gm] I mean it: Thank Goodness!
  |   | + 161516 [eric_mahurin] Trans, I thought the discussion was the need for a non-closure
  |   |   161592 [transfire gm] Anonymous methods, blocks etc. (Cont. 'default block params')
  |   |   161649 [eric_mahurin] Then what was your point of the above code?  All 3 of the
  |   + 161273 [eric_mahurin] With 1.9 being able to specify local variables in the argument
  |   | 161298 [halostatue g] As I said earlier, though, most of the blocks (I'd say 60%) that I use
  |   + 161282 [sean.ohalpin] I ~was~ being ironic (hence the ;)
  |     161299 [halostatue g] I know. I still think it was worth a response.
  + 161109 [sean.ohalpin] Hmmm. I must have missed that. What does "closure capabilities" mean exactly?
  + 163525 [zdennis mkte] Was there an RCR for this syntax? If so what is it's name, I do not see
    163530 [transfire gm] It's Matz' baby; borrwoed from Perl. So no RCR required.
    163533 [zdennis mkte] Is the -> syntax still open for debate Matz? I agree with Austin on
    + 163544 [zdennis mkte] I wanted to partially rephrase this last comment in case it comes across
    | 163552 [daniel.schie] I agree. The `->(args) {}' syntax is cluttered and hard to read. The
    + 163570 [matz ruby-la] It's always open.  But define "ugly" first.
      163576 [zdennis mkte] Here are some of my thoughts on the syntax "->(a=5,b=1){ }" to denote it as ugly.
      + 163584 [martindemell] I mentioned Arc's use of fn for lambda a year or two ago, but Matz felt
      + 163614 [gavin refine] * It's a pain to type on a US English keyboard. Under 'proper'
      | 163630 [transfire gm] This is abit to the side, but maybe it would shed light on the
      | + 163648 [gwtmp01 mac.] Something tells me that it will be impossible to have an identical
      | | 163682 [transfire gm] What do you mean by #3? Other than that why so you see this as problem?
      | | 163693 [gwtmp01 mac.] Right now there are some heuristics that allow the ruby parser to
      | | 163754 [transfire gm] Right. And that's all it needs to do here. Nothing in this respect
      | | 163763 [gwtmp01 mac.] Even if there is a fast way of doing it, I think your proposal requires
      | | 163776 [transfire gm] def proxy(a, b, c)
      | | 163783 [mental rydia] Actually, no, you just need to know it's a Callable.  Or duck-typed
      | | + 163800 [transfire gm] So instead of depending on the class of object, you're duck-typing the
      | | + 163817 [gwtmp01 mac.] Now you are right back to where we started.
      | |   163821 [transfire gm] No, I think he was still working with implict execution. The -> is
      | |   163830 [gwtmp01 mac.] My bad. But that doesn't mean anything other than swapping the
      | |   163840 [transfire gm] Yes it is, but not as an actual implementation. Once again Ruby proves
      | |   163844 [mental rydia] That doesn't mean it's unusable, however.  If 90% of your program's time
      | |   163847 [transfire gm] Fair enough. Still, a more efficient core lazy-evaluation feature would
      | |   163856 [mental rydia] Any suggestions for what the interface for enabling/disabling caching
      | |   163990 [transfire gm] Perhaps extend #memoize to handle procs and promises in additional to
      | |   163994 [mental rydia] Nah, you'd want normal laziness by default.  Only in rare circumstances
      | |   164000 [transfire gm] ???
      | |   164007 [mental rydia] It sounded like you were suggesting that caching should require the user
      | |   164045 [mental rydia] I would expect it to be rare not because of the implementation, but
      | |   164058 [transfire gm] I see. I not thinking just of the lazy evaluation. I'm also thinking of
      | + 163733 [martindemell] This breaks ruby's model quite badly, though. If a lambda is a function
      |   163740 [transfire gm] Martin,
      |   + 163757 [transfire gm] Actually that's not exactly true. It is only not backwards comapitable
      |   + 163804 [martindemell] What I mean is, you're breaking the model of a lambda as a "first class
      + 163649 [rm_rails che] Seems that creating an anonymous function has one of the most widely
threads.html
top