367717-368242

367520-369187 subjects 367905-377064

file.readlines  problem
367717 [myocean135@y] please run the following program in your computer,the output is
367741 [myocean135@y] urlfile.rewind

Mongrel not starting, missing environment Engineyard
367719 [ccomstock@gm] I am trying to deploy my app on Engineyard and I have not been able to
367721 [rick.denatal] You are much more likely to get help in the Rails group than here, or

hash-style parameters
367724 [spare@fr gi ] para "Paragraph Text", :style => "this", :whatever => "that"
367727 [ninja@sl ph ] You could answer your own question by looking at the source of the program
+ 367733 [tn.pablo@gm ] Just a note: while you can omit parens in method definitions, most
| 367737 [ninja@sl ph ] Why?
| 367755 [tn.pablo@gm ] Just a convention, I guess precisely so you can easily tell method
+ 367806 [rogerpack200] Posted via http://www.ruby-forum.com/.

Chrome ore Sell Pakistani 30% - 52%,
367725 [resourts85@g] Chrome ore Sell Pakistani 30% - 52%,

kind_of?( NilClass )
367728 [lists@ke pg ] Should I write
+ 367729 [steve@st ve ] You can always var.nil?
| 367730 [lists@ke pg ] Well, yes if the var is a kind_of?(Object) but not if
| 367738 [ninja@sl ph ] The purpose of a BasicObject is, generally, to implement proxy classes.
| 367745 [lists@ke pg ] Right.
+ 367735 [ryand-ruby@z] Do you actually care if it is nil? Or just untruthy? I much prefer
+ 367748 [shortcutter@] The other suggested checks are cleaner IMHO.  There is only ever one

[ANN] Inochi 5.1.0
367734 [sunaku@gm il] Inochi

how to sove the loaderror?
367742 [myocean135@y] please run the following program  in irb,you can get
+ 367744 [myocean135@y] sorry , it is
+ 367786 [b.candler@po] (1) Don't use class variables (@@myfile): the value will be shared

Help with too many methods
367747 [samatoms@gm ] I am writing a Ruby program that creates different URL queries. Right
+ 367749 [shortcutter@] Without further information about what all these methods do it's
| 367750 [samatoms@gm ] Thanks Robert.
| 367761 [stefano.miol] Take a look to The Well-Grounded Rubyist (Manning, David Black), too.
+ 367752 [wagner.andre] def get(name,value)
  + 367753 [samatoms@gm ] Thank you very much. This will work excellently.
  + 367754 [shortcutter@] I'd rather use a Hash and lambdas for that since it is more explicit and
  + 367757 [tn.pablo@gm ] That would be
    + 367759 [wagner.andre] o play with it.
    + 367785 [b.candler@po] def get(name, value)
      367787 [wagner.andre] Ah, good call. That's my bad, not Pablo's.

[ANN][Security] XSS in WEBrick (CVE-2010-0541)
367763 [yugui@yu ui ] A possible security vulnerability on WEBrick. The vulnerability has been

[ANN] Ruby 1.9.1-p430 is out
367764 [yugui@yu ui ] Ruby 1.9.1-p430 has been released. This is a security fix for CVE-2010-0541.

[ANN][Security] Ruby 1.8.7 patchlevel 301 released (CVE-2010-0541)
367765 [shyouhei@ru ] As Yugui posted earlier, there is a XSS vulnerability in WEBrick HTTP ser=
367769 [shyouhei@ru ] erver.

[ANN] RubyInstaller 1.9.1-p430 available
367766 [luislavena@g] Wanted to inform that RubyInstaller project just made available

YAML Bug - can't round-trip a hash value with leading newlines.
367767 [daniels@pr n] YAML can't round-trip the hash: {"default"=3D>"\r\n  Monkey \r\nX"}.
+ 367768 [botpena@gm i] iianm, it fails for ruby ver below 1.9.2.  it is fixed ruby1.9.2
+ 368098 [headius@he d] Please file a bug if you could, at http://bugs.jruby.org :)
+ 368242 [vikkous@gm i] The patch for it did finally get accepted in 1.9.2.

Ansi animation
367772 [dennis@co te] Anyone aware of a ruby ansi animation project, like Term::Animation?

which C standard
367773 [graham.agnew] Which C standard does MRI use?  When I run configure on HP-UX, it seems
367815 [aaron@te de ] MRI uses C89.

Click on html element
367774 [tcblues@gm i] <td>A</td>
367955 [tcblues@gm i] No ideas?
367960 [jgabrielygal] <html>

Embedded Ruby 1.8.7”½Segmentation fault
367778 [slash.public] Dear community,
367779 [slash.public] === RUBY ===

