392735-393593 subjects 393168-393641

^ Starting a process and specifying its parent
392979 [vic.blaga gm] I need to start a (sub)process from inside a ruby script that will continue
+ 392989 [shortcutter ] No.  Storing the PID of the child somewhere and stopping the child
| 392990 [vic.blaga gm] Thank you for your answer. I've further investigated the issue and you are
| 392994 [shortcutter ] Victor, please do not top post.
+ 392993 [rob agilecon] You need at least 2 forks to be certain that the final process is =

^ Problem to fetch data with ruby and mysql
392991 [srimanta12 g] Just yesterday I successfully installed ruby in my pc, means I am
392992 [peter vanden] I see more relevance in 'mysql2'

^ Next Ruby Release?
392995 [shevegen lin] Does anyone know when the next ruby release will come from the 1.9.x
392997 [steve stevek] IIRC, there will not be another release of 1.9.x. 2.0.0 is currently
392998 [sophrinix gm] I thought ruby 2.0 was going to be delivered sometime in Feburary of 2013.

^ win32console and open3 incompatibility
392996 [James.French] A prize (or at least a big thank you) to anyone who can tell me why comment=
394515 [James.French] A prize (or at least a big thank you) to anyone who can tell me why comment=

^ Reading specific columns on a text file
392999 [cassiopgodin] I'm working on script here and I need do read the 1st and the 10th
+ 393000 [matma.rex gm] line.split(" ")[0 , 11] does, in fact, return 11 items, starting from 0th.
| 393002 [cassiopgodin] Thank you very much, that was perfect.
+ 393001 [rob agilecon] first
  393103 [shortcutter ] 35959

^ moveto(x,y) method
393004 [aport99 gmai] How can I declare moveto method if I want to change co-ordinates (x,y)
+ 393005 [code apotheo] module Domieszka
+ 393006 [peter vanden] You probably want a class here, so you can make
+ 393007 [aport99 gmai] ok, than you very much. It must be a module because it will be used in

^ class Circle
393008 [aport99 gmai] With co-ordinates x y that are in Domieszka module I want to do ray r in
+ 393009 [aport99 gmai] ray that has some length:) not co-ordinates
+ 393018 [steve stevek] Circle = Struct.new(:x, :y)
  393019 [steve stevek] Circle = Struct.new(:x, :y, :r)

^ Basic Ruby performance
393012 [dniq dniq-on] First, I should point out that I'm new to Ruby, although it seems pretty
+ 393013 [dniq dniq-on] s = "This is a test string"
| 393015 [ryand-ruby z] s = "This is a test string"
| + 393016 [peter vanden] Euhmmm, I doubt that ...
| | 393020 [ryand-ruby z] You're replacing a method call (a.match b) with a syntactic construct a =
| | + 393022 [josh.cheek g] Wow, I never knew that. I don't understand how it accomplishes this, a
| | | + 393024 [ryand-ruby z] a =3D~
| | | | 393032 [code apotheo] . . . unless you have a different default for the method's argument.
| | | + 393029 [code apotheo] That's only because it *does* look cleaner.
| | + 393028 [dniq dniq-on] The reason I tried to use Regexp.new is because I figured it would
| |   + 393036 [jeremy bopp.] Everything in Ruby is an object, even regexps, so you can save your
| |   | + 393040 [josh.cheek g] The o flag tells Ruby to only interpolate the first time, and then cache
| |   | | 393044 [jeremy bopp.] Thanks for the tip! :-)  Still, sprinkling that option around might
| |   | + 393060 [dniq dniq-on] Thank you for the advices!
| |   |   393063 [wyhaines gma] Do you realize that there are multiple Ruby interpreters with
| |   |   393065 [dniq dniq-on] Yeah, I saw it in another post - I'll give them a try.
| |   + 393052 [shortcutter ] Not necessary in Ruby: regexp literals are treated specially and are
| + 393017 [jeremy bopp.] Ryan is being a little facetious about the parenthesis and whitespace in
|   + 393021 [ryand-ruby z] I tried to drive that point home by showing a ruby solution that was =
|   + 393027 [dniq dniq-on] Hmmm... Didn't realize this would make difference :) Thanks!
|     393058 [cremes.devli] Hard to believe that this thread has gone this long without a mention of other Ruby runtimes.
+ 393014 [ryand-ruby z] like
| 393026 [dniq dniq-on] My code was merely an example of very simple loop. Its purpose was not
| + 393033 [su.comp.lang] One thing you can do is to replace for loops with while loops. For loops
| | 393034 [dniq dniq-on] Hmmm... Thanks! Definitely useful advice!
| + 393051 [shortcutter ] your processing is CPU bound?  If it is IO bound the difference
|   393061 [dniq dniq-on] Yep, I'm sure it's CPU bound: the CPU load is at 100%. The data comes in
|   393066 [josh.cheek g] It creates a Range, which just iterates, not an array. A more idiomatic way
|   393069 [dniq dniq-on] Phew... :)
+ 393030 [dniq dniq-on] I have to tell, however, that string.split() works much faster in Ruby
+ 393041 [botpena gmai] omg, careful w big numbers in ruby..
| 393043 [botpena gmai] using plain fixnum may help, but the jump is still there
| + 393046 [botpena gmai] pls ignore. i think it is consistent at 10
| + 393059 [rubytalk2dav] Ummmm... yeah... every time you tell it to do ten times as many loops,
|   393089 [botpena gmai] i noticed the mult 10 too late. what i was emphasizing is that, given
+ 393045 [reid.thompso] $ cat mult.rb
+ 393062 [dniq dniq-on] Here's a question: when I say "for a in ( 0..1E8 )" - does Ruby create
| 393064 [echristopher] It might make a counter-based loop internally, but at a higher level
+ 393071 [dniq dniq-on] Tried rubinius and jruby. Rubinius so far is the fastest one, but still
| + 393073 [cremes.devli] The thing you need to know about Rubinius and JRuby is that they both JIT (just-in-time) compile the code, but they need to collect statistics on the runtime profile first. That usually takes a few seconds. So any test that runs for under 10s or so doesn't give the runtime much opportunity to optimize the code.
| + 393476 [headius head] I cannot reproduce. Post your jruby -v...I suspect it's running with
|   393477 [headius head] And your other bench. Again, pretty meaningless.
+ 393072 [dniq dniq-on] - Ruby 1.8.7 does not support \p{} regexps (like \p{Alnum} for example),

