396881-414794

396664-397042 subjects 397075-412515

Segfaults and memory leaks
396881 [lists@ru y- ] I'm not really sure where to start with this, but I experience a lot of
396941 [drbrain@se m] of

help for a little regexp
396883 [lists@ru y- ] So I am new to ruby, and I need help for a regexp.
+ 396885 [lists@ru y- ] I don't know how you've come to the "\/" part of the regex. This makes
| 396894 [ruby-talk@la] Even better, use [[:alpha:]]+ so that the expression also matches
+ 396886 [jgabrielygal] This works for me. Note that the start anchor "^" is outside of the
+ 396890 [lists@ru y- ] Okay, thank you guys for your help and advices :)
  396905 [jonanscheffl] In the future you should check out rubular.com. It's always my first stop

script hanging with looping SIGVTALRM calls
396888 [saku@yt i. i] I have script which I run three times a day, it does heavily threaded
399739 [saku@yt i. i] I'm bumping this, as this occurred again for the 3rd time and I really

MyHDL port to Ruby?
396889 [lists@ru y- ] does anybody know of a (partial) port of MyHDL to Ruby?

how about adding method hook
396892 [jarodzz@gm i] I want An agent on machine, so that it can fake user actions.
+ 396895 [shortcutter@] Btw, your code is not safe as it does not restore on exception.
| 396912 [jarodzz@gm i] thanks, robert.
+ 396897 [hmaddocks@me] ...
  396913 [jarodzz@gm i] thanks for the info.
  396944 [jarodzz@gm i] sorry to robert.
  396946 [shortcutter@] line 7 and see what happens.

Pause the execution of the code on keypress and continue on keypress
396893 [lists@ru y- ] Hey guys,

Copying text from MS Word and wrapping in HTML - help please
396896 [lists@ru y- ] I'm new to Ruby and was wondering if someone can help me out with this.
+ 396899 [lists@ru y- ] What's the exact format of the Word files? It might be easier to parse
+ 396900 [lists@ru y- ] Thank you for your reply. Yes the documents comes through generally as
+ 396901 [lists@ru y- ] OK, it's in the attachments.
+ 396904 [lists@ru y- ] Thank you very much. So I presume I have to point the location below to
+ 396907 [lists@ru y- ] tree = DocxTree.new 'C:/Users/me/Documents/myDocument.docx'
+ 396908 [lists@ru y- ] Thanks. Sorry if I'm missing the obvious here but looking in the two
+ 396910 [lists@ru y- ] The files only supply the classes. In order to use them, you have to
+ 396919 [lists@ru y- ] I see, thank you very much for your help. Being new to Ruby, think I
+ 396957 [graham@me he] I'm not sure that Ruby is the right tool for this task. Why not use
  396958 [mike@os n. r] There are antiword and catdoc out there (but these would rather

Jan E.
396903 [lists@ru y- ] Jan E.
396906 [lists@ru y- ] Yes, and it worked flawlessly. I've also checked the file, and there are

Is this good code
396914 [lists@ru y- ] I'm digging through some older code in my application and i stumbled on
+ 396915 [lists@ru y- ] There is no conditional "end". The "end" belongs to a bigger statement
+ 396916 [groups@in ox] Your instincts serve you well. The unless at the end is a surprise, a
| 396917 [lists@ru y- ] To be honest, I find this almost as obscure as the original code. A
+ 396921 [lists@ru y- ] If it bothers your brain to look at it, definitely rewrite it so
  396922 [lists@ru y- ] Digging through more code i found an even more convoluted example. Here
  396929 [lists@ru y- ] #------------

[ANN] inversion 0.10.2 Released
396918 [ged@Fa ri MU] inversion version 0.10.2 has been released!

Audio based Instructions (via Ruby and Linux)?
396920 [lists@ru y- ] Anyone has an idea where I could look for SIMPLE audio based
396925 [ryand-ruby@z] I'm not trying to be presumptuous, but I think I speak for all of us =
396927 [rodj@ro an m] I think he is looking for a ruby script to respond to voice commands.
396932 [ryand-ruby@z] that is simpler than text input??? How do you beat #gets ?
396933 [ryand-ruby@z] *sigh* I swear I'm literate. I just haven't had enough coffee. Really.
397019 [zipizap123@g] ?!? Something like a voice recognition engine in ruby ??

should $1 propagate through method calls?
396924 [lists@ru y- ] When running this snippet, I expected that, since $1 "looks" like a
+ 396926 [ryand-ruby@z] it
| 396930 [groups@in ox] Personally I love the Perl heritage stuff like this. But for someone coming
+ 396938 [lists@ru y- ] Well that explains it.  Thanks everybody.

[ANN] graph 2.5.1 Released
396928 [ryand-ruby@z] graph version 2.5.1 has been released!

Using Yield - Lambdas & Blocks exercise Ruby Monk
396939 [lists@ru y- ] New to Ruby and currently trying to get a grasp of Lambdas and Blocks.

fake loading bar/time lapse wait
396942 [lists@ru y- ] language. But basically what i am trying to do is make a "loading bar"
396943 [saji@u- iz .] I guess you may get some inspiration from this ruby library by Jordan

Re: Need help understanding Yield (trying to grasp Lambdas and Blocks)
396945 [lists@ru y- ] Your descriptions are correct, but I find your terminology a bit

[ANN] Slide Show (S9) 1.2.1 Update - Quick Starter Templates, Takahashi, etc.
396948 [gerald.bauer] I've uploaded a new slideshow gem (aka Slide Show (S9)), that is, v1.2.1.
+ 396949 [ryand-ruby@z] I love you
+ 396951 [botpena@gm i] thank you for slideshow.
  396983 [gerald.bauer] Thanks for your comments.

Is this the correct use of rand?
396950 [lists@ru y- ] In the example below why was it necessary to put (max+1)? Couldn't that
+ 396952 [akr@fs j. rg] rand(max+1) may generates a number between 0 and max.
+ 396953 [lists@ru y- ] If you call rand(n) with n being an Integer, the method will return a
+ 396955 [shortcutter@] I am surprised nobody mentioned that code is flawed because it does
  396956 [shortcutter@] Sorry Tanaka Akira, you mentioned it - and I overlooked it. :-)
  396968 [lists@ru y- ] Thanks for the help everyone! Going to use the range version as I'm
  + 396969 [matma.rex@gm] "Learn Ruby the Hard Way" probably won't help much if you've already
  | 397085 [lists@ru y- ] Thanks for the reply. Also was looking to do some quick review to make sure that I actually do grasp the basics. Any suggestions?
  + 397295 [alex@st nk .] synchronized with the labs