Unix Philosophy in Ruby Programing
367781 [di3go.bernar] I use Linux about 5 years, but, this year that i started to "use" linux.
+ 367782 [peterhickman] Because not all OSs are Unix, not all Unixes have sendmail,
| 367790 [joseph.savar] @ peterhickman386@googlemail.com
| 367792 [peterhickman] Now that I reflect on this I find that the point where I understood
| 367800 [oscartheduck] What's neat is that the core unix philosophy of small tools working together
| 367801 [shortcutter@] Not all Unix tools are free of side effects or can have side effects
| 367814 [no@sp m. le ] Unix was considered to have significantly departed from this philosophy
+ 367783 [marco-oweber] Because Ruby applications also run on Mac, Windows, ....
| + 367784 [stuart@st ar] linux.
| + 367823 [ninja@sl ph ] I don't really buy this as an argument. I'll respond directly in a separate
+ 367788 [joseph.savar] Gems or any other reusable library structure/components provide brilliance
+ 367789 [mberg@da na ] Why write sendmail when you could send with UUCP?  Why write monit if you
| 367824 [ninja@sl ph ] Bingo. This is probably the second biggest reason for doing it this way.
+ 367826 [ninja@sl ph ] "I wanted a scripting language that was more powerful than Perl, and more
| 367835 [sentinel1879] Another issue with calling Unix commands is portability. I've finally
| 367917 [ninja@sl ph ] This is solvable -- there is enough in common, and GNU coreutils are
| 367971 [sentinel1879] If you've tried to make your software run: say the date command for
+ 367925 [normalperson] People build libraries/applications to fill particular niches/needs that
| 368043 [sentinel1879] Eric, I was reading that page. The link of the file Tomayko has been
| 368095 [normalperson] Yup, that's always the latest version on git.bogomips.org.
+ 367975 [sentinel1879] I think you are making a wrong comparison: comparing ruby gems to unix
+ 368232 [eleanor@ga e] linux.

QtRuby : constructor optional parameter
367794 [arturo.bonec] I would like to know how to manage (with QtRuby) the optional parameter
367798 [stefano.croc] Use nil as default value. Generally speaking, everywhere the C++ takes a
367799 [arturo.bonec] Thank you for the quick reply!

just click and meet ur dearest girl nearest u
367795 [iamforufrien] just click and meet ur dearest girl nearest u

[ANN] RubyInstaller 1.8.7-p302 available
367802 [luislavena@g] Wanted to inform that RubyInstaller project just made available

1.9.2 array performance
367803 [jzakiya@gm i] In Antonio Cangiano's blog http://antoniocangiano.com/
367809 [rogerpack200] You can ping ruby core about it I suppose...

Indentation in stdlib
367804 [lists@ke pg ] Annoyed about inconsistent indentation in some files in the stdlib
367816 [aaron@te de ] Probably this is by accident.  If you check the code style in the wiki,

Have I been staring at the screen too long?
367820 [iainspeed@gm] $ irb
+ 367827 [ninja@sl ph ] irb(main):002:0> Array.public_instance_methods.include? :rand
| 367840 [b.candler@po] That'll be Kernel#rand I expect.
| 367866 [iainspeed@gm] So why did it produce two different outputs even though my patch didn't =
| 367882 [b.candler@po] I've no idea, because you haven't shown the source of your
| 367891 [iainspeed@gm] didn't=20
+ 367899 [b.candler@po] In ruby 1.9, rubygems is activated automatically - you don't need
  367901 [iainspeed@gm] relative=20
  367950 [b.candler@po] The actual behaviour of Kernel#load is not obvious

Killing a gnome-terminal process from a ruby script
367821 [lisien.gjonc] I'm working on a dialog manager and I'm stuck at the part where I need
367822 [me@wa to ho ] Processes such as gnome-terminal are free to ignore sigterm, and many
367831 [lisien.gjonc] Process.kill :SIGKILL, @terminal_pid.pid if !@terminal_pid.nil?

Intstalled Ruby 1.8.7 but still getting ruby -v => 1.8.6
367825 [go_mitchell@] I have followed the instructions to install ruby 1.8.7. Everything seems
+ 367838 [b.candler@po] Which instructions? What did you do? On what platform? The question
| 367845 [mitchellgoul] I followed these instructions that were posted on this forum.
| 367847 [b.candler@po] Did you do a plain "./configure" or did you add any options to it?
| 367951 [mitchellgoul] I Did not do any options when I installed. However I have discovered
| 367982 [rogerpack200] I would just rename /usr/bin/ruby to /usr/bin/ruby_old or something.
+ 367900 [rogerpack200] running "whereis ruby" will probably tell you which one it is using, and