^ [ANN] isolate 3.2.2 Released
393025 [ryand-ruby z] isolate version 3.2.2 has been released!

^ problem with method
393035 [aport99 gmai] Why method pole= doesn't work??
+ 393037 [code apotheo] I'm not entirely sure what you're trying to do.  Does this accomplish
+ 393038 [aport99 gmai] I mean that Pole= is the same as Pole_is. I want to declare accessors to
+ 393039 [aport99 gmai] pole= is the name of the method
+ 393042 [josh.cheek g] There's a bunch of things here to pay attention to.

^ [ANN] md2man 1.1.0
393047 [sunaku gmail] md2man - markdown to manpage - https://github.com/sunaku/md2man#readme

^ [ANN] binman 3.0.1
393048 [sunaku gmail] binman - UNIX man pages for Ruby bin/ scripts

^ Choosing target network for UDP broadcast
393050 [wever axini.] socket = UDPSocket.new
+ 393055 [shortcutter ] Hm, no UDP specialist here but can't you bind to the proper address
+ 393056 [sean.ohalpin] Use #bind - http://ruby-doc.org/stdlib-1.9.3/libdoc/socket/rdoc/Socket.html=
  393057 [sean.ohalpin] ml#method-i-bind

^ Problem migrating to Ruby 1.9.2
393076 [pbayford tal] Some assistance please - I have a Ruby project, which I started in Ruby
+ 393077 [ryand-ruby z] Ruby
+ 393078 [shortcutter ] Did you consider using Marshal?
| 393094 [pbayford tal] I did try using Marshal, however, while the examples show how to use
| 393102 [shortcutter ] The docs at http://www.ruby-doc.org/core-1.9.3/Marshal.html#method-c-dump
| 393293 [pbayford tal] Thanks for the assist Robert - marshal does indeed work - the key for me
| 393308 [shortcutter ] ve
+ 393080 [pbayford tal] Just went back to it to get a copy of the errors, which were extensive,
  393081 [rubytalk2dav] Yes, we fixed it by remote control.  ;-)
  393092 [pbayford tal] I guessed as much!!! Seriously, wondering if something in the site code

