211990-215563

211925-214280 subjects 212232-215015

Re: Happy Numbers (#93)
211990 [wccrawford@g] -Boggles-
211994 [james@gr yp ] Sounds right on to me.
211997 [peter@se an ] Doesn't this mean that all numbers are happy?
+ 212000 [chris.hulan@] Do it by hand for 3...
| 212013 [peter@se an ] Problem is that from the quiz it states that you either get a 1 or an
| 212060 [nospam@no it] As I understand the Wolfram article, an unhappy number never hits 1 as a
| 212149 [fugalh@xm ss] What you have described here is the halting problem. Good luck with that.
| + 212154 [gavin@re in ] IMO, that's an unnecessary spoiler (which is why I didn't look at the
| | 212168 [fugalh@xm ss] This isn't a math quiz. It's a programming quiz.
| | 212198 [nospam@no it] Yes, true, but to program efficiently, you need to know at least some of the
| + 212156 [wccrawford@g] As long as we're noting strategy, the site also noted that 16 and 61 are
| + 212160 [sander.land@] Something which reduces to HP is not equivalent to HP, only if you can
| + 212166 [lukfugl@gm i] The period cannot be any larger than 1000. The largest period is
| | + 212171 [lukfugl@gm i] And here's the "below" referred to (I forgot it earlier). :)
| | + 212173 [fugalh@xm ss] <mathematical proof proof />
| | + 212540 [michael.ulm@] Actually, it is possible to show that for any three digit number
| |   + 212571 [hawkman.gelo] ...
| |   + 212972 [lukfugl@gm i] Cool, thanks.
| |   + 212976 [lukfugl@gm i] section of the thread, just skim on past... :)
| |     213086 [michael.ulm@] ...
| + 212195 [nospam@no it] / ...
+ 212002 [james@gr yp ] James Edward Gray II
  + 212006 [semmons99@gm] ...
  + 212016 [wccrawford@g] Wow.  Lots of strategy on that page.  Almost like cheating ;)
    + 212023 [lukfugl@gm i] /me sheepishly raises his hand
    + 212028 [semmons99@gm] ...
    | 212058 [canyonrat@ma] That's not quite what the cited article says. it says that happy
    + 212031 [roland.swing] One note of advice - the operator to use is actually ** not ^ as might
      + 212048 [nospam@no it] I think you  meant 7 ** 2 = 49, whereas
      | 212089 [james@gr yp ] #!/usr/bin/env ruby -w
      | 212110 [nospam@no it] / ...
      | + 212157 [robert.dober] ...
      | + 212297 [martin@sn wp] That's not the way anyone does exponentiation with integers.  Instead,
      |   + 212300 [jcarbaut@la ] "Bignum limits ?" to see the reason (and it won't work only in ruby
      |   + 212327 [nospam@no it] / ...
      |     212333 [abergeron@gm] I did my own benchmarking and my results are contrary to what was said before.
      |     + 212340 [nospam@no it] / ... snip demonstration in which n * n is 3.2 x faster than n ** 2
      |     + 212389 [james@gr yp ] My original test was on a MacBook Pro (an Intel Mac).
      |     + 212390 [james@gr yp ] Your test doesn't use Bignums.  That could be the difference.
      |       212401 [abergeron@gm] I redid it with a Bignum and got about 0.7s for each.  So yeah, with
      |       212436 [gavin@re in ] Here are my two solutions. Both take arbitrary bases. Neither counts
      |       212446 [gavin@re in ] class Array
      |       + 212449 [robert.dober] ...
      |       + 212463 [sander.land@] Is that really so much faster? Worth breaking on empty arrays?
      |         + 212478 [robert.dober] ...
      |         + 212580 [gavin@re in ] Interesting! Thanks for sharing. I'm surprised that #each with += is so
      + 212061 [mike@st k. a] => 5
        212087 [roland.swing] Sorry, should have been 7 ** 2 :)
        + 212111 [nospam@no it] Considering this thread and the quiz question, I think maybe a psychologist
        | 212112 [gavin@re in ] Interestingly, there doesn't seem to be a pattern as to the number of
        | 212120 [gavin@re in ] Although others are sure to have better results, I thought I'd post
        + 212137 [matthew.moss] As has been said, "real mathematicians" shudder that their work might be useful.
          212200 [nospam@no it] Another example is non-Euclidean geometry, which was an impractical, exotic
          212203 [wccrawford@g] Wait, are you suggesting that in a hundred years, Happy Numbers could
          212264 [robert.dober] ...