IMAP: unexpected token LPAR (expected QUOTED or LITERAL)
367828 [shea@sy ac .] I'm writing an IMAP parser that uses BODYSTRUCTURE to fetch only the
367829 [shea@sy ac .] Heres an example message that triggers it.
367907 [shea@sy ac .] Heres the full trace, with Net::IMAP.debug = true

www.fpsgames.com.au/starcraft key,key 'starcraft,Starcraft c
367832 [robinbest60@] As the professional cd key

can i do this in ruby? a simulation process
367833 [winshocker@g] A superhighway connects one large metropolitan area to another.
+ 367834 [jeanjulien.f] You sure can do it in ruby but first you have to decide what ruby have
+ 367836 [jeanjulien.f] You sure can do it in ruby but first you have to decide what ruby have
| + 367837 [winshocker@g] Cheers Thanks, anyway i already did writing and other stuff but the only
| | 367839 [jeanjulien.f] Try to create a Vehicle class where you compute the arrival time and
| | 367849 [wagner.andre] Hmm, I may or may not disagree with you on what the output should be. I
| | + 367850 [b.candler@po] Ruby quiz :-)
| | | 367853 [wagner.andre] Interesting. Sounds like I've got a bug to hunt down. Agreed, as far as
| | | + 367857 [winshocker@g] A superhighway connects one large metropolitan area to another.
| | | | 367870 [b.candler@po] No, and in any case that's the wrong approach for a simulation.
| | | + 367858 [winshocker@g] A superhighway connects one large metropolitan area to another.
| | |   + 367859 [winshocker@g] sorry for the double post :)
| | |   + 367862 [wagner.andre] I used rand() for both departure time and traveling time, assuming all the
| | |   | 367867 [jeanjulien.f] "A vehicle leaves the first city every 5-35sec. [...] How long does it
| | |   | 367873 [wagner.andre] Well, it may be interesting, but not in terms of the question originally
| | |   | + 367881 [winshocker@g] is it possible?
| | |   | | 367883 [winshocker@g] OR like this one
| | |   | | + 367886 [winshocker@g] is it possible for someone to post their code? is not that i would copy
| | |   | | | 367888 [wagner.andre] I think it would be better if you posted (a link to) your code, and we can
| | |   | | + 367887 [wagner.andre] Bruce,
| | |   | | | 367889 [winshocker@g] yes, i agree
| | |   | | + 367892 [b.candler@po] That's a good start, although the question says a vehicle takes between
| | |   | |   367895 [winshocker@g] yes indeed i talk to much i didn't realize the requirements which you
| | |   | + 367885 [jeanjulien.f] to
| | |   |   367890 [wagner.andre] Ah, I see your point. Very interesting indeed. Is it reasonable to guess
| | |   |   + 367894 [winshocker@g] Yes indeed.
| | |   |   + 367898 [jeanjulien.f] Sure. I have no time left to play with it today, but I will try it tomorrow=
| | |   |     367980 [jeanjulien.f] Well, in the end, it did not take too long: less than 3 hours in mean
| | |   + 367864 [b.candler@po] Yes. rand() by itself gives a random number between 0.0 and 1.0 (well
| | |   | 367868 [wagner.andre] Ah. Yes, I didn't mean to say that I used rand without any parameters. I
| | |   + 367865 [jeanjulien.f] Yes, we did. But also when taking into account the number of
| | |     367871 [wagner.andre] Yes, but you take that into account by doing a large number of trials,
| | + 367852 [jeanjulien.f] It was just to get him the idea.
| | | 367854 [wagner.andre] Ah yes, I see now what Brian meant by "bursty". Thanks for the results!
| | + 367911 [brabuhr@gm i] 58,387 trials
| |   367922 [brabuhr@gm i] 33
| |   367937 [winshocker@g] can someone post some code here: I'm only a newbie in ruby :( and
| |   367946 [b.candler@po] You seem to have made a good start. Why don't you post what you've done
| |   367952 [winshocker@g] print "Number of Vehicle: " #That will be maximum of 5 only
| |   + 367958 [brabuhr@gm i] Don't worry about it so much, we all start as beginners :)
| |   + 367965 [b.candler@po] For a newbie, it's a fine start, and this is the best way to learn.
| |     367967 [b.candler@po] Sorry, what I said was completely wrong there; I misread your code.
| |     367984 [winshocker@g] i already erase some codes: but the thing is how can i get the total
| |     367989 [brabuhr@gm i] arrival_time =3D departure_time + travel_time
| |     367991 [winshocker@g] i've been trying to change the thing you said but it shows nothing. :(
| |     367992 [brabuhr@gm i] START DELETE
| |     367993 [winshocker@g] i already done that Thanks
| |     367994 [jeanjulien.f] I think you misread the problem: nobody says that the first vehicle
| |     367998 [brabuhr@gm i] Bruce,
| |     368004 [Rob@Ag le on] OK, I know this thread is going for some kind of record, but like any
| |     368013 [brabuhr@gm i] What kind of record would that be?
| |     368035 [jeanjulien.f] od
| + 367920 [josh.cheek@g] I'm not sure how much your simulation needs to include, on one hand, you
|   367945 [b.candler@po] You have to be very careful with the termination condition.
+ 367841 [b.candler@po] To start with, I'd ask the following: how would you perform the
+ 368002 [ian.hobson@n] Some concepts for you. A simulation has exactly three types of "events".

Write to file
367843 [tigrib85-for] I'm trying to write to a new file, wich I'm creating by
367844 [jgabrielygal] The problem is that gets returns the \n at the end of the string, so
367846 [tigrib85-for] Hey, thanks very much, its working!

Refactoring Global Constants
367848 [frank.guerin] I'm going to ask a dumb question (sorry for that, in advance)...
367851 [b.candler@po] The best way to define a constant is using a constant :-)
367934 [frank.guerin] This is perfect.  Thank you very much!

