253790-255470

253526-254921 subjects 253847-255750

^ [ANN] concurrent-0.2.2 released (bugfixes)
253790 [mental rydia] ...

^ qri -SOa (was RE: get info from object_id)
253791 [botp delmont] # > yikes! objectspace is the key word. should have done qri

^ Import File problem
253792 [meadmaker197] I have a problem I am hoping someone can help me out with.  I am trying

^ tengo problemas con el ruby error.rb
253794 [daniels_171 ] Estoy trabajando en centos 5.0, he instalado asterisk y quiero integrar
253845 [brenton.lean] Creo que debe usar 'require' en vez de 'require_gem' en linea 20.  Si
254031 [daniels171 g] tengo problemas con el ruby error.rb
254042 [brenton.lean] ?Sabe Ud. la versi?n de rubygems que tiene?  Me pregunto si su versi?n
254046 [daniels171 g] Estoy usando Centos 5.0 kernel-2.6.18-8.el5 ruby-1.8.5-5.el5
254047 [daniels171 g] Acabo de actualizar el Rubygem 0.9.0 al 0.9.4 con "gem update --system"

^ gets does not block (STDOUT.flush issue?)
253795 [public bojer] STDOUT.sync=true
253797 [B.Candler po] answer=$stdin.gets.chomp

^ Ruby bug in +=?
253798 [zarawesome g] def addToList(x)
253800 [james.d.mast] On May 31, 10:40 pm, "zarawes...@gmail.com" <zarawes...@gmail.com>
253804 [zarawesome g] Yeah, figured. It's just odd, and allows for some nice obfuscated
+ 253805 [list.push gm] Are you expecting ["a","b","c","d"] ?
+ 253806 [mick hollins] I'd suggest what's making for the obfuscated code here is not +=, but the use of a global variable
| 253831 [shortcutter ] Absolutely agree!  The code presented is pretty weird and far from
+ 253822 [dblack wobbl] I'm not sure how you'd obfuscate anything using +=.  As far as I know,

^ ruby vs perl6
253807 [jim.zhang.ch] ...
+ 253808 [cyclewood_lt] ...
| 253810 [jim.zhang.ch] ...
+ 253809 [robert.dober] Which is the very reason I use Ruby, maybe you should wait, but I say
+ 253811 [adrianh quie] Because Ruby is here and working now :-)
| 253815 [perrin apoth] Alas, I don't know quite enough about Perl 6 to be able to make a
| + 253824 [adrianh quie] I said something vaguely similar in my "Perl Eye for the Ruby Guy"
| | 253826 [perrin apoth] Good to know!  Thanks.
| + 253833 [robert.dober] So your quoting program picked that quote, that's AI!!!!
|   + 253883 [vasudevram g] language :-)
|   + 253934 [perrin apoth] My simple little Ruby script does a surprisingly good job of picking out
|     253957 [robert.dober] Thanks for the background, but...
+ 253820 [dblack wobbl] I'm not sure what sb. is (I'm bad at acronyms and abbreviations), but

^ How to specify access modifers for variables????
253812 [vineetraja g] class Person
+ 253813 [stefano.croc] Yes, it's impossible. But you don't need it. Instance variables are always
| 253817 [vineetraja g] yup it helps,
+ 253814 [halfgaar gmx] class Person
| 253816 [halfgaar gmx] Never mind, I misunderstood the question... I thought you declared the method
+ 253818 [l.g.chin gma] In a word, no.

^ Access Modifiers
253825 [vineetraja g] 1  class Person
+ 253834 [l.g.chin gma] Note first that private is not a declaration.
+ 253840 [skoot ideico] While waiting for someone wiser than me to answer, I'll try to explain

