12157-13260 subjects 12540-13642

Re: [OT] Re: FEATURE REQUEST: 'my' local variables
12287 [billk@ct .c ] Holy COW!  I just grepped the Perl code I've written over the

cookbook site code
12290 [colin@we g2 ] CAVEAT EMPTOR: It's a bit ugly; I'm learning Ruby as I write the

Ruby on byte.com
12298 [andy@to ls e] If ya'll haven't seen it yet, there's a brief

Alternate source for Cygwin Ruby/GTK+ Binaries?
12300 [gsemones@pr ] Does anyone know if there is an alternate source for the Ruby/GTK+
12368 [sent@qu li y] I still have a copy that I could post somewhere

[OT] Is Ruby japanese-centered?
12302 [kentda@st d.] So naturally, as a Norwegian, I haven't heard of this before... because

How to pipe to an application?
12304 [jim@fr ez .o] I'm sure this is an easy one, but it is getting late in the day and my
+ 12305 [Dave@Pr gm t] IO.popen("cat -b", "w") do |cmd|
+ 12323 [kjana@os xa ] And you can do so too in ruby :-)  Object#open which is actually

GUI Toolkit for Ruby
12308 [jjthrash@po ] I bought the Gang of Four's "Design Patterns" book the other day,
+ 12310 [mdavis@se ai] Yes, I think about it all the time.  I plan to create one as time permits.
| 12314 [sent@qu li y] We had a (brief) thread on exactly this topic
| 12317 [schneik@us i] # >Bridge patterns.  Anyhow, the basic idea is that you write a
+ 12318 [erik@ba fo s] This is great except that you will have to go by the smallest subset of
  12319 [jjthrash@po ] I agree.  I like wxWindows a lot (even though there don't seem to
  12325 [erik@ba fo s] That's why wxwindows with bindings should be included in the ruby
  12334 [ben_tilly@ho] [...stuff about gui wrappers benig hard...]
  + 12343 [gsemones@pr ] any
  + 12350 [hgs@dm .a .u] All of this would make GUIs accessible to people using Braille.
    12357 [ben_tilly@op] Yes, it is possible to do if the GUI designer knows what
    12362 [brk@je ko .c] [Bryn Keller]
    + 12386 [john_van_v@y] Because the CGI equivs have been accessed by everybody at least once ??
    + 12409 [lecouey-bypa] If someone knows "Some Bigwig" at Corel (makers of WordPerfect), they could see
    + 12770 [claird@st rb] I like your recommendations for sources of good ideas.
      12879 [brk@je ko .c] [Bryn Keller]

Re: Welcome to our (ruby-talk ML)        You are added automatically
12312 [adachi@ya u.] # help
12313 [adachi@ya u.] I'm sorry.

Reading a binary file / writing binary data to a file
12321 [ppladijs@ca ] I'm having troubles while reading binary file with under
12322 [decoux@mo lo] Try in binary mode

[ANN] NQXML 0.4.0 (renamed parser, new examples, and more)
12327 [jimm@er s. o] Thanks to everyone for the lively discussion about XML parsers. The new and

Math package
12329 [matju@sy pa ] why is it Math.sin(42.0) and not (42.0).sin ?
+ 12338 [gnhurst@hu s] I agree.
+ 12339 [gotoken@ma h] Though Math::sin is not bad, I would like Numeric#<function> as
| 12372 [matz@ze ab t] No.  It won't help functions with two or more parameters.  I like the
| + 12381 [ale@cr ms n.] Someone presented a wild idea here not so long ago. IIRC he queried
| | + 12431 [matz@ze ab t] No, please.
| | + 12439 [crippel@pr m] I think,
| |   12456 [matz@ze ab t] Let me clarify that I don't like the NOTATION, not the concept.
| |   + 12482 [decoux@mo lo] You can have multi-dispatch if you write
| |   | + 12531 [crippel@pr m] True, but type based overloaded functions and multi-dispatch
| |   | + 12783 [tarod@ho e. ] In which version of Ruby does this work?
| |   |   12798 [ppladijs@ca ] Certainly not in the versions 1.4 and 1.6.
| |   + 12532 [crippel@pr m] Thanks,
| |     12591 [ben_tilly@op] I think that the point of the second statement is that there
| + 12504 [gotoken@ma h] Yes, it is.  And that would show an example of hierarchy in a module.
|   12513 [matz@ze ab t] I still don't get the point of your second statement.  Having both
|   12518 [gotoken@ma h] I'm sorry for too short words.
+ 12348 [johann@ph si] Because sine isn't a method of numbers, and instead is a function
| 12396 [matju@sy pa ] Okay, what do you define as fundamental? Numeric#- can trivially be
| 12397 [matju@sy pa ] sorry for this confused+confusing reply paragraph. just ignore those three
| 12404 [decoux@mo lo] x = abs(x)
+ 12351 [masa@st rs g] I think this is because 2-argument functions like
  12373 [matz@ze ab t] I have no knowledge about availabily of those function.  If someone
  12391 [matju@sy pa ] def asin(x)

Haskell goodies, RCR and challenge
12330 [feldt@ce ch ] It's friday afternoon (here in Sweden that is) so here's a small script
12374 [matz@ze ab t] I think it's good to add them to Enumerable.
+ 12432 [matz@ze ab t] The method name should be verb, and preferably end with "ct" to rhyme
| + 12445 [crippel@pr m] But,
| | 12455 [matz@ze ab t] Thank you for the comment.  And bisect_at and insert_at always make
| | + 12459 [schneik@us i] # I'd like to put this particular one into RCR and get comments from
| | | + 12465 [feldt@ce ch ] FWIW, I vote for partition for the same reasons.
| | | + 12486 [dblack@ca dl] I'd go along with this, based on the word of people who know more
| | |   12495 [feldt@ce ch ] I agree that its simple. However, I find it useful enough to warrant
| | + 12503 [dfan@ha mo i] I like 'partition'.  It is the standard verb for the operation.  For
| |   12512 [matz@ze ab t] OK.  I withdraw "bisect".  I think we could fix the name candidate.
| |   12526 [schneik@us i] # Hello --
| |   + 12527 [schneik@us i] # >
| |   + 12530 [dblack@ca dl] I agree completely.  I don't have any principled objection to
| + 12816 [gnhurst@hu s] (from http://www.concordance.com/cgi-bin/crossword.pl
+ 12463 [feldt@ce ch ] # Different forms for foldl and foldr
  + 12472 [jonas.bulow@] How about 'head'  instead of 'init'?
  | + 12483 [jmichel@sc u] head suggests the first element only. What about 'front'?
  | | 12497 [feldt@ce ch ] I like it.
  | + 12484 [luigi.ballab] I think the name is already in use in functional programming with a
  |   12496 [feldt@ce ch ] in Haskell head([1,2,3,4]) would evaluate to 1.
  + 12477 [jmichel@sc u] Fine, but did not we say at some stage that reduce might be a better name for
  | 12498 [feldt@ce ch ] In functional programming: foldl is left-associative, foldr is
  + 12502 [dfan@ha mo i] For what it's worth, Python has a zip function with the same behavior.

...and the challenge
12332 [feldt@ce ch ] Write a nice, fast and small Ruby program for generating the n
12337 [matju@sy pa ] Here's one for a start. it's not fast though.
12344 [matju@sy pa ] limiting it to 1_000_000, it takes 27 seconds to run.
12346 [gotoken@ma h] On my machine, yours takes 1.15 sec.
+ 12356 [ben_tilly@op] =====
| 12367 [sent@qu li y] Pure speculation: Could we speed it up a bit by
| 12375 [ben_tilly@op] This version is the fastest on my machine.  YMMV.
+ 12388 [matju@sy pa ] Ok, I also had written the following one. How long does it take over
  12402 [smeg@bl ck a] Here's a rewrite of Ben's version that takes about 2 times longer.  I was
  12415 [matju@sy pa ] some average times I got with 10**30
  12419 [ben_tilly@op] We have a winner.  If you want all of the Hamming numbers less
  12423 [matju@sy pa ] I believe there are faster ways than that, but I don't want to go that
  12443 [ben_tilly@op] Well fastest of the submitted solutions. :-)
  + 12462 [feldt@ce ch ] I was about to post that Ben was the winner since matju's solution didn't
  | 12583 [matju@sy pa ] Well, ProcAsArray doesn't cache anything, so you added that as well.
  + 12582 [matju@sy pa ] I found that using GNUplot and with the intuition that the exponent was

Re: Understanding Design Patterns Was: GUI Toolkit for Ruby
12335 [petemcbreen@] <20010308195003.A5189@jimmy.nc.rr.com>...
12342 [gsemones@pr ] <snipped some of Pete's comments>
+ 12390 [elderburn@mi] That's no excuse! :-D
+ 12771 [claird@st rb] For an expression of the same sentiment from the
  12796 [rashworth@ma] Do you have a simple Ruby program code for a graph of

"[ruby-talk:12345]" tag is removed
12345 [matz@ru y- a] From now on, [ruby-talk:12345] is removed.

Can Ruby-GTK display Gif Png or Jpeg files?
12349 [phlip_cpp@my] My mom got my kid a NickClick Mattel toy digital camera - it comes with a
+ 12352 [gsemones@pr ] with a
| + 12418 [phlip_cpp@my] The mattel_cam.tar.gz quicky program I downloaded (yay!) does only JPG - my
| + 12755 [claird@st rb] you're thinking.
+ 12354 [Dave@Pr gm t] There's some basic code from the book that does this with Tk at
  + 12376 [elderburn@mi] The limitation of Tk is that it natively supports gif, but not jpg or png
  | 12412 [johnson2@hi ] Now seems like a good time for me to pipe up and say that FOX (and FXRuby)
  + 12378 [phlip_cpp@my] Thanks to you both. (And hi, Dave, small 'net, huh?)

Java on Ruby, Ruby on Java, JRuby?  where?
12377 [samantha@ob ] I saw some references that looked sort of like Java on Ruby or vice
+ 12387 [elderburn@mi] FWIW the following files are available from
| 12395 [samantha@ob ] Kent,
| 12399 [elderburn@mi] Of course, this is a very good point. In his recent writing ESR brings up the
| + 12403 [rise@kn ve y] Apple of all companies is actually taking a crack at the problem[1]. One
| | 12405 [dgjs@ac .o g] "Some potential for bloat"?  If you're going to be using this facility
| | 12426 [rise@kn ve y] Remind me to never leave off <sarcasm></sarcasm> tags again. The
| + 12408 [samantha@ob ] I find that writing in Java I spent even more time creating more decent
+ 12461 [tammo.freese] As far as I know, there is no such thing. The Java Ruby Interface
  + 12474 [elderburn@mi] Yeah, that's right; I just opened up the package last night. Now, this could
  + 12757 [claird@st rb] Use of a "lighter" language in development of Java classes

Thread::parent ?
12382 [ristad@mn mo] What's the cleanest way to for a thread to access it's parent (ie.,
12430 [matz@ze ab t] All threads are created equal (except the "main" thread), so that
12451 [ristad@mn mo] All threads are created equal (except the "main" thread), so that

emulating String#~
12401 [matju@sy pa ] In pickaxe book, p.371, it is said that ~ a_string is equivalent to $_ =~

Where is the tk module?
12414 [phlip_cpp@my] Sorry, but I searched and clicked all over ruby-lang.org & google, and I
12410 [phlip_cpp@my] - download & expand stable-snapshot.tar.gz
12413 [johnson2@hi ] /usr/X11R6/lib
12417 [phlip_cpp@my] That folder contains many lib*.a files, but not libX11.a. But if I can link

RAA submission
12421 [dlh@ma l. om] I would like to submit to the RAA a ruby Rijndael cryptography class.
12424 [rise@kn ve y] Consider setting up a Sourceforge project page if you intend to continue

getting caller's $_
12422 [matju@sy pa ] Pickaxe book is correct when saying ~str is like $_=~str, but that assumes
12479 [decoux@mo lo] When you write this, the first *local* variable is $_. This mean, in this

ruby - first impressions
12425 [miles@bu o. ] I've been playing with ruby for the past week or two and I'm quite impressed.
+ 12436 [ppladijs@ca ] To me, Ruby does not seem very consistent in the use of function suffix
| 12442 [dblack@ca dl] As you suggest, the fact that a method alters its receiver does not mean
+ 12681 [dblack@ca dl] I don't know exactly why.  The same thing happens in Perl, which

12427 [matju@sy pa ] Why does IO#close_read complain on a read-only IO object when it could
12450 [matz@ze ab t] Does it?

Sum of Squares
12428 [rashworth@ma] # The following code does not Sum the squares of the elements.
12429 [matju@sy pa ] "nested method definition". you forgot an "end" here.
12434 [sent@qu li y] Having never gotten used to the "inject" concept,
12528 [rashworth@ma] Thank you for your reply on the Sum of Squares.
12529 [rashworth@ma] Thank you for your note. The new coding worked just fine.
12690 [matju@sy pa ] That is called a dot product, not a "sum of cross-products". Unfortunately
12734 [luigi.ballab] To follow up on the Haskell-functional programming thing, this is where
12735 [feldt@ce ch ] A good example of zip usage, indeed. Thanks for posting.
12760 [rashworth@ma] thanks for your code.  ERA
12761 [rashworth@ma] Thanks for your code.  ERA

Building mswin32 ruby
12435 [jeromg@ho ma] Fellow rubyers,

New Ruby book
12437 [ppladijs@ca ] I just noticed on Amazone.com that Matz is writing

tcltklib missing in 1.6.2?
12438 [  tk@hc d. e] I just tried to use Tk in ruby according to the ProgrammingRuby book.
+ 12440 [  tk@hc d. e] I don't have the problem Phlip had - there's no problem when compiling.
+ 12441 [  tk@hc d. e] guess a four letter word starting with "d"...

class variables
12444 [max@ma va co] class A
12447 [kentda@st d.] From your expectations, you're basically assuming that each class has
+ 12448 [avi@be a4 co] <CODE>
+ 12449 [crippel@pr m] How about this variation?
+ 12466 [max@ma va co] So, this is a feature? It seems counter-intuitive.
| 12487 [Dave@Pr gm t] I agree: we don't really say either way in the book. To make it
| + 12506 [spwhite@ch r] There's only one class hierachy... Object.
| | 12511 [Dave@Pr gm t] I believe that what he was saying is that class variables are
| + 12541 [crippel@pr m] also
|   12543 [Dave@Pr gm t] instance variables
|   + 12575 [crippel@pr m] yes
|   + 12576 [decoux@mo lo] I'm probably stupid but why you don't write ?
|     12578 [crippel@pr m] Because they are NOT the same - if you accidentally write
+ 12579 [cjon@sa ph r] Why not this instead?

Locale support in Ruby
12446 [roberto@RE O] What's the status of locale support in Ruby?  I'd like to be able to
12454 [matz@ze ab t] No.  The locale system is not sufficient for non western languages,
+ 12478 [roberto@RE O] Right.
| 12488 [matz@ze ab t] Regex too depends on ctype macros.  The point is you have to call
| 12492 [bombadil@wa ] How setlocale is called from Ruby script?.
| + 12508 [roberto@RE O] I'd say we need a Ruby extension to act as a  glue with setlocale(3).
| + 12509 [matz@ze ab t] Using extension.
+ 12480 [decoux@mo lo] Well, I think that this is one of the goal of 1.7

12453 [DavidK@ca dg] # subscribe davidk@cardguard.com

[ot] [libraries]
12458 [knos@fr e. r] .-

Using Excel OLE
12464 [PAUL_GRIFFIN] I'm using Ruby to drive MS Excel but I get a EXCEL process left over after
12467 [tammo.freese] Hmmm... when Ruby exits on my system, all EXCEL processes that I started with
12471 [PAUL_GRIFFIN] Thanks for the info. I was running inside RubyWin.

how to use Ruby syscall?
12499 [ristad@mn mo] Can someone please point me to some nontrivial examples of

net/http get parameters
12501 [ronjeffries@] I was looking for how to do access to passworded pages with http.get,
12545 [aamine@dp u-] should be included in RD (of net/http). I add some code there.
12564 [ronjeffries@] Thanks!
12592 [ben_tilly@op] This is part of the standard definition of what a URL can

rb_ary_each and hash
12507 [tcovert@sa u] is there an example of how to use the rb_ary_each(VALUE) function. I know how to use it in ruby, but not sure how that would work in c.
12514 [matz@ze ab t] Use st_foreach().  Examplea are shown in hash.c.
12515 [decoux@mo lo] for (i = 0; RARRAY(ary)->len; i++) {
12520 [decoux@mo lo] It's perhaps best to write

audio recording from soundcard
12510 [smoerk@gm .d] is it possible to record audio from a sound card with ruby?
12560 [matju@sy pa ] 440 Hz tone to a sound card. Requires Linux, though.

next edition of pickaxe
12519 [snowzone@ho ] this would probably be handier for newbies (AND a lot of work for the
12522 [Dave@Pr gm t] We actually had that in preliminary versions, but took it out because
12647 [snowzone@ho ] i'll take a look at taht

SV:  Re: FEATURE REQUEST: 'my' local variables
12521 [dennisdecker] Agreed. I didn't like the notion of 'my' but a more explicit notion would be

rb_ary_each and hash
12523 [tcovert@sa u] awesome! thanks all!

C++ is like teenage sex.
12524 [spwhite@ch r] Forwarded message from glen mccready <gkm@petting-zoo.net> -----
+ 12566 [phlip_cpp@my] - all the kids use them
| 12568 [matju@sy pa ] - you get into race conditions all the time
+ 12569 [phlip_cpp@my] * and there's lots of rotten old men who do it very well

a FTP-question
12525 [Roman.Fische] I want to move the files of one FTP-Source to a couple of FTP-targets. So I
12534 [matz@ze ab t] Use Net::FTP#nlst.