301899-302834

301744-303506 subjects 302076-303929

^ Contionnal sum
301899 [pedrolito la] I am wondering if it is possible to create a conditionnal sum.
+ 301908 [cmdjackryan ] Should be.
+ 301910 [fxn hashref.] # untested
| 301916 [kbloom gmail] Enumerable#sum is also in facets.
| 301926 [pedrolito la] Thank you all for your messages. Yes it is a piece of code I am using in
+ 301914 [overlord gmx] @total_amount = @orders.inject(0) do | sum, order |

^ Re: The Book Of Ruby - Free eBook
301909 [huw darkneon] Just to clarify the 'level'... while it starts right at the beginning

^ Re: Watir: How to return a Watir::IE object for an existing
301911 [charley.bake] require 'watir'

^ Ruby 1.9 compatibility and performance
301918 [ruby djc.net] I have pretty much committed to Ruby for several projects - and two
+ 301927 [cmdjackryan ] Ruby 1.9 is a testbed of sorts for the eventual Ruby 2.0, and not
| 301929 [rick.denatal] Actually, not quite true.
+ 302177 [ryand-ruby z] It is certainly slow and bloated if you do a full parse. If you switch
  302301 [james graypr] Interesting.  Can you talk a little about why you prefer using regexen
  302340 [ryand-ruby z] 1) damn fast.
  302341 [james graypr] Yeah, I think those are great points.

