7911-9384

7721-8649 subjects 8143-8644

^ Re: Code sample for improvement
7911 [schneik us.i] Pretty clever joke.
8027 [gotoken math] I'd like to wait date.rb's support :-)

^ beginner's question -- hashes
7930 [rubinubi cyb] Thanks for answering my previous question. Now I'm having problems with
+ 7940 [sent quality] I can't directly answer the question, but one of
+ 7947 [dblack candl] hash = {}
  7990 [rubinubi cyb] Thanks very much, David. I wasn't sure if I had some silly syntax error.

^ Perl is now a teenager.
7933 [schneik us.i] # Perl is now a teenager

^ Praise for Ruby/GTK
7941 [sent quality] I've been writing a little app in Ruby using Tk,
+ 7944 [bombadil wan] It has some missed classes and functions. Look at API in Ruby/Gtk page for
+ 7945 [harryo zipwo] I thought there was already at least a beta of GTK+ for Windows.
| 7966 [duncan nycap] As someone mentioned, as of Tk 8.0, Tk has native Windows look and
+ 7953 [falis gnat.c] I've been working on an app using Ada and the GTKAda binding lately.
  7964 [sent quality] My app is really simple so far. The main window

^ Determining endianness
7946 [feldt ce.cha] We've previously discussed how to determine endianness in C code but can
+ 7948 [MAP2303 mapl] Re the message of ``[ruby-talk:7946] Determining endianness''...
+ 7949 [spcoltri hro] i = 0x01020304

