200780-203150

200588-202101 subjects 201012-204982

^ IF test in FOR loop
200780 [josselin wan] is it possible to test a condition (true-false) for each element in a
+ 200782 [daniel.schie] For starters, I would use #each instead of the `for' magic. Second, if
+ 200783 [has.sox gmai] You could use
+ 200788 [matz ruby-la] for user in @users
  200805 [robert.dober] I like this one specifically, but try "unless" please ;)

^ Google Checkout Pointers
200787 [jasbur gmail] I have a nearly complete site using ruby on rails and need to integrate

^ Sweet Lord!
200795 [daniel.schie] Why haven't I thought of this before?
+ 200814 [w_a_x_man ya] def each
| + 200816 [daniel.schie] Thanks! Yes, that's of course a whole lot faster.
| | 200874 [w_a_x_man ya] I didn't know that it would be faster; I only knew that using &block
| | 200875 [daniel.schie] That, my friend, is a matter of taste.
| | + 200876 [lopx gazeta.] There is nothing without a purpose. Consider an object method that takes
| | | 200898 [w_a_x_man ya] Utterly illogical.  That is like saying that sometimes we must amputate
| | | 200931 [daniel.schie] I think he was trying to say that there are times when `yield' is the
| | | 200944 [lopx gazeta.] ;D
| | | 200943 [lopx gazeta.] or for recursive calls e.g.
| | + 200896 [w_a_x_man ya] Some have good taste.  Some have very bad taste;  they relish a
| |   200905 [ruby-talk wh] But, you have to admit, it does stand to reason that feces would require more
| + 200821 [rubyfan gmai] Equivilent code, actually.  It's a case of "you say tomaTOE I say tomAHto"
|   + 200829 [lopx gazeta.] block.call is significantly slower since conversion from block to Proc
|   + 200832 [daniel.schie] Actually, the `yield' version is significantly faster. When using the
|   + 200834 [dblack wobbl] It does seem that yielding is faster; note the effect of turning the
|   | 200841 [rubyfan gmai] That is a fairly significant difference, so maybe I should revise my
|   + 200870 [vjoel path.b] Note that rdoc can scan for yields, and document them.
+ 200940 [shortcutter ] Is chomp really worth a new class?  Note that you can do all of this
  + 200951 [daniel.schie] I'm not sure, but it's a great way to show off Ruby's flexibility.
  + 200952 [daniel.schie] class Terminal
    201236 [drbrain segm] $stdin.readlines.join ', '

^ WAtir usage
200799 [junkone roge] I found Watir and am excited to use it. I cannot find much examples in
200843 [fxn hashref.] Watir is a wrapper around MSIE. In my limited experience crawling
+ 200847 [james.britt ] About a year or so ago I poked around trying to get HTML from IE in
| 201213 [arkie compli] You should be able to do something like
| + 201219 [james.britt ] Well, that *would* save a good deal of trouble.
| + 201232 [fxn hashref.] What do you mean? Watir::IE#html gives a dump of the internal MSIE
+ 200878 [fxn hashref.] table = ie.table(:index, 3)

^ Algorithm searched ...
200801 [Meino.Cramer] On my harddisc there are several recording of broadcasts made with my
+ 200808 [Nuralanur ao] Dear Meino,
| 200810 [Meino.Cramer] Thank you very much for the links and hints !
| 200812 [Nuralanur ao] Dear Meino,
+ 200809 [shortcutter ] This is known as "knapsack problem": see for example
| 200823 [lopx gazeta.] Ant colony systems can also be considered (they are more convergent and
+ 200835 [ysantoso-rub] This problem is known as the binary (0/1) knapsack problem.
  200838 [Meino.Cramer] Thank you very much fior your reply and your program! :)

^ String#starts_with?
200804 [martindemell] Has anyone run tests to see what the fastest way to do a
200817 [lopx gazeta.] String#index should be the fastest
+ 200822 [martindemell] thanks. any suggestions for #ends_with?
| + 200824 [Nuralanur ao] If the above is correct, String#rindex.
| | 200828 [martindemell] doh - completely forgot about rindex.
| + 200830 [robin nibor.] "this is a test" =~ /test$/  #=> 10 (true)
+ 200826 [robin nibor.] I'm afraid it isn't suitable for this case. String#index searches the

^ Method lookup weirdness
200820 [ilmari.heikk] ### Strange
200935 [decoux moulo] It's a bug : can you submit it to ruby-bug ?
200947 [ilmari.heikk] Ok, thanks. Done.

