191850-229831

191639-199672 subjects 192128-192686

new to Ruby and XML
191850 [walkerhunter] <records>        <record>          <f id='3'>9</f>          <f
+ 191859 [simon.kroege] Hash[*xml.scan(%r{>([^>]*)</f>}).flatten]
+ 191873 [rossrt@ro co] If you want to parse the XML you could do it with libxml-ruby

net/smtp & High Importance flag
191853 [sjc2000_uk@y] I have a mail alert system running very happily using
191855 [sjc2000_uk@y] hehe, nm I found it, the positioning of the

A few block-related questions
191856 [vshepelev@im] str = 'some string'
+ 191860 [decoux@mo lo] yes,
| 191885 [vshepelev@im] Thanks a lot! I use exactly 1.9.
+ 191861 [shortcutter@] blk = lambda {|it, text| it.text=text}
  191886 [vshepelev@im] Yes, I can. But it looks a bit ugly, isn't it?

how to call a class from another file
191863 [huseyinpolat] external file called
+ 191866 [shortcutter@] You're problem is almost certainly connected to the fact that there's
| 191871 [huseyinpolat] Robert, that was it, I have forgotten the "new" as you have said.. thank
+ 191867 [rasputnik@gm] This has nothing to do with external files.

Fireruby and stored procedures
191864 [bet_nospam_t] I've got a question about stored procedures and fireruby.

OpenSSL weird padding
191865 [ben@ia u. et] I've been using OpenSSL::Cipher to try and talk to an IPSec implementation

More Proc Beauty
191870 [daniel.schie] The madness continues! This is getting out of hand!
191908 [ruby-talk@wh] Scarlet fever.  Tell me, is there a little red ping-pong ball floating
191914 [daniel.schie] Suuuure, if you want to do it the _easy_ way! :P

Class Methods
191879 [michael.gors] ...
+ 191880 [edder@tk sp ] ClassB.instance_methods - ClassB.superclass.instance_methods
| 191881 [helge.elvik@] onlyClassBMethods = ClassB.instance_methods - ClassA.instance_methods
| 191882 [michael.gors] ...
+ 191883 [decoux@mo lo] ClassB.instance_methods(false)

Raw idea about Proc
191891 [vshepelev@im] class Proc
+ 191893 [james@gr yp ] Yes, this is called Currying and has been written about a lot.
| + 191896 [vshepelev@im] Oh, I know. The question meant "is this concrete extension would be useful
| + 191898 [benjohn@fy h] *cough* :) I'd like to quote from the docs at the moment where I lost
|   192031 [rossrt@ro co] Yeah, in truth it took me longer to figure out what the original Perl
+ 191897 [rossrt@ro co] There are a few drawbacks to this approach I think, most of which I
  191900 [vshepelev@im] Yes, I know (and disclaimer said about "VERY dirty code"). I've just tried

[OT] List problems?
191899 [rossrt@ro co] Just wondering if anyone else is experiencing problems with the list?

Custom serialization scheme
191919 [weyus@at .n ] I have an object with one attribute that is unserializable (due to it's

Fwd: Please Forward: Ruby Quiz Submission
191921 [james@gr yp ] ...

How can I write the awesome kind of code?
191922 [pergesu@gm i] I'm writing a small app to do poker simulations.  I read a lot of
+ 191925 [james@gr yp ] class Hand
| 191929 [pergesu@gm i] Okay so now I have
| 191933 [james@gr yp ] You can remove the &init parameter to hand(), since you are using
| 191942 [pergesu@gm i] I took out &init, I understand why I don't need that in there.
+ 191928 [logancapaldo] class Hand
  191935 [pergesu@gm i] Hey Logan,
  191939 [logancapaldo] proc { h }.call is redundant.

Question about soap/wsdlDriver
191924 [robothor@gm ] I ran into an oddity the other day as I was chunking through
191927 [Daniel.Berge] My *guess* is that soap/wsdlDriver is being overzealous with a camelCase
191934 [robothor@gm ] Thanks, that is what I thought.  Or it is trying to avoid creation of

Ruby Quiz Contest Winner!
191930 [james@gr yp ] Ross Bamford has submitted a quiz that exceeded the mark I said I
+ 191946 [belorion@gm ] ...
| 191947 [logancapaldo] Um, for him to have won, his quiz would have had to have already occured
| + 191950 [belorion@gm ] ...
| + 191952 [james@gr yp ] too.  ;)
+ 192030 [rossrt@ro co] Wow - I never win _anything_ :) Part of me wants to say I couldn't take
  192049 [james@gr yp ] I too have enjoyed the contest and it just so happens that I have