DNS server
212010 [rubytalk@ea ] ...
212014 [garbagecat10] What are you trying to accomplish that can't be done with standard DNS servers?
212021 [rubytalk@ea ] ...
212036 [garbagecat10] ...
212052 [rubytalk@ea ] ...
212189 [abergeron@gm] Or you could look into somthing else than Bind (which no doubt what is

Race Is On to Woo Next-Gen Developer
212026 [enogrob@ho m] Dynamic languages are flexible languages that enable developers to
212039 [mike@st k. a] With a few small changes to the first five words this could have been

Ruby on Rails: Up and Running in print or PDF
212030 [enogrob@ho m] Ruby on Rails: Up and Running - You can now buy this must-have book in
212053 [james.britt@] Is this poster a press release bot?
212079 [halostatue@g] I think so.

Best practice? libs and modules
212033 [rubyforum@co] another 'best practice' question. Example: I have a library which I
+ 212038 [eero.saynatk] The latter is fine. So long as your top-level namespace is
+ 212059 [khaines@en g] How you scope your class has a subjective element.  Only you can decide
| + 212133 [rubyforum@co] thank you for your valuable comments. My "namespace" is very unlikely to
| | 212142 [chiology@gm ] For structuring my projects, I tend to keep nested modules and classes
| + 212250 [transfire@gm] There's a downside to this though. To take advantage of those
|   212306 [khaines@en g] No, it really doesn't matter if I am changing the behavior of a built in
|   212311 [transfire@gm] Hmm... If you have a fix for that I'd love to incorporate it.
|   212319 [khaines@en g] Well, let me tell you what I did.
|   212495 [transfire@gm] Well, I think those are useful features. It would be nice if it could
+ 212212 [drbrain@se m] If you're going this way,
  212254 [mr.cruft@gm ] That's really cool!

Ruby: Result of a Japanese guy that just wanted to be happy programming and made a revolution
212034 [enogrob@ho m] Ruby - is a reflective Object Oriented (OO) dynamic language created by
212147 [martindemell] Well-intentioned article, but it shows a fundamental misunderstanding

Re: Incorrect return of the TkFont configure instance method when no value
212035 [lionel.maiau] Thanks a lot to Morton and Hidetoshi for their answers.
+ 212062 [m_goldberg@a] You could try <http://raa.ruby-lang.org/project/rubytk_en/>. It's
+ 212069 [m_goldberg@a] You could try <http://raa.ruby-lang.org/project/rubytk_en/>. It's

Why does the derived class instance need to be duplicated with TkComposite
212044 [lionel.maiau] Is there any reason to duplicate the derived class instance when using
212696 [nagai@ai ky ] TkComposite is used to create a Mega-widget class which is constructed

why is XML-RPC client prog not running??
212045 [pankajkumar1] when i run ruby client program(which simply adds& subtracts two numbers
+ 212063 [ksruby@gm il] ...
+ 212070 [rubyfan@gm i] can you post your code?
  212257 [pankajkumar1] below are client as well as server code...(i've simply copied the
  215563 [flori@ni e. ] s.add_handler(...

When clever is stupid
212083 [khaines@en g] if pu : pu = pu.url.to_s != '' ? pu : nil end
+ 212097 [pbattley@gm ] Perhaps it's just not clever enough! ;-) It's concise, but it could be
+ 212098 [x0uhk6q02@sn] Seeing how it assigns pu to pu (in one case) I would classify that
| 212196 [rabbitblue@g] I take my hat off to you good sir. Would you please kindly illustrate
| + 212199 [perrin@ap th] I think that's one of the reasons that long-time C, Java, and Fortran
| | 212256 [x0uhk6q02@sn] While it may have something to do with it, it is, compared to C,
| | 212260 [znmeb@ce ma ] You can't or shouldn't really do those things in Java or Fortran either.
| | 212323 [perrin@ap th] . . . and I wouldn't use C or Fortran for certain classes of complex
| | 212334 [znmeb@ce ma ] There are a lot of things I wouldn't use Fortran for, although when it
| | + 212362 [igouy@ya oo ] No, not just whining.
| | | 212371 [znmeb@ce ma ] Ah ... but why would I waste the time to search for, download, install,
| | | 212405 [igouy@ya oo ] Yes, either understandable ignorance (didn't know there were C
| | + 212393 [perrin@ap th] Hell, pay me enough, and I'll write your word processor web application
| + 212218 [david@va ln ] Try a brick. *duck*
+ 212331 [shortcutter@] I wasn't even aware that you can use ":" instead of "then"...

gserver / exceptions?
212085 [michael.gors] ...

a selfish ruby question
212091 [bitdoger2@ya] => nil
212101 [gavin@re in ] You can't have an explicit receiver for private methods. See below.
212104 [bitdoger2@ya] in trying to understand this....
+ 212164 [gavin@re in ] You need to provide more details. You have explicitly stated that you
+ 212366 [rick.denatal] It's not.
  212383 [logancapaldo] This select is most likely Kernel#select (as in IO).

Re-binding Proc
212096 [gavin@re in ] Is there a way to call a proc while passing in the binding/scope for
+ 212100 [gavin@re in ] Damn, hit send too soon. **continues**
+ 212187 [eero.saynatk] I may be just feeling light-headed from COBOL, but

Re: When clever is stupid [RANT]
212106 [david@va ln ] Here, have a cookie. A Cookie of Clarity. It has extra doses of golf
+ 212113 [znmeb@ce ma ] I'm not a big fan of nested conditionals -- there's usually an elegant
| 212185 [david@va ln ] With the usual messy codebase to maintain, I thought I was the only one
+ 212114 [khaines@en g] But is it a tasty cookie?  Maybe with a little chocolate (preferably
| 212119 [rdm@cf l. om] "The Elements of Programming Style", although written decades
+ 212117 [gavin@re in ] The one exception I would list is something like a chained comparison.
  + 212123 [martindemell] result = case true
  | + 212124 [martindemell] Oops - missed the "javascript" bit.
  | + 212170 [vjoel@pa h. ] result = case
  |   212361 [martindemell] Why does this work?
  |   212367 [logancapaldo] Cause ruby is cool like that? ;)
  + 212146 [halostatue@g] resul = (a > b ? 1 : (a < b ? -1 : 0))

Re: Ruby: Result of a Japanese guy that just wanted to be ha
212108 [bitdoger2@ya] from my limited experience....and i haven't seen it mentioned here too

Using rake package task- suppressing initial segment of path
212115 [dandante@da ] I have the following trivial bit of code, just to help me figure out

ruby on blackberry or other phones?
212121 [sergio@vi la] hey, all..
212125 [prakash.diby] ...

RDoc: How to extend; YAML?
212126 [checkforreal] I'm wanting to extend RDoc to produce module/class/method etc data in an
+ 212179 [eero.saynatk] I needed to do this a while back and just ended up
| + 212184 [james.britt@] RDog also does rdoc source/outputter  manipulation, and may offer some
| + 212229 [notarealaddr] I'm not directly interested in spitting out the yaml, I was interested in
+ 212213 [drbrain@se m] Unfortunately, no.

AIX 5.3 ruby-1.8.5 Binaries
212128 [unixadminm@g] I tried compiling ruby-1.8.5 on AIX5.3 and evrytime it fsils saying
212417 [nobu@ru y- a] Can't you show the relevant portion of config.log file?

[ANN] open4-0.7.0
212131 [ara.t.howard] URIS

Re: Using rake package task- suppressing initial segment of
212140 [jim@we ri hh] Yikes!  I hate when packages dump their contained files intermingled
212167 [dandante@da ] Yeah...but I'm not creating a package. I have a specialized need.

Re: How can I ask to which module a method belongs to?
212159 [gavin@re in ] Sexy! :)
212364 [rick.denatal] Well although the ri documentation for Module#included_modules doesn't

Re: Welcome to our (ruby-talk ML) You are added automatically
212174 [james2mccart] ...

File.ctime for detecting directory modifications?
212175 [eero.saynatk] Can anyone tell me if Ruby's File.ctime can be reliably
+ 212191 [nospam@no it] additions or removals, but not changes to existing files.
| 212194 [eero.saynatk] Excellent, this is just what I needed to know.
| 212202 [nospam@no it] / ...
| 212369 [rick.denatal] Actually, won't this behavior depend on the file system rather than the kernel?
| 212386 [nospam@no it] / ...
| 212402 [drosihn@gm i] The operating system just reports what the filesystem tells it.
| 212408 [nospam@no it] / ...
| + 212475 [rick.denatal] And note that you can mount various types of windows file systems in
| + 212509 [hassan.schro] I'd bet the engineers at Sun who originally developed the Network
+ 212802 [ara.t.howard] i'm about to release a new version - fyi.

How can I do this without eval...
212178 [james2mccart] def load_default_attributes(model_name, options = {})
+ 212181 [eero.saynatk] send model_name.to_s.pluralize, fixture
+ 212186 [jan.svitok@g] model = const_get(model_name.to_s.capitalize)
  212205 [james2mccart] Excellent, thank you.
  212355 [pabs@pa lo r] model_class =3D const_get(model_name.to_s.classify)
  212360 [ezmobius@gm ] Also if you are already within rails you may as well use #constantize

fxri bug; where to report?
212193 [notarealaddr] fxri crashes and disappears under some circumstances. Any idea who is
212253 [smartgpx@gm ] In the information pane (upper right) of the window that appears
212275 [checkforreal] Sigh. Yes, I suppose that's obvious if you know it's there and haven't

RegExp issues....
212214 [comprug@gm i] I am trying to validate user input so it contains only letters, numbers,
+ 212217 [TimHunter@nc] Shouldn't your regexp accept lowercase as well? /[A-Za-z0-9_-]/?
| + 212222 [drbrain@se m] \w matches digits too
| + 212223 [comprug@gm i] Yep, that was the issue, as someone coming from a Coldfusion backround,
| + 212224 [david@va ln ] I could've sworn digits are word characters too.
+ 212220 [steviedizzle] You need to validate lowercase also: /[A-Za-z0-9_-]/
+ 212221 [drbrain@se m] That regexp doesn't match lowercase characters.
| 212428 [dblack@wo bl] \Z will allow a final newline character, though, so you'd probably
+ 212226 [nospam@no it] You are not accepting lowercase characters.
| 212228 [comprug@gm i] That definetly is much easier, like I said before, I am no expert at
+ 212245 [tbray@te tu ] There are many more letters than [A-Za-z].  You should either be
| 212290 [comprug@gm i] And are you OK
| 212403 [logancapaldo] That actually only shows up as a "question mark" because either your
+ 212427 [gareth.adams] No one else seems to have mentioned that that regex will match all strings
  212429 [dblack@wo bl] ...

Windows/X-plaiform file path manipulation -- how do you deal with it?
212216 [notarealaddr] Could someone please straighten me out on how the Ruby community deals with
+ 212225 [notarealaddr] ... so to partly answer myself, it looks like the
+ 212231 [djberg96@gm ] Use pathname2 instead.  Available on the RAA.
  212276 [checkforreal] Good to know about. Thanks,

Right way to partly upgrade standard library?
212227 [notarealaddr] Following on from my discovery that the 1.9 version of Pathname is needed
212418 [nobu@ru y- a] pathname.rb in 1.8.5 is same as 1.9.

A little idiom I like
212230 [hal9000@hy e] Here's a little something I like. YMMV.
+ 212234 [djberg96@gm ] Already in pathname2. :)
+ 212238 [gavin@re in ] I like this, both because it's element, AND because I'm not sure I've
| 212247 [twifkak@co c] I'm guessing you aren't aware of the "undef" keyword, either.
| 212342 [chneukirchen] Whoa!
+ 212296 [wccrawford@g] That's pretty freaking nifty.  Thanks Hal.
+ 212457 [rick.denatal] Those poor Windows guys. <G>
  212480 [znmeb@ce ma ] There's a workaround, right? Some combination of other quotes and double
  212507 [rick.denatal] No easily, even if you can figure out how to define a method named \
  212534 [hal9000@hy e] If we're seriously talking about a Windows usage, let me point out
  212990 [halostatue@g] Mostly.
  212994 [Daniel.Berge] Indeed.  This is why all paths generated using the pathname2 package
  + 213026 [rick.denatal] If only Gary Kildall had not decided to use / instead of - for
  | + 213039 [hal9000@hy e] Interesting question. I always assumed the /x notation
  | | + 213063 [znmeb@ce ma ] And VMS and RSX-11. My recollection is that CP-M command line syntax in
  | | + 213125 [transfire@gm] I recollect an old OS called COS (Cobol Operating System?) That
  | |   213196 [rick.denatal] Then of course there was a family of operating systems which started
  | |   213254 [znmeb@ce ma ] Hmmm ... so *that's* where the C++ comment convention came from -- they
  | |   213322 [rick.denatal] HAL?, JCN?, JCL?
  | + 213073 [mike@ru yw z] Don't think it was DEC. On PDP-11/RSX and VAX/VMS directories were
  |   + 213075 [hal9000@hy e] Yes, the brackets were used that way... but Rick was talking
  |   | 213079 [mike@ru yw z] Ahh, yes, it's pure DCL thingie carried all they way to cmd.exe. They
  |   | 213106 [Daniel.Berge] Oops.  That should have said, "...convert all forward slashes to
  |   + 213076 [znmeb@ce ma ] Yes, and the forward slash was used to designate options.
  + 213062 [halostatue@g] Inasmuch as is possible, where Ruby provides these, it should hide
threads.html
top