372841-374017 subjects 373222-390044

Getting Hash to print and work with numbers
373043 [seanfmglobal] trying to learn anyones input would be very helpful. Can't figure out
+ 373044 [shortcutter@] A hint: check your spelling.
+ 373045 [maritariq@gm] a = Company['Emp01']['*p*ayrate']

UTF-8 aware chop for 1.8?
373049 [ammarabuali@] Is there an easy way to chop (as in String#chop) a string that can
+ 373059 [ammarabuali@] Ended up making my own. Posting it here for the benefit of others, and
| 373061 [mentionuse@g] I was going to say
| 373062 [ammarabuali@] Beautiful. Thank you both.
| + 373063 [james@gr ys ] =3D> "\n"
| | 373066 [ammarabuali@] Thanks for the clarification.
| | 373067 [james@gr ys ] last = s[/.\z/mu] || ''
| | 373069 [ammarabuali@] At this rate the method is going to disappear. :)
| | 373099 [botpena@gm i] can we make that a one pass?
| + 373137 [b.candler@po] => "abc\n"
|   373139 [ammarabuali@] James clarified this earlier. But thanks for chiming in nonetheless.
+ 373060 [james@gr ys ] str.gsub(/.\z/mu, "")

Enumerated Scalar
373050 [rubfor@re it] As a one time Pascal programmer - does Ruby have the concept of an
373051 [shortcutter@] There is definitively nothing built in.  You have to create this

Multiple Table Join
373056 [michael.bren] file is .rb so I will give it a shot. I am trying to join a 3rd table to
373058 [shortcutter@] Including error messages and / or stack traces usually helps us a

Ruby Perofrmance
373070 [i_baseet@ho ] Why people say that Ruby is a slow language? And is there any plans to
+ 373071 [steve@st ve ] Like most things, "Ruby is slow" doesn't have a black and white answer.
| 373091 [namekuseijin] are you sure jruby is the fastest?
| 373092 [steve@st ve ] It's quite possible that something has changed recently that I'm not aware
+ 373075 [josh.cheek@g] Ruby 1.8 was, I think, the slowest widely used language in the world. They
| + 373094 [namekuseijin] lang2=3Dracket
| + 373095 [namekuseijin] BTW, I think all scripting languages -- heck!, any high level language
+ 373079 [shadowfirebi] Well, it does have that reputation.  But, slower than what? Obviously it's going to be slower than compiled languages like C. And, when running on what? Since clearly it depends on the hardware you run it on.
+ 373096 [peter.c.r.la] If you have a program that takes a while to run, I think jruby is worth
| 373098 [josh.cheek@g] Another nice thing about  JRuby is it gives you access to Java. And it's
| 373171 [igouy2@ya oo] jruby is worth=0A> trying.  I often find small benchmarks show ruby 1.9 and=
+ 373301 [Ruby@Go gl M] Because they don't understand the difference between a programming
| + 373311 [zuerrong@gm ] or they don't understand the difference between a programmer and a
| + 373327 [cmdjackryan@] Or because they are stuck in the "CPU time is expensive!" mindset. ;)
|   373348 [ammarabuali@] Or simply because they are parroting what they heard years ago,
|   373349 [default@sp r] One could even say even 1.8 wasn't that bad.  Made a benchmark last month
+ 373387 [spam.entfern] All interpreted languages are slow, because you need CPU cycles to
  + 373388 [zuerrong@gm ] 2010/11/9 Oliver Schad
  | 373392 [peterhickman] Many moons ago I started a thread that advocated writing it in C if
  | 373548 [code@ap th o] C and C++ are not the same language, and there is typically a notable
  | 373577 [peterhickman] I focused on C, and to some extent C++, as it is seen as a language
  + 373404 [cmdjackryan@] The fastest code is code that never runs.

ruby and emacs question
373073 [jude.dashiel] What can I download and install with emacs-23 and above so that emacs
373085 [devguy.ca@gm] well i have been returning to the root of simple is faster and better

Interim ruby-quiz: Middle Management Email
373076 [chris.caccia] I would like to offer an interim ruby-quiz.  Note: I am not

Ruby 1.9.2 with Rails 3.0.1
373078 [bcruparel@ya] Is there a problem with Ruby 1.9.2 p0 being able to process unicode
+ 373080 [ammarabuali@] What do you mean by "refuses to process them"? Are you seeing
| 373088 [luislavena@g] - Show us some code, show us the exact problem with a sample program.
+ 373093 [bcruparel@ya] Sorry about that.  Was tired towards the end of the day and therefore a not so bright post.  I owe it to the group to clear things up.
  373100 [luislavena@g] Ruby interprets each file 'encoding' or magical comments to decide
  373115 [b.candler@po] That answer is wrong - but I don't blame you for giving a wrong answer,
  + 373122 [ammarabuali@] That's a great collection of tips and rules. Thanks for sharing.
  + 373130 [bcruparel@ya] "The correct answer is: the encoding of a ruby 1.9 source file (and
  | 373133 [b.candler@po] As the comment says, that setting is used for templates, but seeds.rb is
  + 373146 [luislavena@g] Thank you Brian for correcting me. Encoding has always been in my TODO