^ Difficulty writing a sorting method (Chris Pine's Learn to Program)
393079 [offbeatheart] Chris Pine's book. The assignment I'm working on is to write a sorting
+ 393082 [rcoulman gma] I'm fairly new to Ruby myself, but not to programming in general.
+ 393144 [jgabrielygal] Welcome to Ruby, I hope you enjoy it !

^ Inheritance in other notation
393083 [aport99 gmai] notation like 'class Square', we can write class Rectangle like 'class
393088 [jeremy bopp.] class Rectangle < Square
393104 [shortcutter ] reated classes, so you don't have to do anything special to make Rectangle =
393105 [josh.cheek g] Probably neither should inherit from the other since they break Liskov
393109 [shortcutter ] gle

^ Psych YAML problems
393084 [jlambert oh.] Caught Psych::SyntaxError: (xxxxxx.yaml): couldn't parse YAML at line 168
393097 [ryand-ruby z] 168 column 8

^ 4 random numbers take highest 3 and add them together.
393085 [serpentinexc] I want to get 4 random numbers. The numbers will be between 1-6. I want
+ 393087 [jeremy bopp.] It would be easier for others to help you if you included the actual error message you get in addition to the code that purportedly produced the error. Not everyone seeing your post has the ability (that's me at the moment) or desire to copy and paste your code, but they may be able to help anyway with the error message in hand. :-)
+ 393090 [list.push gm] This is a different approach but if it doesn't work, I think it is
+ 393091 [list.push gm] If you don't like inject, this is even shorter and easier to understand.
+ 393093 [kachick1 gma] I think that error from some causes.
| 393095 [kachick1 gma] sorry, my ex2 is not safety(if [1, 1, 3, 6])
+ 393098 [josh.cheek g] even begin identifying them. I recommend you start with something simple
+ 393111 [serpentinexc] Thank you Harry. Thank you everyone. This works.

^ libv8 problem
393086 [phildobbin g] I'm trying to run an intial rake to create my databases on a Rails
393106 [hassan.schro] Why `sudo` for this?
393107 [phildobbin g] I ran `sudo` because rake complained `no password_auth`.
393108 [phildobbin g] I found the cause: an errant line in my bashrc was leading Ruby up the

^ Encoding error
393096 [guillaume.do] # encoding: UTF-8
393101 [matma.rex gm] Marshal.dump generates binary data, not containing any real strings

^ [ANN] Code Zauker
393099 [jj gioorgi.c] I am happy to announce my new Ruby project after years of python coding

^ Please help me find the error in my logical OR
393110 [serpentinexc] Please help me find the error in my logical OR.
+ 393113 [ryand-ruby z] Why aren't you using Array#sort? I'm sure it was suggested.
+ 393134 [gilbertly gm] as an exercise, you may play your code with the following values for stats1=
+ 393157 [rubytalk2dav] I think it would be a lot easier to fix if it weren't depending on

^ [ANN] event_hook 1.1.1 Released
393112 [ryand-ruby z] event_hook version 1.1.1 has been released!

^ Re: Freightrain 0.8.0 released
393114 [beagle4321_2] I was super impressed with freightrain, when I looked at it last year.
393116 [shevegen lin] rb testapp.rb
+ 393118 [andrea andre] I'm in Argentina at the moment and I can't investigate
+ 393119 [andrea andre] I'm in Argentina at the moment and I can't investigate
+ 393120 [andrea andre] I'm really sorry I didn't kept much contact with you

^ Hooking a function to run in IRB context (but only in IRB context)?
393115 [shevegen lin] I start IRB.
+ 393117 [josh.cheek g] Don't know how to do it with irb, but if you use pry (which is way better
+ 393126 [shevegen lin] Hmm thanks but ... I am really not sure how to do that ...
| 393151 [jrmair gmail] Put this in your `.pryrc`
+ 393127 [b.candler po] => nil

^ [ANN] bulker 0.1.0 Released
393121 [daixque gmai] bulker version 0.1.0 has been released!

^ Re: Armagh v Cork Gaa Allianz Football 2012 game live watch free,
393122 [newgame071 y] Watch here

^ str.encode! sets valid_encoding even if resulting string is invalid (1.9.3)
393123 [tgarnett pan] I get some untrusted input from some of our partners that should be in
393365 [ppaysant goo] I'm observing the same problem. String#encode does not replace invalid

^ Simple even and odd number loop in Ruby
393124 [faithfromslo] type in a number. When this number is an "even" number, it will divide
+ 393125 [matma.rex gm] def f n # this function calculates next number in your sequence
| + 393129 [echristopher] There's also Integer#even? and #odd?.
| + 393160 [faithfromslo] Thank you Bartosz, this is exactly what I was looking for. My loop was =
+ 393158 [shortcutter ] Please show the code so we can give you concrete advice (vs. writing
+ 393165 [faithfromslo] How would you make this loop stop when it reaches number one?
| 393210 [jgabrielygal] Instead of looping forever (while true), you should only loop until num is 1.
+ 393252 [mmanny14 yah] please is there any ideas on how to do this for a range of number say 2

^ inheritance one more time
393128 [aport99 gmai] Square = Struct.new(:x,:y,:a) do
+ 393130 [echristopher] I'm not sure what's in your Domieszka module, but in the code you
+ 393132 [aport99 gmai] That's full of code. I think there is no problem with Domieszka.
  393138 [echristopher] Oh, right -- I forgot Square is a struct with a and a= defined on it.

^ Error with splat params in method definition
393131 [joneslee85 g] ```
393135 [jeremy bopp.] Have you tried calling your method with the workaround with exactly 0 or
393147 [shortcutter ] This cannot reliably be evaluated because there is an ambiguity.  Will

393133 [daniel.manch] Daniel Manchego

^ How to keep list of reglar expressions into array
393136 [lakshmi27.u ] I have morethan one regular expressions
+ 393137 [josh.cheek g] I have absolutely no idea what this means.
+ 393139 [botpena gmai] try,
+ 393143 [shortcutter ] /r(?:uby|ails):\s*$/i

^ how to exit from outerblock
393140 [lakshmi27.u ] I have 2 blocks .i want exit innerblock and outer block if condition
+ 393141 [josh.cheek g] a=[1,2,3,4,5,6]
+ 393142 [shortcutter ] "e.it" is a Groovyism.  We're in the realms of Ruby here. :-)

^ [ANN] md2man 1.2.0
393145 [sunaku gmail] md2man - markdown to manpage - https://github.com/sunaku/md2man#readme

^ [ANN] binman 3.1.0
393146 [sunaku gmail] binman - man pages for bin scripts

^ View/lookup referenced source file
393148 [piggy181 gma] I wonder what would an experience ruby developer does when working a
393152 [richard.conr] I think it is more accurate to say that Rubists both professional and

^ (none)
393149 [fatihdurmus1] ...

393150 [fatihdurmus1] ...
393153 [msporysz06 g] oh that went well.

^ ruby encoding 1.8.7
393155 [srinivasarao] i am using rails 2.2.2 and ruby 1.8.7 and sql server 2008. when i am

^ formal argument cannot be a constant
393161 [tohasmukh ya] def display_method(NM)
+ 393162 [rcoulman gma] In Ruby, variable names start with lower-case letters and constants
| 393172 [tohasmukh ya] Thanks Randy. It works
+ 393163 [jgabrielygal] tells you that you cannot have a constant as a parameter to the
+ 393173 [tohasmukh ya] Thanks Randy. It works

^ Using _ like in Scala?
393164 [shevegen lin] fruits = %w( apple banana orange )
+ 393167 [rubytalk2dav] Lots of things... some of which we want to do, some not.  Let's not go
+ 393197 [josh.cheek g] It could, but I doubt anyone would go for it. As an example, there are
+ 393201 [tony.arcieri] IMHO, Ruby's block argument semantics are already crazy enough.
| 393204 [echristopher] How so?
| 393206 [tony.arcieri] - Yielding arguments to a block without arguments discards the arguments
| 393208 [darkintent g] It would make more sense to just eliminate the need to type even a
| + 393216 [shortcutter ] Like
| | 393219 [josh.cheek g] I do this sometimes, but I do it like this
| | 393220 [shortcutter ] +1
| | 393240 [josh.cheek g] The name would have no impact on the language, it is still just a block
| | + 393241 [darkintent g] ks,
| | + 393254 [shortcutter ] Hmm...  Maybe I wasn't clear enough.  I was trying to ask how any
| |   393259 [josh.cheek g] Not sure about other editors, but TextMate knows what context it is in if
| |   393263 [shortcutter ] by
| |   + 393271 [steve stevek] $ echo "foo" |  ruby -pe 'next unless $_ =~ /(foo|bar|baz)/'
| |   | 393282 [darkintent g] Wouldn't the general use case at issue here be addressed by adding
| |   | 393299 [shortcutter ] I do not think it is a good idea as a general rule because that
| |   + 393292 [josh.cheek g] Yes, what I want is an editor feature (it's also a cognitive aid, even
| |     393300 [shortcutter ] Somehow I didn't understand what you meant by "syntax for naming
| |     393304 [josh.cheek g] Yeah, I gave that example in my first response, just before "But never
| |     393328 [echristopher] Does TextMate have its own mechanism to name a folded block of code,
| |     393334 [josh.cheek g] I am pretty sure I'd have to hack the syntax file. I probably would if I
| + 393224 [code apotheo] What -- like this?
|   393237 [darkintent g] Yes.  Does this only work in the REPL?  I've never tried that kind of
|   393242 [code apotheo] As mentioned elsewhere, this works in Ruby, period.
+ 393222 [markus fisch] You've already got a lot of responses, on top of my head these are the

^ Easy loop question
393166 [faithfromslo] and odd numbers multiplied by three plus one.
+ 393169 [ryand-ruby z] Please do your own homework
+ 393180 [rubytalk2dav] Ask yourself, why is it going forever?  Change the code that makes it
+ 393188 [faithfromslo] Yes, I have done it now. Now I just need to make it count all the
+ 393209 [cidza tin.it] print "Give me an integer number: "
+ 393218 [faith centru] def f n # this function calculates next number in your sequence