193553-413094

193398-202321 subjects 193722-306298

Question on GC
193553 [madan.manoha] Does Ruby's GC treat a class variable (@@x) as 'global scope' or as
+ 193557 [matz@ru y- a] Global, in a sense you use.
| 193560 [madan.manoha] Thanks, Matz.
+ 193590 [nobu@ru y- a] Note that procObj also refers t, so this object will never get
  193610 [madan.manoha] The procObj does not refer to object 't'. procObj is attached as a
  193615 [drbrain@se m] Even the you don't refer to t by name, procObj's environment knows

Undefined method error
193558 [patrick@pk p] Still trying to get my head wrapped around the concepts regarding
193563 [shortcutter@] PostError is a method of MyErrorLogger::ErrorLogger, i.e. of the class
193580 [patrick@pk p] I understood that when an instance of a Method::Class has been created,
193584 [shortcutter@] It seems so.  What is a "Method::Class" in your terminology?
193594 [patrick@pk p] Oops, I meant "Module::Class". As for your reply, thanks! I need some

problems with irb? str = 'a\b\c' seems impossible
193568 [krekna@gm il] Can someone help me out with this, I can't put the string 'a\b\c' in
+ 193570 [cdc@cy he s.] ot.
+ 193571 [dblack@wo bl] I've noticed that too.  For some reason, '\c' seems to produce
| 193573 [mike@st k. a] Idle speculation here.  It looks like something is getting confused,
| 193581 [krekna@gm il] yes, \c seems to mean something itself, some more examples of strange
+ 193576 [shortcutter@] => "a\\b\\c"

Dreamhost having Ruby issues
193591 [ror@gm il co] Just an alert to Dreamhost users. I saw that a few of my Rails sites
+ 193599 [drbrain@se m] The best way to get this solved is to contact dreamhost's support
| 193603 [ror@gm il co] Already have contacted them. Just giving a heads up to anyone else who's
| 193632 [james_b@ne r] I'm not trying to be snarky, but are you aware that posting through
+ 193639 [dave@bu t. d] Thanks for posting this, Doug -- a handy heads-up. I noticed IRB wasn't
  194490 [Eric.Armstro] My thanks, as well. I use DreamHost, and haven't got

[OT]  Re: Ticked Off   piracy
193607 [gsc@om ga og] Quoting US Copyright Law does not impress everyone.

ri stuffs (Was: Where does one find documentation for Text::Format?)
193614 [drbrain@se m] A class' functionality may not exist all in one file or may be in
193622 [jmg3000@gm i] Ah. Right. Thank you.

Why this code returns error?
193617 [nospam@ho ma] Why this line gives me error?
193619 [daniel.schie] It's because the precedence of curly bracket blocks ( {} ) and do/end
193620 [nospam@ho ma] Thank you Daniel.
193630 [daniel.schie] No problem at all :)

Can't find eruby in windows installation
193618 [nospam@ho ma] I installed ruby on my XP machine, but I cannot find eruby. Is eruby
194386 [halostatue@g] begin

Why won't this "if" clause work properly?
193623 [pbailey@bn .] I'm going nuts with this tiny script. I'm basically just doing a page
193638 [pit@ca it in] If you use String#scan with a block, the method returns the original
193644 [pbailey@bn .] Thank you very, Pit. I believe the "do end" bit was in there from a

Where do I download DBI?
193624 [nospam@ho ma] Where can I download the DBI?
193625 [alder.green@] -Alder

Parsing XML into a complete domain object
193628 [bcowdery@gm ] Recently at work we've decided to attempt to build a basic XML driven
+ 193645 [desmarm@gm i] Have you given any thought to using YAML instead of  XML?
| 193655 [james_b@ne r] Have you looked at REXML's pull parser?
| 193661 [desmarm@gm i] YAML buys you a small amount of language independence.  I've chosen YAML
| 193662 [james_b@ne r] Perhaps, though more and more I run into YAML files with custom
| 193711 [james@gr yp ] Right, and if it's something I need to hand edit, I find my brain can
+ 193666 [rob@cs au kl] If you just want to walk the tree from any entry point, through all
+ 193671 [rossrt@ro co] Looks like an ideal DigestR[1] opportunity, if you're able to get
| 193678 [rossrt@ro co] - d.add_link('/script/test-case/test-step/test') { |ts, t| ts.checks << t }
+ 194314 [henrik.marte] module XmlUtil