SMTP SMS Reminder Script
367855 [human.dictio] require 'net/smtp'
+ 367872 [b.candler@po] Probably it's the newline on the end of the username and password. Try
| 367876 [human.dictio] I've tried that previously, the script just sits there until I interrupt
| 367880 [b.candler@po] Sure. So you have another bug. To be sure, try typing a wrong password
| 367906 [human.dictio] /usr/lib/ruby/1.8/net/smtp.rb:551:in `initialize': getaddrinfo: Servname
+ 368017 [human.dictio] require 'net/smtp'

HTTP Downloader
367856 [human.dictio] require 'net/http'
+ 367860 [wagner.andre] Why are you trying to convert the subURL to an integer? That's what to_i
| 367863 [human.dictio] The storage control blocks were destroyed. (SocketError)
| 367869 [peterhickman] The problem is that you must not have the http:// part of the url.
| + 367874 [wagner.andre] Wow, really? Why the terrible error message then?
| + 367875 [peterhickman] As an aside. Here's something to note when reporting errors.
| + 367877 [human.dictio] Thank you; mucho appreciato! :D
| + 367878 [human.dictio] Sorry to double post but is there any way to get the script to extract
|   367879 [peterhickman] To be honest I would not use the net/http library if you can help it.
+ 367861 [peterhickman] An error you say? What error would that be and what steps have you

Making File.open work on gzipped files
367884 [mail@ma sh .] I am trying to write a class for a file parser with an class method for
367893 [b.candler@po] Ruby's Zlib library should do that nicely for you.
+ 367902 [b.candler@po] i.e. http://ruby-doc.org/core/classes/Zlib/GzipReader.html
+ 367919 [mail@ma sh .] Thanks Brian,
  367924 [shortcutter@] Exactly, just try to open with GzipReader and if that throws just work
  367948 [b.candler@po] Remember to rewind it too.
  367953 [mail@ma sh .] Thanks Brian and Robert. The below snippet appears to be working nicely
  + 367954 [shortcutter@] 1. refactor opening code (everything before "if block_given?") into a
  | 367961 [mail@ma sh .] 1 & 3 done! I dont quite get 2.
  | 367963 [shortcutter@] If you have done 1 you will have a single variable left and hence done
  + 367968 [b.candler@po] Good question, but the documentation for GzipReader#close gives you the
    367970 [shortcutter@] That's why I suggested my item 1. :-)
    367978 [mail@ma sh .] I must be missing something :o/
    367986 [shortcutter@] Parse#close does not exist.  :-)
    367997 [mail@ma sh .] Of cause! And inserting the close method the right place inside the

question on if / defined?()
367903 [jrubiando@gm] assuming x is not defined, why does the statement
+ 367904 [rick.denatal] Because x is defined, this happens at parse time so it doesn't matter
| + 367909 [john.sikora@] The two statements were probably typed sequentioally. Consider the
| + 367913 [john.sikora@] Is this because when the parser sees 'x = ...',  Ruby automatically
|   367923 [colinb2r@go ] I think that's correct, but I'd welcome confirmation from those more
|   367933 [joseph.savar] The following appears that when using the ternary operator it sheds a little
+ 367947 [b.candler@po] if false
threads.html
top