140943-141790

140716-143731 subjects 141127-372617

mapping an array to a hash?
140943 [nickwoolley@] Can anyone suggest an idiomatic ruby equivalent to this perl snippet?
+ 140946 [vjoel@PA H. ] index = Hash.new { |h,f| h[f] = compute_something(f) }
| 140967 [logancapaldo] Wouldn't  it make more sense to put #hashmap in module Enumerable?
| 141119 [vjoel@PA H. ] Of course. It would also probably make sense to choose a better name.
+ 140948 [john.carter@] If you want mind bending and obscure, try...
| 140984 [bob.news@gm ] "John Carter" <john.carter@tait.co.nz> schrieb im Newsbeitrag
+ 140950 [Ara.T.Howard] index = Hash::new{|h,f| h[f] = compute_something f}

Any Rubyists in Oslo?
140949 [glyconis@gm ] Sometime this summer, we're going to be moving to Oslo.  (We've been
+ 140957 [johans@gm il] Hey, I'll probably be moving to Oslo as well around summertime, from
| 140995 [bob.news@gm ] Hm, I consider myself a Rubyist and I've also been to Oslo two or three
+ 141002 [kentda@pv .o] Yes, there are some.

Re: Pimki 1.7
140968 [assaph@gm il] edited back
+ 140970 [assaph@gm il] Fix below (watch for line breaks). Will be in CVS tonight.
+ 141001 [rasputnik@he] Tried that patch and it works a treat1

ANN: RubyInline 3.3.1 Released
140969 [ryand-ruby@z] RubyInline version 3.3.1 has been released!

classifier lsi and ruby gsl
140971 [w3gat@nw ag ] Does anyone have ms-win binaries for gsl so that I can use the lsi
+ 141152 [cameron.mcbr] I don't think they exist.  You might find GSL bindings, but the rb-gsl
+ 141153 [dfayram@gm i] Making that build with the rb-gsl might not be trivial, but it's a

mod_ruby and Rails configuration files
140978 [andrewarnott] I walked through Curt Hibbs' tutorial
+ 141011 [tobin@_d _n ] I'm not expert at Apache + Rails, but I've seen enough of the docs to point
+ 141024 [david@lo dt ] You don't want to use mod_ruby. FastCGI is where its at. There's an
  141033 [andrewarnott] I'm following the directions on

C Extensions using MingW (invalid address LoadError)
140979 [kianw@ea th ] I've had some real trouble getting my first C extensions for Ruby to link
+ 140999 [ryand-ruby@z] You might want to take a look at RubyInline. Experiment with simple
+ 141034 [steven.jenki] Do you have to use MinGW? I've been able to build an extension using
| 141090 [kianw@ea th ] I guess I don't... I was under the (apparently erroneous) assumption that
| 141118 [steven.jenki] Yes. The hard part was figuring out (a) what to download, and (b) how to
+ 141569 [nobu.nokada@] Does "configured for MSVC" mean that you use OneClick

[ANN] Defaultable 0.0.3
140980 [ng@jo nw on ] This is the first public release of a very small project I've been

[ANN] Updateable 0.0.3
140981 [ng@jo nw on ] This is the first public release of a very, very small project I've been
141677 [sera@fh an .] Interesting. Is there a particular kind of use that inspired you to

rdoc, how is about :br: ?
140982 [bsd.SANSPAM@] # LIST [ACTIVE.TIMES|EXTENSIONS|OVERVIEW.FMT]
+ 140986 [bsd.SANSPAM@] ...
+ 141435 [halostatue@g] I don't believe that this would be a good idea. I'm presuming that you

Debian: coexistence of debs and gems?
140987 [michael@sc u] I'm using Debian/Linux and have come upon tough rock while digging for
+ 140998 [spamtrap@ca ] I'm also grappling with this issue.  For now, I'm using gems when the
| 141000 [spoooq@gm il] I have not used Debian, but Gentoo packages could simply wrap gems, so
+ 141135 [paulvt@de ia] A libgems-ruby/rubygems package is currently in preparation (by Daigo
  141175 [michael@sc u] Thanks for pointing me to this list. I assumed there might exist one,

Web spider
140989 [lucas@ru y. ] Does anyone know of a web spider built in Ruby?
+ 140990 [bitserf@gm i] htmltokenizer (on RAA). Its really domain-specific though, I'm not
+ 140994 [discordantus] It's not a full-blown lib, but seems to be a pretty good tutorial for

Re: Inverting a regular expression?
140996 [Harry_Ohlsen] give
140997 [Harry_Ohlsen] complement
141006 [mailing-list] Actually, it's not a very good point, as it isn't quite right.  See my
141013 [djd15@po cw ] What was wrong with my method? DFAs are required to be fully defined/complete
141014 [mailing-list] I stated this in my initial response as well.

rails has_and_belongs_to_many problem
141007 [ianic@4d a. ] I have two classes Album and Korisnik (think about that as user),
141021 [threeve.org@] a = Album.find(1) # find an album
141029 [ianic@4d a. ] Sorry,

Ruby Weekly News delayed
141010 [timsuth@ih g] The Ruby Weekly News for last week has been delayed. (The edition for
+ 141025 [james@gr yp ] Congratulations!
| 141037 [zdennis@mk e] aye, Congratulations!
+ 141039 [belorion@gm ] Likely excuse ...
+ 141041 [agorilla@gm ] Congrats!  You're not gonna start charging now that you've gone pro? ;)
+ 141106 [martindemell] That's news enough for this week :) Congratulations.
+ 141131 [surrender_it] congrats! and, well, take your time :)

