176841-241397 subjects 177307-179621

[QUIZ.SUMMARY] Grid Folding (#63)
177067 [matthew.moss] I love mathematics. I love to see problems explored, patterns emerge,
+ 177124 [adudzik@gm i] ...
| 177140 [bdolinar@xm ] When I was testing my solution for check_fold I found that it was
+ 177125 [james@gr yp ] Are there pills for that?!

String.unpack endianess issue?
177068 [matthew.moss] => [0, 0, 0, 6]
177069 [vjoel@pa h. ] irb(main):001:0> a = [0, 0, 0, 6]
177115 [matthew.moss] Ah, thanks.  I noticed the "V" as I searched for "endian" in the docs,

[ANN] Mongrel HTTP Server 0.1.2 (With Camping Tepee Sample)
177070 [zedshaw@ze s] == Mongrel 0.1.2
177092 [se@di it le ] $ ab -n 10000
177093 [zedshaw@ze s] That's cool.  Seems to not crash on cygwin.  So far OSX is the odd

Design problems (beginner)
177072 [mjudge@su ve] A. Still don't understand object-oriented programming
177074 [gregory.t.br] Can you give a bit more information as to what your program actually does?
+ 177076 [gregory.t.br] s/Answers/Answer
+ 177190 [mjudge@su ve] Thanks for your input, Gregory.

Compiling 1.8.4 with djgpp
177077 [zacharooni@c] ...

[Marginally OT] Notes from the First NoVA Ruby Users Group
177080 [pabs@pa lo r] I've compiled and posted my notes from last night's Northern Virginia

Class is object? :very_sleepy
177082 [alex.combas@] Was just thinking today, earlier, but at the moment
+ 177090 [rossrt@ro co] In your terms I'd probably say that Classes are Objects that represent a
+ 177104 [gwtmp01@ma .] Just expand your model a bit.  Think of classes as factories that
+ 177121 [eeklund@gm i] A better metaphor for a class is - a class!
+ 177128 [dblack@wo bl] I agree with Ross that class variables are best avoided, though one
+ 177132 [pbrannan@at ] Take a look at the output from "ri Class" some time (or see
+ 177136 [lthiryidontw] Objects generally don't like to hold their methods themselves, that's
  177138 [dblack@wo bl] (Singleton class was the last term I heard Matz say he was using :-)

Valid XML PIs for ERB
177086 [leoboiko@gm ] suggested by lots of people[1]? Is there any good reason we're stuck
177221 [henrik.marte] than compliant with SGML. The people who built the first web servers
177232 [james_b@ne r] Do you have any references for this?  I'm pretty sure Tim Berners-Lee,
177249 [henrik.marte] Tim Berners-Lee certainly knew about SGML. The original specification
177258 [james_b@ne r] be believed).  I'm doubtful that it had anything to do with processing

Hash with array as value type
177088 [ruby-forum.c] I would like to store arrays in a hash, indexed by a string key.  I
+ 177100 [bob.news@gm ] Yes.  You ran into the typical Hash pitfal: the default value is the one
| + 177103 [ruby-forum.c] Thanks a lot :-).  I had actually already tried the block form, but in a
| + 177118 [martindemell] I find it instructive to think of the default as a #key_missing method,
+ 177101 [rforum@gm il] This makes a new Hash with the default value being the Array reference
| 177106 [rforum@gm il] GAH, that should be
+ 177108 [gwtmp01@ma .] It is a bit confusing.

Call for Participants: Mchen (Munich, Germany) Ruby User Group
177089 [urban@be to ] Hej!

Re: [ruby-talk] Class is object? :very_sleepy
177091 [prins@an nz ] consider a class as a "blueprint object"... problem solved.

Maryland RUG?
177099 [ruby@an hr p] So I went to the NoVA RUG meeting last night. Rich gave an excellent

