228725-243681 subjects 229159-230849

text wrap
228933 [ishamid@co o] I have a ruby script that's doing what I need, and I would like to add
+ 228928 [nospam@no it] Idris, I can offer various methods to break text up into individual lines,
| 228931 [ishamid@co o] Ok, see below...
| 228929 [nospam@no it] / ...
+ 228935 [danfinnie@op] text = whatever you need to wrap
+ 228939 [w_a_x_man@ya] X = 10  # Width is 10 characters.

[ANN] CoolOptions 1.0.4 Released
228937 [ntalbott@gm ] CoolOptions version 1.0.4 has been released!
229078 [botp@de mo t] # CoolOptions version 1.0.4 has been released!

format problem
228945 [chen_li3@ya ] I have a 1D array containing 96 elements. I change it
228955 [nospam@no it] Just one. What are the data, and what result do you want?
228964 [chen_li3@ya ] original 1D array
+ 228999 [nospam@no it] / ... snip result listing
| 229077 [chen_li3@ya ] My script is about 140 lines. I am not sure if I post it.
| 229080 [nospam@no it] Did my previously posted code example solve your problem? If you will be
| + 229082 [chen_li3@ya ] I need sometime to think about your codes. Although my codes have
| + 229084 [chen_li3@ya ] I run your codes  and it works fine.
|   229088 [nospam@no it] Does it produce a result that is different than your own code, when used
|   + 229123 [chen_li3@ya ] When I run your script I need to use pp(pretty print) to get 8 rows x12
|   | 229153 [nospam@no it] No, you /do/ /not/ need to do that. The formatter 'pp' is /optional/, it is
|   | 229164 [chen_li3@ya ] Thank you so much for your time and input.
|   | 229166 [nospam@no it] Paul Lutus
|   | + 229179 [chen_li3@ya ] But how to explain it works when the column number is
|   | | + 229185 [nospam@no it] Libraries are meant to save your time as a software developer, as well as
|   | | | 229192 [chen_li3@ya ] I completely agree with you. And thank you all for time and your reply.
|   | | + 229190 [dblack@wo bl] See Eric Hodel's reply, and my follow-up.  pp has a default width of
|   | + 229191 [dblack@wo bl] Yes it can.  See Eric Hodel's reply and my replies, and see pp.rb.
|   |   229207 [nospam@no it] / ...
|   + 229158 [dblack@wo bl] The pretty-printing library in the standard Ruby distribution.  See
|     229160 [nospam@no it] Thanks. It seems the crux of this poster's problem is his expectation that
+ 229018 [drbrain@se m] require 'pp'
  229162 [dblack@wo bl] I think you have to give it a middle argument (an output handle) so as

attr_reader, etc for class variables
228948 [danfinnie@op] Is there such a thing?
+ 228952 [drbrain@se m] No.
+ 228953 [twifkak@co c] Rails' ActiveSupport provides them as cattr_* and mattr_*. For that
  228969 [dblack@wo bl] I'd add that if you write them (and I agree with Eric that instance

Mysql-ruby 2.7.2 not compile with ruby 1.9
228949 [fg@si me om ] Following changes in the RSTRING structure of ruby 1.9 (CVS), the
229546 [george.ogata] I doubt one already exists.

[ANN] RingyDingy 1.2.1 Released
228956 [drbrain@se m] RingyDingy version 1.2.1 has been released!

asynchronous select from queue
228958 [boris.ourets] Please advise on how to implement multiple select from queues in Ruby. I
228960 [drbrain@se m] ri Queue ?
228961 [boris.ourets] Sorry but no info on select in ri. Look for yourslef
228998 [vidar.hoksta] "select" only works on IO objects - that's it's purpose. The reason for
229098 [shortcutter@] Adding to that, application architectural wise I do not see the benefit
229112 [boris.ourets] Suppose you have 1000 devices which are being sent messages, every
229120 [shortcutter@] True, in that case "select" would help.  But you can easily write your
229126 [boris.ourets] Thanks a lot for the link

rubyscript2exe problem (yes another)
228962 [anselmthecra] I know this forum is full of problems with rubyscript2exe, but i
+ 228966 [alex@de et m] Rubyscript2exe doesn't produce a shell script, so don't run it with sh.
+ 228983 [david.mullet] This doesn't really address your problem (Alex has already done that),
  228986 [anselmthecra] Of course this is a really great script, no question.
  228987 [anselmthecra] Oh, is it possible, that my /tmp direcctory has the wrong rights?
  228993 [anselmthecra] works now.

