323678-349707 subjects 324047-328182

Default values of hashes
323881 [glenn_ritz@y] ...
+ 323882 [Rob@Ag le on] "If a block is
+ 323883 [botp@de mo t] # I would be able to add any key to trt_hash and its value=20
  323901 [glenn_ritz@y] ...
  323909 [glenn_ritz@y] ...
  + 323911 [dblack@ru yp] h = Hash.new{|h,k| h[k]= Hash.new{|h2,k2| h2[k2]= Hash.new{|h3,k3| h3[k3]=0}}}
  | 324144 [jgabrielygal] irb(main):009:0> hash = Hash.new{|h,k| h[k] = Hash.new(&h.default_proc)}
  + 323921 [sepp2k@go gl] def nested_hash(levels, def_value=3Dnil, &def_proc)
    323938 [dblack@ru yp] ...
    + 323952 [glenn_ritz@y] ...
    | 323961 [Rob@Ag le on] Glenn,
    + 323973 [sepp2k@go gl] Because a) that way you can't define a default value or proc for the innermost
      323986 [dblack@ru yp] I'm with you on a) and d) :-) I didn't understand the OP to be asking
      324091 [glenn_ritz@y] ...
      324481 [dblack@ru yp] => #<Proc:0x00248420@(irb):14>
      324487 [glenn_ritz@y] ...

win32ole and WMI question
323885 [baz0860@ya o] I am trying to get process information from Windows server. Using
323887 [phasis@gm il] ret = process.execMethod_('GetOwner')

Re: win32ole and WMI question (Solved)
323888 [baz0860@ya o] Thank you for your help. It is exactly what I wanted. I spent a few

Re: Module specific metric methods for Numeric
323889 [bterkuile@gm] Something went wrong and the message was submitted before I was

magic money world
323892 [arivu88@gm i] As a Magicmoneyworld member you will have your own referral URL

Re: Ruby 1.8.7: ERB is broken
323894 [charliemarx@] Actually comments will work in 1.8.7, but only with a specific, more
326028 [ruby.jordanb] Comments aren't supported, only comment tags are.

[ANN] Consent: a firewall DSL for ActionController
323900 [jcoglan@go g] ...

lost response while transfering large file to FTP server
323905 [lin.zhp@gm i] When I used Net::FTP to put large files(about 200MB) to FTP server, the
+ 323919 [shortcutter@] Maybe you executed it in a thread and that died silently.  You can make
| 323922 [lin.zhp@gm i] Thanks for reply.
+ 323950 [lin.zhp@gm i] ftp_info=%x{
  323951 [lin.zhp@gm i] And at this time, the backup file still got transferred successfully

VERY simple question about "?"
323906 [tomcloyd@co ] I absolutely love Ruby, but...I've always found the subject of Ruby
323908 [fred@la av .] It's simply a language construct, like the ' that delimitates a string
323910 [yaserbuntu@g] ...
323913 [tomcloyd@co ] Thanks, guys.
323920 [shortcutter@] In this case nothing "happens" (see below).  It is just another
+ 323923 [mguterl@gm i] There definitely is an option to select a PDF version for purchase.
| 323924 [shortcutter@] Thanks for the education!  I wasn't aware of this.  There was
| 323944 [tomcloyd@co ] I wouldn't engage with a illegitimate copy - isn't playing fair at all.
| + 323945 [caduceass@gm] Not sure if the following list is comprehensive, but useful nonetheless...
| | 323946 [caduceass@gm] I meant beneath Reserved words.  It's actually classified under Types/Numbers.
| | 323948 [tomcloyd@co ] Definitely a useful page, about which I've known for some time.
| | + 323980 [b.candler@po] There aren't really any operators in Ruby. Ruby simply maps all these to
| | | + 323985 [tomcloyd@co ] Ah...This is actually very helpful. I think we have a language problem,
| | | | 323988 [b.candler@po] That's not exactly the same though. You can (with a bit of work) define
| | | + 324007 [shortcutter@] Brian, you are contradicting yourself: first you deny the presence of
| | |   324024 [b.candler@po] Operators in Ruby are nothing more than syntactic sugar for method
| | |   324063 [shortcutter@] Well, in a way that's what they are in every procedural language - they
| | |   324071 [b.candler@po] I don't think so. Well, not in C anyway. The operation "a + b" is
| | + 323987 [sepp2k@go gl] As has already been mentionen, they are methods and do whatever they're
| + 323947 [dave@pr gp o] And we appreciate that :)
|   323953 [tomcloyd@co ] Oh, man...now I've going to have to get rigorous in my consideration of
|   323957 [dave@pr gp o] I think you're over thinking it. For example, in
|   323967 [tomcloyd@co ] Thanks, Dave. This helps. You have a genuine knack for simple clear
+ 323955 [tomcloyd@co ] Meaning, in linguistics as I understand it, is inherent, contextural, or
  324010 [shortcutter@] Unfortunately we're in the domain of programming languages which is