^ Getting the last N bytes of a string:
253828 [B.Candler po] What's the simplest way to get only the last 10 bytes of a string?
+ 253835 [l.g.chin gma] buf.reverse[0,10]?
+ 253836 [list.push gm] I don't know if this is simple but you can try something like this.
| 253842 [l.g.chin gma] str[/(.{1,10}$)/]
| + 253879 [lists bertra] str[/(.{1,10}\z)/]
| | 253880 [l.g.chin gma] That is a great answer too :)
| + 253941 [list.push gm] Well, I guess the parentheses are not necessary.
+ 253843 [lloyd 2live4] Ok.  Here is my first attempt at answering a coding question.  /deep
+ 253924 [stefan mahli] buf[-10..-1] || buf
+ 253948 [lists bertra] ,From time to time I find myself trying to do something like
  253954 [B.Candler po] Thanks everyone for your answers.
  + 253982 [lloyd 2live4] ok, I have a question now.  In the original post, he wanted to cover
  | 253990 [Rob AgileCon] Well, this is how Rails solves this in ActiveSupport
  + 254299 [ryand-ruby z] => "blah"
    255282 [erik hollens] "blah blah blah".to_a.last(4).join as well.
    255343 [lloyd 2live4] What would be the chances of getting something added to the core?  It
    + 255360 [lists bertra] This is what I would have liked to propose.
    + 255384 [lloyd 2live4] def last_bytes(s, number_of_bytes)
      255466 [renard nc.rr] Sorry to come so late in the thread.
      + 255469 [hutch recurs] str[-100..-1]
      + 255470 [list.push gm] The problem is when there are not 10 bytes in the string.