ml style 'let' impl - fun with metaprogramming...
191940 [ara.t.howard] require 'let'
191944 [rubytalk@ea ] ...

"load"ing a file and keeping the current scope?
191949 [ruby@ph li .] class A
+ 191951 [logancapaldo] class A
| + 191955 [logancapaldo] I realize this is against your "no other solutions" rule, but why won't
| | 191974 [ruby@ph li .] That worked. Thanks!
| | 191983 [logancapaldo] % cat magic_stuff.rb
| + 191956 [vshepelev@im] Interesting solution. What about its effectivenes? And in general,
|   191959 [logancapaldo] Well require-ing only parses the file once. Other than that, this
+ 191954 [christoffer.] eval File.read("magic_file.rb")

Question about instance_eval
191961 [pergesu@gm i] I'm trying to use instance_eval in a project I'm doing, and I
+ 191962 [james@gr yp ] Ruby will always see the above as a local variable declaration.
| 191972 [pergesu@gm i] Can I call pass in an object to instance_eval?  Let me show you the
| 191976 [pergesu@gm i] Apparently I can't do that, so I changed the design up a bit so that I
+ 191964 [jgbailey@gm ] ...

Modifying Hash Default Value
191966 [louis.j.scor] Don't do this...This one bit me hard =)
191968 [james@gr yp ] Hash.new { |hash, key| hash[key] = Array.new }
191971 [louis.j.scor] Heh, I knew it would end up being something obvious.  Still, don't do
192028 [shortcutter@] This comes up here roughly every three days. So you're not alone if
192041 [louis.j.scor] Heh.  Nope, I'm almost never comforted by other people's misfortunes,

IO#puts and arrays
191978 [daniel.schie] Exactly how does IO#puts determine if an argument is an array? That is,
191979 [daniel.schie] Oooops, it was #to_ary, and it's working like a charm :)

how are you  locating method signatures and sources?
191991 [vjraman83@ya] 1. given there is a method say, "save" within a ruby class, how are you
191993 [logancapaldo] You should check out ri, gem_server and http://www.ruby-doc.org/

Why not just create a new proc with the desired parameters?
191997 [strobel@se u] 1. Binding parameters is useful sometimes.
192026 [vshepelev@im] adder = proc { |a,b| self.output(a+b) }
194333 [strobel@se u] If I'd ever see code like A.new.instance_exec(4, &adder) and I'd have

win32utils tail eventlog error upon change
192012 [botp@de mo t] I have the ff code.
192014 [djberg96@gm ] Works fine for me.  The error you're seeing makes me wonder if the

Print Out Code in Program
192015 [strife045@ho] class Ab
+ 192018 [logancapaldo] Sounds like a job for xmp[1]
| 192022 [strife045@ho] Thanks, the code works, but is there still a way to print out everything
| 192027 [rubytalk@ea ] ...
| 192032 [kiaroskuro@g] I was asking something similar about blocks in the near past.  After a
+ 192052 [gene.tani@gm] SCRIPT_LINES__, maybe?

irb crash
192023 [curi@cu i. s] I'm new so I don't know if/where I should report this...
192025 [matz@ru y- a] Re-assigning predefined class like String should cause serious

