208055-250370

207773-209210 subjects 208225-261961

Rubygem libs vs Non Rubygem libs
208055 [bulliver@ba ] charset="iso-8859-1"
208057 [tilman@co e-] as I=20
+ 208060 [bulliver@ba ] charset="iso-8859-6"
+ 208174 [khaines@en g] Of course, this isn't such a great solution from inside a library,
  208191 [tilman@co e-] ed
  208237 [bulliver@ba ] charset="iso-8859-6"
  208241 [tilman@co e-] tem=20

Newbie at ruby - syntactic sugar for Range / Array
208056 [neil_lauranc] Was hoping someone could point me in the right direction. I'm currently
208059 [dblack@wo bl] The * is the "unar[r]ay" (unary un-array) operator, or at least
208074 [rick.denatal] Or you can think of the * before the last rvalue in an assignment as a
208075 [dblack@wo bl] a, b = "abc\ndef"  =>  a == "abc\n", b = "def"
+ 208086 [rick.denatal] Nothing at all wierd about that, any enumerable can, which makes
| + 208095 [chiology@gm ] _Why The Lucky Stiff calls it a splat. I like this because it's a very
| | 208260 [dblack@wo bl] I think everyone does, except me :-)  That's certainly what it was
| + 208257 [rick.denatal] And an afterthought.
|   208261 [dblack@wo bl] Let me rephrase my point: the only weird thing is that ranges are
+ 208278 [logancapaldo] irb(main):047:0> a, b = "abc\ndef"
  208514 [dblack@wo bl] Yes -- I forgot the *, which sort of made my point pointless :-)

Parse/Split `cmd`
208085 [tjones@ac or] I'm really new to Ruby, I have been using TCL for a really long time
+ 208087 [skurapat@uc ] Use $x.split, which works on newlines by default.
+ 208090 [nobu@ru y- a] lines = `cmd`.to_a

Re: XPath refreshers
208100 [Eric.Armstro] Again, greatly appreciated.

Rake: How to *stop* if a shell command fails???
208107 [Eric.Armstro] On a related note...
+ 208139 [nobu@ru y- a] World writable system directories?  Hmmm..., amazing.
| 208451 [Eric.Armstro] There's one line in there that's driving me nuts.
| 208456 [hal9000@hy e] Haha... it's a Perl/Ruby idiom...
| 208704 [Eric.Armstro] Thank you!
+ 208443 [Eric.Armstro] It turns out I was (happily) dead wrong about that.

Please help fixing gems on OSX
208114 [andreinla@gm] I installed ruby 1.84 and ruby gems and rails and for a while
+ 208162 [canyonrat@ma] Andre,
| + 208718 [andreinla@gm] Please consider my being very new to Mac OSX and BSD Unix.
| | 208733 [canyonrat@ma] OK, I would have used .bash_profile rather than .bash_login but OK.
| + 208861 [drbrain@se m] Incorrect.  No version of Ruby ships with Rubygems.
|   208868 [canyonrat@ma] Huh?
|   + 208870 [drbrain@se m] Somebody downloaded the rubygems tarball and ran sudo ruby setup.rb
|   | 212916 [andreinla@gm] I downloaded gems and ran sudo ruby setup.rb which seemed to run OK.
|   | 212925 [canyonrat@ma] ~ $ gem
|   | 213318 [andreinla@gm] which gem yelds
|   | 213404 [canyonrat@ma] That's good. What does 'which ruby' yield?
|   | 213468 [andreinla@gm] which ruby yelds
|   | 213472 [canyonrat@ma] Don't thank me for much. If I recall correctly, if you just type
|   + 208875 [logancapaldo] yes the elves did sneak in. Don't believe me or Eric? Download
|     208878 [canyonrat@ma] Well, I actually though of that and confirmed for myself that it
+ 213017 [andreinla@gm] I downloaded gems and ran sudo ruby setup.rb which seemed to run OK.

[ANN] Ruport Day has begun!
208118 [gregory.t.br] == It's Ruport Day! ==
208194 [gregory.t.br] We're now past the halfway point, and support for SVG graphs is