^ [FXRuby] - Combobox reading out current item
200827 [Nuralanur ao] Dear all,
200848 [lyle.johnson] I will file a bug report on your behalf. In the meantime, just catch

^ Rescuing exceptions with "redo"
200837 [dfl_maradent] I have a code like this (from Why's (poignant) guide to Ruby, in
+ 200842 [work ashleym] He must have meant to type "retry" instead of "redo".  redo is for
| 200851 [dfl_maradent] Yes! It works fine with retry! Thanks! :D
+ 201509 [listbox juli] Maybe he mistyped and meant "retry" instead?

^ Alternative to the Symbol#to_proc hack
200839 [work ashleym] I've always been in two minds about the Symbol#to_proc hack, it's
+ 200844 [dblack wobbl] It seems a little odd to send a message to a string, and then have to
| + 200846 [martindemell] you could do that neatly by trapping method_missing for String class
| + 200866 [work ashleym] True, but that only makes Java look old-fashioned.  I wanted to make
|   200868 [dblack wobbl] Hmmmm... I'm still rather fond of Ruby, I have to admit :-)
|   200892 [work ashleym] David
|   + 200895 [dblack wobbl] Maybe... though much of what I like about Ruby is how those two things
|   + 200906 [znmeb cesmai] Access is great until your database gets a byte or 2 bigger than 2 GB. :)
+ 200912 [dan-ml dan42] %w( i am an array ).sort_by(&:reverse)

^ Win32OLE Question
200840 [studlee2 gma] All right, so I decided to write this *bubblegum* script while
200849 [james.britt ] That appears to be a potential source of remarkable harassment.
200850 [studlee2 gma] Ha!  Good point, however the good folks at PhoneTrick have measures in
+ 201075 [masaki.suket] Does the following example help you?
| + 201921 [patrick pksp] Solution using Watir module. Getting "frame error in waitdocument"
| | 201931 [gekko bitkei] Maybe mechanize does the trick too?
| + 202081 [w_a_x_man ya] Very instructive.  Thanks.
+ 201997 [cohen.jeff g] Freudian slip?  I'm sure they *do* make sure people are abused or
  202075 [studlee2 gma] There are several reasons why I chose this site.  First, it was more a

^ Definition of methods: self
200852 [dfl_maradent] In Why's poignant guide to Ruby some examples appear where he defines a
200856 [dfl_maradent] Um...wait...Do I have to set the name of the class before the name of
+ 200859 [shortcutter ] Right, but no exception: initialize is an instance method.  new is a
+ 200862 [lopx gazeta.] Yes. this is the class method declaration syntax. Within class body
  200961 [dfl_maradent] Ok, thanks for the explanations!
  + 200987 [shortcutter ] Without looking too closely at your code I'm guessing that it's because
  + 201306 [sean.ohalpin] I agree with Robert - avoid @@class_variables wherever possible. The
    203150 [dfl_maradent] Yes, thank you all, boys. I had set the class<< LotteryDraw as a new