GDiff
193636 [leslieviljoe] I recently ported Brian Schroeder's great GDiff
193673 [leslieviljoe] Gonzalo sent me a ported suffix array and the tests and it all works
193674 [leslieviljoe] Working better now... the patch files are very similar...
193675 [leslieviljoe] require "gdiff"

need help installing sqlite3 on windows
193641 [ghalsey@ya o] Downloaded sqlite3.dll and placed in c:\windows\system32 (I also tried
193642 [dave@bu t. d] A successful installation.
193657 [ghalsey@ya o] Looking at the post I noticed the code should have the first two letters

Confused about Ruby database interfaces available on rubyfor
193643 [nospam@ho ma] I am trying use Ruby to access to our Oracle database on our windows XP
193686 [dido.sevilla] Yes.  In order to get Ruby's DBI to work with Oracle, you need to

Cool: nil is a class that can have methods
193647 [rob@cs au kl] Excuse a newbee's enthusiasm, but this is really cool. It makes some
193648 [dblack@wo bl] Do be careful, though.  Remember that the changes you make to Object
+ 193649 [rosejn@gm il] This is what namespace selectors would help fix right?  Was there ever a
| 193664 [ mfp@ac .o g] It's not in 1.9 yet. AFAIK this is the last thing we heard about selector
+ 193650 [rob@cs au kl] Good point.
| 193652 [sroberts@un ] The temptation to change the core classes to work a little more like you
| 193658 [rob@cs au kl] Probably total sacrilege, but I was using this to have "nil" as a
+ 193654 [sroberts@un ] Whats the current wisdom on how to do this more nicely?

ruby/mysql cygwin
193659 [jdale58@ya o] I have recently converted to cygwin.  I have mysql (the windows binary)
193681 [Nuralanur@ao] ...

Detecting console dimensions
193660 [sy1234@gm il] Is there a simple way for a ruby script to know the size of the space
+ 193672 [sy1234@gm il] Yeah, I figured this.. it's almost certainly xterm that's generating
| 193680 [leslieviljoe] Also remember that screen dimensions can change while the program is
+ 193719 [jesusrubsyou] Any particular reason not to use curses?  Because it would get you what
  193772 [sy1234@gm il] Yes, there are a few reasons why I'm gun-shy.
  193804 [jesusrubsyou] You're right that it's not everywhere.  In particular, Debian (and

[ANN] srcforge at rubyforge
193663 [ggarra@ad an] I've put together a simple ruby script for downloading the latest file

[ANN] Brite - A ruby compiler for the .NET platform
193669 [pascal_hurni] I discovered ruby some month ago and I liked it in a bunch of minutes.
193670 [florgro@gm i] This looks very promising and I hope it will continue to be developed.

User Account Setup - Multiple OS's
193676 [paul.kraus@g] ...
+ 193811 [paul.kraus@g] ...
| 194044 [strobel@se u] Ruby is very well suited for this, if that is the only answer to you
| 194118 [paul.kraus@g] ...
| 194119 [rubytalk@ea ] ...
| 194135 [paul.kraus@g] ...
| + 194141 [rmagick@gm i] The standard reference for Ruby is the "Pickaxe" book, i.e. Programming
| + 194142 [guslist@fr e] I would add http://www.rubyforge.net
+ 193813 [leavengood@g] See Win32API or other windows related libraries.

[ANN] IRC channel for "Ruby for Rails"
193677 [dblack@wo bl] I've created and registered an IRC channel, #rubyforrails on

[OT] Implementing Enumerable#inject in Io
193679 [daniel.schie] This has nothing to do with Ruby -- I thought there might just be some
193682 [daniel.schie] Found out what the problem was -- the 'call' message to 'blk' messed
193693 [binary42@gm ] I've written this one quite a few times and ways in Io. The way you
193697 [daniel.schie] Thanks for the post! Yeah, I still think Io's a bit immature, but it's

Re: Ruby IDE
193685 [huw@da kn on] We are currently developing an IDE ("Ruby In Steel") for Visual Studio
195428 [rob.02004@gm] Huw, I'm curious, was your site name inspired by "Sapphire and Steel"

foo= methods don't get called inside instance scope without explicit receiver
193689 [alder.green@] irb(main):001:0> class Bar; def foo=(val); puts "Bar#foo= called!"; end; end
193690 [shortcutter@] Yes.  foo= is a local variable assignment. See
193691 [alder.green@] Yup. Seems like assignments to local variable take foo precedence over
193753 [bpettichord@] I'm not sure of your specific situation, but i've found this to help in
193757 [alder.green@] Interesting code. Unfortunately, it's not relevant to the issue I raised.
193768 [shortcutter@] A nice variant of 2 makes use of the fact that a method can receive a

I call Ducktype Violation on #to_proc! :)
193692 [transfire@gm] Trying to be just ducky...
+ 193700 [daniel.schie] Personally, I don't mind that objects given as blocks must define a
| 193705 [transfire@gm] Right. It's not the #to_proc I'm worried about. I completely agree with
| 193707 [daniel.schie] Good to know :)
| 193709 [dave@bu t. d] def to_proc
| + 193725 [transfire@gm] Yea, and I ended up with
| + 193754 [daniel.schie] Yes, that works (thanks!), but I think it's against Ruby spirit to
|   + 193762 [rossrt@ro co] I guess it's probably the way it is because call isn't involved when a
|   | 193766 [shortcutter@] That would be my guess also. Trans, please note that there is an
|   + 193781 [dave@bu t. d] => nil
|   | + 193793 [daniel.schie] But is that because of #to_proc the the method object, or is Ruby
|   | + 193794 [daniel.schie] def cached_proc(&block)
|   + 193985 [drbrain@se m] #to_ary requires you to return an Array.
|     + 194049 [transfire@gm] Fair enough. But then where''s my #to_p method ;)
|     | 194066 [drbrain@se m] Huh?  What are you responding to?
|     | 194145 [transfire@gm] There were two use cases given in this thread. Whether there was a way
|     | 194149 [daniel.schie] Something like this, perhaps? :P
|     | 194172 [transfire@gm] Yep. Exaclty.
|     + 194050 [transfire@gm] Fair enough. But then where''s my #to_p method ;)
+ 193982 [drbrain@se m] There's a convention where to_XXX requires the receiver to return an

[ANN] Mongrel 0.3.13 Update -- Code Review, Code Coverage
193694 [zedshaw@ze s] Hey Folks,
193699 [ppalmer@na i] I'm up for contributing documentation - just let me know how :)
193702 [zedshaw@ze s] Shoot me an e-mail off-list with what you'd be interested in working on.
193704 [ppalmer@na i] I've been working on getting apache 2.2 to do clustering and load

Drb and PStore behaviour
193695 [jvalencia@lo] result = database.find do |record|
+ 193698 [jcribbs@ne p] The problem is that you can't pass a block from the client to the server
| 193703 [jvalencia@lo] Oh, so the answer to my problem will be to rewrite using sockets and
+ 193728 [vjoel@pa h. ] You don't need this, since you are using yield.
  193741 [jvalencia@lo] Interesting point, i'll try it.

Matlab and Ruby ?
193696 [Nuralanur@ao] ...

[ANN] Mongrel 0.3.13 Bugs Update -- Change UID/GID Patch
193706 [zedshaw@ze s] Just a quick announce telling people to update the pre-release again.

sysread changes behavior in the presence of threads?
193708 [garbagecat10] ...
193712 [billk@ct .c ] Regards,
193714 [garbagecat10] ...
193716 [billk@ct .c ] Yeah.  I didn't have a specific need to check for EAGAIN at the
193717 [garbagecat10] ...
193724 [akr@m1 n. rg] A workaround is Thread.exclusive { sd.sysread(4096) }.
193732 [garbagecat10] ...
+ 193739 [ankarp1@gm i] I am not sure Tanaka's explanation is quite satisfactory. If you change
| 193743 [garbagecat10] ...
+ 193744 [billk@ct .c ] That would be awesome!    :)
  193745 [garbagecat10] ...
  193747 [billk@ct .c ] The relevant applications are multi-platform: OS X; Linux; and yes,
  193764 [garbagecat10] ...
  193765 [shortcutter@] But this does not bite you if you use Ruby's condition variables as
  193770 [garbagecat10] I'm working on the eventmachine library (see rubyforge). The goal is
  193823 [sroberts@un ] I understand the argument in general, but since ruby's "threads" aren't
  193850 [garbagecat10] ...
  193859 [shortcutter@] I can see why they hate sticking to that rule.  Basically you disallow
  193869 [garbagecat10] ...
  + 193937 [vjoel@pa h. ] I like this thread, but I'll nudge it in the ruby direction...
  | 193943 [garbagecat10] As a very rough rule of thumb, when I design a thread-hot system, I
  + 194094 [shortcutter@] No, it will change with regard to timing but not with regard to

