181791-193308
181600-188345 subjects 181981-192078
^ [ANN] Dallas Ruby Brigade meets March 7th
181791 [adam thereal] The Dallas Ruby Brigade begins!
^ Drawing a hierarchy w.r.t. class (instance) variables
181795 [minkoo.seo g] Recently, I've read
^ this feels ugly
181796 [wrong socal.] i better explain a little to get started.
181798 [wrong socal.] oops, wrong list. so sorry.
^ Documentation with rDoc and .chm-help.
181797 [email.to.sas] I hava a question about documentation with rDoc an the .chm-help
^ Stack level too deep
181800 [m-lists bris] I have a tree that I do recursion over the nodes (and then some
+ 181802 [meinrad.rech] what is the maximum depth of the tree? and how do you traverse it?
+ 181805 [bob.news gmx] The easiest change is to use BFS instead of DFS - if that's possible in
| 181811 [meinrad.rech] i now remember that i had a similar problem with a deep recursion and stack
| 181818 [bob.news gmx] That's exactly the other recommendation I gave. :-)
| 181881 [m-lists bris] I'm implementing the composite pattern using acts_as_tree and STI in
| 181929 [logancapaldo] charset=US-ASCII;
+ 181945 [ericrchr gma] You can change the stack size of the Ruby executable with editbin. It's
^ how to run a ruby program from another one
181801 [navyaamerine] How can we run a a ruby program from another ruby program. I am working on one program where in i have to run another ruby program from it.
+ 181803 [billk cts.co] Usually
+ 181806 [bob.news gmx] 1912: parent
^ Sending Binary Data?
181804 [ynadji omega] My friend and I are writing a chat/IM client in Ruby. It's nothing
+ 181807 [bob.news gmx] - you use + for string concatenation which constantly creates new objects
+ 181948 [logancapaldo] charset=US-ASCII;
^ Subclassing Struct.new
181812 [minkoo.seo g] irb(main):001:0> class F < Struct.new :n
181814 [kiaroskuro g] The following works for me. I suspect you should have used self
181816 [minkoo.seo g] It works! Thank you.
181819 [kiaroskuro g] The alternative would be to use @n, but I am not sure that Struct
+ 181820 [minkoo.seo g] It is strange because
| + 181825 [rossrt rosco] Well, n = 1 just assigns the fixnum 1 to a (new) local variable 'n'.
| | + 181826 [minkoo.seo g] Sigh. This reminds me of the rule that I have to use
| | + 181829 [kiaroskuro g] It's really unrubesque and tricky. What would be the consequences of
| | | 181834 [rossrt rosco] This isn't necessarily based in fact (i.e. I've not surfed the source
| | | 181835 [kiaroskuro g] I would disagree on the third point.
| | | 181920 [mark mwilden] One explanation I've heard for this behavior is that if 'self' was implied
| | + 181860 [mental rydia] It's really the only possible way; the variable-versus-writer
| | 181961 [rossrt rosco] Hmm, yes now I think about it that makes sense. So in that case I guess
| + 181838 [news wobcom.] How should it be in your opinion?
| | 181854 [kiaroskuro g] thanks for pointing out the side effects of the other stylistic
| | 181989 [news wobcom.] I'm not a regular programmer. So I guess I don't have a chance to discuss
| | + 182083 [mental rydia] When speaking of grammar, "ambiguity" refers to situations where the
| | + 182553 [kiaroskuro g] The reason I find it surprising is that I expect to read from
| + 181859 [mental rydia] Check again. n=1 will parse as assignment to the local variable 'n'
| + 181901 [hal9000 hype] Please explain what you mean.
+ 181858 [mental rydia] Since variables are declared via first assignment, how could it be
181862 [kiaroskuro g] I guess that in principle when you see an '=', you could lookup a
+ 181864 [gwtmp01 mac.] The problem, of course, is that methods can come and go so you would
| 181868 [kiaroskuro g] that wouldn't worry me. it's a rare event that tests would probably
| 181872 [mental rydia] It's not a matter of being defensive... because variables and method
| 181875 [kiaroskuro g] What I meant is that a feature of this grammar forces us to use this
| 181880 [mental rydia] But do we really want a situation where the names of local variables
| + 181892 [pit capitain] 100% agreed.
| + 181949 [logancapaldo] charset=US-ASCII;
+ 181865 [mental rydia] In Ruby's grammar, expressions containing a name parse differently
181932 [matz ruby-la] Yes, and in Ruby2.0, this will be changed to "if you see an assignment
+ 181966 [mental rydia] This is best for the user. However...
| 181977 [matz ruby-la] I'm not sure what you meant by "ambiguities". The identifiers not
+ 181974 [minkoo.seo g] This make sense, but
| 181979 [matz ruby-la] def foobar(ary)
+ 182196 [vikkous gmai] def foo
182227 [matz ruby-la] Hmm, you make me remember a trick in the parser (which I made).
182312 [vikkous gmai] I'm trying to understand the distinction... I think I see. It's
^ Formatting to "Thousands"
181813 [hscbaj hotma] A colleague of mine wishes to format a float to include commas at thousand
181837 [james graypr] def commify( number )
+ 181878 [semmons99 gm] I have to say, that is some great Regex Fu. I was looking to do
+ 181889 [hscbaj hotma] Implemented this into the float class.
+ 181890 [jeff schwabc] That's nice, except that gsub! returns nil if no substitutions are
+ 181891 [james graypr] Good catch. I originally had it in multiple lines and I forgot to
| 181954 [logancapaldo] I don't know why but using regexps to do this kind of scares me.
| 182050 [jeff schwabc] Try the Friedl book. It will open your eyes. :)
+ 181893 [kevin.olbric] Or you could just use 'gsub' instead of 'gsub!' and avoid the nil
^ Re: Python for Fortran programmers
181821 [claird laird] Please help me understand what you're writing here. I *think*
181925 [ptkwt aracne] This is because Python was there earlier.
^ Iterators and Assigment
181830 [bl719293 big] Consider...
181833 [bob.news gmx] Because Ruby does call by value where values are object references. Same
181944 [lists turnip] def fred
182002 [bl719293 big] Thanks guys. Your responses have cleared this up. I was assumig some sort of
^ Bug in Racc?
181831 [j Tippell.co] The following was reported to Minero Aoki (Racc developer) a while ago;
^ Same variable name used in block and local question
181839 [scriptfan gm] Can anybody help me here, TIA!!
+ 181842 [bob.news gmx] No, it isn't because it was defined outside the block. It's used in cases
| 181847 [dblack wobbl] I think that's a different thing, though, from the parameter
| 181873 [bob.news gmx] Is there a difference with regard to scope between
| 181882 [dblack wobbl] I guess I had the impression that what puzzled the OP was that using a
+ 181844 [dblack wobbl] Block parameters actually use assignment semantics, so if a variable
^ Bug in Ripper
181840 [j Tippell.co] Minero Aoki has confirmed that the following is a bug. I'm not (yet!)
^ Wherefore art thou RedCloth 3.1?
181846 [Bil.Kleb NAS] Have the PDF output plans been tabled?
181871 [gregory.t.br] Whoa! If Redcloth gets these things, it'll make Ruport's life a lot easier!
182190 [ news jay.fm] Don't get too excited - I was all atwitter too until I realized that that
^ Using assert() in a loop
181849 [t.catlin els] I hope this question isn't answered somewhere else, but the search was
181874 [bob.news gmx] Well, the test fails as soon as a single URL fails. That's the reason for
181946 [t.catlin els] As with many of these problems, hours of head banging are solved with a
^ OCI8 driver date "out of range"
181877 [crdiaz324 gm] I am building an applications that access an existing database that
+ 181947 [drbrain segm] Either
+ 181950 [crdiaz324 gm] Ok, after doing some research on this, it looks like the problem isn't
| 182027 [rurounijones] I am using a simple simple program that suffers from this problem. I
+ 182031 [kubo jiubao.] Did you use OraDate#to_time?
^ Visual debuggers for Ruby
181879 [ayZIG0106 qa] I normally use DDD for debugging my C/C++ code, and know it can debug Perl
+ 181894 [edder tkwspi] No problem
+ 181898 [meinrad.rech] ...
+ 181902 [collinsj sea] There have been several posts lately about a new graphical debugger for
| 181998 [ayZIG0106 qa] Many thanks all!
+ 181922 [james.herdma] Have you tried this? http://mr-guid.rubyforge.org/
182017 [rurounijones] Just looking at this quickly, can it be used to debug a Ruby on Rails
182043 [mtrier gmail] Also, look into arachnoruby
182079 [ml.chibbs gm] I can second this -- its probably the best graphical debugger
^ Rails on the Mac - Apple Article
181883 [jim freeze.o] I hope this is not old news.
^ [ANN] rcov 0.2.0 - code coverage tool for Ruby
181885 [ mfp acm.org] Source code, additional information, screenshots... available at
+ 181896 [robert.feldt] Thanks Mauricio, this looks great and arrives just at the right momen
+ 181899 [neoneye gmai] very nice :-)
+ 181904 [shanko_date ] Source code, additional information, screenshots... available at
| 181963 [shanko_date ] Source code, additional information, screenshots... available at
| 181965 [shanko_date ] It works ... if I use the correct version !
| + 181967 [mulperi cc.h] It seems like you are using the old rcov eg. rcov 0.1 instead of 0.2
| + 182339 [ mfp acm.org] I think I might be to blame for that; I didn't really think about
+ 181930 [meinrad.rech] many thanks for rcov, batsman!!
+ 184007 [ruby-talk ba] Fabulous!
184100 [ mfp acm.org] It will be possible in the next release; in the meantime, could you use the
184116 [ruby-talk ba] I am doing, and it looks good.
184488 [phurley gmai] Just want to join the chorus of thank you. This is perfect. I found a
+ 184495 [ mfp acm.org] [rcov.rake]
| 184498 [pat.eyler gm] Please do! I've got a much uglier/less comprehensive set of Rake
+ 184583 [chneukirchen] Wouldn't it be better if you used rake's "ruby" method instead of "sh"
191730 [rusty geldma] I think I've gone a step further by integrating Rcov using Rake's
193308 [ mfp acm.org] I took your idea (looking into Rake::TestTask) to implement a Rcov::RcovTask
^ Cannot instal gettext 1.2.0 gem
181895 [byrnejb hart] OS = CentOS4.2
^ Teaching Ruby to COBOL programmers
181897 [wilsonb gmai] This isn't a troll, I promise. I'm actually going to be doing this tomorrow.
+ 181955 [xeno eskimo.] I like the idea that to a great extent what you are trying to do in a
+ 181956 [agorilla gma] Forgetting OOP for a moment, and thinking WWW instead...
| 181969 [steve waits.] I agree.. important to teach.
| + 181970 [hal9000 hype] All true enough.
| | + 181990 [google erikv] LOL :)
| | + 182005 [chneukirchen] Finally, tell them that Rails 1.1 new Object#copy_instance_variables_from
| | + 182022 [wilsonb gmai] Thanks Hal (and everyone).. this kind of thing definitely helps. Part
| | 182202 [bill.walton ] Were it me, with all the obstacles you've outlined, I'd feel successful
| + 182442 [corey.ssf.la] Also, remember that they're very used to thinking in procedural terms.
+ 181968 [dave burt.id] .... and methods belong to objects' classes. I'd be emphasizing OO. To me,
+ 181976 [vjoel path.b] We hear that a lot, but, somehow, it never sounds right. If variables
| + 182161 [gwtmp01 mac.] Well, not everyone conceptualizes numbers, booleans and symbols as
| | 182418 [malteNOSPAM ] If x looks like a reference to an object, if it walks like a reference to
| + 182185 [hal9000 hype] I'd say that they're not "labels" in that sense, but in the sense of
+ 182132 [anibalrojas ] I'll focus it as a introduction to Object Oriented Programming with
+ 182209 [none none.ne] Against common conception, only about 40% of mainframe programmers
+ 182224 [jlsysinc all] MFer here.
+ 182319 [adam.shelly ] So how did it go?
182514 [wilsonb gmai] It went better than I'd feared, really. I'd like to thank everyone
^ save file
181912 [michaelaugus] my form
181957 [james graypr] <%= form_tag({:action => "upload", :id => @property}, :multipart =>
+ 182070 [michaelaugus] yes that's correct , thanks
+ 183613 [eric.python ] I have the same problem.
^ Ruby Consulting work @ Where2GetIt.com
181913 [jonscarbroug] If you do Ruby programming and would like to take on a consulting job
181910 [julian.kamil] Jon, I'm interested in helping. Please take a look at my resume here
^ undefined method `read' for
181917 [michaelaugus] I got an error undefined method `read' for, why ?
181916 [mreed theree] I'm guessing that whatever @params['image_file'] is doesn't have a read method.
181915 [michaelaugus] works better but still have error
^ What am I missing with this closure example?
181921 [sam.s.kong g] Since my last question about
+ 181906 [hitesh.jasan] Like konsu states, you have two different closures. Here's a little
| 181972 [sam.s.kong g] Aha~
+ 181918 [mreed theree] The assignment "x = 0" gets executed every time you call f, creating a new x
+ 181919 [konsu hotmai] f("two") creates a lambda that sees 'x' as it was at the time of its
+ 181934 [mike stok.ca] Each time you call f you get a different x, so the lambda's x are
^ upload a picture save it on hdd
181924 [michaelaugus] how to uplaod the picture and save it in the folder
^ Rio: which is the slow one?
181926 [lispamateur ] caps = []
+ 181971 [meinrad.rech] you could use the ruby profiler to find out exactly ....
+ 181997 [chneukirchen] One line read to memory at a time.
+ 182024 [james graypr] Here you are rolling your own split.
| 182669 [rio4ruby rub] This is a false comparison. The speedy code will not properly parse
| 182716 [lispamateur ] I didn't claim they are equivalent in principle; but for the purpose at
+ 182983 [rio4ruby rub] Good Question. The first problem is that you are using a general
182985 [james graypr] See FasterCSV. ;)
^ Your Favorite One Liner
181927 [nugend gmail] Give out your favorite one liner, what it does, and when you use it.
+ 181940 [ara.t.howard] hashify = lambda{ |*hashes| hashes.inject(accum={}){|accum,hash| accum.update hash} }
+ 181960 [james graypr] This was originally posted by Erik Terpstra, with some editing from
| 181983 [w_a_x_man ya] This doesn't properly handle whitespace between words.
| 181985 [w_a_x_man ya] str =
+ 182103 [farrel.lifso] I did this while messing around at work one afternoon. Pretty sure it
| 182104 [farrel.lifso] Whoops here it is....
| 182138 [w_a_x_man ya] 1 isn't a prime number.
| 182166 [jeff schwabc] mv primes.rb non_composite_natural_numbers.rb
| 182297 [steven lumos] [1, [2, 3, 5,...]]
+ 182189 [horndude77 g] Since there's a prime one-liner (sort of) here's a fibonacci one-liner
^ Hash.from_zipped_array
181931 [farrel.lifso] [1,2,3].zip([2,4,6])
181943 [ara.t.howard] animal, sound = %w[dog cat bird], %w[woof meow cheep]
+ 182096 [farrel.lifso] Is there anything they haven't thought of in the API? They still keep
+ 182115 [dblack wobbl] A good opportunity for my annual plug for the flattenx extension :-)
+ 182123 [james graypr] It's not too hard to allow nested Arrays in Hash construction even
| 182130 [dblack wobbl] Hash[*arr.flatten_once]
| 182170 [matz ruby-la] I'm not sure above is the best solution, but anyway giving #flatten a
| 182174 [dblack wobbl] Actually the flattenx extension has both: flatten_once and flatten(n)
+ 182141 [chneukirchen] Try to get that into 2.0, at least flatten_once. *please*.
182164 [ara.t.howard] agreed. however i'd strongly go with an api like
182179 [vjoel path.b] Is that the sound of one API clapping? ;)
^ Waking ruby thread on external event
181938 [billk cts.co] I have Ruby embedded into a multithreaded C++ app. It's easy for
+ 181941 [zdennis mkte] Can't you do this the other way around as well.... write C/C++ extension for ruby which stores
| 181964 [billk cts.co] All ruby threads run on a single OS thread, and the ruby
+ 181959 [vjoel path.b] Can the ruby thread just Thread.sleep, and wait for the C++ code to call
181975 [billk cts.co] Hmm...
181980 [vjoel path.b] Not necessarily such a problem. rb_thread_wakeup() doesn't muck around
^ [ANN] St. Louis Ruby Dinner confirmation ** new time: 6:00pm **
181939 [curt.hibbs g] Looks like we'll have about 15 people, 10 of which are part of our local St=
182249 [dave pragpro] Just to let you know that the last session of the afternoon doesn't
^ Re: Confused about "private"??
181951 [matz ruby-la] Unlike Smalltalk, Ruby has methods to be called like functions in
182026 [info johnale] Matz,
^ [ANN] March Meeting of the Phoenix Ruby Users Group
181952 [james_b neur] The Phoenix Ruby Users Group will hold its monthly meeting on March 13,
^ returning more than one value
181973 [minkoo.seo g] irb(main):001:0> def foo
181999 [interfecus g] 1, 2 is not a valid expression using ruby syntax. Use something like
^ ASP.NET 2.0 vs Ruby On Rails
181978 [mghaoui gmai] I've spent the past few weeks desperately looking for good comparisons
+ 181987 [mtrier gmail] First, you'd probably get better response from the Rails list.
| + 182102 [w_a_x_man ya] There's no such word as 'noone'. Instead, 'no one', 'nobody', or
| | 182501 [fprimus uxb.] noone can quite begin to guess
| | 182504 [pbattley gma] Isn't pedantry fun?! ;-)
| | 182644 [fprimus uxb.] It sure is, I was just being lazy and did know of the reference. I
| + 182217 [demmer12 fas] You've got to be kidding about VS.NET being the best IDE there is
| 182236 [ruby anthrop] } You've got to be kidding about VS.NET being the best IDE there is
| 182238 [uncledruby g] I happen to be the lucky (or unlucky depending POV) reviewer of one ASP.net
+ 182009 [ruby anthrop] } I've spent the past few weeks desperately looking for good comparisons
+ 182146 [raims dot.co] Take a look at the posts of this blog - http://www.softiesonrails.com/
threads.html
top