qtruby problems
228963 [martindemell] I have both qtruby and qt4-qtruby installed (via the gentoo ebuilds),
228968 [richard.j.da] It's because you're picking up the Qt3 version of QtRuby which doesn't
228971 [martindemell] Thanks! requiring 'Qt4' fixed it. How do I make Qt go back to defaulting to Qt4?
+ 228975 [caleb@ae -t ] I *think* this is a result of whichever you emerged last.  If you
+ 228976 [richard.j.da] Reinstall the Qt4 version of QtRuby so that the Qt.rb file from that

Newbie question: no such file to load -- dbm
228974 [ruby-forum.c] I'm a total ruby newbie, so your help would be much appreciated.

[ANN] Phoenix Ruby USers Group December Meeting
228979 [james.britt@] See http://www.rubyaz.org/groups/prug/ for a map

What ruby on rails for?
228995 [md9@ib st co] I?m a Delphi programmer,tht was once a clipper programmer,that was
+ 228997 [dblack@wo bl] ...
+ 229001 [david@va ln ] Rails uses ActiveRecord for its ORM by default, which doesn't like to

Re: [QUIZ] Tournament Matchups (#105) (Not a spoiler)
229004 [danfinnie@op] I have some questions about this problem.
+ 229006 [james@gr yp ] Your way seems more correct to me, yes.
+ 229015 [louis.j.scor] I think you're misreading this.  It says that all teams have a 'bye'
  229017 [danfinnie@op] I assumed the extended bracket for 2 and 3 was done on purpose by the

AJAX and RoR examples?
229007 [beingthexemp] does anyone know where there are some AJAX and RoR examples? I'm
229019 [drbrain@se m] Probably on the Rails list.
229022 [beingthexemp] ...

Ruby training?
229011 [michael@ha l] I'd like to send a couple of my employees to a Ruby class, the ideal
+ 229073 [rubytraining] May I suggest www.learnruby.com.  The class material (and instructor)
| 229074 [ramalho@gm i] Virtually nothing out of a 3-day workshop? It sounds like a slight
| 229349 [rubytraining] In hindsight I think you're right, at least mostly.  Given that the
+ 229079 [michael@ha l] Also it would be very ideal of the training were either in Seattle or

OT: Some german Rubies near Stuttgart on the list?
229012 [fvgi242ss@gm] are there some Rubies from Germany near Stuttgart on this list?
229051 [lists@be tr ] Bertram

defining key equivalence in a hash
229014 [ snk@gn .o g] I'm trying to make two keys equivalent by having their #hash method
+ 229016 [danfinnie@op] If you put K.new into a variable, and then check for that, it will
+ 229020 [drbrain@se m] class K; def eql?(other) true; end; end
+ 229021 [ara.t.howard] K#eql?

[ANN] sup 0.0.2 Released
229023 [wmorgan-ruby] sup version 0.0.2 has been released! Now, with IMAP support (thanks
229037 [stephane.wir] About the last release, the sup/source.rb file is missing in this release.

Question on IO objects, initialize, and yaml
229024 [jmarkn@gm il] ...
+ 229065 [drbrain@se m] Ruby and YAML provide hooks to cause things to happen when you load
| 229086 [jmarkn@gm il] ...
| 229224 [ mfp@ac .o g] require 'yaml'
+ 229169 [vjoel@pa h. ] A possible alternative is to be lazy about constructing the non-dumpable
  229174 [vjoel@pa h. ] That's not quite right. If you use #b and then dump/load and try to use

Scope of block
229025 [daniel@it l.] I want to define a block at one time.
+ 229026 [nospam@no it] Perhaps you will be satisfied that the block receive values from the parent
| 229029 [daniel@it l.] That is how it is solved now, but the proc needs to be flexible.
| 229033 [nospam@no it] Use instance variables.
+ 229042 [gustav@ra ls] #########
| + 229044 [dblack@wo bl] No need for instance_eval there.  @block already belongs to self, and
| | 229046 [gustav@ra ls] LOL!
| + 229047 [daniel@it l.] because you set out_of_scope_var before you create the block
+ 229130 [noonknight@g] t = BlockTest.new
  229136 [noonknight@g] t.process { "var = #{eval('out_of_scope_var')}" }

Re: [Solution] [Quiz] Tournament Matchups (#105)
229028 [kegelman@rb ] module Math

Re: Tournament Matchups (#105) (Not a spoiler)
229032 [broclee@gm i] The goal is not to minimize the number of byes.  The goal is to

Monkey Patching a method and back
229035 [srobertjames] I need to temporarily mokey patch out a method in a certain class used
+ 229038 [james@gr yp ] #!/usr/bin/env ruby -w
| 229041 [srobertjames] Will this be OK even if patched and unpatched multiple times?
| 229043 [james@gr yp ] You probably want to use something more robust for that.  You need to
| 229045 [dblack@wo bl] David
| 229066 [srobertjames] Thanks.  That's quite a hefty module - with method am I interested in?
| 229069 [dblack@wo bl] module M
+ 229039 [dblack@wo bl] I reply under mild protest, as I detest the term "monkey patching"
  + 229040 [dblack@wo bl] Found it: "import-module".  It's even thread-safe.
  + 229111 [martindemell] +1

Complete Newbie - Matrix Question
229048 [j@so ew er .] This is probably quite easy, but I can't find a Matrix function or way
+ 229052 [nospam@no it] #!/usr/bin/ruby -w
+ 229056 [broclee@gm i] Based on the documentation at ruby-doc.org, I would think that the
+ 229057 [broclee@gm i] Based on the documentation at ruby-doc.org, I would think that the
+ 229060 [jasaugusto@g] ...

glib2 errors
229054 [ramsayw1@co ] Can anyone explain why I'm suddenly getting the following errors?
+ 229055 [nospam@no it] What exactly did you update, and how? It looks as though your open-GL
+ 229058 [kou@co mi ng] The problem was fixed in CVS.

Re: Tournament Matchups (#105)
229059 [demetriusnun] Here is my original solution and a sample run for 10 players.

Newbie question about pop3 access
229062 [WookieTim@gm] I am rather new to Ruby and I want to write a program to play around
+ 229063 [thomas.adam2] I don't quite see how you expect to have anything drain your back
| 229129 [WookieTim@gm] Actually, I hadn't seen that. All the libraries I found so far cost
+ 229064 [danfinnie@op] This is mostly pure speculation based on prior knowledge that hasn't

Re: [QUIZ] Tournament Matchups (#105) -- Solution
229068 [rubytraining] Below you'll find my solution.  The code to create the binary tree is

Marshall and Modules
229070 [srobertjames] I get loads of problems when using Marshall (ie, in CGI::Session) for
229075 [drbrain@se m] What kind of problems?  Examples?

YAML::Syck::Map.children_with_index has a non-useless mode?
229081 [phlipcpp@ya ] I have some dirt-simple YAML, and I need to traverse the object model
229083 [nospam@no it] The problem might lie in your code, or your YAML database. The parts that

can it be shorter?
229085 [wuyasea@gm i] doing formating, i need to break a long line of words to roughly 80
+ 229087 [nospam@no it] "Shorter" is one issue, but you really don't need to recurse to accomplish
+ 229092 [m.fellinger@] It's not perfect, but well... just inviting all the regex-gurus to improve
+ 229135 [james@gr yp ] def break_line(text)

[ANN] Dhaka 0.0.4 release
229089 [mushfeq.khan] ...
229091 [mushfeq.khan] ...

[ANN] Dhaka 0.0.4 released
229090 [mushfeq.khan] ...

TkCanvas on windows seems slow
229094 [vjoel@pa h. ] ran it on windows. It's much slower on windows than on linux (maybe,
229314 [vjoel@pa h. ] Ok, I've got a workaround. I think the problem is that the command
230247 [nagai@ai ky ] I cannot understand how to reproduce your trouble.
230479 [vjoel@pa h. ] Thanks for the reference, I didn't know about those methods.

Regexp/scan question
229095 [peter@ru yr ] #begin here
+ 229096 [angus@qu va ] n = 4
| + 229097 [angus@qu va ] better with '?', to make it not greedy :).
| + 229099 [peter@ru yr ] Sorry, I need to 'scan' it. I have been playing around with similar
| | 229103 [angus@qu va ] irb(main):001:0> text = "#begin aaa end bbb } ccc } #begin ddd end eee
| | 229104 [peter@ru yr ] Ha! That was the trick I have been looking for! Muchas Gracias, Carlos.
| + 229100 [shortcutter@] IMHO this does not work because of the greedy ".*".  You could try with
|   229101 [peter@ru yr ] Yeah, I tried to correct these problems but I am still not quite there...
+ 229107 [nospam@no it] This won't solve the entire problem, but it will give you an array of

`sysread' end of file reached `rbuf_fill' problem
229106 [mento_ruby@h] when my problem is using multithreading to get some documents from www

Dir.chdir("..") versus `cd ..`
229110 [pere.noel@la] Dir.chdir("..")
+ 229113 [dudu@du u. o] Because "cd .." executes in a child process. So the cwd change only
+ 229114 [patrick@er b] maybe the first one creates a new environment and close it after the
+ 229115 [patrick@er b] maybe the first one creates a new environment and close it after the
+ 229116 [patrick@er b] maybe the first one creates a new environment and close it after the
+ 229117 [vincent.four] When you're using backquotes, Ruby forks a shell and feeds it with the
  229118 [pere.noel@la] yes, thanks for all (and to all answers) it's clear enough to me right

else inside rescue  is useless?
229119 [capitain@gm ] The "The ruby way" book said
+ 229124 [cyclewood_lt] ...
| 229128 [dblack@wo bl] begin
| 229154 [cyclewood_lt] ...
+ 229143 [wilsonb@gm i] @count = 1
  229292 [ruby@ml ic m] Yes, else only runs if no exception was raised; and it will run BEFORE the
  229307 [wilsonb@gm i] Do you feel like that's an implementation quirk of Ruby, or something
  229313 [ruby@ml ic m] It sounds like it is deliberate - otherwise, why introducing the else

Ruby binaries for Symbian S60
229121 [user@do ai .] ago (runs on Nokia mobile phones for example).

Newbie questions
229122 [kakaze@ta k2] trouble with more intermediate features.
+ 229125 [pfortuny@gm ] ...
| 229134 [james@gr yp ] whole_file = File.read("name_of_file")
| 229138 [pfortuny@gm ] ...
+ 229127 [hhausman@gm ] malarky indeed.
+ 229303 [kakaze@ta k2] Thanks. I've got it reading in a file and checking each line against a
| + 229316 [slamboy@gm i] ...
| | 229319 [dblack@wo bl] You can use \S (non-whitespace) for your character class.  (I do have
| + 229317 [nospam@no it] #!/usr/bin/ruby -w
+ 229424 [kakaze@ta k2] OK that makes a lot less sense...I don't recognise many of those
  + 229426 [kakaze@ta k2] Oh also...What if I don't want example as part of it? Just what follows.
  | + 229433 [pfortuny@gm ] ...
  | | 229440 [slamboy@gm i] ...
  | + 229438 [slamboy@gm i] ...
  + 229475 [nospam@no it] Mr. Jones, you've posted in such a way that you have started a new thread,

New Haven Rubyists December Meeting
229132 [novakps@gm i] Connecticut on

Bug in Ruby or Pickaxe? (was: Re: else inside rescue  is useless?)
229133 [shortcutter@] This is plain wrong - at least in 1.8.5.  The Pickaxe says the "else"
+ 229167 [m_goldberg@a] I would be horrified if the <else> were executed after a <return> --
+ 229204 [dave@pr gp o] Why would you expect the else clause to be executed if a return is
| 229265 [shortcutter@] I have low expectations with regard to the "else" clause but the book
| + 229269 [robert.dober] ...
| + 229278 [dave@pr gp o] I guess in my mind, the semantics of return take precedence over most
|   + 229279 [robert.dober] ...
|   + 229283 [shortcutter@] Dave, you're welcome!  I was probably in formal mode when reading that,
|   | 229287 [dblack@wo bl] I don't think that's needed.  Executing a body of code means executing
|   + 229285 [dblack@wo bl] No, I think it's correct.  I consider "executes body" to expand
|   + 229289 [ruby@ml ic m] I think detailing every condition under which else would not get called is
+ 229245 [george.ogata] begin

RubyForge scheduled downtime later today
229137 [tom@in oe he] I'm going to take RubyForge down for a upgrade this afternoon.  Should

Questions about DRb and security
229139 [zimbatm@or e] ...
+ 229151 [pit@ca it in] Jonas, I'm no DRb expert, but this client code can get access to the
| 229177 [zimbatm@or e] ...
+ 229687 [drbrain@se m] Write a new DRbProtocol that must send user/password first.

Help recherche de package
229144 [vialadom@gm ] Bonjour
229145 [jeremymcanal] Bonjour,
229147 [vialadom@gm ] I'm beginner in Ruby and I want to know if there are librairy for
+ 229148 [nospam@no it] Can you be more specific? What kind of meta-data? How do you mean "uploading
| 229150 [vialadom@gm ] I have the solution for uploading  but not for having the metadata. The
| 229157 [nospam@no it] Are the meta-data located inside the file, or outside the file? Does
| 229262 [vialadom@gm ] Are the meta-data located inside the file, or outside the file? Does
+ 229149 [nicolas.desp] You can use File.stat (available in the core of ruby) to read the meta