^ [QUIZ] FizzBuzz (#126)
253837 [james graypr] ...
+ 253846 [seebs seebs.] ...
+ 253853 [fugalh ziane] Done, 4 times over. Not a bad quiz though my answers will probably be
| + 253858 [wieczo.yo go] Fizzbuzz has nothing with the Microsoft "How many Ping Pong balls fit
| | 253870 [seebs seebs.] ...
| + 253877 [james graypr] I almost didn't run it, for this reason.  Solutions are everywhere,
| | 253881 [fugalh ziane] Oh, I meant I had done it in four ways since the quiz had been posted.
| | + 253905 [martin snowp] Right, which is why FizzBuzz or the minsum question I mentioned (or
| | + 253983 [ari aribrown] Hey all,
| |   + 253986 [phillipsds y] try &&
| |   + 253987 [caifara.subs] My solution has 75 characters, damn, I will have another look at it!
| |     254049 [ari aribrown] Alrighty - looks good so far. When would it be appropriate to use 'and'?
| |     + 254050 [caduceass gm] irb(main):001:0> array = []
| |     + 254052 [gm.vlkv gmai] array = (1..100).to_a
| |       + 254055 [phurley gmai] ?d
| |       + 254065 [robert.dober] not quite
| |         254073 [geniusleonid] ...
| |         + 254074 [robert.dober] No idea, the recruiters are not here yet, they will arrive in an hour
| |         + 254117 [james graypr] Just as a reminder, please check that the no spoiler period has
| + 253885 [martin snowp] I think the usefulness of this interview technique depends on what
|   + 253889 [mikemondrago] "Write a function that reverses the *words* in a string" (in java)
|   + 253911 [robert.dober] APL? A wild guess though.
|   | 253920 [frioux gmail] APL was my guest too.
|   + 253914 [sander.land ] Mathematica.
|   | 253939 [martin snowp] Bingo.
|   | 253956 [robert.dober] Do you mean it is Mathematica or do you mean it is Bingo ;)
|   + 254124 [fugalh ziane] I suppose I should clarify what I mean by cleverness. I distinguish
|     254130 [leavengood g] (1..100).each do |i|
+ 253910 [rick.denatal] Like many others, I knocked this out in a few minutes, while I was eating lunch.
+ 253917 [ari aribrown] I have a working version of it, but I just want to compare and see
| 253918 [bulliver bad] it in probably the most obvious way, so it's certainly not 'clever' or
| + 253925 [rick.denatal] Integer, and a (1..100).each {|i| p i.fizz_buzzn)
| + 254138 [bulliver bad] Friday I had a rush of old memories. I have never heard of fizzbuzz being
|   254175 [pvande gmail] ...
+ 253945 [m_goldberg a] I would not be surprised if this quiz produces the most submissions
| 254215 [james graypr] Good prediction.  You were right.
| + 254224 [m_goldberg a] Well, if I'm on a roll, perhaps you'll tolerate some further semi-
| | 254230 [robert.dober] Honestly the idea is awesome, but he should have taken care to get the
| | 254319 [m_goldberg a] If I were on the hiring side in the scenario put forth in the quiz
| | + 254327 [rick.denatal] Perhaps a particular potential employer might see it that way. I
| | + 254375 [caduceass gm] Phillips' solution isn't so much of an example of KISS as it is a
| + 254260 [martin snowp] And yet, no one has so far posted a solution involving callcc or
|   + 254267 [robert.dober] and inject (unless I midded it;)
|   | 254284 [martin snowp] Aside from the one posted just after you sent this, there actually
|   + 254354 [martin snowp] # A> I CAN HAS INTERVIEW?  I ARE ADVANCED PROGRAMMER.
+ 253969 [martin snowp] Anyone care for a friendly game of golf?
| + 253974 [dblack wobbl] I'm afraid I'm stuck on 71.  Is it OK to post solutions here at this
| | + 253977 [B.Candler po] 67 here too, and nothing really clever in it.
| | + 253981 [martin snowp] According to the rules posted, we need to wait 48 hours from the
| + 253979 [B.Candler po] Actually, I've now got 65 character or 62 characters. The 62 character
| | 254003 [wfroelich db] Speaking of literal interpetation, the original Quiz post came across in my mail with a number of non-standard ASCII characters wrapped around the Fizz and Buzz text.
| | + 254008 [stack.tcpip ] Yes. Probably this symbols came from non-standard quotation marks.
| | | 254013 [geniusleonid] ...
| | | + 254016 [sam powersou] I can't wait for tomorrow to see how you all got such ridiculously low
| | | | + 254022 [caduceass gm] I'm down to 42 chars.
| | | | + 254024 [phurley gmai] I know at an interview I would start with (well not exactly, but this
| | | + 254023 [robert.dober] We failed, just look at the achieves, I do not consider that a spoiler
| | + 254027 [fophillips19] ...
| + 253988 [james graypr] Is that how you would solve it in your job interview?  Just curious.
| | 253997 [martin snowp] Well, no.  In a job interview I'd give the first solution I came up
| + 254025 [svolkov comc] ...
+ 254077 [ecomba mac.c] I didn't want to post mine as there was to much golfing around ;)
| 254078 [seebs seebs.] ...
| 254123 [cdcarter gma] My solution (see other thread) uses a lot of those same techniques.
| 254170 [seebs seebs.] ...
+ 254083 [phillipsds y] Well, It's a few minutes early, but I've got an early morning tomorrow.
| 254084 [robert.dober] If I want the job ;)
| + 254086 [robert.dober] and if I do not ;)
| + 254167 [svolkov comc] ...
|   254174 [robert.dober] That could be discussed, but this is a small entity, from my
|   254187 [svolkov comc] ...
|   254192 [robert.dober] But what is simple?
|   254199 [robert.dober] Sergey it is your fault if I cannot sleep ;), is this more readable ?
|   254205 [gm.vlkv gmai] relax, Robert, nobody hurt :)
|   + 254207 [a.postzone g] ...
|   + 254220 [robert.dober] I feel good ;)
+ 254087 [cdemyanovich] Here's my solution. It's the first one that occurred to me, and it
+ 254089 [kazaam oleco] that's my clear and straight-forward solution, I would give on a job
+ 254091 [caduceass gm] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| + 254092 [caduceass gm] Oops, this should be "if loki_roused"
| + 254093 [levandon gma] Attached is my first submission to the Ruby Quiz.  I am relatively
+ 254094 [stack.tcpip ] Everything is supposed to be a "FizzBuzz" unless having been declared
+ 254095 [grzm seespot] My first Ruby Quiz submission.
| 254120 [grzm seespot] I can't count today: 70 chars.
+ 254098 [wfroelich db] Here was my first attempt that was around 5 minutes of effort.  After
+ 254100 [agorilla gma] It's been months, and everbody else is, so why not...
+ 254119 [cdcarter gma] Here is my nice, ungolfed version.  But I took Peter's Extra Credit challenge.
+ 254134 [paddor gmail] (1..100).each do |n|
+ 254135 [gregory.t.br] I'd probably want to do something a little clever but not anything
+ 254139 [martin snowp] # Well, Mr. Martin, this is just a simple little question we ask all of
| + 254142 [james graypr] They would be a fool not to hire you.  ;)
| + 254155 [bulliver bad] <snip humourous, insightful, and bizarre solutions>
+ 254144 [james graypr] This is my solution from the time when I was considering this as a quiz.
+ 254153 [ben benatkin] I laughed at how silly the quiz is, and then I did my solution without
+ 254166 [ari aribrown] Arlighty! my first submission. If I ever get asked this at a job
| 254169 [ari aribrown] Ok, minor change to my prog - at least it will cut away 10 chars though.
+ 254209 [matthew.moss] My solution, which is probably pretty similar to everyone else's
| 254212 [matthew.moss] 1.upto(100) do |i|
+ 254273 [donald.ball ] I'll add my solutions to the thundering horde. My first solution was
| 254274 [robert.dober] That takes care of inject, what a great response time Donald ;)!
+ 254485 [danfinnie op] for i in 1..100
+ 254543 [phelan tttec] I am sure I just submitted this with a lengthy explanation but it
| + 254581 [jballanc gma] I hope it's not too late for a new submission!
| | 254620 [james graypr] James Edward Gray II
| + 254990 [martindemell] Sadly, + (and hence +=) is a method call too :)
|   255115 [phelan tttec] True but I think the overall method count will be lower
+ 254588 [m_goldberg a] Quiz 126 is now the most popular Ruby Quiz ever. Quiz 84 was the
  + 254589 [Rob AgileCon] puts "very popular" if RubyQuiz.number % 42 == 0
  | 254591 [m_goldberg a] It's too bad, but that theory fails. I wish it were otherwise, but
  + 254590 [ecomba mac.c] Hmmmm 42...