Confusion about aliasing eql? and ==
396959 [lists@ru y- ] I'm new to ruby and have some confusion about the eql? and == methods. I
396961 [lists@ru y- ] Well, eql? is generally just a method you can use to compare more
396963 [lists@ru y- ] Isn't eql? used for hashing? If you want your objects to be properly
396965 [lists@ru y- ] You *can*, if you want the keys to be compared in a certain way rather

Asynchronous IO
396960 [lists@ru y- ] I have found quite a bit on the web regarding asynchronous IO, but
+ 396962 [andrea@an re] ...
| 396993 [shortcutter@] - use the block form of IO.popen
+ 396964 [jeremy@bo p.] The problem you're probably facing is due to the program being run via
+ 396977 [lists@ru y- ] Thanks a lot, I'll go through and try everything you guys suggested and
+ 397016 [sean.ohalpin] I just so happen to have been mucking about with the PTY

Interactions between 'new' and 'initialize' ?
396966 [lists@ru y- ] In JRuby, I am extending an existing Java Class with a Ruby initialising
+ 396971 [matma.rex@gm] Well, you redefined .new to only accept one argument, so what are you expecting?
+ 396972 [lists@ru y- ] I redefined 'new' for Parent, not for Child, so I expected the 'new' for
| 396973 [matma.rex@gm] Child inherits the redefined method from Parent. You'll have to
| 396984 [lists@ru y- ] I agree that redefining 'new' for Child should work, but I don't think
| 396986 [lists@ru y- ] Well, "new" is a normal class method, so it will behave just like any
+ 396990 [shortcutter@] That does not sound like a good idea.  Class#new should only be
  397051 [lists@ru y- ] Many thanks for all the contributions.
  397056 [shortcutter@] You're welcome!

[ANN] ANSI v1.4.3 released
396974 [transfire@gm] ANSI 1.4.3 has been released.

stack level too deep for quicksort code
396975 [lists@ru y- ] as pivot).
+ 396976 [ryand-ruby@z] Write tests.
| 396980 [lists@ru y- ] And add in lots of prints, for example at the start of each function,
+ 396985 [lists@ru y- ] The parti method fails for two element arrays, which are already
+ 396987 [lists@ru y- ] By the way, this low level element swapping isn't necessary in Ruby. The
| 396989 [ruby-talk@la] pivot = array.shift
| 396991 [lists@ru y- ] I wouldn't do it. This removes the first element from the original
| 397023 [ruby-talk@la] The only time the array is referenced later in the method is when you
| 397024 [lists@ru y- ] I'm talking about the original array you want to sort. When you pass it
| 397026 [ruby-talk@la] Ah, now I see what you mean. Good call.
+ 396995 [lists@ru y- ] Actually the reason I skipped the 7-line solution and did this low level
  397013 [lists@ru y- ] OK. But you should still get rid of "l" and "r", because these

Making a ruby program open up an audio file
396978 [lists@ru y- ] program to open up an audio file so it can play it at that specific time
396979 [lists@ru y- ] Of course it's possible. You could simply open a console with Ruby and

