211990-215563

211925-214280 subjects 212232-215015

^ Re: Happy Numbers (#93)
211990 [wccrawford g] -Boggles-
211994 [james graypr] Sounds right on to me.
211997 [peter semant] Doesn't this mean that all numbers are happy?
+ 212000 [chris.hulan ] Do it by hand for 3...
| 212013 [peter semant] Problem is that from the quiz it states that you either get a 1 or an
| 212060 [nospam nosit] As I understand the Wolfram article, an unhappy number never hits 1 as a
| 212149 [fugalh xmiss] What you have described here is the halting problem. Good luck with that.
| + 212154 [gavin refine] IMO, that's an unnecessary spoiler (which is why I didn't look at the
| | 212168 [fugalh xmiss] This isn't a math quiz. It's a programming quiz.
| | 212198 [nospam nosit] 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 gmai] The period cannot be any larger than 1000. The largest period is
| | + 212171 [lukfugl gmai] And here's the "below" referred to (I forgot it earlier). :)
| | + 212173 [fugalh xmiss] <mathematical proof proof />
| | + 212540 [michael.ulm ] Actually, it is possible to show that for any three digit number
| |   + 212571 [hawkman.gelo] my solution isn't short, and it isn't fast, only does base 10 (i didn't feel
| |   + 212972 [lukfugl gmai] Cool, thanks.
| |   + 212976 [lukfugl gmai] section of the thread, just skim on past... :)
| |     213086 [michael.ulm ] You are right, thanks for the correction and explanations.
| + 212195 [nospam nosit] / ...
+ 212002 [james graypr] James Edward Gray II
  + 212006 [semmons99 gm] 3^2=9
  + 212016 [wccrawford g] Wow.  Lots of strategy on that page.  Almost like cheating ;)
    + 212023 [lukfugl gmai] /me sheepishly raises his hand
    + 212028 [semmons99 gm] Sorry, I should have clarified that a Happy number results in 1, and an
    | 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 nosit] I think you  meant 7 ** 2 = 49, whereas
      | 212089 [james graypr] #!/usr/bin/env ruby -w
      | 212110 [nospam nosit] / ...
      | + 212157 [robert.dober] I was quite surprised at first too, however, the interpreter knows how to
      | + 212297 [martin snowp] That's not the way anyone does exponentiation with integers.  Instead,
      |   + 212300 [jcarbaut lap] "Bignum limits ?" to see the reason (and it won't work only in ruby
      |   + 212327 [nospam nosit] / ...
      |     212333 [abergeron gm] I did my own benchmarking and my results are contrary to what was said before.
      |     + 212340 [nospam nosit] / ... snip demonstration in which n * n is 3.2 x faster than n ** 2
      |     + 212389 [james graypr] My original test was on a MacBook Pro (an Intel Mac).
      |     + 212390 [james graypr] 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 refine] Here are my two solutions. Both take arbitrary bases. Neither counts
      |       212446 [gavin refine] class Array
      |       + 212449 [robert.dober] thread about it, was there not ;)
      |       + 212463 [sander.land ] Is that really so much faster? Worth breaking on empty arrays?
      |         + 212478 [robert.dober] Nope not quite :)
      |         + 212580 [gavin refine] Interesting! Thanks for sharing. I'm surprised that #each with += is so
      + 212061 [mike stok.ca] => 5
        212087 [roland.swing] Sorry, should have been 7 ** 2 :)
        + 212111 [nospam nosit] Considering this thread and the quiz question, I think maybe a psychologist
        | 212112 [gavin refine] Interestingly, there doesn't seem to be a pattern as to the number of
        | 212120 [gavin refine] 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 nosit] 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] Please stop it, you are ruining my day, just to be sure, are you seriously

^ DNS server
212010 [rubytalk eac] I was just wondering if anyone had written an authoritative DNS server in
212014 [garbagecat10] What are you trying to accomplish that can't be done with standard DNS servers?
212021 [rubytalk eac] I was hoping to have a very simple one in ruby, nothing different to other
212036 [garbagecat10] Sorry if I'm making more of this than you intend, but by "very simple" I
212052 [rubytalk eac] thanks
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 hotm] Dynamic languages are flexible languages that enable developers to
212039 [mike stok.ca] 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 hotm] 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 enig] 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 gma] 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 enig] 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 enig] 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 segm] If you're going this way,
  212254 [mr.cruft gma] That's really cool!