A use case for an ordered hash
208131 [hal9000@hy e] There have been numerous occasions when I wanted an
+ 208132 [znmeb@ce ma ] That sort of code is what Chuck Moore evolved into Forth. :)  Seriously,
| 208133 [hal9000@hy e] Yes, I could use a single flat array... I could also program
+ 208134 [garbagecat10] actions.keys.sort {|a,b| b.to_s <=> a.to_s}.each {|k|
| 208135 [hal9000@hy e] Clever workaround. Thanks for that.
+ 208136 [shortcutter@] To me a Hash feels wrong.  Why?  Because you don't make any use of hash
| + 208147 [chiology@gm ] Absolutely... an Array is perfect for ordered information.
| | 208153 [ mfp@ac .o g] That's not what he wants though (the point is matching against the Regexp ---
| | + 208208 [hal9000@hy e] Now, that's clever. That's probably the least painful
| | | 208227 [tom@he me st] Tom
| | | 208234 [hal9000@hy e] I knew we were reaching that point in the fugue
| | + 208213 [james@gr yp ] You could use find() there, right?
| + 208177 [james@gr yp ] He *is* making use of a Hash property.  He wants the keys to be
| | 208192 [ mfp@ac .o g] Hal is making the case for *literal* "ordered hashes".  The keys will be
| + 208206 [hal9000@hy e] I never use a hash for fast lookup. I use it because it
|   208233 [shortcutter@] Um...  So you're saying that you wouldn't bother if lookups were O(n)?  Wow!
|   208236 [hal9000@hy e] I think you mean "wouldn't care"?
|   + 208238 [shortcutter@] Probably.  I'm not a native speaker so I'm certainly not authoritative
|   + 208246 [sitharus@si ] Unfortunately for you some of us do things that involve searching
|     + 208255 [hal9000@hy e] Your point is well taken.
|     | + 208258 [transfire@gm] +1 for Hal
|     | | 208265 [hal9000@hy e] I've seen that, and it's kind of cool.
|     | | 208273 [logancapaldo] class AssocList
|     | + 208259 [sitharus@si ] I would support this as there are uses for it.
|     + 209677 [w_a_x_man@ya] # a = ['key 1','1',  'key 2', '2',  'key 3',3].to_assoc
|     + 209690 [Bil.Kleb@NA ] I don't think anyone is suggesting replacing the
|       209695 [rick.denatal] Which, as has been shown can be provided without changes to the base
|       + 209698 [editor@ad et] This functionality is not part of Hash as traditionally
|       + 209701 [hal9000@hy e] Sure. And if you didn't have Hash, you could implenent
|       | 209741 [ihatespam@ro] I disagree.  I dislike the hash literal syntax and I can't believe that
|       | 209759 [hal9000@hy e] Haha... I don't think anyone said it's the *only* useful thing. :)
|       | 209765 [gavin@re in ] Coming to Ruby from JavaScript (among other paths) I personally dislike
|       | + 209766 [w_a_x_man@ya] We already do; it's just that the pompous popinjays refuse to use it.
|       | | + 209771 [hal9000@hy e] Is that the way the syntax goes?
|       | | + 209773 [halostatue@g] Is it refusal, or a desire to do what is clearest and most compatible?
|       | | + 209892 [gavin@re in ] ruby 1.8.4 (2006-04-14) [i386-mswin32]
|       | |   209897 [gavin@re in ] Bah...don't mind me. I'm an idiot. Of course that works in 1.8.4 if you
|       | |   + 209913 [thoran@th ra] I switched from 'my' thread because this seems more appropriate to
|       | |   | 209928 [thoran@th ra] m = [:a => 'a'] # m is for map.  I could go for this term too as it
|       | |   | 210024 [hal9000@hy e] Again, interesting... but what if your keys are integers? Or arrays?
|       | |   + 210114 [robert.dober] ...
|       | + 209768 [james@gr yp ] $ ruby_yarv -ve 'p({foo: "bar", baz: "bar"})'
|       | | 209895 [gavin@re in ] Yeehaw! Thanks, powers-that-be! :)
|       | | 210020 [hal9000@hy e] It's pretty cool. The only catch is that your keys have
|       | | 210102 [james@gr yp ] Correct.  It's just and alternate symbol Hash key syntax.
|       | + 209770 [hal9000@hy e] I agree I'd prefer a "nicer" notation than we have, but the
|       + 209748 [gwtmp01@ma .] A ordered hash implementation in the standard library would be better
|       | 209753 [ara.t.howard] not if
|       | + 209763 [hal9000@hy e] No, I think it would still require a core change -- because a
|       | + 209764 [halostatue@g] Which, IIRC, no one but opponents to an (insertion) ordered
|       + 209762 [halostatue@g] Such implementations *are* a bit slower and less efficient since
+ 208243 [john.carter@] I'm in the habit of automagically writing...
| + 208250 [perrin@ap th] . . . but if you want them in a *specific* order (other than that
| + 208277 [halostatue@g] In the case that Hal is talking about, and in the case where
|   208293 [hal9000@hy e] Either (=>) or [=>] would be fine with me. I'd slightly prefer
|   208301 [martindemell] Or we could use another %?{ } constructor, which are, after all, being
|   + 208318 [halostatue@g] Wouldn't it be the same as Hash lookup? It's still got every other
|   | + 208356 [martindemell] True, I suppose you could do it with a doubly linked list overlaid on
|   | | 208365 [gwtmp01@ma .] Can't you just maintain an internal array representing the key insertion
|   | | 208369 [halostatue@g] It's a little more complex than that, but that's pretty much what all
|   | | 208380 [gwtmp01@ma .] Yep, I understand the need for the literal constructor. It is a bit
|   | + 208363 [robert.dober] ...
|   | + 208450 [hal9000@hy e] OHash lookup should be as fast as Hash lookup.
|   |   209681 [robert.dober] ...
|   |   209700 [hal9000@hy e] I meant an ordered hash would be slowed down simply
|   |   209702 [robert.dober] ...
|   |   209710 [martindemell] The thing is, there's no way to preserve insertion order in a hash
|   |   209724 [robert.dober] ...
|   |   + 209725 [ara.t.howard] my alib has an orderedhash which maintains insertion order.
|   |   | 209799 [transfire@gm] He he. Facets has one too called Dictionary (but also aliased as
|   |   | 209808 [ara.t.howard] indeed.
|   |   + 209734 [perrin@ap th] OrderHash sounds good to me.
|   |     209735 [rick.denatal] <duck>Well when I OrderHash, I usually order CornedBeefHash with a
|   |     + 209737 [ara.t.howard] and i have a good time in amsterdam.  ;-)
|   |     + 209738 [perrin@ap th] I was thinking of hash browns, actually.
|   |     + 210113 [robert.dober] ...
|   |       210226 [rick.denatal] Rick DeNatale
|   + 208442 [chneukirchen] #524<5|>lilith:~/src$ grep Dict ruby-0.49/dict.c
|     208458 [hal9000@hy e] Now, that's funny.
+ 208422 [Bil.Kleb@NA ] I had a string with a bunch of tagged "tolerance fields",
| + 208436 [garbagecat10] I've had to deal with this (interestingly, in something that was
| + 208453 [hal9000@hy e] See, guys? An ordered hash in Ruby would help support
+ 210472 [surfunbear@y] Can't you create your own using mixins and including enumerable or
  210476 [hal9000@hy e] Yes, but I would lose the convenient literal notation.
  + 210489 [halostatue@g] ...and which could have been seen by someone who looked at more than
  | 210493 [hal9000@hy e] Heh heh. That's OK. We were at "that point" in the fugue.
  + 210748 [surfunbear@y] ================================================
    210778 [halostatue@g] hash-like objects. I've written one. Hal has probably written one. Ara
    + 210817 [surfunbear@y] I started to get the idea to such an effect, or that some short hand
    + 250370 [axgle@12 .c ] up

Tim Bray (Sun Microsystems) on Ruby
208138 [enogrob@ho m] The Director of Web Technologies at Sun Microsystems jumps directly to
+ 208150 [fxn@ha hr f.] "Finally, a minor, almost a footnote, issue. I miss polymorphism. In
| + 208164 [hutch@re ur ] I'm pretty sure he means 'ad hoc polymorphism' which is, within half
| | 208167 [garbagecat10] What I find myself becoming more and more comfortable with is passing
| + 208184 [james@gr yp ] Hmm, I would say you would mimic this by accepting any number of
+ 208181 [james@gr yp ] Looks like he will be giving the internationalization,

Secrets of lightweight development success
208140 [enogrob@ho m] "The Java? programming language is powerful, but it has significant

Microsoft Phasing in Support for Dynamic Languages on .Net
208141 [enogrob@ho m] Microsoft is working behind the scenes to enhance the support of .Net

Ruby climbed up to the 13th place in the Tiobe index
208142 [enogrob@ho m] In blitz interview with Bruce Tate, he says that does not know, use, or
+ 208154 [dblack@wo bl] know Ruby, not Bruce Tate.
+ 208158 [robert.dober] ...
  208160 [bulliver@ba ] charset="iso-8859-6"

Gmail and ruby-talk (was Re: Pen and Paper (#90))
208172 [rick.denatal] Matt,
208176 [james@gr yp ] I'm *assuming* this happens because Ruby Talk is configured by
+ 208224 [chiology@gm ] I did not know you could shut it off. But, yes, that's been my
+ 208350 [jmg3000@gm i] This has been discussed a number of times here. It might be useful to

How to update nested Hashes?
208178 [hammed@gm il] ...
208185 [dblack@wo bl] def a.nested_update(b)
208190 [hammed@gm il] ...

[SOLUTION] (1)   [QUIZ] Pen and Paper (#90)
208179 [curi@cu i. s] it works by assigning each square a point value based on how many

Ruby in Steel won't work, am I just screwed?
208183 [ihatespam@ro] Okay, I've posted this before but I finally got around to trying it
208195 [huw@DE TH SB] If you contact us direct we can walk you through your installation to check

[Solution] (2)  [QUIZ] Pen and Paper (#90)
208187 [curi@cu i. s] Here is my second solution.

[Solution] Bonus Questions  [QUIZ] Pen and Paper (#90)
208189 [curi@cu i. s] For 5x5, I found 9 steps (which is just your example with the first
208270 [bulliver@ba ] charset="iso-8859-1"
208280 [curi@cu i. s] i think jumping over 2 squares means landing on third square away.
208284 [curi@cu i. s] oh haha. there are typos. the 4 and 5 should be one row lower. i

stderr capture on Windows
208196 [sardaukary@y] Is it possible to capture stderr on Windows?
+ 208221 [anatol.pomoz] See solution here
| 208223 [sardaukary@y] Well that gives me another cryptic error
| 208229 [anatol.pomoz] Try to put following line to separate script and run
| 208411 [sardaukary@y] Yes it was my script that works now.
+ 208235 [billk@ct .c ] or

Toward better project layouts
208197 [transfire@gm] As some of you may know I've been working on and off on a lib versioing

[SOLUTION] Re: [QUIZ] Pen and Paper (#90)
208198 [skurapat@uc ] Here is my solution, which uses recursion like the Civilization II
208239 [skurapat@uc ] Well, I discovered that this solution doesn't always find the

Search objects
208199 [sambient@gm ] I've set up this class and objects and would like to "search" it
+ 208201 [m_goldberg@a] I'm assuming that you are just implementing this for its educational
| 208205 [sambient@gm ] Well a few things.  For some reason, in the past I've attempted to use
+ 208207 [james@gr yp ] Well, if we had those composers in an Array, we could use normal
+ 208211 [ara.t.howard] require 'weakref'
  208240 [sambient@gm ] That's a lot of food :)

[Solution] re: [QUIZ] Pen and Paper (#90)
208202 [collinsj@se ] Here's my solution, which works the same way as Elliot's first solution,
208231 [collinsj@se ] [justin@cheese ruby]$ time -p ruby penpaper.rb 5 > /dev/null

gems, helpers and rails
208203 [waspfactory@] this is the ruby forum but i think this might be half a ruby question. I
208214 [waspfactory@] okay update
208217 [waspfactory@] tis all sorted for now

[Solution] [QUIZ] Pen and Paper (#90)
208210 [boris.prinz@] my solution is recursive and works only for small boards. The largest
208232 [sander.land@] My solution also uses the Warnsdorff heuristic (moving to the square

Module to make guerilla (monkey?) / reopening classes easier. Comments?
208212 [logancapaldo] I hammered this out today. It has some limitations (works only for

Using Ruby in a commercial application?
208215 [chanon.s@gm ] I just began learning Ruby a few hours ago, but it has been enough to
+ 208244 [znmeb@ce ma ] My "advice" is to seek *legal* advice from *attorneys*, *accounting*
| 208248 [canyonrat@ma] I got a grin out of Ed's advice, but, in fact, lawyers who know
| 208312 [richard.conr] With respect to licensing, I think most of the popular libraries ship with
+ 208245 [kbloom@gm il] From a purely technical standpoint, you're not going to be able to protect
| 208247 [garbagecat10] ...
+ 208383 [jmg3000@gm i] You'll need to look at the licenses for each library/module you use,
  208478 [rdm@cf l. om] Nolo Press has a number of useful books on legal

Newsgroup/mailing list/ruby-forum.com disconnect?
208219 [eero.saynatk] I am using http://www.ruby-forum.com to view ruby-talk
+ 208404 [collinsj@se ] What I've found works best is to double check ruby-forum against the
+ 208537 [f@an re s- .] Fixed, the missing mails have been imported into the forum, nothing has
  208604 [eero.saynatk] Thank you, all is in order!

gems timeout on the rubyforge repository
208222 [ryangrow@ya ] I have downloaded and compiled both ruby and gems. I am now trying to
208230 [canyonrat@ma] Try again now. I just tried it and it works for me.
209145 [ryangrow@ya ] Yes, I just tried it and it worked. Thanks.
threads.html
top