^ nested methods don't really exist?!
253838 [am artbot.de] I've just encountered somehow strange (for me) behavior of nested
+ 253895 [frioux gmail] I am not exactly a wizard, but I think that your issue is context.
| 253903 [jameskilton ] ...
+ 253906 [shortcutter ] You're right on.  I think that nested methods are a bad thing to have
| + 253916 [B.Candler po] FWIW, nested subs in Perl cause horrendous problems. For the gory details,
| + 253919 [transfire gm] There are dynamic behavior scenarios such as memoize where it could be
|   + 253921 [frioux gmail] Once for a class I had to write a simple regular expression parser and
|   + 253928 [rick.denatal] Trans, you lost me there on several counts.
|   | 253951 [transfire gm] Right. Inner def would be treated just like local variables. There
|   | 253968 [rick.denatal] It was a conscious choice on my part to using instance_methods(false)
|   | 253975 [transfire gm] Oh, I wasn't saying anything about your code. It's fine. I was just
|   + 253961 [shortcutter ] That's exactly what they are not.  If at all they are a shortcut for
|   | 253967 [robert.dober] class A
|   | + 253970 [rick.denatal] $ cat innerdef.rb
|   | | 253984 [robert.dober] Sure was, sure was, I am just with you right now, thanks to your
|   | + 253971 [transfire gm] Ah, so inner defs won't be allowed after all. Figures, I guess. Why
|   |   253973 [dblack wobbl] They're allowed; they're just not executed until the enclosing method
|   |   253978 [transfire gm] Okay. I misunderstood (should have read your post more carefully...
|   |   253980 [dblack wobbl] I would guess because it's easier to constrain it to self.class, than
|   |   253991 [transfire gm] Hmm... still a little confusion here. I don;t mean that it would imply
|   |   + 253995 [transfire gm] s/wouldn't/would/
|   |   + 254029 [dblack wobbl] Yes, I think I misunderstood, and garbled the answer anyway.  So let's
|   |     + 254030 [robert.dober] This seems however to be the first case I ever have seen where the
|   |     | 254033 [dblack wobbl] module M
|   |     | 254040 [robert.dober] Ah thanks, I was not aware of this case.
|   |     + 254041 [transfire gm] In other words, the conciser syntax does the thing that would be
|   + 253996 [james.britt ] Early on, SICP shows the use of inner methods for abstracting function
+ 253935 [dblack wobbl] inner.rb:9:in `c': undefined local variable or method `b' for

^ [Bug] String.titlecase failing on UTF-8 with accented chars
253844 [manoel lemos] Anybody knows how to solve that?
+ 253850 [matz ruby-la] case conversion functions do/will not support characters out of ASCII
+ 253857 [skoot ideico] Titlecase is a Rails-ism (and the usual policy here is that Rails
+ 253863 [dan-ml dan42] If you're going to use utf-8 you need at least to set $KCODE='u'
threads.html
top