Re: Ruber 0.0.4 released
373081 [danrbr@gm il] Scala solved this problem (which can viewed as a lack of the "uniform

Aziende Ruby / Rails a Torino?
373083 [riccio@in ai] ciao a tutti,

Ruby vs PHP for the web
373097 [i_baseet@ho ] I am not here to say that PHP is better or the opposite, I am here to
+ 373101 [wroxdb@gm il] But Ruby with Rails does create a web app with much less code than others.
+ 373104 [devguy.ca@gm] yes it works with the same DBs and others, not sure what you mean by
+ 373105 [rubfor@re it] If you use eRuby, then the two are very similar in the way you code, the
| 373135 [b.candler@po] That's true, but I'd say that most ruby app designers don't write their
+ 373138 [jose.halesga] ...
+ 373169 [i_baseet@ho ] Thank you guys,
| + 373173 [devguy.ca@gm] you must be sitting in agony trying to decide between php and ruby =P,
| | 373179 [ammarabuali@] I agree. With all those dollar signs, arrows (->), and mandatory
| + 373181 [code@ap th o] As someone who has written a fair bit of both PHP and Ruby for the Web
| + 373631 [d_rems@ya oo] I had 15 years of programing after me when I ended my programing carrier
+ 373337 [call@an ol s] For creating a web application, you need to use ruby on rails and not
| 373338 [cmdjackryan@] but you don't *have* to, nor do you *need* no.
| 373346 [code@ap th o] In fact, you do not need any framework at all.  Ruby can be run
+ 373341 [spam.entfern] Ruby cause of the high dynamic approach and a cleaner language design.
+ 373461 [cbciv@ya oo ] As others have said, yes.  There are Ruby libraries to allow you to
| 373534 [rubfor@re it] Can you explain what you mean? That seems a contradiction in terms.
| 373563 [jgabrielygal] It means that the language imposes restrictions about how different
| + 373585 [josh.cheek@g] 2010/11/12 Jes=FAs Gabriel y Gal=E1n <jgabrielygalan@gmail.com>
| | + 373589 [jgabrielygal] I know that, but that's not an implicit conversion performed by the
| | | 373611 [josh.cheek@g] 2010/11/12 Jes=FAs Gabriel y Gal=E1n <jgabrielygalan@gmail.com>
| | + 373590 [shortcutter@] Strongly typed because there is no _implicit_ conversion.
| |   373605 [rubfor@re it] To me it's pretty straightforward. An object of Class A cannot be
| |   + 373620 [joelvanderwe] What makes this so slippery a question is what "treat as" means.
| |   + 373629 [shortcutter@] So you are claiming that Ruby is weakly typed.  It is not.  Ruby does
| |   | 373765 [rubfor@re it] dynamic typing.
| |   | 373771 [shortcutter@] Dynamic typing only says something about _when_ types are evaluated.
| |   | 373781 [shortcutter@] Typo!!! This should of course have read "strongly typed".
| |   + 373760 [code@ap th o] Not quite.  The type of an object of class A is never changed.  Rather, a
| + 373888 [zuerrong@gm ] $ perl -le 'print 2+"2"'
|   373897 [w_a_x_man@ya] In awk, "+" always means arithmetical addition; string concatenation
|   373898 [w_a_x_man@ya] Or even
+ 373853 [alpha.azieru] the 70s/early 80s), then PASCAL, JAVA, and now Ruby.
  373891 [shortcutter@] Interesting tidbit: research has shown that developers have roughly
  + 373895 [josh.cheek@g] Though you take a hit learning how to use the preproduced code. I have spent
  + 373934 [alpha.azieru] Thank you.
    + 373949 [shortcutter@] IIRC the statement was that independent from programming language the
    + 374503 [code@ap th o] I suppose that, if you are going to produce the same number of lines of

cms 4 static pages?
373102 [gstepken@go ] m looking 4 a framework, that allows to build static community software
373114 [b.candler@po] * nanoc 3
374200 [gstepken@go ] tnx lots, great help!

Ruby Time - Sports Time
373103 [flebber.crue] what time method would be best for sports times. I am referring to
373112 [shortcutter@] First we should distinguish between storage and representation.  You
373116 [flebber.crue] om/posts/rklemme/019-Complete_Numeric_...
373128 [shortcutter@] com/posts/rklemme/019-Complete_Numeric_...