^ Ruby: Result of a Japanese guy that just wanted to be happy programming and made a revolution
212034 [enogrob hotm] 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.kyu] 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 gmail] On the server. For a longer answer you need elaborate more.
+ 212070 [rubyfan gmai] can you post your code?
  212257 [pankajkumar1] below are client as well as server code...(i've simply copied the
  215563 [flori nixe.p] s.add_handler(...

^ When clever is stupid
212083 [khaines enig] if pu : pu = pu.url.to_s != '' ? pu : nil end
+ 212097 [pbattley gma] 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 apoth] 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 cesmai] You can't or shouldn't really do those things in Java or Fortran either.
| | 212323 [perrin apoth] . . . and I wouldn't use C or Fortran for certain classes of complex
| | 212334 [znmeb cesmai] There are a lot of things I wouldn't use Fortran for, although when it
| | + 212362 [igouy yahoo.] No, not just whining.
| | | 212371 [znmeb cesmai] Ah ... but why would I waste the time to search for, download, install,
| | | 212405 [igouy yahoo.] Yes, either understandable ignorance (didn't know there were C
| | + 212393 [perrin apoth] Hell, pay me enough, and I'll write your word processor web application
| + 212218 [david vallne] Try a brick. *duck*
+ 212331 [shortcutter ] I wasn't even aware that you can use ":" instead of "then"...

^ gserver / exceptions?
212085 [michael.gors] I am writing a simple application that utilizes 'gserver'.  Occasionaly, a

^ a selfish ruby question
212091 [bitdoger2 ya] => nil
212101 [gavin refine] You can't have an explicit receiver for private methods. See below.
212104 [bitdoger2 ya] in trying to understand this....
+ 212164 [gavin refine] 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 refine] Is there a way to call a proc while passing in the binding/scope for
+ 212100 [gavin refine] Damn, hit send too soon. **continues**
+ 212187 [eero.saynatk] I may be just feeling light-headed from COBOL, but

^ Re: syntax highlight problem about the ruby-mode in emacs
212105 [silversys bt] I have the same problem.

^ Re: When clever is stupid [RANT]
212106 [david vallne] Here, have a cookie. A Cookie of Clarity. It has extra doses of golf
+ 212113 [znmeb cesmai] I'm not a big fan of nested conditionals -- there's usually an elegant
| 212185 [david vallne] With the usual messy codebase to maintain, I thought I was the only one
+ 212114 [khaines enig] But is it a tasty cookie?  Maybe with a little chocolate (preferably
| 212119 [rdm cfcl.com] "The Elements of Programming Style", although written decades
+ 212117 [gavin refine] 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 path.b] 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 dan] I have the following trivial bit of code, just to help me figure out

^ ruby on blackberry or other phones?
212121 [sergio villa] 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 segm] 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 ruby-la] 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 weirichh] Yikes!  I hate when packages dump their contained files intermingled
212167 [dandante dan] 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 refine] 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] # help

^ File.ctime for detecting directory modifications?
212175 [eero.saynatk] Can anyone tell me if Ruby's File.ctime can be reliably
+ 212191 [nospam nosit] additions or removals, but not changes to existing files.
| 212194 [eero.saynatk] Excellent, this is just what I needed to know.
| 212202 [nospam nosit] / ...
| 212369 [rick.denatal] Actually, won't this behavior depend on the file system rather than the kernel?
| 212386 [nospam nosit] / ...
| 212402 [drosihn gmai] The operating system just reports what the filesystem tells it.
| 212408 [nospam nosit] / ...
| + 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 pablotr] model_class =3D const_get(model_name.to_s.classify)
  212360 [ezmobius gma] 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 gma] 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 gmai] 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 segm] \w matches digits too
| + 212223 [comprug gmai] Yep, that was the issue, as someone coming from a Coldfusion backround,
| + 212224 [david vallne] I could've sworn digits are word characters too.
+ 212220 [steviedizzle] You need to validate lowercase also: /[A-Za-z0-9_-]/
+ 212221 [drbrain segm] That regexp doesn't match lowercase characters.
| 212428 [dblack wobbl] \Z will allow a final newline character, though, so you'd probably
+ 212226 [nospam nosit] You are not accepting lowercase characters.
| 212228 [comprug gmai] That definetly is much easier, like I said before, I am no expert at
+ 212245 [tbray textua] There are many more letters than [A-Za-z].  You should either be
| 212290 [comprug gmai] 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 wobbl] This message is in MIME format.  The first part should be readable text,

^ 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 gma] 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 ruby-la] pathname.rb in 1.8.5 is same as 1.9.

^ A little idiom I like
212230 [hal9000 hype] Here's a little something I like. YMMV.
+ 212234 [djberg96 gma] Already in pathname2. :)
+ 212238 [gavin refine] I like this, both because it's element, AND because I'm not sure I've
| 212247 [twifkak comc] 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 cesmai] 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 hype] 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 hype] Interesting question. I always assumed the /x notation
  | | + 213063 [znmeb cesmai] 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 cesmai] Hmmm ... so *that's* where the C++ comment convention came from -- they
  | |   213322 [rick.denatal] HAL?, JCN?, JCL?
  | + 213073 [mike rubywiz] Don't think it was DEC. On PDP-11/RSX and VAX/VMS directories were
  |   + 213075 [hal9000 hype] Yes, the brackets were used that way... but Rick was talking
  |   | 213079 [mike rubywiz] 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 cesmai] 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