wxruby 2
177112 [rcs@bg ar .n] Does anyone know the status of wxruby2, when something will be out (beta
177114 [mail@ko fe n] The sub-project of wxruby formerly known as wxruby-swig has been renamed

subprocess on Windows
177113 [jeff@sc wa c] Whenever my Windows rubyw script launches a subprocess, a command window
+ 177122 [bob.news@gm ] One thing is you can change the linke to open the window minimized.  And I
| 177123 [HQuiroz@en .] I don't know much about Windows any more but I do remember the 'start' command. I think you can launch apps and specify windows attributes on the command line.
+ 177130 [desmarm@gm i] You may want Kernel.exec instead of Kernel.system.  See ri Kernel.exec
+ 177164 [wilsonb@gm i] `start /B gvim #{logfile}`

[QUIZ][SOLUTION] Grid Folding (#63)
177126 [email55555@g] I wonder for 4x4 the total solution is 16 * 4! = 384
177134 [matthew.moss] Actually, you are right, that my math was wrong. (All this talk about

RubyForge slowness
177135 [tom@in oe he] RubyForge is extremely slow right now due to mirror server problems.
177143 [pfharlock@ya] Thanks for posting this message.  I was wondering why I was having
177171 [tom@in oe he] We've shut down the main RubyForge site for a bit until we can get a new
177185 [tom@in oe he] Mirror has been restored, RubyForge is back in operation.  As always,

Re: Memoization?
177139 [groups@gr nd] Er, um, huh?
+ 177142 [mental@ry ia] -mental
| 177148 [groups@gr nd] I didn't think it was. That's why the comment and the question are in
| 177223 [henryj@pa ad] Ruby Hashes, Blocks & Memoization
| 177261 [alex.combas@] I would really like to learn more about memoization
| + 177262 [james_b@ne r] Do you know this to be an Ubuntu issue, or just a problem you recently
| + 177263 [james@gr yp ] You bet.  It's a single file.  Just download the source from
|   177266 [alex.combas@] Thanks James!
|   + 177268 [james_b@ne r] Basically, the arguments to the target method are used as a hash key
|   | 177296 [james@gr yp ] It's actually always in memory with the current implementation, and
|   | 177298 [james_b@ne r] Ah, I missed that. Thanks.
|   + 177297 [james@gr yp ] Set a constant to the module version, so user code can check it as
+ 177162 [john.carter@] I sense deep confuzzlement so let's take that a lot slower.
  177169 [groups@gr nd] Ha ha. Except that if everybody in my country had a
  + 177182 [john.carter@] Exactly. Which is why it's a lousy example, except in the sense it clearly
  + 177194 [logancapaldo] Often memoization is used to speed up functions that are

disconnect   net/imap -- need to talk with developer
177144 [r.fulton@au ] I guess my real question is "who looks after the IMAP module?".

Subselecting hash back into hash (oneliner?)
177150 [jonbaer@jo b] Going through pick-axe and was just wondering if there was a one
+ 177151 [james@gr yp ] Like this?
| 177181 [jonbaer@jo b] Nice .. well that works :-) but in the constructor can you tell me
| + 177183 [ezmobius@gm ] The "*" is sometimes called the "splat" operator. If you use the Hash
| + 177186 [james@gr yp ] I see you've already got this answer.
|   177217 [pit@ca it in] Regards,
+ 177154 [desmarm@gm i] h2 = Hash.new

Module Eval Syntax
177153 [ng@jo nw on ] => nil
177176 [rossrt@ro co] This isn't a direct answer to John's question, but more an expansion of

painfully slow Ruby download
177155 [bill.roberts] I'm trying to download ruby182-15.exe from
177156 [bill.roberts] Oops, just seen the post from Tom further down the page - thanks for the

thread local variables
177157 [r.fulton@au ] file.each{|line|

Error calling a SOAP service from within a Rails controller
177159 [deanholdren@] **********************************************************************************************
177160 [anthony.eliz] When you're playing with SOAP in Rails, I think you want to use
177170 [deanholdren@] thanks, I've tried using ActionWebService::Client::SOAP, but I get the
177260 [deanholdren@] well it turns out I was passing bad parameters to the service. weird

Need a ruby math genius - potential ruby bug.
177163 [tgate@my ub ] Please forgive the longish post, I've tried to boil down a bug to its
+ 177168 [tgate@my ub ] I should have included the results...
| 177173 [adudzik@gm i] ...
+ 177174 [matthew.moss] I think (offhand, didn't actually run your code) your problem is not
  177177 [tgate@my ub ] Brilliant!  Thankyou Very much.  I completely forgot about the variable

logging with rake
177165 [neoneye@gm i] Howto capture stdout + stderr from jobs invoked with rake?
+ 177198 [logancapaldo] Well first, have you tried using IO redirection in a shell script and
+ 177225 [rubikitch@ru] cd /path/to/backup; rake 2>&1 >> /log/handybackup.log
| + 177336 [neoneye@gm i] Aha.. I did'nt knew redirection was possible.. very nice.
| | 177342 [neoneye@gm i] When invoking `cmd 2> log2 >> log1` within ruby..
| | 177344 [halostatue@g] 2>&1 and a few other Unix redirectionisms will work on Windows with
| + 177554 [guslist@fr e] The order is significant. To append both stdout and stderr to the log
+ 178686 [neoneye@gm i] On OpenBSD 3.7 the stdout is not syncronized.

Code that will returns dates from a recurrence rule?
177166 [sajeem@ho ma] Given a recurrence rule, for example iCal RRULE (see

Textilize and Markdown and URLs
177178 [mannl@gm .c ] Neither Textilize nor Markdown seem to turn plain old URLs into links.
177184 [ng@jo nw on ] I noticed this today while reading through the docs on helper methods.
177188 [james_b@ne r] Install Rails just to get RedCloth or BlueCloth to link some text?
177220 [mannl@gm .c ] I'm actually using Rails. I just asked this here because I thought
177253 [gboyer@gm il] ...

WIN32OLE InternetExplorer SaveAs command
177187 [derek_haskin] I've been trying to use the WIL32OLE to call the

Pass References To Methods As Arguments?
177197 [wegzumir@gm ] ...
+ 177208 [halostatue@g] There is no way to do that directly in Ruby.
| 177214 [wegzumir@gm ] Yes, my apologies for the example! I was actually trying to strip down
+ 177209 [drbrain@se m] def print_unix(line)
| 177213 [wegzumir@gm ] Cool, so there is a "&" prefix that's available for use like that. But
+ 177210 [vjoel@pa h. ] # first, using a proc
  177212 [wegzumir@gm ] Thanks for the reply! One of the things I had tried was using the

release notes?
177199 [ryantate@ry ] I must be a real dolt. I have been search around at
177200 [ryantate@ry ] Sorry, found it. It's in the ChangeLog file in the source directory.

REXML and XPath
177204 [r.mark.volkm] The documentation for REXML says is has full XPath 1.0 support.
177205 [r.mark.volkm] Minor syntax correction here,
177255 [adam@th re l] count = XPath.match(doc, '//book').length
177286 [r.mark.volkm] I found out that it does support what I wanted which is XPath

Ruby user group in/near Wilmington, DE? Interest in starting one?
177216 [obiefernande] In early February, me and several other ThoughtWorkers* are starting a

Ruby Homepage Redesign
177224 [doug.bromley] I was throwing myself about the net and came across a Ruby homepage
177230 [james_b@ne r] That was discussed on ruby-talk within the past few days, if you want to

[QUIZ] Port a Library (#64)
177229 [james@gr yp ] 1.  Please do not post any solutions or spoiler discussion for this quiz until
+ 177347 [james@gr yp ] I just know people aren't going to believe me on this, so here's my
| + 177566 [james@gr yp ] I just noticed that everyone provided sample usage (just as I asked
| + 177589 [james@gr yp ] I haven't had time to document it yet, but here is the other port of
+ 177468 [matthew.moss] There aren't any particular libraries I've used anytime recently...
+ 177618 [adam.shelly@] I went browsing in CPAN to find something interesting, and came up

The Seattle Brigade Chats with Bruce Eckel
177233 [james_b@ne r] Quite impressive.
+ 177731 [bob.news@gm ] Definitely.  Although I have to admit that I find the selection of
| + 177878 [cribbsj@oa w] I thought the same thing when I read his comments.  To me, blocks are
| + 177936 [james@gr yp ] Yeah, some of the examples bugged me too, like Array#dump (which is
| | 178097 [drbrain@se m] Its my bad, I filled his brain up with too much standard library and
| + 178093 [drbrain@se m] Bruce and I spent a ton of time on blocks including syntax and use.
+ 177741 [sigzero@gm i] In defense of Bruce, he was not vehemently against Ruby. He just wanted

[ANN] Net::SSH 1.0.7
177235 [jamis@37 ig ] There have been a few unannounced releases, culminating in 1.0.7. The
177239 [tsumeruby@ts] Yay!

corrupted double-linked list (Ruby 1.8.4, FC 4)
177240 [fishkei@gm i] ...
177305 [oliver.andri] I am using the same setup, and I don't get this error message. Can you
177324 [fishkei@gm i] ...

Find.find or Dir[**/*] with spaces in filenames?
177242 [ezmobius@gm ] Friends-
177244 [Daniel.Berge] This looks ok to me.  File.find yields files and directories with spaces
177245 [ezmobius@gm ] Daniel-

class_eval and braces
177243 [lists@be tr ] as I notice there is a difference between `class_eval' called
177252 [ruby-ml@ma i] Closures again. The @@m in the block is the @@m of M,

Files and variables (noob alert)
177246 [info@ja eo a] Chaps,
177254 [wilsonb@gm i] irb(main):010:0> File.exist? 'helloworld.rb'
+ 177256 [info@ja eo a] Thanks!
+ 177257 [info@ja eo a] irb(main):006:0> x = 'l2.txt' if File.exist? 'l2.txt'

csv help
177248 [cbowmanschoo] Can anyone point me to a good tutorial on csv files and ruby.  I've read
177250 [james@gr yp ] array_of_csv_rows = CSV.read("my_file.csv")

Incorporating gem documentation into ri
177251 [lists@so rc ] Guys,
177259 [james_b@ne r] I believe you can run rdoc -r ... over the gem's source code, and it
177270 [Dave@Pr gP o] ...
177271 [james_b@ne r] Could be.
177290 [lists@so rc ] Thanks guys. When I try doing this (), it goes on for awhile and then
177386 [drbrain@se m] RDoc looks for RDoc in .rb files.  Since that file is not a ruby
177444 [lists@so rc ] Hmmm...you're right...this doesn't look like a true Ruby file, although
177451 [lists@so rc ] Success!

Ruby IPC
177264 [marcantonios] ...
177385 [drbrain@se m] Usually IPC in Ruby is performed via high-level constructs rather
177723 [ptkwt@ar cn ] What if you need to transfer data between two different processes
177941 [logancapaldo] I would suggest man mmap. But to answer your question, it allows for

working with file types and directories
177265 [info@ja eo a] This line shows all the files in the current dir.
+ 177267 [vjoel@pa h. ] Dir.foreach(".") {|x| puts File.ftype x }
| 177280 [info@ja eo a] Thanks for that reply. I guess that the only way to check that files
| 177282 [mail@ko fe n] Returns true if file is of zero length.
| 177283 [info@ja eo a] Yesss!!! Thanks :)
+ 177291 [info@ja eo a] OK, next step...
  + 177302 [vjoel@pa h. ] Comparing the return value with the string "true" won't work because you
  + 177330 [kjana@dm la ] Dir.foreach returns nil, nil != "true" so the condition can not be
    177337 [info@ja eo a] Thanks for that reply...

listing Object.methods
177273 [alex.combas@] Tonight I was thinking that it would be handy to
177274 [ruby-ml@ma i] class << foo; self; end.instance_methods false
177295 [james@gr yp ] self.class.instance_methods(false)
177310 [ruby-ml@ma i] Yep, otherwise singleton methods will not be included.

Having trouble embedding ruby.
177275 [scoopr@ik .f] - A little wrapper executable which basicly just links to
177281 [matt.mower@g] I'm doing very similar work with an XCode project embedding Ruby 1.8.4
177303 [scoopr@ik .f] Yes.
177312 [ruby-ml@ma i] Can you get anything out of a debugger, either from the process

Load vs Require
177276 [hugo.mag@gm ] Is there any difference between using Load and Require?
177277 [ruby-ml@ma i] #load always loads and interprets the file in question,

a = b = new
177284 [notmyprivate] I'm coming to ruby mainly from python background.
+ 177287 [fxn@ha hr f.] irb(main):001:0> a = b = Range.new(0, 9)
| 177289 [notmyprivate] Did just that. Should have done it twice I guess :)
+ 177288 [florgro@gm i] Actually, it won't.

Ruby source directories
177285 [r.mark.volkm] I know under the lib/ruby directory
177304 [M.B.Smillie@] site_ruby (named in convention with site_lisp and others) is a

Ruby Chaps in London
177292 [info@ja eo a] Are there any Ruby users in London? I've been to a python/ruby meet
+ 177299 [dblack@wo bl] and a meeting coming up on Feb. 7; see very recent email archives for
+ 177301 [matt.mower@g] At least one London rubyist here.
  177323 [glenn.ruby@g] ...

nil != []
177306 [notmyprivate] OK. Here's my second stupid question for today.
+ 177308 [SimonKroeger] how on earth can -1 be true?
+ 177309 [M.B.Smillie@] 0 *the integer* is only false by convention, and it's a convention
  + 177313 [notmyprivate] Well I do understand that it's a convention. They same is true for a
  | + 177316 [mental@ry ia] Among other things, it makes things like ||= much more useful.
  | + 177317 [ttt@re ou ce] Well... 0 evaluating to false is a convention used mainly in the C/C++
  | + 177321 [M.B.Smillie@] Computer languages are not cars, nor are all conventions equal.  For
  | + 177322 [stefan.walk@] When you get used to it, it's quite handy. Some methods return integers,
  |   + 177335 [notmyprivate] yeah. that makes sense.
  |   | 177359 [checketts@gm] ...
  |   + 177766 [amrangaye@gm] One example of this that tripped me up today is the regular expression
  + 177314 [julesjacobs@] I think 0 is false because of the way it is represented in low-level