Can I run windows command line app interactively?
373110 [cai.inceptio] # open a session
+ 373143 [jeremy@bo p.] The problem is that @session.each will run until the input stream is
| 373459 [cai.inceptio] Thanks a lot Jeremy for reply.
+ 373462 [cbciv@ya oo ] You can do this, but you'll need to use the Win32 API to attach to a
  373652 [cai.inceptio] Thanks Charles, this looks promising.
  373685 [cbciv@ya oo ] You're welcome.
  373871 [cai.inceptio] My case is the former. I write scripts running regular jobs and they

Splitting a string into characters - not bytes
373117 [peterhickman] I realise that this is probably a known thing but my google-fu is not
+ 373119 [ammarabuali@] => ["俺", "の", "嫁", "と", "会", "話", "2", " ", "|", " ", "あ", "ね", "こ"]
| 373120 [peterhickman] Thank you thank you thank you
| 373123 [ammarabuali@] I was just reminded of that simple solution myself yesterday on this very list.
| 373144 [mentionuse@g] If you want the array you can do str.chars.to_a.
| 373145 [ammarabuali@] => "1.9.2"
+ 373121 [stefano.croc] What version of ruby are you using? In ruby 1.9, you can simply use

true! or false!
373118 [transfire@gm] class TrueClass
+ 373124 [default@sp r] I believe the more idiomatic way of doing it would be with question marks,
| 373126 [transfire@gm] Originally I did not have the exclamations at all, just `.true`, but
+ 373134 [b.candler@po] class TrueClass
+ 373149 [josh.cheek@g] You would need to override at a higher level, I think, because I frequently
  373155 [transfire@gm] ly

Any emacs user here?
373131 [t.yao426@gm ] I'm now using Sinatra and I'm an emacser
+ 373132 [ruby@sl gh l] Yes, there is -
| 373140 [t.yao426@gm ] Thanks a lot
+ 373166 [tim.hoolihan] I don't have a haml answer, but I have I use rinari, ecb, etc
+ 373168 [ryand-ruby@z] I just added http://www.emacswiki.org/emacs/HamlMode
| + 373186 [jude.dashiel] I tried git pull http://github.com/technomancy/emacs-starter-kit/ in
| | 373203 [ryand-ruby@z] ...
| + 373189 [t.yao426@gm ] Thank you guys , you're great~
+ 373223 [ruby.object@] Did you try ELPA? They have an Emacs package manager that can be

getpersonas travel-cambodia recomment about
373136 [khmerrole@gm] in http://sihanoukvillekampongsom.com sihanoukvillecloselink

beginner question - searching csv file by column and returning values if true
373147 [microfud@ao ] I'm a complete noob to ruby and am hoping someone can help me with this.
+ 373152 [w_a_x_man@ya] # Read the file.
+ 373156 [jeremy@bo p.] require 'csv'
  373465 [cbciv@ya oo ] of the standard CSV class.  If you're using 1.9, FasterCSV is already

1.9 CSV Parsing Issues
373153 [kenneth.lam@] I'm currently porting a script to 1.9 and I'm having problems getting
+ 373154 [james@gr ys ] $ ruby -v -r csv -e 'p CSV.parse("field1,field2\r\nfield3,field4\r\n")'
+ 373157 [kenneth.lam@] File.read shows "field1,field2\nfield3,field4\n"
| 373159 [james@gr ys ] Great.  That's what we expected to see.  You are right about the =
+ 373160 [kenneth.lam@] Excellent, that works perfectly.  Thanks a lot for your help.
| 373163 [james@gr ys ] My pleasure.
+ 412711 [lists@ru y- ] I'm running into this same error, file reads like so:    (Client
| + 412712 [shortcutter@] What *same* error?
| | 412713 [lists@ru y- ] Unquoted fields do not allow \r or \n (line 152344).
| | 412715 [shortcutter@] Yes.  For production code that needs to be made more robust of course.
| + 412717 [tamouse.list] Robert's responses notwithstanding, I've never seen a CSV file that uses
|   412718 [shortcutter@] I was going to suggest to fix the generation code instead of adjusting
+ 412719 [lists@ru y- ] The Issue is that I don't have control over the generation of the file.
+ 412720 [lists@ru y- ] You could always "chomp" the file before passing it to the parser, or
+ 412721 [lists@ru y- ] You can Chomp a file?  I thought that was only strings
+ 412723 [lists@ru y- ] Well, if you read the file into a string, you can chomp it.

Rack usage.
373170 [paradisaeida] How many Racks is it reasonable to have in a call stak?