A question about Net-ssh
323907 [youhaodeyi@g] I installed net-ssh by running the command: "gem install net-ssh", but I
+ 323916 [badboy@he rt] do you have a "require 'rubygems'" above your "require 'net/ssh'" ?
+ 323918 [djberg96@gm ] Try "require 'rubygems'" first.

the thread problem in ruby imap
323912 [lanwen.bangb] my application is about ruby imap, it depends on daemons lib and runs
323915 [charles.nutt] I've noticed some really odd threading behavior in net/imap too. I think
323954 [lanwen.bangb] Charlieļ¼? thank you for your reply!
323983 [charles.nutt] Well, looking at imap makes my head hurt, so I'm going to say it's a
323984 [lanwen.bangb] Charlie, if you look at the imap implementation in ruby1.8 and ruby1.9,

How to control the time while ruby connect to oracle?
323917 [zengzhenyan@] require 'rubygems'
323993 [kubo@ji ba .] Timeout.rb doesn't work when it is blocked in a C function.

Finding filename from a URL
323925 [asbestos999@] This is just a basic parsing question, really. I'm trying to work out
+ 323926 [badboy@he rt] File.basename("http://www.example.com/x/y/z/myfile.txt")
| 323931 [asbestos999@] Thanks a lot! I added ".txt" to the arguments of File.basename to get
+ 323927 [TimHunter@nc] $ irb
+ 323928 [shortcutter@] IMHO it is not a good idea to use a File method for URL's because
  323936 [Rob@Ag le on] Rather than jump to a Regexp, just use the right tool for the job.
  323941 [shortcutter@] I considered URI as well but what makes your code the "right tool for
  323942 [Rob@Ag le on] I guess it depends on what your url might look like. For example, if
  324012 [shortcutter@] Certainly.  I do have to say that I get the impression we are talking a

First whack at thread safe Containers
323930 [robert.dober] Charly suggested thread safe containers some weeks ago. I finally

Saw children in the face of tanks
323934 [haithm72@gm ] Saved their lives even one word

How can I prevent require duplicate files
323956 [youhaodeyi@g] In a big ruby project, how to prevent requiring a file multiple times?
323958 [phlip2005@gm] require() already prevents multiple includes. load() forces an unquestioned input.
323964 [youhaodeyi@g] require() already prevents multiple includes. load() forces an
323965 [phlip2005@gm] I don't know about all cases but I suspect the biggest culprit is require 'foo'
323976 [youhaodeyi@g] But there is only one file named foo.rb, how could require 'foo' happen?
323977 [blambeau@gm ] There must be a mistake, below is the test I've made. No warning at
323978 [b.candler@po] require 'test1'
323979 [blambeau@gm ] Well, we know that ruby 1.8.x doesn't ensure unique loading with that
323990 [b.candler@po] Yuk, that will break any program which uses any sort of external
324036 [youhaodeyi@g] This is the case, I have three files, a.rb, b.rb and c.rb.
324056 [b.candler@po] That's the source of the problem.
324058 [youhaodeyi@g] this works. thanks.

is there a way to get the paths to all previously required files?
323959 [timrandg@gm ] Let's say I am in irb and I execute
323962 [Rob@Ag le on] $"                (historic variable)
323963 [timrandg@gm ] Here is a one liner that does it. Thanks for the hint.

I can't uninstall a few gems
323960 [orengolan@gm] some info about my system: ubuntu 8.10, ruby 1.8.3, rubygems 1.3.1
323982 [djberg96@gm ] What is the output of "gem env"? I'm guessing that you have multiple gem
324006 [orengolan@gm] - RUBYGEMS VERSION: 1.3.1
324008 [luislavena@g] INSTALLATION DIRECTORY indicates where the gems will be installed and
324041 [orengolan@gm] thanks, it worked.
+ 324456 [orengolan@gm] does anyone knows the cause for this issue and how can I prevent it from
+ 324471 [jcoglan@go g] ...
  324525 [orengolan@gm] got it. thanks!