[QUIZ] Bracket Packing (#78) - Solution
192033 [benjohn@fy h] even then didn't cover all the cases), and this substitution on. Solving
192038 [benjohn@fy h] [QUIZ] Bracket Packing (#78) - Solution

Twisted for Ruby?
192040 [garbagecat10] ...
+ 192042 [dharple@ge e] I think you will find a lot of interest, but IMO it would be best for
| 192047 [garbagecat10] ...
| 192050 [james@gr yp ] Just a minor correction here:  Mac OS X is a Unix flavor so compilers
| 192051 [garbagecat10] Understood, but I was thinking about the masses of OSX machines out
| 192061 [wilig.ruby@g] C++ or not, I think this would be an excellent addition to the
| 192066 [benjohn@fy h] Would it be terrifically difficult to have both a c++ implementation,
| 192067 [garbagecat10] ...
| 192083 [tsuraan@ts r] Is libevent an option for this?  I don't really know much about it, but
| + 192088 [garbagecat10] I believe this has been tried and didn't work all that well. Among
| + 192473 [zedshaw@ze s] Already did that a long time ago.
|   192474 [nohmad@gm il] Is it true? If so, that means future ruby implementation wouldhave dependency with libevent?
+ 192043 [james@gr yp ] My opinion is that this would make you a lot of new friends.  ;)

Problem with 2nd File.Read in small script.
192044 [pbailey@bn .] Can someone look at my code below? I have a RUBY debugger that indicates
192089 [collinsj@se ] ...
192095 [pbailey@bn .] Thanks, Justin. Your comments made me dive deeper, and, it works!
192099 [logancapaldo] If you are going to File.read the whole file into memory anyway, I
192112 [pbailey@bn .] Good idea! Thanks, Logan. I'll try it. I've got a pretty healthy box,
192190 [shortcutter@] If you cannot do that I guess it's still more efficient to open the

non-static way to get the filename?
192045 [peter@ru yr ] I am new to Ruby etc. etc. (all the usual disclaimer about how i can not
+ 192054 [ara.t.howard] require 'pathname'
+ 192055 [christoffer.] Look up Pathname, it's probably what you want.
  192062 [Daniel.Berge] I'm confused.  You're saying File.basename(file) is *too verbose*?  Or
  192161 [peter@ru yr ] Well, for me
  192164 [pit@ca it in] Peter, this syntax is very nice, indeed. But remember that your "file"
  192167 [peter@ru yr ] exist).

Method Size - Best Practices
192056 [jesusrubsyou] Poll (for everyone, not just Eric): What is good or acceptable method
+ 192057 [louis.j.scor] Well, I won't chime in on the _recomended_ line count for a method,
+ 192058 [ara.t.howard] i think this is a bit silly really,  i have several image processing programs
| + 192065 [benjohn@fy h] *snip*
| + 192068 [shortcutter@] 4 cents now.
| + 192093 [drbrain@se m] Exactly.
+ 192064 [benjohn@fy h] A great method size is one line. Most of my methods come in at under
+ 192076 [chneukirchen] "I tend to break up a subprogram when there are too many local
+ 192094 [drbrain@se m] A good and acceptable method size should be almost entirely based on
| + 192097 [toalett@gm i] Exactly. Break everything down into comfertable units, but not any
| | 192100 [mike@st k. a] Heh.  Recently a 4,500 line method caught my eye at work.  I ignored
| | 192101 [Nuralanur@ao] ...
| | + 192108 [pat.eyler@gm] It sounds like it was gestating ... getting ready to give birth to a brood
| | + 192113 [mike@st k. a] Hmmm.  Mustn't give too much away here.
| |   192114 [Nuralanur@ao] ...
| + 192109 [james@gr yp ] This is a good point, I think.
+ 192098 [james_b@ne r] I aim for zero lines of code.  Fewer bugs.
+ 192296 [peter.havens] There is an excellent book named "Code Complete" by Steve McConnell that

RUBY on 64-bit Windows PCs.
192071 [pbailey@bn .] I can't seem to get Ruby's ftp to work on a new 64-bit Intel box I just
192072 [Daniel.Berge] There has been virtually no testing on 64 bit Windows because, well,
+ 192086 [pbailey@bn .] Dan,
| 192090 [Daniel.Berge] I'm not sure it's related, but you're unnecessarily reopening your ftp
| 192096 [pbailey@bn .] Yes, I know that I'm iterating ftps here. But, it works on multiple
| 192102 [Daniel.Berge] Good question.  I don't see anything in ftp.rb, but I could be missing
| + 192107 [pbailey@bn .] Thanks for your ftp query. And, thanks for your persistence here. But,
| + 192120 [collinsj@se ] ...
|   192183 [pbailey@bn .] Yes, that's definitely smarter. I thought about it last night, and, of
+ 192125 [w3gat@nw ag ] I've been using a 64 bit AMD and windows 2000 for months without any
  192181 [pbailey@bn .] OK. Well, I guess it's another issue then. Maybe some ports are closed,

Ruby Quiz Vacation
192077 [james@gr yp ] Well folks, I'm off for some rest and relaxation starting this
+ 192079 [matthew.moss] ...
| 192080 [lukfugl@gm i] hooray!
| 192081 [logancapaldo] hooray!
| 192082 [anthony.mora] hooray!
| + 192118 [matthew.moss] You know...  There's something about this group cheer that makes me
| + 192212 [rossrt@ro co] Awww, you guys :)
+ 192084 [deanwampler@] Oh, I figured the quiz would take take a vacation with the Car Talk