Help selecting the correct elements in an array
373172 [demetriuso@h] I'm working on a method but the results are "the opposite" of what I
373177 [ammarabuali@] scores.where(["standard_id NOT IN (?)", standard_ids])
373195 [demetriuso@h] Ammar,

Emacs/putty code help
373174 [thierryny@ho] Please someone help me with this ruby code on putty/emacs
+ 373178 [w_a_x_man@ya] mber
+ 373184 [jgabrielygal] Take a look at ARGV

ssl encryption with post_form()
373175 [robmckennie@] im writing a program that needs to post a form, and iv found that i can
373176 [ammarabuali@] Did you try googling for "ruby https post"? The first few results will
373205 [robmckennie@] <sarcasm>
373215 [ammarabuali@] .facetiousness

the second argument
373182 [wroxdb@gm il] what's the argument of "obj" in:   def []=(index,obj) ?
+ 373183 [jgabrielygal] This is syntactic sugar for
+ 373469 [cbciv@ya oo ] a[index] = obj

Wonderful Website...!!!!!
373185 [parimalam01@] Dear All,

require problem
373188 [roni.kekkone] Pragmatic Programmers) and I'm at chapter 7 where I have touse require
373190 [ammarabuali@] Ruby 1.9 no longer includes the current directory in the load path.
373201 [roni.kekkone] Thank you very much, Ammar. That explains a lot. I trust you when you
373211 [cmdjackryan@] Consider <http://www.microsoft.com/technet/security/advisory/2269637.mspx>.

ANN: Sequel 3.17.0 Released
373194 [code@je em e] Sequel is a lightweight database access toolkit for Ruby.

Conta occorrenze in Hash
373196 [darkangel-84] 1)
+ 373197 [justincollin] frequency = { 'alle' => 13, 'legge' => 16, 'delle' => 13, 'sono' => 16 }
+ 373198 [jgabrielygal] trasforma

bundler+metric_fu customs configuration (not rails) - after changing default folder, still creating the default folder tmp
373199 [paqs140482@g] I'm trying to configure the rake file in order to change the default folder

bulding a crash-proof eval(), is it possible?
373202 [nick@ni k- r] I'm building an app which must execute user-submitted bits of Ruby code.
373204 [stefano.croc] You need to replace rescue with
373208 [nick@ni k- r] Thanks you Stefano; that did the trick!
373221 [huard.elise@] Also, you probably thought of that, but you want stop them from

text editor on USB drive
373206 [chen_li3@ya ] I install Ruby1.92(PC version) on my USB drive but I cannot install a
373210 [cmdjackryan@] If you don't need file associations and the like, just use one that is
+ 373236 [devguy.ca@gm] you can also try emacs, i love emacs =)
+ 373320 [shortcutter@] Kind regards
  373339 [chen_li3@ya ] Thanks for the recommendation. I download Scite and install it the USB

install text editor without adminstrator previlege
373207 [chen_li3@ya ] Can I find a text editor without using adminstrator previlege and
373209 [sutniuq@gm .] Just extract it where you want it to be and use it from there.
373340 [chen_li3@ya ] Thanks for the suggestion. I now installl Scite on the USB drive and it works.
373350 [scott@ai ru ] You could use NetBeans or RadRails, as well.
373351 [Reid.Thompso] ...

Who is your soulmate? Get the answer from a live psychic now!!!
373212 [aymooontrix@] Who is your soulmate? Get the answer from a live psychic now!!!

Get a value from array
373216 [b1368810@lh ] I need to get a value from array.
373217 [Gennady.Byst] h[0].to_s[2,4]

Maybe not a Ruby question but I still need to know
373219 [sbstn26@ya o] I'm using windows XP.  I save my practice files in my thumb drive -
373234 [devguy.ca@gm] what are you saying? that you want"H:\Ruby\Practice\example1.rb" to run
373247 [sbstn26@ya o] Yes I can and I have been doing that for several months now.  That's
373355 [zettabyte@gm] 'my-script.rb' is not recognized as an internal or external command,
373772 [sbstn26@ya o] To Kendall Gifford,

Create a class - ideas
373220 [flebber.crue] Evening
373225 [shortcutter@] First of all you should get your variables right.  Variable "Per" does
373235 [flebber.crue] ow...
373237 [flebber.crue] ave
+ 373238 [mike@ca ga .] flow
+ 373240 [mike@ca ga .] flow
  373243 [flebber.crue] ow
  + 373252 [flebber.crue] flow
  | 373281 [mike@ca ga .] best flow
  | 373326 [flebber.crue] flow
  | 373429 [flebber.crue] st flow
  | 373431 [flebber.crue] best flow
  + 373253 [jrmair@gm il] This WHILE loop will not work because the condition is only evaluated
    373267 [shortcutter@] Where's the point in doing this when there are "while" loops already
    373271 [jrmair@gm il] fun