228684-243681 subjects 229122-230849

^ File.yaml?(fname)
228891 [transfire gm] what's the best way to determine if a file is yaml?
+ 228895 [twifkak comc] def File.yaml?(fname)
+ 228897 [nospam nosit] Process the file using a parser meant to process YAML. If the parse fails,
+ 228904 [vjoel path.b] In light of the other responses, which show how hard it is to do this in
| 228915 [transfire gm] yikes! if that's what it takes then i must run away! :-) i need
+ 228905 [ara.t.howard] in ruby queue i detect whether stdin input is a normal list or yaml in this

^ Re: [OT] educational programming languages (was: Fwd: Seymour Papert Gravely Injured in Motorbike Accident)
228906 [twifkak comc] <life-story>

^ [ANN] CoolOptions 1.0.3 has been released
228907 [ntalbott gma] CoolOptions version 1.0.3 has been released!

^ Re: Ruby Core + Php FrontEnd (open)
228910 [jungans gmai] Why not just use PHP for the cron job? It doesn't seem like a good

^ bending ruby space
228914 [transfire gm] i came upon this "pattern" working on a rather difficult problem. see
+ 228930 [twifkak comc] module R; extend self end
| 228941 [dblack wobbl] I'm not sure what you mean.  extend self doesn't do what class << self
| 228946 [twifkak comc] It was a "green is the new blue" parody. Not a funny one, mind you, but
+ 228942 [johnwilger g] Job security? ;-)
| 228943 [transfire gm] LOL! :-D
+ 228947 [ara.t.howard] one side effect is that all instance methods of R are available at the module
  + 228989 [transfire gm] that's an interesting method in it's own right. i'm tempted to add to
  | 228996 [ara.t.howard] dynamically injectable 'super' - very useful.
  + 229141 [transfire gm] speaking of this "export" method, how does one do that for a whole
    229142 [ara.t.howard] module X
    229152 [transfire gm] but that undoes the module_function-ality of X.
    229156 [ara.t.howard] ??
    229163 [transfire gm] module CompressUtils
    229171 [ara.t.howard] module CompressUtils
    229202 [transfire gm] ah. yes i know this pattern. though i prefer #class_extension myself.

^ Re: educational programming languages (was: Fwd: Seymour Papert Gravely Injured in Motorbike Accident)
228916 [transfire gm] i don't know how many people realize that logo is in essence lisp.

^ Help me with some nested Hashes.
228918 [danfinnie op] What I want to do is have 2 nested hashes, the outer hash returning a
+ 228919 [vjoel path.b] value = Hash.new {|h,k| h[k] = Hash.new {|h1,k1| h1[k1] = " "}}
| 228921 [vjoel path.b] Another option, in case you don't want all those empty strings
| 228922 [danfinnie op] Thanks, that works perfectly!  (I'm only storing 1 char strings)
+ 228923 [work ashleym] Daniel

^ hello ! everyone.
228920 [tourney_hugh] This is a great forum with valuable information.
228940 [michael.mell] Welcome aboard!  I'm new as well.

^ text wrap
228933 [ishamid colo] I have a ruby script that's doing what I need, and I would like to add
+ 228928 [nospam nosit] Idris, I can offer various methods to break text up into individual lines,
| 228931 [ishamid colo] Ok, see below...
| 228929 [nospam nosit] / ...
+ 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 gma] CoolOptions version 1.0.4 has been released!
229078 [botp delmont] # CoolOptions version 1.0.4 has been released!

^ format problem
228945 [chen_li3 yah] I have a 1D array containing 96 elements. I change it
228955 [nospam nosit] Just one. What are the data, and what result do you want?
228964 [chen_li3 yah] original 1D array
+ 228999 [nospam nosit] / ... snip result listing
| 229077 [chen_li3 yah] My script is about 140 lines. I am not sure if I post it.
| 229080 [nospam nosit] Did my previously posted code example solve your problem? If you will be
| + 229082 [chen_li3 yah] I need sometime to think about your codes. Although my codes have
| + 229084 [chen_li3 yah] I run your codes  and it works fine.
|   229088 [nospam nosit] Does it produce a result that is different than your own code, when used
|   + 229123 [chen_li3 yah] When I run your script I need to use pp(pretty print) to get 8 rows x12
|   | 229153 [nospam nosit] No, you /do/ /not/ need to do that. The formatter 'pp' is /optional/, it is
|   | 229164 [chen_li3 yah] Thank you so much for your time and input.
|   | 229166 [nospam nosit] Paul Lutus
|   | + 229179 [chen_li3 yah] But how to explain it works when the column number is
|   | | + 229185 [nospam nosit] Libraries are meant to save your time as a software developer, as well as
|   | | | 229192 [chen_li3 yah] I completely agree with you. And thank you all for time and your reply.
|   | | + 229190 [dblack wobbl] See Eric Hodel's reply, and my follow-up.  pp has a default width of
|   | + 229191 [dblack wobbl] Yes it can.  See Eric Hodel's reply and my replies, and see pp.rb.
|   |   229207 [nospam nosit] / ...
|   + 229158 [dblack wobbl] The pretty-printing library in the standard Ruby distribution.  See
|     229160 [nospam nosit] Thanks. It seems the crux of this poster's problem is his expectation that
+ 229018 [drbrain segm] require 'pp'
  229162 [dblack wobbl] 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 segm] No.
+ 228953 [twifkak comc] Rails' ActiveSupport provides them as cattr_* and mattr_*. For that
  228969 [dblack wobbl] 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 siamecomm] 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 segm] 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 segm] 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 deletem] 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 aei-te] 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 ibest.co] I a Delphi programmer,tht was once a clipper programmer,that was