Ruby Invoicing System?
193710 [leavengood@g] I know we have quite a few consultants in the Ruby world. Does anyone
+ 193713 [james@gr yp ] I'm pretty sure this isn't what you wanted, but are you aware of
+ 193715 [ppalmer@na i] I'm currently working on a project called Miracle Accounts
| 193877 [krisleech@in] Would be up for doing some beta testing...
| 193904 [ppalmer@na i] I will be hosting it like Basecamp. Several people have asked about
| 193910 [james_b@ne r] Please consider building an alternative to Basecamp.  I know a number of
| 193949 [ppalmer@na i] What sort of features etc did you have in mind? Miracle will mainly be
+ 193816 [pollak@gm il] ...
| 193818 [leavengood@g] Cool David, I'll check it out.
+ 193824 [hannes.wyss@] here at ywesee we're using two tools that fit your description,

rubynuby - confused by method name "inject"
193718 [jp@je fp it ] Can anybody explain to me how the Enumberable#inject method is
+ 193720 [logancapaldo] Would you prefer foldl? :-p
+ 193721 [dblack@wo bl] I have just about the mental energy for collect right now, so I'll
+ 193723 [dave@bu t. d] ["foo", "bar"].inject(5) {|total, word| total + word.length } #=> 11
| 193734 [jp@je fp it ] I agree, "map" makes a lot more sense than "collect".  I'm going to just
| + 193736 [jp@je fp it ] BTW, I think "combine" makes the most sense to me for a synonym of
| | 193738 [logancapaldo] each_with_state
| | 193740 [abrahamson.j] In Common Lisp there is the reduce function. I think that name
| | 193746 [jbresnik@gm ] yea look into the difference between functional / imperative
| + 193737 [logancapaldo] I think you mean Sigma. And I believe when you don't refer to it as
| | 194384 [aledonne.lis] The big Sigma is often called the n-ary sum operator, and there's a
| | 194451 [jesusrubsyou] Shockingly [to myself], I actually understand that, but I think it
| + 193750 [vjoel@pa h. ] You can think of it as "accumulate", since there is an "accumulator",
| + 193761 [dblack@wo bl] It would be bad form, in my opinion.  It's good to discuss what you
| + 193790 [jim@we ri hh] How I remember:  Inject takes a binary operation (e.g. +) and injects it
|   + 193806 [miken700@ya ] I think about this in a slightly different way, which helps me
|   + 193832 [leslieviljoe] Awesome! That really helps me!
|     193835 [spamwhite@co] Seems like "sum" would have been a better name.
|     + 193837 [leslieviljoe] Or an alias inject_operator perhaps...
|     | 193841 [leslieviljoe] ..though the other uses of inject defy "inject_operator"...
|     | + 193844 [farrel.lifso] longest_sample = data.max{|a,b| a.length <=> b.length}
|     | | 193847 [leslieviljoe] Yes precisely! That's what I like about Ruby, everyone's a smartypants!
|     | + 193848 [has.sox@gm i] ...
|     | | 193861 [shortcutter@] Exactly the same - only values are different.
|     | + 193873 [simon.kroege] Well, Enumerable#max is the way to go here, but inject isn't
|     |   194436 [chneukirchen] longest = data.inject{|max, this| [this.length, max.length].max }
|     |   194439 [pit@ca it in] I know why I prefer Ruby ;-)
|     |   194457 [syarus@gm il] p data.inject(0){|max, this| [this.length, max].max }
|     |   194479 [jp@je fp it ] I must say I'm surprised that my tired old thread is still kicking
|     |   241248 [jenda@cp n. ] The thread is still kicking exactly because names are important. And
|     |   + 241249 [rimantas@gm ] Don't you confuse "stupid" with "the ones I am not used to"?
|     |   + 241250 [robert.dober] you are polluting this ML
|     |   + 241308 [lukfugl@gm i] I have to ask, from the apparent bitterness and outright hostility of
|     + 193838 [shortcutter@] Definitively not because you can do far more than calculating sums with inject.
|     + 193843 [dblack@wo bl] Only in the case where you're calculating a sum :-)  Inject does the
|     + 193865 [jim@we ri hh] Unless the operator isn't + ...
+ 193735 [garbagecat10] ...
+ 193751 [rubytalk@ea ] ...
+ 193756 [daniel.schie] addresses = contacts.collect{|contact| contact.address}
+ 193763 [me@yo rh me ] I agree!!!!
| + 193773 [jp@je fp it ] Following David's suggestion, I think I'll go ahead and use it, but
| | 193778 [cyclists@nc ] No, Matz has said that he wanted to create a language that could be
| | 193785 [dblack@wo bl] * discourage use of symbol variables (e.g. $/, etc.) in manual
| + 193784 [shortcutter@] Granted that it may take some time to understand it and to recognize
|   193789 [Gennady.Byst] Ruby's inject() lets you do amazing things very expressively. I first
+ 413079 [lists@ru y- ] Since this old discussion is one of the top ranking pages when you Google 'ruby inject' or 'inject method', it's probably worth adding that since version 1.8.7 Ruby has had the #reduce method, which is an alias of #inject.
| + 413080 [groups@in ox] I find #reduce much better than #inject, but #fold is my preference as
| + 413081 [stu@ru yp og] Fold is actually an older than functional programming concept for recursive
| | + 413083 [groups@in ox] This statement amuses me, because Alan Kay was specifically inspired by
| | | 413090 [stu@ru yp og] @Avdi
| | + 413085 [lists@ru y- ] Hey, if the protein folding metaphor works for you, great! Strike up
| |   413087 [rubytalk2dav] It sort of does, if you think of it as *injecting* the method or
| |   413088 [groups@in ox] What I've learned after many conversations about #inject and its aliases is
| |   413089 [rubytalk2dav] Agreed.  I didn't grok why other languages called it "fold" until
| |   413091 [lists@ru y- ] Look no further than this very thread! See Jim Weirich's first comment.
| |   413094 [stu@ru yp og] The problem: Write a function foo that takes a number n and returns a
| + 413084 [andrew@av t.] Something about "map" + "fold" is pleasantly humorous.
|   413086 [lists@ru y- ] Now that you point that out, indeed it is! There you go, another fine
+ 413092 [lists@ru y- ] Wooosh! (The sound of Stu's comment flying over my head.) I'll have to
threads.html
top