^ [SUMMARY] The Turing Machine (#162)
301919 [matthew.moss] While waiting for 48 hours to pass, several examples of Turing Machine

^ Re: Randomizing an Array?
301930 [rubyforum th] That's because sort{ foo } expects foo to be in -1,0,1.
301964 [shortcutter ] irb(main):001:0> (1..10).sort { -1 }

^ Re: The Turing Machine (#162)
301936 [alpha.chen g] Thanks for the writeup!
301942 [matthew.moss] No... the intent was that blanks be removed from the ends, but
+ 301944 [alpha.chen g] Oops, my mistake! Goes to show how well I can read the spec...
+ 302043 [robert.dober] Great Quiz, I was offline but solved it anyway!

^ Matz: can we have rescue/else/ensure available in all blocks?
301937 [coderrr.cont] I recently posted a Ruby 1.9 wishlist (http://groups.google.com/group/
+ 301943 [matz ruby-la] can be considered as
| 301945 [coderrr.cont] Hey Matz,
+ 301947 [dev-null pma] If you write code that looks like that, maybe you should give Java a
  301949 [coderrr.cont] It was a contrived example.  So would that be a "not in favor of" from you
  + 301967 [mneumann nte] from you
  | 302083 [coderrr.cont] pages.each { |page|
  + 301990 [dev-null pma] I'm certainly not convinced.  Maybe you could post a more real world
    302089 [coderrr.cont] This has nothing to do with nested rescues.  I merely used that in the
    + 302090 [coderrr.cont] do \s* (?:\| [^|]* \|)? \s*
    + 302094 [dev-null pma] Ah, now I know why.  I ran this on ~/ and it only showed lines in a
      302108 [coderrr.cont] btw, that script _will_ give some false positives when there are other

^ Create an empty file of certain size
301938 [seo mkdynami] I need to create an empty (or at least garbage) file of a certain size.
301939 [ara.t.howard] fd.truncate( 2 ** 20 )
301940 [seo mkdynami] Thanks that's great, didn't know about that method!
301960 [shortcutter ] If it does not work on your platform, you can speed up your solution
301962 [phasis gmail] size = 2**30

^ PickAxe tutorial (was What is the bes Ruby's book for beginners?)
301941 [dave pragpro] This is a topic that's been vexing me a lot in the last few weeks.
+ 301946 [alec arlross] Thomas <dave@pragprog.com> writes
| 301983 [twscannell g] Dave,
| 301993 [dave pragpro] These are good points. The PickAxe was never intended to teach
+ 301981 [doodpants ma] I vote for keeping it the way it was in 1st. and 2nd. ed., with
+ 302802 [afmcc btinte] Sorry to come to this late. I was fine with the OO stuff and I think
  302828 [shevegen lin] I recommend the Pickaxe book.

^ Differing output for function moved from ruby 1.8 to 1.9
301948 [john.d.perki] Sup, fools?
301950 [john.d.perki] Here's an idea: a migration script that detects when and where a
301951 [cmdjackryan ] Maybe *the* chance to get your 15 minutes of fame, and deepen your
301952 [john.d.perki] I think a no-brainer prerequisite to this script would be 2.0 actually

^ A Couple of Questions Regarding Ruby Style
301953 [_mwryder wor] While working on my rational class I came up with a couple of questions
+ 301955 [cmdjackryan ] clearer.
+ 301956 [cmshea gmail] On May 15, 10:52 pm, "Michael W. Ryder" <_mwry...@worldnet.att.net>
  302053 [_mwryder wor] I am really confused now!  Integer('0xa') = 10 but '0xa'.to_i = 0.  So
  302171 [gwtmp01 mac.] Float literals must have digits to the left of
  302239 [_mwryder wor] That I figured out a while ago.  My comment was that x = .25 is not

^ [ANN] rutema 0.7.0 Released
301968 [damphyr free] rutema version 0.7.0 has been released!

^ Ruby gem newbie question
301969 [moose56 gmai] I am trying to create a ruby gem and I have a slight problem finding a
301972 [moose56 gmai] Ok, I found a fix. I am not sure if this is the correct way but it seems

^ Bug or feature?
301970 [igvt mail.ru] Can anybody explain to me what does it mean?
301971 [shortcutter ] I guess it's because of the intermediate arrays that are created for
302274 [igvt mail.ru] There isn't such a problem in 1.9.0.

^ iterate Array
301973 [sijo maxxion] I have created an array like
301974 [cdemyanovich] Using each is the most common way to iterate an array. Is there
301976 [sijo maxxion] I have a doubt regrding .collect That is why I asked tht.Is there any
301982 [shortcutter ] xxx.collect! {|n| n}

^ Responding to xmlhttp requests.
301978 [kyleaschmitt] Well I did something silly: I confused xmlrpc and xmlhttprequests, and

^ Problem in using structure in ruby
301980 [abhishek.v t] I m new to ruby so kindly forgive for small mistakes. I m trying to

^ Ruby for web without rails
301985 [di3go.bernar] I dont really like frameworks, i tryed to work with rails and i didnt
+ 301986 [avdi avdi.or] Rack makes it possible to write scripts in a CGI style without caring
+ 301989 [jeremymcanal] Ruby in Practice (http://manning.com/mcanally/)
+ 302006 [cmdjackryan ] Well, there is mod_ruby (showing its age, though), there's fastcgi and
+ 302011 [ara.t.howard] just use rails/ramaze/merb and put everything in the view.  merb and
+ 302055 [eleanor game] It's far from efficient, but there's a Camping presentation in my
| 302097 [di3go.bernar] I forgot camping, gonna give it a try, ive look the freatures, seams
+ 302128 [vidar.hoksta] Rack is a great place to start. My blog (http://www.hokstad.com/blog)
+ 302167 [albertschlef] Just for the record: there isn't really a serious project that uses
  302180 [di3go.bernar] yea, i dont know, maybe im traumatized with some big frameworks, i fell
  302182 [nefigah gmai] No, that's like using a CMS to make your site. Using a framework is like

^ Email data
301987 [tim.wolak gm] I have gathered data in my ruby script and would like to insert the data

^ [QUIZ] Obfuscated Email
301992 [matthew.moss] _If you want to ignore the introduction and just get to the task, skip down
+ 302134 [dangerwillro] Pretty interesting idea. The only catch is, anybody can run it
+ 302207 [list.push gm] Here is my solution.
+ 302210 [mikael hoilu] This is my first submission to a quiz, so excuse me if I mess up the =20
| + 302212 [sandro.pagan] Here's mine :)
| + 302214 [cmdjackryan ] Only in what you can write and want to post.
+ 302225 [marcelo.maga] Interesting,
+ 302249 [steverhahn h] This quiz was a lot of fun.  Thanks.
+ 302268 [mikael hoilu] a,b=%Q=Z,O^NPO\r4_PV\\PI\x15^-\x0\v=,email=%\%%%c\%115%%# Mikael
+ 302282 [list.push gm] Is this solution OK?
+ 302294 [mikael hoilu] I'm bored;
+ 302328 [jgabrielygal] This is my solution. I just converted each letter in my email address

^ newbie questions
301994 [jason.lillyw] I feel like we need a Forum called, "Ruby Newbie" for people like me. Is
+ 301999 [caduceass gm] or...
| 302030 [jason.lillyw] I found some issues with the above proposed solutions that I wanted to
| + 302056 [caduceass gm] Yep.  You are correct.  Sorry 'bout that.
| + 302059 [flo andersgr] To give you a more elaborate answer on why "nil" is printed... Lets
|   302070 [jason.lillyw] Perfect. Thank you both!
+ 302012 [adam.shelly ] This one usually works fine.
  302016 [jason.lillyw] Thank you! Yes, very helpful.

^ Pulling a class from a ruby file
301997 [hey_a_ray ho] I have a single ruby file, consisting of a class definition, and some
302010 [avdi avdi.or] No.
302156 [vjoel path.b] def external
302162 [mark mwilden] This is cool, but is it any different than
302164 [vjoel path.b] Oh, that would too and maybe even be better, if your condition is just a

^ Ruby classes and << Syntax
302008 [c.schiessl g] I have written a simple snippet of code and would appreciate any help
302013 [caduceass gm] You are defining a class method and not a class instance method.  Do this...
302014 [c.schiessl g] class <<Person
302129 [twscannell g] class <<Person

^ How to use MySQL instead of sqlite3
302017 [achun u.wash] The current release of Ruby on Rails uses sqlite3 as its default database.
+ 302019 [rimantas gma] For existing projects you should chage database.yml, for new projects
+ 302020 [cmdjackryan ] rubyonrails.com/community

^ Re: Named sprintf parameters
302023 [vontrapp fug] <snip/>
302024 [vontrapp fug] I forgot one important point... Don't make me use a hash if I don't want

^ Monkey Patching (definition)?
302028 [c.schiessl g] class ExampleClass
+ 302035 [jameskilton ] That's really just open classes. The term Monkey Patching comes into
+ 302040 [cmdjackryan ] Yes and no. Monkey patching it is called, if one ignores potential side
| + 302047 [robert.dober] Sorry Philip to disagree slightly, re-opening a Core class is not
| | 302052 [flo andersgr] Actually, I disagree with both definitions. I don't consider opening
| | + 302062 [robert.dober] Nor do I, as Philip was kindly giving the link to the recent
| | + 302066 [avdi avdi.or] I think this is one of the best definitions I've seen.  It should be
| + 302058 [micathom gma] ...
|   302080 [caduceass gm] class C
|   302103 [micathom gma] In a class-based OO language with open classes like ruby, I'd actually
+ 302050 [justincollin] I would suggest open classes, re-opening classes, and creating the so
+ 302074 [rick.denatal] Actually, this code never reopens the definition of ExampleClass.

^ Speaking of free books
302033 [cmdjackryan ] Are there any plans to release Programming Ruby 2nd Edition as a free
302037 [dave pragpro] To be honest, I haven't thought that far ahead.
302042 [cmdjackryan ] Yeah, I read your little rant on the changes to Ruby 1.9 on your blog.
302071 [rick.denatal] There are some advantages to you to buy directly from the Prags.  For
302073 [cmdjackryan ] That is a good point. Though I fail to see why I should register a book.
302075 [rick.denatal] In order to get notified of updates and errata.  And if you have the
302088 [cmdjackryan ] Yeah, but I can do that manually, too. Though, automation is nice, I agree.

^ Not quite getting it.
302034 [roger.alsing] I'm trying to get whats Ruby is all about.
+ 302036 [roger.alsing] Before I get killed, I ment static typed..
+ 302039 [dave pragpro] I kinda think that this is the basis of programming in any language...
+ 302041 [jameskilton ] Very oft brought up question, and valid in some points.
+ 302044 [cmdjackryan ] Well, if it walks like a duck, and it talks like a duck, it probably is
+ 302057 [flo andersgr] Actually, how do you guarantee those semantics in a statically typed
| 302077 [keithrbennet] Florian, your example is not a fair one; it illustrates an intentional
| + 302087 [caduceass gm] I tend to think that using a RDBMS for data integrity with an overlay
| + 302091 [flo andersgr] Actually, you don't have to go that far :). I know, the example is a
+ 302079 [ara.t.howard] then you will need a tall box.
| 302092 [flo andersgr] Pragmatic Programming ;).
| 302109 [roger.alsing] So is it common practise to do it like this?
| + 302110 [nefigah gmai] I wouldn't really say it's "common practice" in Ruby to do a bunch of
| | 302205 [rick.denatal] Good advice.
| | 302211 [roger.alsing] This kind of mindset is just asking for things to go wrong..
| | 302216 [rick.denatal] The type checking in the popular strongly typed languages like Java
| | 302220 [roger.alsing] Yes absolutely, static typed languages have a problem finding logical
| | 302226 [roger.alsing] Also, I'm not here to run a war about static VS dynamic typing.
| | 302229 [cmdjackryan ] In a sane way: Once the potential gets realized, the code gets adjusted.
| | 302235 [roger.alsing] Absolutely, I'm all with you on that one.
| | + 302270 [nefigah gmai] I'm not sure what to say beyond what has been said.
| | + 302273 [cmdjackryan ] Call me naive, but I think that developers are able to read
| + 302115 [flo andersgr] Yes, ActiveRecord checks for the type of Associations. I would not call
|   302119 [shevegen lin] I am not a good ruby coder but the code I saw, and my own code as well,
|   302131 [keithrbennet] An interesting example of an intentional violation of method semantics
|   302168 [JAMES.T.MCLA] charset="UTF-8"
+ 302219 [huw darkneon] You can still have decent IntelliSense with Ruby. Take a look ;-)
+ 302834 [paddy3118 go] <<Snip>>

^ Class methods in modules
302038 [AdrianLloydS] This maybe a pretty obvious question - but I decided to ask anyway.
302049 [flo andersgr] Class Methods of Modules are local to the module.
302072 [rick.denatal] Or for a module, which adds both class and instance methods, the
302160 [c.schiessl g] Interesting - so class methods in modules don't make any sense at all?
302204 [rick.denatal] Well, since Modules aren't classes, they can't have class methods per

^ Re: Obfuscated Email
302045 [john.d.perki] Google catches my spam for me.
+ 302048 [robert.dober] Optimism is the root of all evil ;) and BTW do you really want to keep
| 302054 [john.d.perki] Dude! It's not like they do it by hand or something. They have 15-
| + 302063 [robert.dober] I do not approve of that kind of language and therefore do not read
| | 302069 [john.d.perki] Yeah, wait whilst I rephrase everything I write to conform to what I
| | 302111 [robert.dober] You got me right here. That's exactly what I was expecting, but I
| | 302130 [john.d.perki] 'frightening'.tr('fr',' l').gsub('ing', ' up')
| | 302132 [robert.dober] Seems you are a nice guy ;)
| + 302065 [cmdjackryan ] 48h grace period, in which the Quiz gets discussed (if necessary) or
|   302169 [matthew.moss] That may be my fault... I neglected to add the standard Ruby Quiz
|   302247 [matthew.moss] Y'know... I debated with myself whether I should have run this quiz.
|   302250 [mikael hoilu] Apropos, is it customary to let a detailed breakdown accompany your
|   302260 [matthew.moss] It's fine either way... Most quizzes aren't going to be obfuscations
|   302262 [cmshea gmail] Here's mine.  I avoided unpack and gsub and zip so that I could write
|   302346 [APNelson.L g] x = [65, 110, 100, 114, 101, 119]
|   302441 [come.news fr] "ERoPHFwYCxUTGyIeHxQLFVwWDRQ=
|   302478 [adam.shelly ] My sig follows.
|   302531 [matthew.moss] I want you guys to know that I have read all fifteen entries... Some
|   + 302534 [matthew.moss] And, of course, you now see that my brain hurts from reading Mikael's
|   | 302535 [matthew.moss] Arg... I meant %%\%c%%%%\%%[0]  or even  %%\%c%%?%
|   | 302544 [cmdjackryan ] I've seen a C 'Hello World' program using such a technique.
|   + 302681 [mikael hoilu] After reading the summary, I realize I might have gone a bit over-=20
+ 302067 [matthew.moss] On May 16, 2:25 pm, DJ Jazzy Linefeed <john.d.perk...@gmail.com>
  302068 [cmdjackryan ] I get Russian spam. At least I think it is spam. ;)
  + 302084 [caduceass gm] I have nightmares thinking some foreign power is sending me obfuscated
  + 302098 [matthew.moss] My primary meaning is that if your signature is stored in sig.rb, I
    302099 [john.d.perki] 1.8 or 1.9?
    + 302100 [billk cts.co] 1.Dude!
    + 302101 [matthew.moss] Generally, I'm running 1.8.6, but fully expect that someone will toss

^ [ANN] MiniExiftool 0.6.0 released
302046 [janfri.rubyf] MiniExiftool version 0.6.0 released!

^ Where in the world is Shugo Maeda?
302051 [ged FaerieMU] I've recently been trying to contact the maintainer of mod_ruby, Shugo
302176 [ryand-ruby z] I'd start by writing core instead of talk. You'll trawl a richer pond.

^ [ANN] Radiant 0.6.7 "Mordant" Release
302061 [seancribbs g] Radiant 0.6.7 "Mordant" resolves several security holes and includes

^ ruby 1.9 hates you and me and the encodings we rode in on so just get  used to it.
302064 [john.d.perki] def prep_file(path)
+ 302365 [matz ruby-la] Regular expression operation does not work fine on broken strings.  It
| 302408 [john.d.perki] It makes no sense, Matz.
| 302425 [matz ruby-la] Since today's OSes do not provide encoding information for files, you
| 302426 [znmeb cesmai] I ran across this in Perl last week on a Windows machine. It seems the
+ 302370 [bbxx789_05ss] Just shut your eyes and hum the mantra, "Ruby doesn't get in your way.
+ 302429 [caduceass gm] I love it.  Another person that wants a babel fish.  The irony is in
threads.html
top