Generating an Atom Feed?
192085 [nathan.olber] Does anyone know of a library for generating an Atom feed? I've looked
+ 192087 [Nuralanur@ao] ...
+ 192091 [ray@wa mr om] feedtools can generate and parse atom feeds.
+ 192191 [snowzone5@ho] to create an rss feed. found parsers but no generators

FTP#mget, FTP#mput
192103 [Daniel.Berge] Is there a method in Net::FTP that corresponds to ftp's mget and mput functions?
+ 192104 [ara.t.howard] this grabs directories if you give it something like
+ 192106 [ara.t.howard] this does something like mput

What's the difference between a Thread and a Process?
192105 [groups@gr nd] They seem similar, but by no means identical. My guess is that Ruby
+ 192110 [logancapaldo] Yes, but threads can also be implemented at the OS level. (Ruby's
| 192111 [work@as le m] The JRuby project maps Ruby threads to Java threads, and I think they
| 192117 [phurley@gm i] Ruby uses what are often called green threads. The OS is unaware of
+ 192121 [lutzky@gm il] I think the more notable difference is that threads share variables,
  192127 [groups@gr nd] Aha. Now that's interesting. What DO forks share? Apparently Signals
  192133 [deanwampler@] They also share open file "handles", at least on *nix systems, at the
  192141 [garbagecat10] ...
  229831 [weijun77@gm ] searching for an answer for Solaris lwp...really great piece of

Compiler for Ruby
192115 [Jamal.Mazrui] I realize that a compiler is not necessarily important to a lot of Ruby
192119 [agorilla@gm ] Bill Guindon (aka aGorilla)
192197 [Jamal.Mazrui] Thanks for the links.  After reviewing several web pages, I have a few
192208 [logancapaldo] ack, top-posting evil!
192324 [rossrt@ro co] $ ruby-yarv -v

Exponential calcs with very large exponents
192116 [doug@dm ha r] Greetings all.
+ 192124 [gm.vlkv@gm i] ## Use Fixnum#[] - Bit Reference
| + 192158 [sroberts@un ] No, but in case its useful (a long shot), I have some source that does
| + 192162 [shortcutter@] Dunno whether any of these is faster
+ 192132 [john-rubytal] if e[j] == 1

Ruby documentation discovery
192122 [john.emerson] ...
+ 192126 [groups@gr nd] Huh. I got so tired of trying to play "guess the spelling and
| + 192134 [john.emerson] ...
| | 192137 [phil@ha el .] On a related note, is it possible to get RDoc in GNU Info format? IMHO
| | + 192139 [john.emerson] ...
| | + 192252 [drbrain@se m] $ ri --help
| | | 192297 [john.emerson] ...
| | | 192298 [hal9000@hy e] I can't speak for Eric, but I would say: There's no such
| | | 192307 [drbrain@se m] Yup.  You could even go a step further and add an option to RDoc
| | + 192309 [sroberts@un ] Rdoc has a pretty flexible framework to output 'stuff'. I'd like gnu
| + 192288 [leslieviljoe] Well come on! Don't just say "it does this and that and makes coffee
+ 192130 [drbrain@se m] The next release of Ruby and Rubygems will build ri for installed gems.
| 192135 [john.emerson] ...
| 192250 [drbrain@se m] ri is rather twisty inside, so I haven't figured out how to make "you
| 192267 [james_b@ne r] James Britt
+ 192166 [benjohn@fy h] *snip*
  + 192204 [louis.j.scor] You can always generate the documentation from the source.  Whenever I
  | 192253 [drbrain@se m] Why not just run gem_server?  Most packages build their own RDoc anyhow.
  + 192300 [john.emerson] ...

ruby game
192123 [curi@cu i. s] I would like to make a game in ruby. I've written tetris with python/
192129 [billk@ct .c ] Here's a recent post from Florian G. about a game written in Ruby / Gosu,
threads.html
top