298743-299836

298479-309420 subjects 298991-378241

[ANN] CapGun 0.0.1 released - super simple Capistrano deployment notifications
298743 [rsanheim@gm ] Tell everyone about your releases!  Send email notification after

What's the 'portable' way to do this?
298751 [jan.h.xie@gm] I hope my programe will accept data from redirected stdin or pipe, like
+ 298756 [ara.t.howard] stdin = STDIN.dup
| 298774 [jan.h.xie@gm] Thanks for your reply, but this seems not work.
| 298818 [ara.t.howard] yeah, you'll need to start out with a tty - maybe taking in the input
+ 298826 [dan@da fi ni] data = ARGF.read
  298874 [jan.h.xie@gm] I'm afraid the problem is the same: you can't interact with the program
  298882 [m.fellinger@] You can check if you are getting data from a pipe by asking
  298886 [jftucker@gm ] Make that CON: and you're on to a winner!
  + 298887 [celtic@sa ry] ...
  + 298964 [jan.h.xie@gm] =20
    299030 [jftucker@gm ] Yes 'CON:' applies to windows, not to *nix. On other platforms, most

how to set RUBYLIB path?
298763 [martin@an le] Dear all,
+ 298811 [rogerpack200] maybe gem install builder?
+ 298821 [robert.dober] /lib/mylibs/mylibrary.rb

Naming question
298768 [robert.dober] I actually just need the following method there is no doubt about it;)
+ 298773 [robert.dober] Enumerable#cluster_by
+ 298776 [botp@de mo t] # module Enumerable
  298795 [rick.denatal] Which, I believe, first showed up in Rails sometime in 2006.
  298819 [sean.ohalpin] There are possibly even earlier ones.
  298820 [robert.dober] module Enumerable

strange Expectations answer
298770 [michel@de az] I am using Expectations and I found something which looks strange, when
298777 [ola.bini@gm ] To put it bluntly - you shouldn't do it that way.
298779 [michel@de az] Thanks Ola.

redirecting url
298780 [vio_meyer@ho] I have my web site url : http://www.mywebsite.eu
298783 [cmdjackryan@] Check the manual and other support sites for your webserver.
298789 [flo@an er gr] If RTFM is the only thing that you have to say: keep it to yourself. Manual and support won't help him here, because he is obviously on a wrong track.
298791 [cmdjackryan@] Manual and support won't help him here, because he is obviously on a
298797 [flo@an er gr] While this is true, your answer would have been more useful if you
298800 [cmdjackryan@] actually
298802 [flo@an er gr] My point was: If you think that the question is a null statement,

Block binding does not contains local variable
298787 [artem.vorozt] Maybe it contains.
298794 [dblack@ru yp] My understanding is that given a Proc, there's no way that Ruby can
298956 [artem.vorozt] Thank you!

Webrick override HTTPResponse::setup_header
298792 [Andrey.D.Nik] class MyServlet < HTTPServlet::AbstractServlet
+ 298841 [drbrain@se m] What are you trying to accomplish with this code?
+ 298865 [dan@da fi ni] As Eric said, it's not obvious what end result you are expecting but
  298903 [dan@da fi ni] SGksCgpHZW5lcmFsbHkgeW91IHNob3VsZCByZXBseSB0byB0aGUgcnVieS10YWxrIGxpc3QgaW5z
  298905 [dan@da fi ni] SGkgYW5kcmV5LAoKVG8gY2xlYXIgb3V0IGFsbCBvZiB0aGUgZXhpc3RpbmcgaGVhZGVycyB5b3Ug
  298907 [Andrey.D.Nik] def do_GET(req, res)
  299213 [overlord@gm ] If you want to change the Content-Type, use