C++ extension using boost
396988 [lists@ru y- ] I'm trying to create a ruby extension with a library that uses boost.

Ruby 1.8.7 patchlevel 370 released
396992 [shyouhei@ru ] Ruby 1.8.7 was released on June 1st, 2008.  In commemoration

Newb on String to Hex for UDP packet
396994 [lists@ru y- ] Guys im a total newb to ruby and i have been battling with something
+ 397022 [ruby-talk@la] How do you determine whether a given number (like 10) is hexadecimal or
+ 397032 [lists@ru y- ] You might want to look at Array#pack

Accessor Methods with a Twist
396996 [lists@ru y- ] I am surprised that the code shown below returns, 'Doug'.  I would
+ 396997 [matma.rex@gm] "name=('Fred')" is interpreted as local variable assignment, not
+ 396998 [jgabrielygal] name=3D('Fred')  is interpreted as an assignment to a local variable
+ 396999 [justincollin] `name=('Fred)` is not calling your `name=` method. It's parsed as `name
| 397028 [lists@ru y- ] Oh.  I see.  My knee-jerk reaction from reading the responses was, "Why
| + 397029 [lists@ru y- ] I seems you haven't fully understood the concept of object orientation.
| | 397034 [lists@ru y- ] Thanks, Jan, so much for that *VERY* thorough response.
| | 397035 [lists@ru y- ] - local variables beginning with a lowercase letter or an underscore
| | 397036 [lists@ru y- ] Thanks again for another very thorough response.
| | 397037 [ryand-ruby@z] You should stop here.
| | 397053 [lists@ru y- ] You'll get a kick out of this.  When I first read your response, I
| | 397057 [lists@ru y- ] I'm actually a "he". ;-)
| | 397106 [doug@ds if r] # This module can be mixed in to a class
| + 397033 [whitequark@w] Jan E. has replied with an excellent explanation, but I'll answer your
+ 397043 [lists@ru y- ] I don't see why you want to use a module for this. I'd rather use a

Ruby pty and expect
397000 [lists@ru y- ] I'm trying to write a program that will log into a list of ip's and run
+ 397006 [astounding@g] You do remember that the $ character is special in regular
+ 397012 [lists@ru y- ] That was it.  thanks a million
  397018 [zipizap123@g] Also if any time later you need more from ruby+ssh, have a look at gem
  397021 [aaron.psamue] I agree with the regex comment and also I have had an easier time / better

ruby performance
397001 [lists@ru y- ] I have snippet from my project, and this iteration is performing very
+ 397002 [lists@ru y- ] maybe try jruby in --server mode?
+ 397003 [lists@ru y- ] replace "for i in 1..suffix_array_len-1 do"
+ 397007 [matma.rex@gm] The MRI is, unfortunately, slow as balls, and there's not much you can
| 397008 [lists@ru y- ] if you write shitty code, its still shit in jruby too.
| 397010 [matma.rex@gm] Yes, of course 1.9 is faster.
| 397011 [matma.rex@gm] Yes, of course 1.9 is faster.
| 397047 [lists@ru y- ] A loop with no payload is a completely useless benchmarking scenario.
| 397048 [matma.rex@gm] You are wrong. It's the same as benchmarking a loop with a payload,
| 397068 [shortcutter@] I am going to place myself right between your chairs.  I think both of
| 397086 [lists@ru y- ] i = 0
| 397088 [matma.rex@gm] The problem is that with every iteration inside #times, Ruby yield the
| 397090 [lists@ru y- ] I should provide version numbers... the RHEL on work machines is pretty
| + 397091 [whitequark@w] 1.8.1?!! That's just ancient. I doubt it's compatible with any recent
| + 397095 [botpena@gm i] cmon, with objects, speed becomes relative...
| | + 397096 [lists@ru y- ] This is a slight cheat, since my examples had addition independent of
| | | 397108 [code@ap th o] Why does j even exist in this?
| | | 397113 [lists@ru y- ] Yes -- I wanted to "do something" in the loop, so I incremented a
| | + 397101 [ruby-talk@la] Note that the overhead for starting up and exiting the interpreter has
| |   397102 [ryand-ruby@z] an impact on your results when you benchmark like that.
| |   397104 [lists@ru y- ] I agree, and I think the whole benchmarking has nothing to do with the
| |   397105 [lists@ru y- ] This sounds like a religious discussion.
| |   397120 [ryand-ruby@z] bullshit
| + 397107 [lists@ru y- ] No surprise there; the loop doesn't do anything, so the optimizer can
+ 397020 [hmaddocks@me] Maybe if you told us what that code was supposed to do then we could suggest a better approach.
+ 397027 [hutch-lists@] Yes that's a huge difference, and what you're seeing is roughly what you =
| 397039 [lists@ru y- ] Thanks Bob for your valuable input. I think then in this case, Ruby with
| + 397054 [hutch-lists@] with
| + 397067 [shortcutter@] Can you be more specific about your use case?  I am asking because
+ 397031 [lists@ru y- ] If performance is what you're after, I think Ruby is simply the wrong
| 397040 [lists@ru y- ] Yes, I am Ruby newbie :)
+ 397121 [lists@ru y- ] Whoa -- excuse me.  I try to run some quick numbers out of curiosity and
  397146 [mike@os n. r] Hey, excuse them.