+ 228997 [dblack wobbl] This message is in MIME format.  The first part should be readable text,
+ 229001 [david vallne] 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 graypr] 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 segm] Probably on the Rails list.
229022 [beingthexemp] yea I just realized I was on the ruby list.. went to rails list.

^ Ruby training?
229011 [michael hall] 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 gmai] 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 hall] 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 bertra] Bertram

^ defining key equivalence in a hash
229014 [ snk gna.org] 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 segm] 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 gmail] class Test
+ 229065 [drbrain segm] Ruby and YAML provide hooks to cause things to happen when you load
| 229086 [jmarkn gmail] I _want_ to use a built-in hook (the ruby way, if you will), if I can figure
| 229224 [ mfp acm.org] require 'yaml'
+ 229169 [vjoel path.b] A possible alternative is to be lazy about constructing the non-dumpable
  229174 [vjoel path.b] That's not quite right. If you use #b and then dump/load and try to use

^ Scope of block
229025 [daniel itxl.] I want to define a block at one time.
+ 229026 [nospam nosit] Perhaps you will be satisfied that the block receive values from the parent
| 229029 [daniel itxl.] That is how it is solved now, but the proc needs to be flexible.
| 229033 [nospam nosit] Use instance variables.
+ 229042 [gustav rails] #########
| + 229044 [dblack wobbl] No need for instance_eval there.  @block already belongs to self, and
| | 229046 [gustav rails] LOL!
| + 229047 [daniel itxl.] 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 rbg] filename="105-tournament-matchups.rb"

^ Re: Tournament Matchups (#105) (Not a spoiler)
229032 [broclee gmai] 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 graypr] #!/usr/bin/env ruby -w
| 229041 [srobertjames] Will this be OK even if patched and unpatched multiple times?
| 229043 [james graypr] You probably want to use something more robust for that.  You need to
| 229045 [dblack wobbl] David
| 229066 [srobertjames] Thanks.  That's quite a hefty module - with method am I interested in?
| 229069 [dblack wobbl] module M
+ 229039 [dblack wobbl] I reply under mild protest, as I detest the term "monkey patching"
  + 229040 [dblack wobbl] Found it: "import-module".  It's even thread-safe.
  + 229111 [martindemell] +1

^ Re: DBI connection problem
229036 [mvanemmerik ] Andrea,
248301 [sonny.chee g] Hey Guys,

^ Complete Newbie - Matrix Question
229048 [j somewhere.] This is probably quite easy, but I can't find a Matrix function or way
+ 229052 [nospam nosit] #!/usr/bin/ruby -w
+ 229056 [broclee gmai] Based on the documentation at ruby-doc.org, I would think that the
+ 229057 [broclee gmai] Based on the documentation at ruby-doc.org, I would think that the
+ 229060 [jasaugusto g] Once I had the same problem and proposed the following functions

^ glib2 errors
229054 [ramsayw1 com] Can anyone explain why I'm suddenly getting the following errors?
+ 229055 [nospam nosit] What exactly did you update, and how? It looks as though your open-GL
+ 229058 [kou cozmixng] 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 segm] What kind of problems?  Examples?

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

^ can it be shorter?
229085 [wuyasea gmai] doing formating, i need to break a long line of words to roughly 80
+ 229087 [nospam nosit] "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 graypr] def break_line(text)

^ [ANN] Dhaka 0.0.4 release
229089 [mushfeq.khan] Dhaka is now much faster and has several new features since its initial
229091 [mushfeq.khan] Oops, my apologies - my post got truncated. :D Please see the complete

^ [ANN] Dhaka 0.0.4 released
229090 [mushfeq.khan] To recap, Dhaka is an LALR1 parser generator written purely in Ruby (see

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

^ Regexp/scan question
229095 [peter rubyra] #begin here
+ 229096 [angus quovad] n = 4
| + 229097 [angus quovad] better with '?', to make it not greedy :).
| + 229099 [peter rubyra] Sorry, I need to 'scan' it. I have been playing around with similar
| | 229103 [angus quovad] irb(main):001:0> text = "#begin aaa end bbb } ccc } #begin ddd end eee
| | 229104 [peter rubyra] 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 rubyra] Yeah, I tried to correct these problems but I am still not quite there...
+ 229107 [nospam nosit] 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 dudu.ro] Because "cd .." executes in a child process. So the cwd change only
+ 229114 [patrick erdb] maybe the first one creates a new environment and close it after the
+ 229115 [patrick erdb] maybe the first one creates a new environment and close it after the
+ 229116 [patrick erdb] 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 gma] The "The ruby way" book said
+ 229124 [cyclewood_lt] exactly, the else is in the rescue which means an exception has been thrown. if it doesn;t match any of the exceptions you've declared as being important to catching, and you include an else, the else wiill catch what you don;t want.
| 229128 [dblack wobbl] begin
| 229154 [cyclewood_lt] yeha, yeah, yeah. my mistake.
+ 229143 [wilsonb gmai] @count = 1
  229292 [ruby ml.icem] Yes, else only runs if no exception was raised; and it will run BEFORE the
  229307 [wilsonb gmai] Do you feel like that's an implementation quirk of Ruby, or something
  229313 [ruby ml.icem] It sounds like it is deliberate - otherwise, why introducing the else

^ Ruby binaries for Symbian S60
229121 [user domain.] ago (runs on Nokia mobile phones for example).