line breaks in multiline regexp
298803 [chaschev@gm ] The problem is that \s is not only a line break.
+ 298807 [Rob@Ag le on] ...
+ 298866 [dan@da fi ni] I see that Rob posted a response to this but his email came thru blank
| + 298933 [Rob@Ag le on] I reposted by earlier response, but Dan's suggestion might be closer
| + 298944 [chaschev@gm ] Yes, indeed this works! Thank you guys!
|   299054 [chaschev@gm ] Sorry, this indeed works fine. Don't know what was the problem. Thank
+ 298932 [Rob@Ag le on] Oops!  If I have the "signed" option in Mail.app, the response doesn't

Re: Word Search Generator (#159, again)
298804 [matthew.moss] Apologies for the late summary... it will be coming today. New quiz

How to substitute tabs into single spaces for a String
298805 [loftuz@gm il] val = "     hello     ".sub(/\t/, ' ')
+ 298806 [keletmaster@] irb(main):006:0> "\tlol\t".gsub("\t", ' ')
+ 298808 [cmdjackryan@] You could use a regex that converts whitespace into a single space, in
+ 298809 [fedzor@gm il] Use gsub instead of sub!
+ 298822 [cmshea@gm il] The code you posted will only substitute the first tab character into
+ 298825 [tim.pease@gm] Use the String#tr comand

how to change objects in heap?
298813 [regentdv@gm ] I'm novice at ruby and faced to a little problem.
298815 [bbxx789_05ss] a = [10]
298835 [regentdv@gm ] This way you are correcting existed object.
298838 [kbloom@gm il] Ruby doesn't have pointers or references the way C++ does. To get similar

Ruby script to run command as root on remote linux system
298823 [jdinkel@gm i] I WAS just trying to pass on the password to sudo being run over
+ 298837 [vk@ds .p pe ] If you have control over remote computer (and can live with security
| 299104 [kbloom@gm il] SSH also allows you to create single-purpose keys.
+ 298861 [botp@de mo t] # So I am just wonder if anybody has found ANY possible way to
| 298872 [poppopreturn] ...
+ 298873 [celtic@sa ry] ...
+ 298909 [vk@ds .p pe ] Securing root access using ssh keys (the other accounts are not

Re: forkoff - parallel processing for ruby enumerables
298828 [erikveen@gm ] I've once implemented Enumerable#fork myself. It doesn't use
+ 298829 [erikveen@gm ] Just a word of warning: The construction "Thread.new(i){|i|" is
| 298831 [ara.t.howard] indeed - left over from a previous iteration.
+ 298830 [ara.t.howard] this is precisely how forkoff manages the number of processes, only

Why this code is working
298834 [neeraj.fresh] this code is a simplified version of the code I saw in Rails.
+ 298836 [justincollin] *args means "zero or more parameters" which are then placed in an array
+ 298839 [kbloom@gm il] When you prefix the last argument name with a * (as you did with *types)

How to add gems folder to allinoneruby exe?
298840 [seannakasone] folder C:\ruby\lib\ruby\gems ?  I tried to change the sitedirlib by

[SUMMARY] Word Search Generator (#159)
298849 [matthew.moss] Adam Shelly was our sole submission this week, so we are going to take
+ 298871 [bulliver@ba ] That's a fantastic writeup. Thanks Mathew...
+ 298923 [adam.shelly@] Thanks for the nice writeup.

NEW email
298859 [fixxie.wits@] ...

changenotify - determine when a file has been closed.
298863 [seannakasone] Is there a way to determine when a file has been closed?  I know the
298947 [tim.pease@gm] A quick way to do this would be the directory_watcher gem. It watches

Mack 0.4.6 Released
298867 [markykang-ru] This is a pretty cool release. First off Thin has been updated to 0.8.0,

Included in Kernel, yet won't show up in `C::ancestors'?
298875 [celtic@sa ry] ...
+ 298880 [vjoel@pa h. ] You may be stark, raving mad, but there's nothing to be gained by group
+ 298881 [shortcutter@] Relax.  Don't worry to much.  Take a nap.
+ 298892 [calamitates@] You've bumped here into what some people call the double inclusion
  298895 [celtic@sa ry] ...

How to pass XML as input for webservice function??
298877 [varun.rajesh] Suppose i have one function which is defined in web service that
298952 [rogerpack200] google 'rails web service' and 'ruby web service' perhaps that will

Can I use xmlrpc to manage my msn spaces
298878 [flyerhzm@gm ] ...
299066 [pieterste@gm] Sorry for a late reply, had quite a busy weekend.  You can use

why doesn't ruby have generics?
298883 [hawat.thufir] Is it because Ruby is dynamic, or something else?
+ 298884 [celtic@sa ry] ...
+ 298885 [flo@an er gr] Why would you bind to a type in a language that doesn't really
| + 298889 [shevegen@li ] Maybe it first needs to be described which specific advantage a
| + 298891 [shortcutter@] That would be a type restricted Array but not a generic Array.  You
|   298894 [flo@an er gr] Yeah, thats why I was talking about "such functionality". It would
|   298901 [shortcutter@] For practical purposes you are probably right.  But strictly speaking
|   299203 [kbloom@gm il] * In C++, you can use the generically inferred type names to construct
+ 298913 [pjb@in or at] Mu.
+ 298945 [jl235@ke t. ] As far as I've understood it, in Ruby it's not about what the type is
  298954 [hawat.thufir] Right; I'm taking a Java course which will be covering Generics and, in
  298962 [flo@an er gr] Arrays are not the interesting thing when it comes to Generics. (As
  + 298965 [shortcutter@] He probably meant ArrayList instead of array...
  | 299008 [hawat.thufir] Yes, I did.
  + 299009 [hawat.thufir] It wouldn't be useful to have some sort test to make sure there's not a
    + 299026 [cmdjackryan@] thing = Hash.new
    + 299028 [robert.dober] Well if you search the archives you will see that I made the same
    + 299029 [mowat27@go g] ...

if behavior
298893 [frea@em il c] i recently started to learn ruby as well as rails and came across a
+ 298896 [stefano.croc] I think the problem is the if at the end of the last line. In ruby, the if-
+ 298897 [flo@an er gr] Yes, because the code never gets evaluated. if-blocks are ended by
| 298900 [stefano.croc] I don't think so. Without a condition after the if, you'll get a SyntaxError.
+ 298898 [frea@em il c] ehm great
  + 298899 [celtic@sa ry] ...
  + 298902 [dblack@ru yp] $ ruby -e 'if true then p 1 else p 2 end if false'
  + 298935 [cmdicely@gm ] ...

win32-service-0.6.1 using a Rails Model
298914 [davidhooey@g] Windows 2000 SP4
+ 298924 [djberg96@gm ] <snip code>
+ 298940 [gthiesfeld@g] I can't offer help with win32-service, but I could suggest an
| 299332 [davidhooey@g] Thanks Gordon, I will give that option a try.
+ 298953 [rogerpack200] It is running as the same user with enough privileges, I'd imagine?
  299333 [davidhooey@g] Roger, yes I'm a local Administrator on the box.
  299344 [gthiesfeld@g] Also, I'll probably be releasing a new version soon (this weekend?)

[QUIZ] Triangle Area (#160)
298915 [matthew.moss] Apologies for the latest... Some busy stuff this week in "real life."
+ 299010 [dan@da fi ni] ...
+ 299084 [caduceass@gm] I'm doing a little cheating here, and may have severely wimped out.
| + 299088 [dan@da fi ni] I like your math-y solution -- it probably runs circles around the
| | 299089 [caduceass@gm] Hey Dan,
| + 299091 [adam.shelly@] 1/2(b*h) wa the first thing I thought of when I read the quiz title.
|   299099 [caduceass@gm] That is awesome!  It's almost exactly what I had in mind.  The cool
|   299199 [adam.shelly@] Ah. This illustrates the ( joys | perils ) of  test-driven development.
+ 299101 [eric.mahurin] ...
+ 299277 [marcelo.maga] ...
  299331 [jamesbkoppel] ...
  299335 [jamesbkoppel] ...

[ANN] Radiant CMS 0.6.5 "Chisel" Release
298921 [seancribbs@g] Radiant 0.6.5 "Chisel" represents a major leap forward for Radiant.

Re: Triangle Area (#160)
298927 [matthew.moss] That should read, "Apologies for the **lateness**...".  :)
298929 [cmdjackryan@] See, switching off the splellchecker for gains in speed isn't helpful at
+ 298930 [matthew.moss] Splellchecker?
| 298931 [cmdjackryan@] Oh, right, that should be splelingchequer. My bad. ;)
+ 298936 [robert.dober] Rilli Ai culd not agri lesz wis u at al.
  298939 [cmdjackryan@] Oh, that made my day. Gave me a laugh I desperately needed. :D
  298943 [matthew.moss] If you decide to implement this technique and are using random
  298946 [matthew.moss] require "test/unit"

Database construction in Ruby
298950 [sonicdisturb] I'm interested in building a database for my company so that we can
+ 298963 [cmdjackryan@] Do you plan to write the database engine from scratch, instead of using,
| 299013 [chris.lowis@] Also, depending on your application, a web-based GUI developed using
+ 298973 [cmdicely@gm ] I think Ruby is a fine language for what you are proposing. The things I think
| 298977 [caduceass@gm] and (4) make sure you don't distort what is supposed to be good data
+ 299050 [cminear@se u] My first recommendation would be to go out and buy the book 'Mastering
  + 299085 [caduceass@gm] I should mention that you can use your own table names in Rails, you
  + 299092 [martin@op ng] I have finished my first application in Ruby successfully. I work in an

Executing code in a variable
298957 [z4n9ief@gm i] buffer = ' puts "Hello World!" '
+ 298958 [sepp2k@go gl] eval buffer
+ 298959 [christianthe] Sure, you can use eval, eg.
| + 298960 [z4n9ief@gm i] Thanks you a lot! I think I will use instance_eval to do so.
| + 298968 [dblack@ru yp] The main advantage of instance/class/module_eval over eval, though, is
|   298969 [shortcutter@] It is slightly better because with #instance_eval you can control what
|   298970 [dblack@ru yp] That's the thing -- I think it's more a string thing, and the dangers
|   298971 [robert.dober] As David I am not sure that instance_eval is safer than eval. As the
|   298974 [cmdicely@gm ] ...
|   298975 [robert.dober] Seems to be perfect, now for eval to make sense in the sandbox one has
+ 298961 [shortcutter@] robert

Ruby 1.8.7-preview2 has been released
298966 [knu@iD em ns] Folks,
298979 [alex@de et m] Firstly, Akinori, thank you very much for your generous work on ruby.
298981 [cmdjackryan@] I second that motion.
299063 [charles.nutt] Interestingly, several of the failures in Ruby 1.8.7 were found by JRuby

Ruby 1.8.7-preview2 has been released
298967 [knu@iD em ns] Folks,

[ANN] Radiant 0.6.6 - Chiseled Release (bugfixes)
298976 [seancribbs@g] Radiant 0.6.6 "Chiseled" corrects two showstopper bugs in yesterday's

Bug: multiline ruby expressions with parens
298980 [alex.shulgin] Anyone aware of this bug?
+ 298985 [vjoel@pa h. ] AFAIK not a bug. It's because parens can contain two or more
| 299021 [allergic-to-] a = (2
| 299057 [vjoel@pa h. ] Right. I should have said that the expression
+ 299022 [drbrain@se m] This is not a bug.  Newlines are significant in ruby.
  299108 [alex.shulgin] Yes, I realize now.

Counting Program
298982 [will.liljon@] I recently actually started "studying" ruby again and attempted to
298983 [cmdjackryan@] time1 = 1
+ 298989 [will.liljon@] Thanks, that worked.
+ 299006 [dandiebolt@y] ...
  299334 [dana.merrick] (1..10).each { |num| p num }
  + 299578 [will.liljon@] If I was to revise it to be able to simply type in a number and then
  + 299581 [dblack@ru yp] puts *1..10
    + 299653 [will.liljon@] No, I mean in a manner that allows user input. So you may type in a
    | 299654 [john.d.perki] require 'readline'
    | + 299655 [john.d.perki] ...
    | | 299656 [john.d.perki] Moral of the story: run your code before they all laugh at you.
    | + 299663 [will.liljon@] Received the following error: realcountin.rb:3 unterminated string
    |   299664 [will.liljon@] require 'rubygems'
    |   + 299668 [peter.bunyan] print "Upto what number? " # ask the question
    |   | 299835 [dana.merrick] p "Upto what number?"; p *1..gets.to_i
    |   + 299670 [john.d.perki] How are you running this? My snippet works from the command line, I
    |     299671 [will.liljon@] The previous one worked. Thanks.
    + 299836 [dana.merrick] I didn't know that! That's awesome.

Defining attr like methods
298984 [floppyformat] Here is what I'm trying to do
298987 [shortcutter@] You are looking for class methods.
298992 [floppyformat] Thanks.
298997 [dan@da fi ni] You might want to check out the Doodle rubygem at http://doodle.rubyforge.org/ .

A couple of questions regarding class design
298986 [_mwryder@wo ] I am part way through implementing a Rational math class to further my
+ 298988 [vjoel@pa h. ] unless ...
| 299069 [_mwryder@wo ] That worked except for a minor problem.  I first tried a.class ==
| + 299071 [lionel-subsc] a.is_a? Integer
| + 299183 [cmdicely@gm ] You could use a.kind_of? Integer, but why not just call a.to_int? to
|   299193 [_mwryder@wo ] That will not work if the value is a string or some other object that
+ 298990 [shortcutter@] The return value of #initialize is ignored - always.  The proper way to
| + 299070 [_mwryder@wo ] My background in older languages is slowing me down.  I thought that
| | 299073 [shortcutter@] If I remember this correctly I found exceptions a bit tricky when I
| + 299111 [overlord@gm ] Pardon?
|   299115 [shortcutter@] Correct.  Hehe, it never occurred to me to invoke #initialize as
|   299118 [robert.dober] Hey Robert I would have sworn like you, and in some ways it is almost
+ 299079 [robert.dober] which is a good idea and I see that you are in good hands with Robert.
  + 299080 [robert.dober] and of course J=F6el and the others....
  + 299083 [_mwryder@wo ] I chose this after reading about it in Knuth's 2nd volume.  I wanted to
    299112 [shortcutter@] And, does it feel better?  For me it does - for Knuth apparently not.  I
    299170 [_mwryder@wo ] Coming from a background in computers from the 70's when the language
    + 299175 [robert.dober] Very true, but as I have mentioned one has to be disciplined.
    | 299194 [_mwryder@wo ] Most of my programming is for business use.  A lot of the time the user
    | 299202 [robert.dober] Well without the code I cannot really help but somehow I have the
    | 299234 [shortcutter@] Now Michael just needs to integrate the Ruby interpreter into his
    | + 299257 [robert.dober] Have you given up hope for him already ;) ?
    | | 299263 [shortcutter@] Hey, I didn't say he can't do it. :-)
    | | 299298 [robert.dober] Just to be clear, I meant to join Ruby, not that he could not program,
    | | 299311 [shortcutter@] Oh no, not at all - at least here. :-)
    | | 299314 [robert.dober] Common Lisp that is I hope ;)
    | | 299507 [shortcutter@] Of course, with 22 actors and one controller.  A complex application
    | | 299558 [robert.dober] Well in our match of wit (very modest as I am) I declare you the winner.
    | | 299627 [shortcutter@] That's just an intermediate result - wait for the 2nd half.  I am sure
    | + 299326 [_mwryder@wo ] Funny you should mention that.  One of the things I am working on is
    + 299233 [shortcutter@] Well, you had to use what you got, didn't you?  I believe the reasons
      299329 [_mwryder@wo ] One thing I haven't figured out is returning from an exception to the
      299418 [shortcutter@] irb(main):009:0> def test(x) raise "#{x} is too low" if x < 5 end
threads.html
top