^ Re: Sorting arrays
200857 [sambient gma] I have a question on the code below that James shared with me.  While
200873 [M.B.Smillie ] [James' code below]
200890 [sambient gma] Are you saying to use these two types of arrays it must be done with a
200948 [sambient gma] I'm trying to take this in one step at a time. Only I can't grasp, the
200949 [dblack wobbl] I haven't been following this thread but let me try to explain.
200954 [sambient gma] Okay, I sort of see that.
200958 [dblack wobbl] if <some expression is true>
+ 200964 [has.sox gmai] Dark,
+ 200966 [sambient gma] That being the case I now understand how it's working, but don't
  200967 [dblack wobbl] lowest == nil
  200971 [sambient gma] Comparing "five" (item) to nil (lowest)
  200973 [dblack wobbl] lowest = nil
  200977 [sambient gma] Sorry I'm not trying to be frustrating.
  200979 [dblack wobbl] So now, lowest is item -- which was "five" (or whatever the first
  200981 [sambient gma] David,
  200985 [sambient gma] I'm back already :).  Basically I'm trying to take James original recursion

^ accessors and anonymous classes
200864 [r.fulton auc] that I failed to post it to the forum, doh! so here it goes again.  If
+ 200881 [r.fulton auc] Hmmmm... I have now done what I should have done before posting this --
+ 200886 [dblack wobbl] Just looking at this quickly: you're assigning to local variables
| 200897 [r.fulton auc] Thanks David!  Doh! it had to be something simple and obvious.
| 201044 [shortcutter ] Although Ruby's syntax is indeed quite flexible I'm rarely bitten by
+ 201167 [pit capitain] class HostService < Section
  202087 [r.fulton auc] Pit, thanks very my for your comments and insights!

^ Write to specified line number of file
200872 [adityar7 gma] I want to read a file, and write to another file by randomize the lines.
200877 [znmeb cesmai] 1. How big is the file?
200887 [adityar7 gma] Thanks for the reply. That'll work. Ofcourse, using excel is the
+ 200919 [renard nc.rr] Assuming that the file can be read into memory and you want to shuffle
+ 201235 [guillaume.ma] I think you misunderstand what IO#lineno and IO#lineno= do. The first
+ 201250 [rforum gmail] Files don't consist of lines, files are ordered sequences of octets.

^ Ruby - mysql - Error Authentication protocol not supported
200879 [jsp408 comca] On Windows XP Prof system, using Ruby 1.8.4 & mysql-ruby-2.7.1 (pure
201162 [collinsj sea] I think I heard that the ruby mysql library doesn't work with mysql 5?

^ Re: excel addin
200882 [ghalsey yaho] Glad you found a solution. Any idea why it behaves this way?
200908 [renard nc.rr] I found this in the description of Installed properly description in

^ List gem updates without installing?
200893 [masonbrown g] Is there a way to list, but not install, updated gems?  I know that 'gem
201011 [ahodgkin row] All I could think of was querying the local gems, querying the remote
+ 201013 [james.britt ] More generally, is there a nice way to add customized behavior to one's
+ 201036 [masonbrown g] That's exactly the type of thing I was looking for.  Thanks for the
  + 202119 [renard nc.rr] What about using "gem update", it updates all the installed gems ... at
  + 202120 [renard nc.rr] What about using "gem update", it updates all the installed gems ... at
    202121 [ahodgkin row] Yes, but the OP wanted to see what gem *would* update, without actually

^ calling a method for an object in a .each block cont./chat
200903 [otherwill ya] [ .. snip ..]
200933 [shortcutter ] Right.

^ Marshal's handling of floats
200910 [rubytalk bri] I was thinking about writing a patch to modify how Marshal handles
+ 200918 [ara.t.howard] i've never tried to use marshaled data across a big and little endian machine
| 200924 [rubytalk bri] The 'g' and 'G' flags for Array#pack/String#unpack are in network
| 201051 [bob.news gmx] - it will break existing code (YAML data)
| + 201104 [vjoel path.b] I thought the OP wanted to change the behavior of Marshal, not YAML. Or
| + 201124 [rubytalk bri] Hey Robert, I have gone with another solution but just as an aside --
+ 201016 [matz ruby-la] * pack('g') would not work on non-IEEE floating machines.
  + 201018 [rubytalk bri] Yes, that's a biggie. I didn't realize that ruby compiled on non-IEEE
  | 201026 [nobu ruby-la] What's the reason of your proposal?
  | 201027 [rubytalk bri] Hey,
  | + 201038 [vjoel path.b] If you don't need to send arbitrary (marshallable) ruby objects, but
  | + 201046 [nobu ruby-la] Introduced in C99, like as 0xaaaa.ccccP+10.
  + 201033 [znmeb cesmai] 1. How does XML handle floats?
    + 201040 [matz ruby-la] Currently all use human-readable decimal string representation.
    + 201350 [strobel secu] Not at all, or however you like to. XML can be used to define your own

^ Re: Q: how is the new Eclipse 3.2 for Ruby and Rails development?
200922 [bpettichord ] I just did a fresh install of eclipse 3.2 (with a new workspace). That
200960 [djberg96 gma] I learned long ago not to upgrade Eclipse before the plugins had a

^ attr_reader as a class method
200923 [minkoo.seo g] I'd like to use attr_reader to introduce a class method. For example,
200925 [ryand-ruby z] The example is simply flawed. ONE is a constant and can be accessed
200927 [minkoo.seo g] I've made a mistake. I should've call Foo::ONE instead of Foo.ONE

^ xml parser + dom + robust + speed = ?
200934 [pertl gmx.or] - multiple encodings
+ 200939 [shortcutter ] However, note that DOM and performance nearly automatically exclude each
+ 201135 [netghost gma] If you are working under windows, it seems to be difficult to get some

^ recursive Rake rules with multiple pre-requisites
200938 [tristan.allw] I'm having a problem getting rake to work using rules that are

^ Re: ruby-opengl
200941 [anne wjh.har] One Tiger trick
200982 [jmg3000 gmai] OS X seems a bit complicated when it comes to libraries. I think

^ Deadlockproblem
200945 [asterixgalli] i'm trying to realize asynchronous communication, but the sender have to
200969 [ara.t.howard] but that's synchronous!  ;-)
200983 [asterixgalli] Thank you very much for your answer, i will try to solve my problem

^ Question about magic enumerators in > 1.8
200953 [dblack wobbl] Can someone jog my memory, and/or enlighten me, as to what a case
+ 200957 [james graypr] array.each_with_index.map { |obj, i| .. }
| 200959 [dblack wobbl] Right, it isn't :-)  I'm still looking for a map example.
| 201029 [logancapaldo] Contrived example: I know a method I'm about to call iterates thru me
+ 201058 [decoux moulo] moulon% ./ruby -e '[12].map.with_index {}'
+ 201068 [chneukirchen] names.map { |x| x.size }.max, and you don't need an immediate array.
  201146 [dblack wobbl] That's not an example of what I'm asking about, though.  There's no

^ why does block know about one instance variable and not the other?
200955 [anne wjh.har] I can't find what the problem is with @foundinfo: since it is defined
+ 200962 [mguterl gmai] @foundinfo=Hash.new
+ 200965 [dblack wobbl] @var
  201014 [anne wjh.har] Thank you for your response.
  + 201017 [dblack wobbl] "Inheritance" is a bit of a misnomer.  A class (or module) contains
  + 201021 [lopx gazeta.] Instance of a class is not a copy of it. Classes are somewhat templates
    201022 [dblack wobbl] This message is in MIME format.  The first part should be readable text,

^ RailsConf Europe, Sept. 14-15: don't put it off!
200956 [dblack wobbl] In the excitement of the Chicago RailsConf and other recent events,

^ renaming files randomly
200968 [Bil.Kleb NAS] Got this request yesterday and still haven't had
+ 200970 [dblack wobbl] Dir["photos/*"].sort_by { rand }
| + 200974 [ara.t.howard] this loop loses data
| | 200975 [ara.t.howard] sorry - replace 'a b c' with '1 2 3' and 'c b a' with '3 2 1' - basically you
| | 200976 [dblack wobbl] new_names = [*0...files.size].map {|n| "MUNGED#{n}" }.sort_by { rand }
| + 200978 [Bil.Kleb NAS] Thanks David.
|   + 200994 [tristan.allw] Hey,
|   + 200995 [marcel verni] => {"a"=>1, "b"=>2, "c"=>3, "d"=>4}
+ 200972 [ara.t.howard] require 'fileutils'

^ Announcing MarkaBoo 0.7.3 - Bookmark Exporting, Advanced Editing, and more
200980 [xmlblog gmai] * Bookmark exporting

^ Ruby C extension/wrapper around  C function that uses scanf and printf
200984 [idrozdov gma] I need  Ruby to access a set of external command line applications for
200988 [shortcutter ] Do they need changing arguments?  Otherwise you could just start an
201253 [lazax.com gm] Go through the source code of your external apps, and replace each

^ Ruby-Interface for Python
200986 [Meino.Cramer] ...before everybody gets an heartattack from what I am asking...
+ 200990 [Nuralanur ao] Dear Meino,
+ 200998 [curi curi.us] take a look at http://www.goto.info.waseda.ac.jp/~fukusima/ruby/
  200999 [Meino.Cramer] thanks a lot for all the friendly replies !

^ [SOLUTION] [QUIZ] Panagrams (#86)
200997 [schapht gmai] This isn't much to look at, but it appears to be > 48 hours since the
201001 [SimonKroeger] [SOLUTION][QUIZ] Panagrams (#86)
201031 [martin snowp] Huh.  I must say that when I saw your program, it wasn't at all what I
201055 [simon.kroege] Ok, I will post my other version as soon as I'm home again.
201174 [SimonKroeger] require 'narray'
201408 [martin snowp] Indeed, this is more what I expected - and this is a distinctly
201425 [rubylearner ] require "integer"
201666 [martin snowp] I'll look more at your code later, but have you tried different

^ Re: [ANN] Mongrel 0.3.13.3 -- Ruby Licensed Release
201003 [info rhalff.] I've had the same problem on a clean debian installation.

^ [SoC][ANN] Ruby Reports 0.4.13 Released
201008 [gregory.t.br] == Ruport 0.4.13 ==

^ Re: CSV::IllegalFormatError (Need to club data entry person)
201009 [smc7000 gmai] Bira, I'm testing your idea with the below script but I'm having
201010 [Nuralanur ao] line = "\"NAME\",\"610 \"A\"  STREET\",\"STATE\",\"POSTAL_CODE\""
threads.html
top