^ Naming of "defined?"
7961 [duncan nycap] Didn't i read that '?' at the end of a method name indicated a boolean
+ 7974 [hal9000 hype] See below...
+ 7979 [gnhurst hurs] Well, first of all, "defined?" is not a method.
| 7980 [Dave Pragmat] You think _you_ had a problem on page 221 ;-)
| 7983 [dblack candl] It seems more like an co-ride than an override, at least taking the
| 7984 [Dave Pragmat] Well, I hear it plays a mean game of pool, and the other ticks quite
+ 7986 [matz zetabit] The '?' methods are methods designed to be used as predicates, not
  7988 [duncan nycap] I made a mistake in thinking there was something wrong with the `not
  7991 [dblack candl] Use the -w flag -- that way if matz introduces new warnings,
  7992 [duncan nycap] Oh . . . _now_ i get it!  They're both there.  You just can't refer to a

^ ActiveRuby?
7962 [MICHAEL.W.WI] This is a multipart message in MIME format.
8136 [fgeiger date] This is a multi-part message in MIME format.

^ Arrgh! It wasn't a bug, just stupidity...
7968 [larry.elmore] I resolved my problem with building Ruby 1.6.1 on Sparc Solaris 2.6 -- I

^ Hash access method
7971 [ted_meng yah] I wonder if the ruby 1.8 could allow "." access
7973 [Dave Pragmat] What happens if the key is an instance method of hash?
7987 [tonys mysple] the more i read 'programming ruby' the more i like the language. i'm not
8003 [c.hintze gmx] #!/bin/env ruby
+ 8004 [dblack candl] (s/%/#/g)
| + 8006 [steve deaf.o] "for" doesn't have a scope, unlike each {}. Hence any variables defined
| | 8007 [dblack candl] for i in ('a'..'z'); eval "#{i} = 'This variable is #{i}'"; end
| + 8093 [tonys mysple] i would have been scratching my head over that one for a few seconds :)
|   8094 [Dave Pragmat] If you're going for a full Rubification, have you considered wrapping
|   8332 [tonys mysple] well i thought 'planet' would be a good object for a planet :)
|   8333 [Dave Pragmat] I guess I was wondering how you used all these 26 variables. If the
|   8489 [tonys mysple] well the 'planet' object, in terms of the game, contains variables, methods
|   8492 [Dave Pragmat] planets.each do |planet|
|   8504 [sent quality] I happen to be writing a similar game right now :-
|   8605 [tonys mysple] well, i don't know how much detail your ships have, but mine don't really
|   8608 [Dave Pragmat] Using a hash is just as clean, but reduces the likelihood that you
|   + 8613 [sent quality] Mine have a size, location, owner (I guess that
|   | 8722 [tonys mysple] yeah, i've seen the light here...
|   + 8639 [tonys mysple] now this is closer to what i want to do. and i expand the number of planets
+ 8092 [tonys mysple] the rubified version looks cleaner and more readable. i'm a bit suprised at
  8109 [c.hintze gmx] But unfortunately it will not work! :-(
  + 8111 [duncan nycap] I've seen this sort of reference to "compilation" many times in various
  + 8112 [decoux moulo] Yes, it do this

^ Re: Komodo and Ruby
7976 [MICHAEL.W.WI] This is a multipart message in MIME format.

^ Ruby pocket reference
7993 [Dave Pragmat] Could someone post the URL of the Ruby Pocket Reference on
+ 7997 [manamist whi] <URL:http://www.amazon.co.jp/exec/obidos/ASIN/4873110238/qid%3D977556701/249-6474692-9574766>
| 8008 [Dave Pragmat] Thank you both.
+ 7998 [crouton weat] If you mean O'Reilly's 'Ruby Desktop Reference(In Japanese)', it will be

^ I ported my app from Tk to GTK
7996 [sent quality] Well, porting my little app from Tk to GTK took
8044 [yashi yashi.] don't know about tk's "get selected"
8052 [yashi yashi.] I ment Gtk::CList#rows.
8060 [sent quality] Actually, I found CList#rows, which is what I
8098 [yashi yashi.] that's just two toplevel windows.  I poked around win32 portion of gdk

^ Comparsion Problem
7999 [jyliu 163.ne] I met a problem when I tried to write some Ruby code to learn Ruby. The
8009 [arjen aragor] String#each_byte returns the (Integer) value of the character, not a string

^ "Require" confusion
8001 [dsafari para] This has confused me before and I don't know why this is
8002 [ben_tilly ho] I think we have all done that...
8018 [dsafari para] Bingo! Thank you very much Ben. I had previously examinied $: and noted that

^ Variable's "value"
8010 [duncan nycap] In some of the previous "Hash access method" threads i've seen this sort
+ 8014 [Dave Pragmat] Not quite.
+ 8016 [dblack candl] No, no, and no.  (In that order :-)

^ Question about "attr_reader" on class level variables
8022 [tc clark.net] I've just gotten the new Programming Ruby book, and have basically spent
8024 [Dave Pragmat] Yes, but you can write your own version or attr_reader for class
8028 [gotoken math] class Class

^ Basic hash question
8026 [ben_tilly ho] Well I know that objects are supposed to be usable as the
8030 [decoux moulo] class Foo < String
+ 8031 [decoux moulo] has
+ 8033 [dblack satur] And yet...
  + 8034 [decoux moulo] It's a bad day for me, because I say only stupid thing :-(
  + 8035 [Dave Pragmat] Even worse
  | 8038 [duncan nycap] #!/usr/bin/ruby
  | 8040 [Dave Pragmat] Yes, in this case the interpreter cheats. When it converts the value
  + 8036 [decoux moulo] yes, ruby check TYPE(obj) == T_STRING
  | 8041 [Dave Pragmat] a = "hello"
  | 8043 [decoux moulo] See rb_str_new4(), you have 2 differents objects which reference the same
  | 8046 [Dave Pragmat] I understand that, Guy. But we're not talking underlying
  | + 8048 [decoux moulo] This difference can be explained by String#hash, which is really special
  | | 8049 [ben_tilly ho] Perhaps not such a basic question then. :-)
  | + 8050 [matz zetabit] Yes.  And this is my intension.  The reference clearly states the
  |   8059 [Dave Pragmat] (just in case I gave that impression). I was just clarifying my
  + 8039 [decoux moulo] In reality this is because you can't change String#hash.
    8042 [Dave Pragmat] But you should be able to subclass String and use it as a hash key. I
    8045 [duncan nycap] This may be an ignorant comment, but why should class String, itself,

^ String#unfreeze
8037 [decoux moulo] I've retrieved an old message [ruby-talk:02552] :-)
8047 [matz zetabit] Uh, maybe.  Some part of string copy-on-write system depends on the
8051 [yashi yashi.] This came up on -list, too.  and, IIRC, you said it'd be possible (or
+ 8055 [steve deaf.o] "cement" for permanent freezing? :)
+ 8056 [joe vpop.net] deepfreeze ?  unalterable ? foreverfreeze ? eternalfreeze ?
| 8062 [Ken Alverson] permafrost =)
+ 8057 [crippel prim] petrified
| 8058 [crippel prim] Ops - petrify -
+ 8067 [ntalbott rol] unfreezable],
| 8069 [joe vpop.net] Word!
+ 8068 [matz zetabit] Yes.  That's easier way.  In that case, unfreezable 'freeze' would be

^ Re: Question about "attr_reader" on class level variables (thanks)
8053 [tc clark.net] Wow, both these answers are sooo slick.  I'm very impressed.

^ Newbie
8064 [mastercougar] Silly newbie here! Just downloaded from the Ruby Language site
8066 [Dave Pragmat] Welcome.
+ 8072 [mastercougar] Thanks
+ 8073 [zarathustra ] nuby, of course
+ 8088 [dblack candl] I've taken to using the single word "nuby" to convey the entire
  8089 [masa stars.g] Oops, I've just thought about abbreviating "Numerical Ruby" to
  8090 [jsmall laser] Ruby is so quick to learn - how long does one stay a newbie?  It
  + 8091 [mastercougar] I'm still a Nuby (note the capitalisation) and have had Ruby
  + 8100 [zarathustra ] Perhaps the progression is from Nuby to Nub[iy]le in 24 hours.

^ 
8070 [aborquez alt] I have just join this ML so let introce myself.
8071 [Dave Pragmat] Welcome! Hope to see you here often.

^ Ruby 1.6.2
8074 [matz zetabit] Remember the words of the Lord Jesus, how he said, It is more
+ 8075 [progress asi] May you live a long and happy life for your generosity.
| 8114 [schneik us.i] As always, thanks for the latest and greatest Ruby.
+ 8132 [ljohnson res] I ran into trouble building Ruby 1.6.2 from the sources, on Windows 2000
| + 8138 [joey joeygib] says...
| | 8654 [jbuffing my-] I tried building Ruby 1.6.2 with vanilla MSVC 6sp4 and could not get
| | 8702 [joeyGibson m] I didn't do anything except extract the src distro, cd into
| | 9264 [jbuffing my-] get
| | 9384 [cpine firaxi] If you want to compile in MSVC 6.0 sp4, it's actually quite easy.  Don't
| + 8140 [ljohnson res] all
+ 8664 [hal9000 hype] I almost wish it would crash the OS... then I could quote (I think)

^ Ruby glossary is now in English.
8076 [manamist whi] Ruby glossary (in English) is out.
+ 8077 [mastercougar] What is RD format? Why do I feel like this is a stupid
| 8080 [rubikitch ru] Please refer this.
+ 8079 [decoux moulo] See

^ Re: NO SUBJECT
8078 [mastercougar] As another nuby on the list, I welcome you.
8087 [aborquez alt] Thanks to Dave, Mark ... for welcome

^ more beginner's questions -- creating a class
8081 [rubinubi cyb] Merry Christmas,
8082 [duncan nycap] inspect returns the "human readable string" . . . you'll get output if
8083 [rubinubi cyb] Thanks. That did it. Here's another, no doubt equally stupid question.
+ 8084 [duncan nycap] I don't have the book but if this is about processing command line
+ 8085 [duncan nycap] Now i know what ARGF is (after looking it up).  It's an alias for $< . .
| 8236 [rubinubi cyb] It still crashes for me. I'll upload the file on the next line.
| 8238 [duncan nycap] What are the symptoms of your "crash"?  (If it truly crashes, there
| 8243 [rubinubi cyb] I have been trying to run it just from RubyWins Ruby/RunFile menu item and
+ 8086 [dsafari para] As I look in the index of my pickAxe book for ARGF I notice that on page 219

^ How to link with Ruby interpreter?
8095 [sent quality] I hope this question isn't too obvious.
8096 [yashi yashi.] what you need should be in libruby.so if you compiled ruby with
8097 [chadfowler y] I'm sure you'll get a much more thorough answer from
8107 [sent quality] Thanks. I did find that by linking in the ruby

^ Converting a Ruby app into an executable
8099 [sent quality] Well, today was an interesting day. I had some
8103 [aborquez alt] Kevin
8105 [sent quality] Thanks for your comments. As you point out, Ruby
8106 [decoux moulo] call ruby_script("name") to set $0

^ Another Nuby question
8101 [jcusickc hom] To All,
+ 8102 [rubikitch ru] You must define the "Song#initialize" method.
| 8104 [sent quality] For better or worse, the examples in the pickaxe
+ 8108 [jcusickc hom] Thanks for the replies.

^ Code examples in the pickaxe book [long]
8110 [Dave Pragmat] A couple of people have mentioned here that they're having problems
+ 8113 [chadfowler y] Personally, I think the fact that the examples aren't
+ 8117 [jcusickc hom] Dave,
+ 8118 [tc clark.net] I think you should leave the code as is.  I've found the book
+ 8123 [jstern fosha] I think that within the book you should should refer to a web
| 8125 [Dave Pragmat] If we were to do that, would each of the individual examples show
| + 8127 [sent quality] It would be nice if you could have a "final",
| | 8129 [Dave Pragmat] Now that's an interesting idea. I'll go see how doable that is.
| + 8131 [jstern fosha] My thought was that it would include just enough to get the text
|   8135 [sent quality] Given that you're not going to add the complete
|   8141 [schneik us.i] Which likely means that *many* (say, 10x-40x ) more people are having
+ 8155 [dsafari para] Interesting deliema. I was happy with the examples in the book as they where,

^ Some Problems with the Ruby 161 Windows distribution
8116 [philippe.luc] I want to use Ruby on my PC Win98 for working around XML, DB BerKeley and
8120 [decoux moulo] Try to see the message [ruby-talk:5325]
8121 [decoux moulo] I've forgotten to say, look also at [ruby-talk:5327]

^ Method as block to method
8122 [ntalbott rol] I find myself wanting to pass a method as the block to another method on a
+ 8124 [gotoken math] Excuse me?  In what situations do you want to do that?  I'm guessing
+ 8126 [jsmall laser] class Listeners < Array
+ 8128 [Dave Pragmat] Rather than adding a method, why not add an observer class?
| 8130 [jon kanji.co] no luck.
+ 8133 [c.hintze gmx] Hmmm ... let me see if I understand you correctly. You have an
| 8134 [sent quality] GTK expects you to pass a code block any time you
| 8137 [schneik us.i] # re kmail: I'm not sure about the dev. of kmail versus balsa, kmail
+ 8147 [matz zetabit] How about the following?
  8179 [ntalbott rol] It's much better, and exactly what I was looking for. Thanks matz.

^ 
8139 [bradclark1 m] unsubscribe

^ speedup of anagram finder
8142 [joe vpop.net] #!/usr/local/bin/ruby
8145 [gotoken math] 1. Initialize block variables before the block.
8152 [dblack candl] That was a great lesson.  I have a couple of follow-up questions.
+ 8160 [Dave Pragmat] I did a little tweaking too. It seemed to me that a lot of effort was
| 8163 [joe vpop.net] That's gotta be me.  Well, I had a feeling that the
| + 8164 [decoux moulo] I was very surprised by this result, so I've asked Joseph McDonald to send
| | 8167 [joe vpop.net] Yup.  Sorry about posting inaccurate benchmarks.
| | + 8168 [decoux moulo] Well, probably "keys" need more objects (memory ?) than "each_byte"
| | + 8169 [dblack candl] OK, to make up for my earlier complete waste of electrons (Joe,
| | | 8175 [ben_tilly ho] You know, had I known how much discussion this would
| | + 8251 [gotoken math] Apologies for my confusing measurements: In bm blocks, `report' should
| |   8287 [barry_shultz] I spent some time today working on a solution to this that seems faster (
| |   + 8292 [gotoken math] Neat!  It is a kind of Goedel number. I've never seen any practical
| |   | 8298 [barry_shultz] Glad you liked it. Listen, if it's a specific case of a Goedel number, could
| |   | 8317 [gotoken math] I'd like to call it "Shultz-Goedel-Abel index" beacuse anagram can be
| |   + 8315 [crippel prim] needed;
| |   + 8316 [crippel prim] Hm,
| |   | + 8318 [mak imakhno.] cough cough "Ruby Way" cough cough...:)
| |   | | 8320 [erne powerna] Being new to Ruby, I don't understand how you are using the non inclusive
| |   | | 8344 [crippel prim] This code uses no Ranges at all. Are you thinking about something
| |   | | 8348 [barry_shultz] A lot happens on this list while I'm asleep :-). It's nice to see that
| |   | + 8321 [gotoken math] I'm sorry to say that this kind of key is not unique for anagrams for
| |   |   8331 [crippel prim] You don't  need to be sorry because you are wrong (and probably pretty
| |   |   8336 [Dave Pragmat] If you're going to be rude, at least be accurate.
| |   |   8341 [crippel prim] Okay,
| |   + 8352 [dblack candl] that thing about primes... but anyway, I found your reimplementation
| |     8358 [erne powerna] I was responding to Christof Ripple  comment that ...
| |     + 8364 [barry_shultz] I think that's a minor problem, fixed with the obvious adjustment ( for all
| |     | 8367 [dblack candl] Interesting.  Based on exactly your code (all I did was change the
| |     | 8370 [barry_shultz] I saw your post about checking the benchmarks. Could my wordlist.txt
| |     | 8372 [dblack candl] Could be: see below.
| |     | 8393 [barry_shultz] I'd appreciate it if you'd send me a zipped version of your word list.
| |     | 8398 [dblack candl] Done (under separate cover).
| |     | 8400 [decoux moulo] 10000 _differents_ words, or can you have some same words ?
| |     | + 8402 [barry_shultz] I have some supporting evidence for your analysis. I ran the following 3
| |     | + 8405 [dblack candl] ruby -ne 'print if $_.size == 6 and /^\w+$/' /usr/dict/words > fives
| |     |   8407 [decoux moulo] I'm not really sure but I think that the GC can have an importance, and
| |     |   8413 [dblack candl] I've now tried a few different ways of generating the word lists, and
| |     |   + 8414 [decoux moulo] Well, it was my first impression. I've the strange impression that "prime"
| |     |   + 8464 [gotoken math] Akemashite omedetou gozaimasu!
| |     |     8468 [ben_tilly ho] At some point in optimization you always reach the point where
| |     |     + 8474 [gotoken math] I agree 100%.
| |     |     + 8475 [dblack candl] My situation is that I want to do general anagram-finding :-)  Assuming
| |     |       + 8476 [gotoken math] I think that you and Barry should submit these results as a letter to
| |     |       + 8480 [Dave Pragmat] I think this has been one of the more interesting threads I've seen on
| |     |         8491 [gotoken math] Well, I'm planning to write them up as an article of my serialization
| |     |         + 8493 [ben_tilly ho] Well be sure to make the trivial fix in the array version of
| |     |         | 8494 [gotoken math] Yes sir.
| |     |         | 8496 [barry_shultz] I was off the list for a couple days; don't you guys ever take a break?? :-)
| |     |         | 8499 [barry_shultz] I ran "frequency", based on the frequency Gotoken sent, and using the
| |     |         | + 8508 [barry_shultz] Here's a faster, but obviously problematic, solution, kind of a first
| |     |         | | + 8523 [jmichel schu] Since I do mathematics, I feel compelled  to add my 2 cents (although it
| |     |         | | | 8528 [Dave Pragmat] That's a good approach.
| |     |         | | | + 8529 [hgs dmu.ac.u] I think you will find some interesting ones done in Icon.
| |     |         | | | | 8531 [Dave Pragmat] A very cool and trivially simple algorithm for determining with some
| |     |         | | | | 8533 [ben_tilly ho] This is sick. :-)
| |     |         | | | | + 8535 [barry_shultz] Maybe I didn't say what I meant. I was not suggesting using powers of e.
| |     |         | | | | + 8539 [crippel prim] Actually round-off errors are a major issue (in theory and practice) -
| |     |         | | | |   8540 [barry_shultz] Oops. Now I see I'm the one who didn't understand what _you_ were saying.
| |     |         | | | |   8541 [barry_shultz] ...
| |     |         | | | |   8542 [barry_shultz] That's why my "slide rule" version was based on logs * ( some large power of
| |     |         | | | |   8543 [ben_tilly ho] In theory, yes.  In practice if you round reasonably, it will
| |     |         | | | |   8548 [crippel prim] Yes, but instead of rounding afterwards you might as well sum up ``good integer
| |     |         | | | + 8544 [jmichel schu] I  guess I  got  bitten  by the  ruby  benchmarking  bug. The  following
| |     |         | | |   8546 [dblack candl] It happens to the best of us :-)
| |     |         | | |   8549 [jmichel schu] Yes, I made a mistake in  benchmarking, now my results agree with yours.
| |     |         | | |   8551 [dblack candl] I rather like the idea of a String#sort_bytes method.  I imagine it
| |     |         | | |   8552 [ben_tilly ho] Ah yes.  The old, "Figuring out an explicit answer is hard, but
| |     |         | | |   8559 [barry_shultz] I actually agree with you. I just wanted to throw out the ideas in case
| |     |         | | + 8597 [matju cam.or] 1. Use an algorithm that gives erroneous results but is very fast
| |     |         | |   8621 [barry_shultz] I thought about this idea and I think at least one other person on the list
| |     |         | |   8622 [barry_shultz] If you're looking for a volunteer to edit your English version, I'd be happy
| |     |         | + 8509 [dblack candl] I ended up using all of /usr/dict/words for this run, since otherwise
| |     |         + 8511 [dblack candl] Well, I find myself doing a kind of write-up... which I will try to
| |     |         + 8585 [elderburn mi] [per Dave]
| |     |           8591 [gotoken math] Well, well, I'm glad your comment, Kent :-) I've never learned writing
| |     + 8365 [dblack candl] I believe the "..." was intended only to mark an elision from the
| + 8165 [dblack candl] Hmmmm....  I don't get anything like that kind of difference between
|   8166 [dblack candl] Please IGNORE my previous post.  Yes, I'm yelling (at myself).
+ 8162 [gotoken math] Helo ---
threads.html
top