Question about run external program in Ruby
323966 [youhaodeyi@g] io=IO.popen("lsa 2>&1")do |f|
+ 323968 [andrew@an re] ...
| 323969 [youhaodeyi@g] I found that $?.exitstatus always return 0.
+ 323971 [andrew@an re] ...
  324048 [youhaodeyi@g] How can I get stderr in this method?
  324049 [b.candler@po] You are already combining stderr with stdout (2>&1)
  324139 [b.candler@po] Another option is the open4 gem. See

Coding a server
323972 [aspirine@gm ] Hey,
323974 [jeremy@hi eg] Take a look at packetfu http://code.google.com/p/packetfu/
323975 [aspirine@gm ] the bindata dependency for packetfu is exactly what I was looking for
324009 [vjoel@pa h. ] I don't know bindata, but from a quick glance at the docs I see that it
324020 [aspirine@gm ] amazing performance, for creating 10k instances of the same simple
324021 [vjoel@pa h. ] Exactly. If you have big packets, and only need to access a few fields

Standard data-structures
323989 [blambeau@gm ] Does anyone know a gem with standard data-structures like AVLTree,
323995 [micathom@gm ] If neither raa nor rubyforge nor this list has the answer to your

Hash is not merged / recursive function
323994 [dominik.kreb] i'm new to ruby, but i really like it.
324000 [robert.dober] I have no idea what's wrong with your code, but I happen to know a

noob question: object to string
323996 [darin.ginthe] So I'm able to exercise creating my own class and returning an object
+ 324001 [caduceass@gm] The count_table method will return whatever the last statement in the
| 324002 [darin.ginthe] I understand what you are saying... We used "yield" to return from the
| 324005 [darin.ginthe] Got it.  Yield goes straight to stdio.  Instead, return the first value
+ 324004 [jim.menard@g] A block returns the value of the last expression inside it. The last
+ 324016 [wpdster@gm i] ...
  + 324018 [darin.ginthe] Was working, but I'll take the context correction.
  + 324116 [justincollin] The OP's approach works as well. It's a shortcut which can be used with

i have some challenges with the date
323997 [junkone1@gm ] here i have a string date like this. 02/01/2009 : Format is DD/MM/YY
+ 323998 [james@gr yp ] => "2009-01-02"
+ 323999 [sepp2k@go gl] => "2009-01-02"

[ANN] January Phoenix Ruby User Group Meeting
324003 [james.britt@] January '09 Phoenix Ruby User Group Meeting

Noob Question: New to Programming
324013 [ericraio@gm ] Hey I am very new to ruby I am trying to learn as much as I can, I was
324019 [phlip2005@gm] Next, you gotta walk before you can run. Print out any of the excellent Ruby

Loading an extension on statically linked ruby
324014 [ehames@gm il] I've configured and built the Ruby interpreter with the following

Writing accented characters into HTML files?
324015 [kenneth.m.mc] I'm having trouble when I write accented characters into HTML files;
+ 324030 [gmurray@cl u] Look into using a reference.  Valid references are dependent on the
+ 324057 [b.candler@po] Use hexdump -C on the file to see what the actual byte sequences are. If
| 324083 [james@gr yp ] James Edward Gray II
+ 324074 [gmane@au bu ] Kenneth McDonald said...

What is the difference between this patterns
324022 [jon.stenqvis] What is the difference between decorator, adaptor and wrapper pattern

improvements to rdoc/alternatives
324023 [davetron5000] I love rdoc, but miss a few things from javadoc, namely the ability to
+ 324031 [ snk@gn .o g] Try YARDoc http://yard.rubyforge.org/
| 324035 [davetron5000] Yeah, that is what I'm looking for.  I guess part 2 of my question is
| 324039 [ snk@gn .o g] Although RDoc remains the de-facto API documentation tool for Ruby, it
| 324050 [ryand-ruby@z] ...
| 324088 [ snk@gn .o g] I thought that because RDoc 2.2.x is released as a gem, it had been
| 324117 [ryand-ruby@z] rdoc is developed externally but continuously integrated into ruby-
+ 324051 [ryand-ruby@z] No, it really isn't. I think it is fair to say that rdoc won't being
  324078 [aff28@de et ] It's a pity if duck-typing has become such rigid dogma.

[ANN] rubyforge 1.0.2 Released
324025 [ryand-ruby@z] rubyforge version 1.0.2 has been released!

