169501-171217

169314-172185 subjects 169676-175646

Re: Amrita2 1.9.6
169501 [gsinclair@gm] Great.  Any chance you could release Amrita as a gem?
169581 [takunakajima] I have uploaded gem of Amrita2 to rubyforge. So, you can install

interesting book sales news
169505 [pat.eyler@gm] Ruby books are up over 1500% over last year, while Python books

ruby pipe with arguments error
169506 [capitain@gm ] i am newbie of ruby , but i met a strange problem
169529 [nobuyoshi.na] ARGF doesn't equal STDIN.

Ruby + Lotus Domino oh my!
169509 [kevin.jackso] Does anyone have any experience interfacing ruby to Notes/Domino?  I
+ 169733 [wilsonb@gm i] If you can run Ruby on the same box as Domino, you can do this.  This
+ 171214 [meta@po ox c] If there's a Domino server involved (i.e. it's not just a database on a
  171216 [sam.dela.cru] In my company, we use Lotus Notes, here's how I extract messages from one
  171217 [sam.dela.cru] Sorry, the tab spaces were kind of messed-up, here's the same code with

is this a good way to find anagrams?
169512 [wrong@so al ] it seems to me, with computers these days, this should finish
+ 169528 [mrkode@gm il] ...
+ 169540 [batkins57@gm] One thing you could try is inverting your algorithm.  My dict/words
| + 169547 [batkins57@gm] I went ahead and implemented my own suggestions, and just to give you
| | 170066 [djberg96@gm ] I think there's an algorithm for finding anagrams using libgmp, for
| + 169552 [martindemell] Even faster - sort the list of permutations, then do an incremental
+ 169544 [m.fellinger@] charset="iso-8859-1"
| 169835 [chneukirchen] Better use #find_all, no?
+ 169845 [ruby.brian@g] if you want to find lots of anagrams against the same database it
  169848 [ruby.brian@g] hash =

SF Beer & Dim Sum SIG (12/28) - !change of venue!
169514 [rdm@cf l. om] It turns out that the Long Island Chinese Restaurant has (a) moved