writing to a file with gsub!
141015 [r_mueller@im] i simply want so change an existing file
+ 141018 [joost@ze ka ] [ ... ]
| 141026 [langstefan@g] # open file test for reading
| 141027 [r_mueller@im] das haut!
+ 141030 [bob.news@gm ] As others have pointed out, reading and writing to the same file at a time
  + 141032 [spamtrap@ca ] This belongs in a ruby one-liner hall of fame.
  + 141035 [r_mueller@im] But what about using \1 and \n in the second argument of gsub. Doesn't require \1 single-quotes
    141036 [james@gr yp ] No.  If you want to put \1 in double quotes, just add a backslash.
    141040 [r_mueller@im] Great.
    141042 [joost@ze ka ] You mean you prefer
    141043 [james@gr yp ] perl -pi.bak -e 's/\d+/###/g' your_file
    141047 [joost@ze ka ] Ack!

Hamburg.rb meeting
141017 [Stephan.Kaem] better late than never...

[RCR] Object#inside_metaclass?
141023 [Ara.T.Howard] class Object
+ 141028 [ilias@la ar ] the statement is false.
| 141436 [halostatue@g] ...true.
| 141447 [ilias@la ar ] A "class" is instantiated to 0..n objects.
| 141450 [hal9000@hy e] You're thinking of the Singleton pattern, which deals
| + 141451 [hal9000@hy e] I was trying to say: does NOT use terms with 100% consistency.
| + 141457 [ilias@la ar ] => resulting in a "singleton object"
+ 141031 [martindemell] That's a very neat approach. Much more satisfying than string-scraping.
| 141085 [Ara.T.Howard] the only problem is that is doesn't work !! ;-(
| 141088 [chr_mail@gm ] I see - thats what you call a meta class - actually you
| 141095 [Ara.T.Howard] def inside_metaclass?
| 141124 [angus@qu va ] [Ara.T.Howard@noaa.gov, 2005-05-04 20.44 CEST]
| 141134 [Ara.T.Howard] ha!  first i noticed you made a typo (the first two lines are a no-op without
| + 141140 [vjoel@PA H. ] Mebbe because #ancestors shows the path that method lookup will follow,
| | 141146 [Ara.T.Howard] makes sense.  bad name then.  should be Class#search_path or someting...
| + 141142 [dblack@wo bl] Isn't that the case we talked about before where you clarified that
| | 141147 [Ara.T.Howard] lol.  i've never heard of anyone being retroactively confused - but i'm sure i
| | 141151 [dblack@wo bl] Well, I think I may be the dolt, since I always seem to be present
| + 141145 [angus@qu va ] [Ara.T.Howard@noaa.gov, 2005-05-05 00.15 CEST]
+ 141045 [dblack@wo bl] I fear the terminology issue raises its head here.  Is there any
| + 141050 [ilias@la ar ] "singleton class" has already a meaning within OOP.
| | 141522 [matz@ru y- a] According to the Design Pattern book, right?
| | 141533 [ilias@la ar ] I don't know this book.
| | 141548 [matz@ru y- a] Until we find a better term.  I don't think other terms proposed such
| | 141550 [ilias@la ar ] who is "we"?
| | 141575 [matz@ru y- a] This statement implies you think avoiding name conflict is more
| | + 141580 [ilias@la ar ] Avoiding name conflict is essential for any recognition process.
| | | + 141591 [matz@ru y- a] I'm not sure what you meant.  If "singleton class" exists, it has an
| | | | + 141601 [ilias@la ar ] The [Ruby] "singleton class" has not.
| | | | | + 141607 [jlsysinc@al ] The answer is really very simple, and much as I loathe to repeat it again
| | | | | + 141658 [matz@ru y- a] Ilias,
| | | | |   + 141669 [ruby-ml@ma i] People have a tendency to find complexity where there is none :)
| | | | |   + 141670 [ilias@la ar ] My diagramm reflects the current OO-observable implementation of ruby
| | | | |     141676 [matz@ru y- a] No.  I will seek for myself.  But to tell the truth, I don't hope
| | | | + 141650 [surrender_it] <snip all>
| | | |   141674 [ilias@la ar ] Not exactly.
| | | + 141613 [discordantus] This is the only part I want to comment on. You keep using the word
| | |   141614 [ilias@la ar ] ok
| | + 141600 [halostatue@g] Not at all.
| + 141059 [jim@we ri hh] There is a distinction, although some people blur it.  Those things that
|   + 141067 [dblack@wo bl] That's what I mean (in case it wasn't clear): the two terms are not
|   | 141082 [jim@we ri hh] Then I wasn't clear either.  In answer to your question 'Is there any
|   | + 141084 [chr_mail@gm ] Nope - the singleton class of Module is not  a meta_class  but it
|   | | 141093 [jim@we ri hh] Module is a class (instances of Module are modules).  The singleton class
|   | + 141101 [dblack@wo bl] I disagree; I think Ara was using the term "metaclass" to mean
|   |   141107 [Ara.T.Howard] it does - but inadvertently.  the only requirement i have is to determine
|   |   141114 [dblack@wo bl] I believe you! :-)  I just extrapolated from that one example and got
|   + 141071 [discordantus] All the more reason to give them a different name... At this point, I
|     141078 [dblack@wo bl] Actually one would not want a completely separate name, for the reason
|     141129 [ilias@la ar ] no, it is not.
+ 141087 [chr_mail@gm ] That is plain false (at least in my understanding of what
+ 141091 [florgro@gm i] Why? Any real world samples?
  141100 [Ara.T.Howard] ...
  141104 [dblack@wo bl] (Just out of curiosity: do you mean to depart from the usual C.a here?
  141115 [Ara.T.Howard] - collections are plural

HTML Form Elements [was Re: [ANN] traits-0.0.0]
141046 [gavin@re in ] Allows you to create fields and validation rules around them, render

[ANN] HighLine 0.3.0 -- Now with ANSI colors!
141049 [james@gr yp ] =======================

Bug or on purpose?
141053 [joaopedrosa@] dewd@heaven:~ $ ruby -v
+ 141056 [bob.news@gm ] Dunno...
| + 141063 [joaopedrosa@] dewd@heaven:~ $ ruby -e "def foo s; 'bar'; end; foo = foo('z')"
| + 141065 [discordantus] This looks like it may be the result of a bug in the new proc calling
+ 141058 [halostatue@g] This looks like a bug in an on-purpose experimental feature.
  141064 [joevandyk@gm] Can someone fill me in on what's going on here?
  141070 [dblack@wo bl] It's trying to set a local variable called opa to the result of
  141072 [joevandyk@gm] Isn't that illegal?  The name 'opa' has already been defined.
  + 141075 [dblack@wo bl] That's exactly what Joao is asking :-)  Up to 1.8.2, at least, it's
  | 141386 [matz@ru y- a] It's intentional.  We are in experiment.
  | 141612 [joaopedrosa@] Thank you for answering.
  + 141077 [bob.news@gm ] "Joe Van Dyk" <joevandyk@gmail.com> schrieb im Newsbeitrag
    141080 [dblack@wo bl] You've hit on one of my pet theories about Ruby discourse and

Is there Neural network library in Ruby?
141054 [sinkanti@gm ] I'm looking for NN lib and can't find one.
141066 [prakash.diby] R u planning to implement Ruby for a NN project or its just for a sake
141073 [mneumann@nt ] Regards,

Fixnum's binary representation
141057 [camsight@gm ] As far as I know, Ruby's Fixnum is 30-bit signed integer.
+ 141060 [bob.news@gm ] Yes.
| 141069 [camsight@gm ] Thanks, Robert!
| + 141081 [discordantus] IIUC, it's not precisely a "sign bit"; it's more like an entire
| | 141097 [ptkwt@ar cn ] It's 2's complement, isn't it?
| | 141110 [discordantus] (looking it up)
| + 141083 [bob.news@gm ] <camsight@gmail.com> schrieb im Newsbeitrag
|   + 141099 [camsight@gm ] Now I understand what you mean.
|   + 141133 [andrew.balla] Guy's this is very neat and it also brings back some memories.
+ 141089 [Ara.T.Howard] don't deny yourself the joys of printf ;-)
| 141098 [camsight@gm ] Wow, that's great.
+ 141122 [drbrain@se m] $ ruby
  141148 [camsight@gm ] Hmmm... this is very interesting.

[ANN] Pages-BibTeX
141079 [tamc2@ca .a ] I'd like to announce a quick ruby script of relevance to some of you

problem using mkmf on redhat 8
141108 [joevandyk@gm] I recently upgraded Ruby to 1.8.2 on a RH 8 machine.
141109 [joevandyk@gm] Nevermind, figured it out.
141113 [joevandyk@gm] % ruby extconf.rb

traits (the other ones) vs. mixins
141117 [Ara.T.Howard] - A trait provides a set of methods that implement behaviour
141123 [vjoel@PA H. ] The operation of mixing in modules is not commutative.
141126 [naseby@gm il] They do; as I have (partially) written up on
+ 141138 [ no@sp m. om] While on the subject of traits, can someone explain the the last part of
| 141173 [surrender_it] well, I think the basic thing they're talking about is the need to call
+ 141141 [Ara.T.Howard] i apologize for not reading this earlier!  i must agree that this sounds like
  141161 [naseby@gm il] <snip />

object reference handle (like perl's reference to scalar)
141125 [eric_mahurin] In ruby, is there a way to get a handle of an object reference?
+ 141128 [halostatue@g] What are you trying to do? There is no equivalent to what you want
+ 141132 [vjoel@PA H. ] irb(main):001:0> a = [1,2,3]
| 141143 [eric_mahurin] I've have various ways I can do what I need.  I just wanted to
| + 141174 [eric_mahurin] Below is what I think is a general purpose solution to making
| | 141248 [florgro@gm i] This looks very interesting, if only from the toying standpoint. Any
| | 141252 [eric_mahurin] I just registered this under the name "reference".  I also just
| | + 141253 [tom@in oe he] Yup, all three should be good to go.
| | + 141256 [dblack@wo bl] ...
| |   141263 [eric_mahurin] The original intent was to have a way to modify these
| |   + 141270 [dblack@wo bl] Doesn't assignment do that?
| |   | 141284 [eric_mahurin] Of course.  But the code doing this assignment has to know the
| |   | 141298 [dblack@wo bl] I don't think I'm confusing it.  variable/attribute/...thingy confuses
| |   | 141332 [dave.burt@gm] To me, this looks more Rubyish. Is there some benefit I'm missing in
| |   | 141333 [dblack@wo bl] Can someone give me an example of such a time?  I'm still not seeing
| |   | + 141351 [botp@de mo t] #Below is what I think is a general purpose solution to making
| |   | | 141360 [dave.burt@gm] This is not possible, unfortunately.
| |   | + 141356 [dave.burt@gm] indirection?
| |   | | 141394 [halostatue@g] I disagree. After all, you've had to use map to replace the integers
| |   | | + 141395 [eric_mahurin] This looks nice too.  I haven't looked at DelegateClass yet,
| |   | | | 141397 [dblack@wo bl] This is uncomfortably (for me) close to all the symbolic reference
| |   | | + 141425 [dave@bu t. d] You're right, you know.
| |   | |   141432 [eric_mahurin] Nope.  You need a dereferencing operator/method just like C.
| |   | + 141361 [martindemell] You could have data structures where every member effectively has a
| |   |   141369 [botp@de mo t] #This is not possible, unfortunately.
| |   |   141423 [dave@bu t. d] You're welcome.
| |   + 141439 [halostatue@g] x, y = y, x
| + 141438 [halostatue@g] I'm not sure why.
|   141512 [dave@bu t. d] Why do you assert these things about any concievable Ref implementation?
|   141513 [halostatue@g] I don't recall the problems mentioned, but Ref objects have been
|   141520 [dave@bu t. d] That's not even difficult.
|   + 141521 [bob.news@gm ] "Dave Burt" <dave@burt.id.au> schrieb im Newsbeitrag
|   | + 141531 [eric_mahurin] Where do I get your ref.db?  I saw a link in another post of
|   | | + 141537 [halostatue@g] Because no one else is going to write their libraries to check for
|   | | + 141540 [dave@bu t. d] Sorry, my fault for posting a link that didn't exist yet.
|   | + 141545 [dave@bu t. d] variable.ref?
|   |   + 141554 [eric_mahurin] I see you modified my example.  This doesn't do what the
|   |   + 141560 [bob.news@gm ] "Dave Burt" <dave@burt.id.au> schrieb im Newsbeitrag
|   |   | 141630 [dave@bu t. d] There are two reasons I like these threads.
|   |   + 141565 [dblack@wo bl] It's a bit misleading to call it "passing by reference".  In Ruby, all
|   |     141632 [dave@bu t. d] I think it's all business as usual for Ruby. It's very similar to passing in
|   |     141640 [dblack@wo bl] def m(a); end
|   |     141790 [dave@bu t. d] David = "David A. Black" <dblack@wobblini.net>
|   + 141535 [halostatue@g] If _y were the only place this were an issue, I'd agree with you --
+ 141440 [phurley@gm i] a = [1, 2,  3]
  141445 [dblack@wo bl] a = b = c = [1,2,3]
  141470 [eric_mahurin] I tried this out and it doesn't seem to do anything.  I did a
  141510 [dave@bu t. d] # require 'ref'
threads.html
top