Convert Integers to Strings
324026 [gary.raffert] Howdy,
324028 [ryand-ruby@z] yes but... gsub is much easier
+ 324029 [gary.raffert] Thanks mate
+ 324061 [njus@la sh u] => ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"]
  324086 [gary.raffert] Nice one Lars.

WANTED: need a real web API for rubyforge.org
324027 [ryand-ruby@z] I just released version 1.0.2 of the rubyforge command line client. It
+ 324032 [tjnogueira@o] Ryan, I?m in!
+ 324040 [transfire@gm] =A0
| 324065 [tjnogueira@o] "...Going further. Doesn't it seem like it's about time for Rubyforge to
| 324145 [gregory.t.br] Yeah, you guys get started on that.  And when you have a very stable,
| 324146 [tjnogueira@o] Ok. I'm here waiting for instructions sir :-)
| + 324152 [gregory.t.br] we would need a system with comparable functionality that can run on
| | 324155 [tjnogueira@o] Greg , i'm really talking serious. I really want to contribuite with our
| | 324163 [gregory.t.br] I've pinged Tom.  He should either join in here, or send you an email directly.
| | + 324164 [tjnogueira@o] Greg ,
| | + 324195 [tom@in oe he] Yeah, this is a good discussion to have, and thanks to Greg for giving
| |   + 324198 [tjnogueira@o] Well Tom, your arguments are valid and I agree completly. I think this
| |   + 324233 [anthonyeden@] Just out of curiosity, rather than rewriting the GForge app or
| |   | 324296 [ryand-ruby@z] which is exactly what I was asking for before trans hijacked yet
| |   | + 324300 [transfire@gm] And I did not hijack the thread. I just ask a related question.
| |   | + 324327 [tom@in oe he] Hm, this is pretty interesting.  I wonder if we could do
| |   + 324374 [simon.a.chia] I know very little about this but I have always wondered if it would
| |     324384 [tom@in oe he] Yeah, that's a good thought.  When I think about doing that, the
| |     324385 [gregory.t.br] Tom, could you possibly prepare a database dump that strips out the
| |     324669 [tom@in oe he] That's a great idea.  Let me spend some time figuring out which fields
| + 324159 [marcelo.maga] If you are serious...
|   + 324161 [ben@bl yt in] There already is one in RedMine.
|   | 324175 [transfire@gm] To me GForge seems very dated. I think GitHub is much better example
|   | + 324177 [james@gr yp ] I've really come to feel this way too.  There's definitely more it
|   | + 324179 [djberg96@gm ] I don't see a way to submit bugs.
|   | | 324192 [tjnogueira@o] In this case ,i agree with you, dan.
|   | | 324249 [transfire@gm] Dan, I think you over value some of these features -- download stats
|   | | 324271 [djberg96@gm ] Except for a few projects that have either inadvertently or
|   | + 324190 [ben@bl yt in] I think that GitHub demonstrates many aspects of the model that
|   + 324165 [btricha@gm i] ...
|     324173 [djberg96@gm ] 's
|     324189 [ben@bl yt in] I think this is a *terrible* idea.  The last thing we need is further
|     + 324191 [james@gr yp ] I would be interested to hear what percentage of GForge features see
|     | 324334 [ben@bl yt in] Nope, but I feel pretty strongly that we'd all be better off if it had been.
|     + 324193 [djberg96@gm ] I'm not sure how division in the community over where projects live
|       324335 [ben@bl yt in] Those are good points.  I guess it's a matter of whether or not this
|       324337 [gregory.t.br] old.rubyforge.org  ?
+ 324080 [gregory.t.br] Though we haven't really advertised it yet, the source for RubyForge

How can I find the source of ruby package installed by gem
324033 [youhaodeyi@g] I installed a ruby application by gem. Where can I find its source code?
324034 [TimHunter@nc] gem unpack
324037 [youhaodeyi@g] OK, it works. thanks.
324038 [Rob@Ag le on] There's also gem list -d gemname

thanks (Re: rubyforge 1.0.2 Released)
324042 [thaniyarasu@] thanks

Re: To get IP addres of the machine
324043 [rogerpack200] class Socket
+ 324053 [b.candler@po] Your machine may have multiple IP addresses, but assuming its hostname
| 324093 [John.Haltiwa] require 'ipaddr'
| 324097 [gwtmp01@ma .] It is important to realize that this method won't take into account
+ 324115 [rogerpack200] heh

Re: scRUBYt! 0.4.1
324046 [jzakiya@gm i] d!