About class methods
169516 [hankgong@gm ] ...
+ 169519 [logancapaldo] class methods are (more or less) the same thing as static methods in C
+ 169522 [james_b@ne r] p Array.class  # Class
| 169524 [transfire@gm] Actually, they are ad hoc. ;-)
| 169587 [transfire@gm] Sorry Hank, if you are unware of what were talking about in these last
| + 169658 [hankgong@gm ] ...
| | 169669 [dblack@wo bl] Basically an object's singleton class is a class created ad hoc, and
| | + 169709 [transfire@gm] Interesting. Perhaps we've met halfway then. 'Ad hoc' is an excellent
| | | 169721 [zjll9@im il ] What did you guys think about using simpleton to refer to these
| | | 169743 [gwtmp01@ma .] On Dec 8, 2005, at 3:45 PM, jonathan <zjll9@imail.etsu.edu>
| | | 169806 [zjll9@im il ] been called a singleton but, it has no methods at all (neither class nor
| | | 169810 [zjll9@im il ] My understanding of 'singleton' methods or 'ad hoc' methods or
| | | 169861 [transfire@gm] J,
| | | 170016 [zjll9@im il ] Well, actually, I think you do it the same way you would in C++, i.e.,
| | | 170019 [zjll9@im il ] T,
| | | 170025 [transfire@gm] Well, I think its basically because Matz used the class nothing more
| | | + 170027 [dblack@wo bl] The latter, yes, from what Matz has said (no convenience method
| | | | 170160 [transfire@gm] I tend to agree with you. While on the surface it may seem simpler
| | | + 170035 [zjll9@im il ] Hmm.. Ok.  But, with Ruby, you can still dynamically create subclasses
| | |   + 170053 [dblack@wo bl] The starting-point of the whole thing is the principle that objects
| | |   | 170106 [zjll9@im il ] Hmm.  Ok, so there really is no singleton class for Myclass?  In other
| | |   | + 170112 [gwtmp01@ma .] In Ruby, a class *is* an instance.  Specifically, a class is an instance
| | |   | | 170116 [zjll9@im il ] Oops.  It should have been #{some_class}.  The whole point of that was
| | |   | | 170118 [zjll9@im il ] Actually, according to wikipedia, metaprogramming involves only rewrites
| | |   | | 170146 [james@gr yp ] That's not how we generally use it in the Ruby community, but keep in
| | |   | + 170117 [ruby-ml@ma i] On 2005.12.11 10:34, "jonathan <zjll9@imail.etsu.edu>
| | |   | | 170120 [zjll9@im il ] Oooh.  That's cool!  In the case I was envisioning, I would want to eval
| | |   | | 170147 [ruby-forum-r] Just to be clear (I think you have the right idea, but for the
| | |   | + 170162 [dblack@wo bl] Every object (almost) can have a singleton class, including Class
| | |   |   170198 [zjll9@im il ] Oh.  That's a neat way of doing it.  Would the code below also work in
| | |   |   170199 [ruby-ml@ma i] On 2005.12.12 13:07, "jonathan <zjll9@imail.etsu.edu> <zjll9@ima"
| | |   |   170409 [zjll9@im il ] Why is the code above unadvisable?
| | |   |   170415 [ruby-forum-r] I personally think the idiom is a bit suspect but it could
| | |   |   170425 [zjll9@im il ] I don't really see how duck-typing is relevant, but I would assume that
| | |   + 170206 [martindemell] It's not a subclass, it's an anonymous proxy superclass. It goes into
| | |     + 170411 [zjll9@im il ] So, this means you lose the functionality of a?  I thought the whole
| | |     | 170413 [zjll9@im il ] Oops. Nevermind the part about losing functionality.  However, I think
| | |     + 170418 [gene.tani@gm] ...
| | + 169756 [sean.ohalpin] Heu magister carbunculi! ;)
| + 170201 [mark.ericson] ...
|   170203 [hal9000@hy e] I think "class method" is used in our community, but it is considered
|   170209 [perrin@ap th] By the way . . . has anyone considered a name like "singular"?  What
|   + 170215 [ruby-ml@ma i] I advocate "pouch" :)
|   + 170446 [groups@gr nd] Well, I'm having a terrible time following the distinction between the
|     + 170449 [michael.ulm@] Chunky Bacon Class!
|     + 170468 [dblack@wo bl] First, there's an existing term (singleton method/class) that's under
|     + 170587 [zjll9@im il ] I believe, and there is a slight chance that I'm wrong, that the terms
|     + 170588 [zjll9@im il ] Well, I think 'simpleton' and 'singleton' are synonymous terms (about
|       170591 [dblack@wo bl] I think you're laboring under a misunderstanding.
|       + 170599 [zjll9@im il ] I don't think so.
|       | + 170601 [dblack@wo bl] This seems to be some kind of play on words.  "Simpleton" is not an
|       | | 170604 [zjll9@im il ] Yea, I agree there is some word playing going on (it may be kinda like
|       | + 170613 [rosco@ro co ] Lol!
|       + 170665 [logancapaldo] ...
|         170724 [zjll9@im il ] What is the source of this definition?  This could be my vindication. :)
+ 169523 [transfire@gm] In Ruby a class is an object too. So it can have it's own methods just

A small query
169525 [srinivas.j@s] Dear all,
+ 169531 [dandiebolt@y] ...
| 169545 [srinivas.j@s] I see that it does take care of nesting. But, since
+ 169533 [nobuyoshi.na] Fortunately, no.  On dynamic languages such as Ruby, it would
| 169543 [batkins57@gm] Isn't that sample the same as obj.instance_eval ?
+ 169565 [bob.news@gm ] obj.instance_eval do
  + 169611 [rampant@gm i] def with(obj, &block)
  | 169617 [james@gr yp ] Ah yes.  This actually does what you asked for.  Ignore my incorrect
  | 169620 [mental@ry ia] In either case, caveat nuby -- within the block 'self' will refer to
  + 169614 [james@gr yp ] class Object

YAML can not accept "\t" under windows!
169527 [capitain@gm ] when i try this code
+ 169550 [dooby@d1 .k ] Which proves that if you try hard enough to break something,
| 169624 [capitain@gm ] I meet the same problem when using rubyonrails
+ 169551 [malte__@gm -] It doesn't under Linux either. YAML does not like tabs.
  169631 [capitain@gm ] 5 min ago, I realized that the ruby version in my linux server is
  169640 [shot@sh t. l] that question being 'Why does YAML forbid tabs?' :o)

Re: Weird Numbers (#57) Solution
169546 [rubyforum.20] I was impressed when I started going through 1..1000 in under 15

YAML hash of array (ruby <-> perl)
169556 [zhimin.wen@g] Given the data of h={"a"=>[1,2]}, perl's YAML gives the result of
169557 [dandiebolt@y] ...
169558 [zhimin.wen@g] My version of ruby is

Suggestion to the Pragmatic Programmers
169567 [xrfang@ho ma] I recently purchased the PickAxe 2 PDF edition. I intended to use it to
+ 169576 [james@gr yp ] orders@pragmaticprogrammer.com
+ 169615 [fugalh@gm il] While I don't have pickaxe2, I do have the rails book and I find the
| 169619 [danieljohnle] Acrobat Reader (or Adobe Reader as its now called) does indeed have
+ 169693 [cyberco@gm i] Totally agree. I also bought PickAxe II recently and even mailed the

Gem errors
169569 [bwalling@gm ] I'm trying to get going with Rails, but gem is giving me errors with
169585 [tom@in oe he] Hm, yup, there seems to be some problems with the gem mirroring system.

...rubygems... in require: no such file to load
169572 [wybo@se va y] I have a script requiring rubygems, rio, and more, plus a module in a
169626 [jim@we ri hh] ...rubygems... in require: no such file to load
170045 [wybo@se va y] Thanks, Jim. This helped: we finally found out that the session gem wasn't

[SUMMARY] Weird Numbers (#57)
169574 [james@gr yp ] In reading through all the interesting solutions to this quiz, I noticed two

do/end vs braces
169578 [slitt@ea th ] It looks to me like when you use an iterator (each for instance), you can make
+ 169579 [joevandyk@gm] Typically,
| + 169591 [james@gr yp ] Another convention some use is that { ... } are for the times when
| | 169594 [joevandyk@gm] Good point.  And also use { ... } if you want to do crazy chains like
| | 169595 [joevandyk@gm] Oops, that first 'i' should be an 'a'.
| + 169612 [mental@ry ia] I can promise there's no speed difference.  They both parse to the
| + 169637 [martindemell] matchit.vim
| + 169876 [ysantoso-rub] I am not sure why Pickaxe mentioned this convention that is based
| | + 169883 [daniel.cedil] In the end doesn't it all come up to a matter of preference? I prefer
| | | 169893 [gwtmp01@ma .] I find the different precedence useful.
| | | 169894 [transfire@gm] I've sometimes thought, "man wouldn't it be tight if we had some sort
| | | 170050 [chneukirchen] /\
| | + 169905 [ezra@ya im h] Yohanes-
| |   169929 [ysantoso-rub] Thank you for the thought, although I can't use that as I'm using
| + 169896 [neil@ha ub .] I use do .. end always.  I find it easier to read, and more in line with
+ 169593 [james@gr yp ] Hope that helps.
+ 169603 [daniel.schie] There's a slight difference in how they're parsed.
  169752 [slitt@ea th ] #!/usr/bin/ruby
  169760 [lukfugl@gm i] ~$ cat test.rb
  169772 [slitt@ea th ] Confirmed! Thanks Jacob. This is the first time I've seen Ruby conflict with
  + 169773 [paul@no pa .] Interestingly, it worked for me with a space or without the parens when
  | 169780 [slitt@ea th ] It works as expected with braces, but not with do/end.
  + 169808 [mental@ry ia] =20
  + 169822 [logancapaldo] irb(main):003:0> puts ("Hello", "World")
    169824 [perrin@ap th] I'd be happy with it either way, as long as it's consistent.
    + 169839 [dooby@d1 .k ] Without space, it's consistent.
    | 169906 [perrin@ap th] There's a problem of understanding there, not of consistency.  When you
    | 169953 [lukfugl@gm i] 1) Choice of block delimiters has no more influence on whether
    | 169971 [perrin@ap th] [lots of stuff]
    + 169850 [slitt@ea th ] Yes, at least the warning would get me out of the habit ast.

Retrieving PID running time
169586 [phil@pr co .] People,
169599 [joevandyk@gm] That information should be in /proc/<pid>/stat.  Look at the man page
169605 [phil@pr co .] ptime = Process.pid.time
+ 169623 [gwtmp01@ma .] This sort of thing is very platform specific.  I'm assuming
| + 169629 [Daniel.Berge] It's not in the standard library, but there is sys-proctable, available on the RAA.
| + 169643 [joevandyk@gm] I thought Process::times just returned the system and user cpu time,
|   169648 [gwtmp01@ma .] I assumed the OP was looking for the system/user time not the clock
+ 169644 [joevandyk@gm] class Process

Re: ArachnoRuby -- a professional Ruby IDE
169604 [Patrick.Benn] I never said it would be easy.  ;)

Best Practice Advise for a Total Ruby Beginner
169609 [crosone@gm i] Hey, I've just started running through the first edition of
+ 169613 [M.B.Smillie@] Basically, yes.  It's generally referred to as 'encapsulation' in
+ 169618 [jellen@ru yc] class Man

ruby newby
169632 [schmitt@nu .] I'm trying to write a parser for cooking recipes.
169634 [ef@al m. it ] This doesn't do what you want.  It's trying to call the "find_start"

fastcgi and shared interpreters
169636 [james_b@ne r] I'm doing more work with fascgi and scgi, and I'm looking for some
+ 169655 [jeremy@bi sw] How you process requests in a FastCGI or SCGI handler is up to you.
+ 169787 [ara.t.howard] fastcgi is process based - you don't need to worry about any concurrent access
  169818 [james_b@ne r] Right.  There's no telling what other app might be trying to access the
  169823 [jeremy@bi sw] Most FastCGI implementations work this way, but it is not a rule.
  + 169825 [jeremy@bi sw] In fact, FastCGI can handle concurrent requests on concurrent
  + 169827 [james_b@ne r] I'm writing and deploying Rails and Nitro apps and using fastcgi/scgi at
    169829 [jeremy@bi sw] Zed's SCGI Rails runner is threaded but serializes request processing
    169833 [george.mosch] Nitro also supports multithreaded applications. Nitro and Og are (or

[ANN] Rails RC5 (0.14.4): Next stop one-oh (really, this time!)
169641 [david.heinem] It's been a month since we promised that RC4 would be the final

ordered/sorted hash
169642 [robert_kuzel] is there anywhere a class that does soemthing
+ 169646 [transfire@gm] The dictionary class in Facets/Calibre is basically the ordered hash
| + 169664 [robert_kuzel] the only real requirement is
| | 169713 [SimonKroeger] class SortedHash < Hash
| + 169670 [robert_kuzel] another idea would be to be able to define
|   169687 [transfire@gm] I see. So you want a way to tell the object itself how it's to order
+ 169647 [slitt@ea th ] When I tried it, it seemed that Ruby automatically sorted the keys. I'm not
| 169653 [gene.tani@gm] Not sure what "it" is, but Hash#sort will convert the hash to a list of
| 169654 [Daniel.Berge] hash.sort.each{ |e| puts "#{e[0]} => #{e[1]}" }
| 169667 [robert_kuzel] this has the effect that clients of that hash
| + 169675 [transfire@gm] Thank robertj I'll work on it now.
| + 169685 [james@gr yp ] You could easily wrap a Hash and provide an each() that sorted before
|   169795 [hal9000@hy e] I've been discussing this off and on for years. What you say is true,
|   170149 [w_a_x_man@ya] ["x", "a"]
+ 169651 [billk@ct .c ] Perhaps rbtree?
+ 169788 [ara.t.howard] require "alib"
  169799 [transfire@gm] Insertion order?
  169802 [ara.t.howard] require "alib"
  169895 [transfire@gm] Okay, I have preliminary implementation of Dictionary class with
  170056 [robert_kuzel] thats way cool.
  170137 [transfire@gm] Good good. I'll do that.

SwitchTower for non-Rails projects
169652 [slavomir23@g] Is there anyone out there, who has used SwitchTower for non-Rails

Html parses
169657 [marcio.franc] Does anyone knows about an html parser in ruby?
+ 169683 [james@gr yp ] James Edward Gray II
+ 169699 [gene.tani@gm] I'm time trialling python and ruby parser right now, so I'm going to

New guy... Intoduction and first question on some direction.
169660 [rakxzo@gm il] I'm learning Ruby.  I've been working on an automated web application
+ 169662 [bob.news@gm ] That's great news!  Welcom aboard.
+ 169666 [akonsu@gm il] 1. what should happen if the files have different structure (different

sync.rb difference between Sync::UN, Sync::EX and Sync::SH
169665 [transfire@gm] In sync.rb what are Sync::UN, Sync::EX and Sync::SH all about?
+ 169671 [transfire@gm] Oh, one other thing. SyncEnumerator has nothing to do with Sync right?
+ 169684 [vjoel@pa h. ] EX is exclusive: if a thread requests an EX lock, no other threads may
+ 170242 [transfire@gm] No one know? I assume Sync::EX when underlying data is gogin to change

invalid arg to sysread deep within protocol.rb
169673 [williamerubi] I just made a script that fetches certain web pages, using Net::HTTP,
169718 [logancapaldo] Maybe there aren't 1024 bytes left? According to the docs sysread is
169720 [williamerubi] Yes, I'm sure.  Now that I look back at my original post, I notice that
169740 [williamerubi] This seems to occur every few thousand iterations (not the same number

Transparent Caching Idiom
169674 [b@gi pe t. o] I've made good use of this idiom recently, and wanted to share it.
+ 169715 [daniel.schie] Neat. Though it would be cool if the methods that were to be cached were
| 169785 [gene.tani@gm] I got this bookmarked, When i get time, i'll have to compare to prior
| 169841 [bob.news@gm ] Kind regards
+ 169917 [daniel.schie] This is a touched-up version of your code.
threads.html
top