45883-47186 subjects 46357-47516
passing arguments to extconf.rb
46130 [danny@fr uk ] To get a --debug flag accepted by extconf.rb, I've put this function in
46164 [nobu.nokada@] mkmf.rb has arg_config, but it doesn't change any global status
C++ & Excel & Win32Ole stranginess
46131 [alv@po zt .o] I'm trying to export data to excel from my C++ program, using
46439 [alv@po zt .o] Well, anybody else experiencing it? Maybe it's just my config which
mini-ANN: Magnetic Poetry via TkCanvas
46132 [phlip_cpp@ya] The TkCanvas widget rocks.
Subtle bug in Ruby/Tk? (Attn: Hidetoshi Nagai)
46133 [alwagner@tc ] In the sample code below, a subtle bug appears in either Ruby/Tk or Tk itself.
47579 [nagai@ai ky ] I'm very sorry, but I cannot maintain Ruby/Tk now.
+ 47583 [bilotta78@ho] Oh my. I hope it all goes well.
+ 47617 [kero@ch ll .] I am very sorry to hear that. Best of luck with your eye!
Should this work?
46136 [hal9000@hy e] Should multiple assignment work for the
+ 46146 [g_ogata@op u] Where do you propose we draw the line?
| 46156 [hal9000@hy e] Well, = and += are both considered
| + 46157 [matju@sy pa ] There's a problem: x,y,z=5 assumes 5,nil,nil instead of 5,5,5. So the
| | 46169 [hal9000@hy e] The nil case alone is reason enough to avoid it.
| + 46206 [gsinclair@so] [Discussion about += etc. snipped as it's deallt with by other posts.]
| + 46208 [decoux@mo lo] Have you used a P language ? :-)
| | 46215 [gsinclair@so] A "Perl" language? Yes. I'm not very proficient, because it seems
| | 46220 [decoux@mo lo] #collect is a method of Enumerable and call #each, for example
| + 46225 [matju@sy pa ] module Enumerable
| 46255 [gsinclair@so] Interesting, thanks.
+ 46185 [matz@ru y- a] It makes Ruby's syntax more complex. I don't have any other positive
+ 46193 [dblack@ca dl] It's too magic for my taste. I've always thought of
46200 [transami@tr ] x =+ n.
46267 [pabs@pa lo r] That's the syntax for the original C operators, actually. It was
Re: Dinner Tonight
46140 [pate@ey er a] At this point Daniel and Dave should be meeting in the lobby ... I think
Another Segmentation Fault problem
46142 [matt@te hn r] Ok, I'm very new at programming in Ruby, so maybe I missed something.
46184 [matz@ru y- a] ruby -v
46373 [vor_lord@ho ] It's a bit long, but here it is. I've never done any real software
46441 [matt@te hn r] Here's another bit of information. The program Segfaults much faster on
46502 [decoux@mo lo] You have a problem with the GC. Try to reduce your script to a few lines,
Let me hash my URIs
46147 [g_ogata@op u] Is there any reason why URI doesn't define #hash and #eql? so they're more
String -> Integer anomoly?
46151 [gsinclair@so] Why does "09".to_i return 9
46155 [hal9000@hy e] Arguably a feature. My understanding is that
46170 [kjana@dm la ] And then Integer() considers "09" as a representation of an octal
46229 [nobu.nokada@] Integer() isn't String specific. String#to_i in 1.7 takes
IO#read is slow
46154 [matju@sy pa ] I have a program that needs IO#read to be fast. I found out that IO#read
+ 46165 [nobu.nokada@] I know, see 1.7.
+ 46168 [matju@sy pa ] Never mind, it's using fread() in 1.7.
46177 [nobu.nokada@] 1.7.0 20010215. What's problem?
46199 [matju@sy pa ] Nothing. I had written all of my code for 1.6, really, and that's all. I
ZIGZAG - was Re: Assoc Class (Hash Pairs)
46161 [hal9000@hy e] OK, Massimiliano, now you've done it -- you've
46166 [list@NO PA c] Sounds like you'd been waiting for this. :-)
46167 [rich@in oe h] OK, this thread intrigued me to go look up ZigZag (which I had never
46174 [mikkelfj-ant] Sounds much like something I've been working on: The Cell Model.
Seeking the Coroutines for Ruby module
46175 [ljz@as as .c] I noticed the 'Coroutines for Ruby" module on RACC, but the link is stale,
46315 [brandt-ruby-] not sure how up-to-date this is, but i've got a copy at
FREE RUBY Books
46181 [ignaciolopez] Here in www.ignaciolopez.com you cand download all the ruby's books that you
46195 [robert.calco] Hmmm. Get some more download authorization... geocities doesn't seem to
Detecting when an instance variable is created/set
46192 [harryo@zi .c] Imagine we have a class like ...
46198 [transami@tr ] this has been touched on in some of the other threads. i brought it up
+ 46202 [djkea2@mu ca] Yes.
+ 46207 [harryo@zi .c] I guess what I'm trying to do is similar. Just as you're trying to catch
| + 46212 [transami@tr ] tru'nuff. that won't do it.
| + 46226 [list@NO PA c] Would it be enough for you to catch creation of instance variables in
| | + 46242 [harryo@zi .c] Unfortunately, for it to be useful to me, I'd specifically need it to work in
| | | 46245 [list@NO PA c] I don't know why it does not work in initialize (I assumed it would).
| | | + 46246 [harryo@zi .c] What is that super() calling? It seems to be the initialize() in Initializer,
| | | | + 46249 [dblack@ca dl] It is indeed the initialize in Initializer. super basically looks for
| | | | + 46258 [dblack@ca dl] My experience was the same as Massimiliano's: the #initialize didn't
| | | | + 46261 [list@NO PA c] Uhm, did it work for you? Could you post the code?
| | | + 46248 [dblack@ca dl] It's because initialize is a private method, so it doesn't appear in
| | + 46262 [gotoken@no w] Interesting! I tried another approach, a generic wrapping procedure.
| | 46338 [list@NO PA c] Now Harry, *that* is what a guru looks like. :-)
| + 46228 [dblack@ca dl] It's not that -- it's that there's no call to #a= in your code. @a=a
+ 46210 [harryo@zi .c] To give you a feel for what I want to do ...
| 46219 [pit@ca it in] if you cange the initialize method to
+ 46230 [kentda@st d.] How would you have assignment be a method? Should everyone redefine and
+ 46232 [qrczak@kn .o] It doesn't matter if it existed. @a=... just doesn't call a=().
| 46240 [harryo@zi .c] Good point! I figured there was some good reason that a=() wasn't being
+ 46234 [vjoel@PA H. ] It is pure by my standards: everything you can talk about in the ruby
#Re: String -> Integer anomoly?
46201 [gsinclair@so] Hmmm, strikes me as a violation of POLS.
+ 46203 [decoux@mo lo] ri Kernel#Integer
+ 46231 [kentda@st d.] Doesn't violate my PoLS atleast. Since Integer is a method of Kernel,
46252 [gsinclair@so] Interesting, because it surprised me when I found out that Integer was a
46259 [gsinclair@so] Ahh, I see, because it's not String-specific (thanks Nobu). Fair enough.
Verbose map (Re: Should this work?)
46217 [pit@ca it in] What about the following? It's not quite the same, but less verbose
46221 [dblack@ca dl] This is similar to (rejected) RCR 50. Which doesn't mean you
Implicit local variables for do...end blocks
46222 [gsinclair@so] In the thread "Should this work?", I proposed that :collect should be able
+ 46223 [decoux@mo lo] Well, you have in the ToDo
| 46224 [gsinclair@so] Hmmmm.... fair point. I rarely use Perlish features in Ruby; this just
+ 46277 [transami@tr ] you know, if your going to do this, then just go all the away and spare
Re: Unicode in Ruby?
46233 [ontologist_2] i do not want to bore you, but,
46256 [cjs@cy ic ne] The question is really about where you put the functionality. Should
Range oddness ?
46235 [rubytalk@bo ] I'm trying to implement simple range check for my admin module ...
+ 46236 [rubytalk@bo ] Well, my real problem is that I'm just heedless ... uid = "997", just
| 46237 [dblack@ca dl] (p (1..4)).type
+ 46239 [kentda@st d.] irb(main):001:0> p (1..4).type
does -v imply -w?
46238 [dblack@ca dl] In hacking away at an answer to Wejn's question about ranges,
46244 [dblack@ca dl] To answer my own question -- actually to report the answer provided by
Can I get a method object for a class method?
46250 [jim@fr ez .o] Is is possible to get a pointer to a class method as in the
+ 46251 [ned@bi e- om] class A
| 46253 [vjoel@PA H. ] class B < A
+ 46254 [nobu.nokada@] @func2 = self.class.method(:class_method)
Dynamic creation of classes and methods
46264 [taw@us rs so] I want to create classes and methods on fly.
46289 [decoux@mo lo] The constant Foo::Bar don't exist
46290 [taw@us rs so] I mean not just for one Bar, for any Bar.
46292 [decoux@mo lo] Use begin ... rescue
46305 [taw@us rs so] How can I find out which constant was missing ?
46307 [decoux@mo lo] I've not yet understood what you want to do. Can you give a concrete
46319 [taw@us rs so] I want to make a module that has functions and classes, just like any
46323 [decoux@mo lo] Except, I think, that ruby don't work like this :-)
Is there a bug in Matrix or Complex?
46265 [jim@fr ez .o] I found what I would call strange behavior with Matrix and Complex.
46270 [gsinclair@so] Folks,
+ 46271 [dblack@ca dl] It will still find the first '.' from the left, and then be
| + 46272 [jim@fr ez .o] /\w+$/
| | + 46273 [dblack@ca dl] (You forgot the \. :-) \w will cover the example given, though I was
| | + 46279 [gsinclair@so] Hmm.. that'll do! :) Thanks.
| | 46291 [jim@fr ez .o] Note that /\w+$/ will not match all extensions. E.g.,
| | 46293 [dblack@ca dl] I guess Gavin didn't need to include the '.' itself in the match (it
| | 46297 [mghall@en er] Now wouldn't all this be much simpler if we had a method
| | + 46320 [dblack@ca dl] Heavens -- object-oriented regular expressions are Ruby-esque enough
| | | 46321 [dblack@ca dl] sub(/are/, "aren't") # :-)
| | + 46322 [gsinclair@so] I agree there's room for some help from the File module here. We already
| + 46274 [nobu.nokada@] Or
+ 46285 [bfisseni@we ] I think this happens because of leftmost matching.
Regex to count syllables
46275 [phlip_cpp@ya] Just a tricky one. I need a function that counts syllables in English words
46278 [dido@im er u] I think that syllabication rules in words are not regular sets. I
46280 [phlip_cpp@ya] I'm sorry. I should have made clearer I was not asking for high-level
46286 [pit@ca it in] On 5 Aug 2002, at 12:58, Phlip asked about a regex suited to
how to get a socket's foreign ip address and port
46283 [barry_shultz] I'm using Ruby 1.6.6 (Andy's version) on Win NT 4 SP5 or 6, and Win XP.
46287 [barry_shultz] Forget that. I found a sol'n: ruby-talk:22493
ruby-dev summary 17714-17874
46296 [ttate@kt ja ] [ruby-dev:17840] Re: new mathn
46301 [pbrannan@at ] What code will produce this warning? I have never seen it.
+ 46304 [decoux@mo lo] pigeon% ruby -e 'a[b c]'
+ 46310 [michael_s_ca] I have; asked the author about it and got it fixed. Using 1.7.2 on
Gets command line params?
46306 [chrismo@cl b] Why does the gets call get my command-line text?
+ 46311 [chrismo@cl b] that's just the way it is. To make sure this doesn't happen, I need to
+ 46312 [decoux@mo lo] Kernel#gets is trying to read from the file given in ARGV, or from $stdin
Ruby/Perl: tight integration
46309 [bn@st an ed ] I'm planning to write a system consisting of a supervise process (which
+ 46318 [erik@so id o] It is faster, simpler and more flexible than SOAP and XML-RPC.
| 46390 [bn@st an ed ] Interesting; I'll have a closer look at this. Thanks!
+ 46330 [comp.lang.ru] - - Hmm, that's pretty hefty for any scripted server to deal with
46389 [bn@st an ed ] <bbense+comp.lang.ruby.Aug.email@example.com>
Newbie Question - Looking for resource
46313 [mike@sh es b] Im looking to delve into Ruby and would like to know if there is a
+ 46317 [camin@ci .r ] hth,
+ 46327 [charleshixsn] To my mind, the definitive book is still the pickax book (Programming
What Is the Rule to Declare Global Variables?
46324 [billtj@y. lu] Thanks for the assertion. After reading the code again, it is the same
+ 46325 [decoux@mo lo] You really don't want to post your source :-)
| 46329 [billtj@z. lu] When I protect the global variables, the problem has been solved. One
| 46392 [decoux@mo lo] No, these rules exist but I don't want to formalize them because I don't
+ 46332 [nobu.nokada@] All of your list protect the variables. Particularly, all what
RE: EW is unable to deliver
46326 [T.Hammond@el] Is there anything you can determine your end? I'm looking into this (Garry's
46328 [D.Lawrence@E] Tony,
A Ruby-C Interface Model
46331 [billtj@z. lu] Because I am dealing with entities which are created and destroyed so
46382 [matz@ru y- a] I see no danger in your model. It seems excellent.
46337 [hal9000@hy e] Here's an idea for you. I've worked on it a couple of days.
+ 46339 [transami@tr ] hal,
+ 46340 [dblack@ca dl] I've only just started to look at it, so this is sort of a preliminary
+ 46344 [dblack@ca dl] Just for fun, I've converted your tests to Test::Unit format. This is
| 46379 [hal9000@hy e] Neat. I need to get into that habit.
+ 46398 [hgs@dm .a .u] I think this is a specific case -- maybe you will want to do
46422 [hal9000@hy e] Interesting. I'd probably have both. I think 90%
More questions on automation from naïöe Windows user.
46341 [gehlker@fa t] I'm still working on making Ruby an automation language for the Mac and
+ 46345 [james@ja es ] The first is a stand-alone Ruby installation, while the latter is a loadable
| 46374 [gehlker@fa t] Aha! Thanks.
+ 46414 [chrismo@cl b] msdn.microsoft.com is where I usually go to find stuff. Sometimes it's hard
| + 46431 [gehlker@fa t] Hey James and Chris, thanks for the informative responses.
| + 46624 [masaki.suket] Sorry, I have noticed this problem, but not fixed yet.
| 47406 [masaki.suket] I forgot to announce. This problem has been fixed in 0.4.9 or later.
+ 46425 [gordonhartle] ~/data/rb/ole$ cat methods.rb
| 46429 [chrismo@cl b] Huh - this didn't work for me (well, it did, but I only got a partial list).
| 46463 [gordonhartle] ~/data/rb$ ruby --version
| 46522 [chrismo@cl b] I thought that might be the case after I looked further. Your ole_methods
+ 46623 [masaki.suket] If you have the latest version of Win32OLE, then sample/olegen.rb might
+ 46657 [chrismo@cl b] Wow! This is fantastic - don't know how I ever overlooked this before. You
+ 46662 [chrismo@cl b] Wow! This is fantastic - don't know how I ever overlooked this before. You
Mailing list problem?
46342 [gehlker@fa t] I noticed that Matz posted a nice informative reply to my posting about
block , yield and proc?
46346 [ADATE@kc rr ] I am experimenting with code using blocks, yield and proc in Ruby (1.7.2
46380 [matz@ru y- a] (a) block parameter |v| means takes everything in a single variable,
46413 [ADATE@kc rr ] Oh, OK ! Got it ..
Ruby Weekly News
46348 [Dave@Pr gm t] Ruby Weekly News: 08/05/2002
[GTK] Toolbar, Gdk::Pixmap::create_from_xpm_d
46349 [jtanzler@yl ] #v+
46385 [hgrosse@le s] Before creating a pixmap with default window settings, you must realize
New version of GMP bindings for Ruby
46350 [taw@us rs so] This version has better suport for floating points
Coding challenge (on Ruby Garden)
46356 [dblack@ca dl] Coding Challenge 0002 (my numbering scheme :-) has been posted to
+ 46358 [transami@tr ] what about this
| 46359 [dblack@ca dl] Yes. As long as you can draw one line, so to speak, from each item
| 46370 [baker.921@os] Is it legal to assume that the first array contains no duplicate items?
| 46371 [dblack@ca dl] No, I think it can.
+ 46360 [dblack@ca dl] A unit test has been added, in case you haven't downloaded it in the
| 46364 [billk@ct .c ] Hmm, what about
| 46365 [dblack@ca dl] I'm not sure whether you mean as a unit test, or just whether it
| 46367 [billk@ct .c ] Ah, OK thanks. I'd noticed no existing unit tests had had duplicate
| 46369 [dblack@ca dl] I think just testable for equality. Whatever's harder :-)
+ 46378 [gsinclair@so] Half the tests are successful without implementing the method! Do I get
| 46401 [dblack@ca dl] I guess the tests could be changed to "assert_equal(true, ...)" etc.
+ 46386 [avi@be a4 co] So, what are the criteria for the challenge, apart from passing the
| + 46387 [transami@tr ] very nice use of recursion! very very nice.
| | 46405 [pit@ca it in] Very impressive indeed. Avi, as you said it isn't golf, but you could
| + 46391 [transami@tr ] did you calculate those yourself or is there a way to get a readout of
| | + 46402 [dblack@ca dl] I respectfully decline the verdict of okay-ness :-) There's definitely
| | + 46434 [billk@ct .c ] I thought it might be interesting to try some timing with a
| | + 46436 [ned@bi e- om] algorithms with order N vs order N^2: 10x the number of items means
| | | 46438 [billk@ct .c ] Hehe, yeah.... sorry to come off like a dumbass.. :) I hadn't
| | + 46445 [transami@tr ] bill can you tell where mine is failing? it passes david's tests plus
| | | 46447 [billk@ct .c ] I tried reducing the dataset size as far as possible and having it
| | | 46448 [transami@tr ] just figured it out.
| | + 46480 [chr_news@gm ] self[j]}
| | 46482 [billk@ct .c ] Aiyeee!!! =) I'd specifically copied the one from the wiki page
| | 46535 [matju@sy pa ] Your algorithm chooses any of the n possibilities for element 0, then
| | 46569 [chr_news@gm ] All true and thanks for catching this. I'll promise to check
| | 46658 [g_ogata@op u] one_in_each([1,2,3,4],[[1,2,3,4],[2,3,4],[2,3,4],[2,3,4]])
| | 46680 [david.naseby] Of course, you are right.. this line should be
| | 46708 [g_ogata@op u] Hope I didn't keep you waiting too long... ;)
| | 46724 [chr_news@gm ] Your solution fails, i.e. it returns false, for
| | 46800 [g_ogata@op u] Good point.
| + 46403 [dblack@ca dl] The criteria are passing the tests, and the mysterious "meeting the
| 46406 [g_ogata@op u] I think Avi's doesn't quite meet the requirements. This should be true,
| + 46408 [transami@tr ] damn! i went to measure the speed on that one liner, but alas i run on
| | 46430 [g_ogata@op u] I don't know how your measuring them, but I think it'd be quite difficult
| + 46440 [avi@be a4 co] Ah, nice catch. The only way I can think to fix that would be to use
+ 46396 [mikkelfj-ant] This is actually a special case of the assignment problem of operational
+ 46757 [dfan@df n. r] I just got here, but isn't this just the bipartite matching problem?