distribute windows ruby app
397004 [lists@ru y- ] I'm familiar with "ruby2exe" or "OCRA" or the like, that basically zip
414794 [rogerdpack2@] At the risk of answering my own question, I believe releasy does this.

[ANN] RubyInstaller 1.8.7-p370 released
397009 [luislavena@g] In combination with the rest of the RubyInstaller team, I'm very

Marshal.load error
397014 [lists@ru y- ] I've been trying hard to find a smart way of serializing objects using
+ 397015 [matma.rex@gm] You're not opening the file in binary mode for reading (only for
+ 397069 [shortcutter@] Apart from the binmode issue that Bartosz mentioned you are not

[ANN] Ruby mogilefs-client 3.2.0 released
397017 [normalperson] A MogileFS client library for Ruby.  MogileFS is an open source

"Register" Ruby function as Tcl function in Ruby-Tk?
397025 [kw@co eb ke ] Python has a "register" function that wraps a Python function into a Tcl
397485 [nagai@ai ky ] There are some ways of interaction betwenn Ruby and Tcl.

ruby SQLite under cygwin
397030 [lists@ru y- ] I have been trying to get sqlite3-ruby going under cygwin (XP 32-bit). I
397187 [lists@ru y- ] I was able to get SQLite Ruby installed and working under cygwin using

Real time collaborative editing
397038 [lists@ru y- ] I was just thinking on create a little app for real time collaborative
397046 [ryand-ruby@z] not

[ANN] local-openid 0.3.0 - Single User, Ephemeral OpenID Provider
397044 [normalperson] local-openid allows users with shell accounts on servers to authenticate

Cannot get proper query CPU Temperature under win7-64bit
397045 [lists@ru y- ] I Can't query CPU proper Temperature (MSAcpi_ThermalZoneTemperature) on
+ 397050 [jam@ja an be] It looks like the problem you're facing isn't a ruby problem. You might havebetter luck with your motherboard manufacturer's documentation.
+ 397077 [lists@ru y- ] Thank you Jams. Let me check the specification of wmi and motherboard

Question on Learning Ruby the Hard Way
397049 [lists@ru y- ] Specifically, I'm wondering if someone to talk me through what's
+ 397052 [ixti@me be .] Inside loop you are calling `method` instance method, which returns a
+ 397055 [lists@ru y- ] For the next time, please *attach* the code rather than post it. The
| 397058 [ixti@me be .] Michael, please notice that this Method object is bounded to the object
+ 397059 [lists@ru y- ] Thank you for the help!  I'll try to wrap my head around these concepts
+ 397060 [lists@ru y- ] One more quick question.
  + 397061 [lists@ru y- ] You need the next room, which is returned by this method.
  + 397062 [ixti@me be .] Because `room` in this case is not a method, but an object.

ruby_rhymes question
397063 [lists@ru y- ] I am interested in using ruby_rhymes, but have no idea how to use it. I
+ 397064 [ryand-ruby@z] The url you reference has many working examples.
+ 397065 [lists@ru y- ] Yes, however, I am just learning about ruby and working with the basic
  + 397066 [jam@ja an be] What have you tried? You might want to start with a text file that includes t=
  | 397080 [lists@ru y- ] Well, I've only tried writing some basic ruby code, not using any of the
  | + 397081 [lists@ru y- ] Maybe you should start with a more popular and better documented gem to
  | | 397083 [its.code.in.] ...
  | + 397092 [botpena@gm i] try eg,
  + 397078 [code@ap th o] Are you on MS Windows or something Unix-like?
    397079 [lists@ru y- ] Ubuntu Linux.
    397094 [code@ap th o] Do you know about using "require" to use a library?

how to sort this nested hash
397070 [lists@ru y- ] s = {'s1'=>{'hn1'=>{'15'=> {'m1'=> ['aa', 'bb'] }}}, 's3'=>{'hn2'=>{'10'
+ 397071 [jgabrielygal] First of all, a Hash is not sorted, so the result cannot be what you
| 397072 [ryand-ruby@z] ...
+ 397073 [lists@ru y- ] Like Jesus already said, you cannot sort a Hash. But of course you can
  397074 [shortcutter@] Yes.  I would rely on that feature for debug printing purposes only
threads.html
top