144973-148596

144765-158741 subjects 145198-145844

How to take password from user
144973 [sujeetkr@gm ] I have to take some password from user in a Ruby Program. I want
+ 144978 [james@gr yp ] The HighLine library (http://highline.rubyforge.org/) on RubyForge
| 144981 [Ara.T.Howard] does this clear out the password buffer in memory?
| 144982 [james@gr yp ] Forgive me if I didn't understand your question completely, but I
| 144984 [Ara.T.Howard] hmmm... it's probably still in memory for a while unless there is an explicit
| + 144988 [james@gr yp ] I'm trying to envision how I could improve this...  If you can give
| + 145063 [james@gr yp ] Would something like the following be an improvement, do you think?
|   + 145069 [twifkak@co c] I'm not a Ruby Guru by any means, but my guess is no, given that the String literal "password" creates an object, and pass << "password" creates another. pass = nil kills neither -- rather, it reassigns pass to *point* to the nil object (and pass falls immediately out of scope, any how), leaving the other two at the mercy of the GC. Maybe there's something you can do with the ObjectSpace?
|   + 145080 [guslist@fr e] def fetch_password
+ 144990 [marcel@ve ni] Aside from the Highline approach already mentioned there is a password

Getting a method object directly from a module
144985 [djberg96@ho ] Is it possible to get a method object from a Module directly?  This
144986 [ksruby@gm il] irb(main):001:0> module M
144987 [mrcode@ne ro] m = Object.new.extend(Foo).method(:my_method)
+ 144989 [djberg96@ho ] That works great.  Thanks both.
+ 145019 [matz@ru y- a] Foo.instance_method(:my_method).bind(obj).call

[ANN] http://sciruby.codeforpeople.com/
144991 [Ara.T.Howard] the scientific ruby wiki is a place for all things scientific and ruby.  come
144999 [ptkwt@ar cn ] I just had a look - very cool.  I definately WantToBecomeAMember.
145027 [discordantus] Based on the error message I got when I investigated the spell-check

text to images using RMagick
144992 [chipped_up@h] just wondering if it's possible to convert a string to an image x pixels
+ 145024 [cyclists@nc ] I got this to work but while doing so I discovered that RMagick is
+ 145124 [cyclists@nc ] Okay, I just uploaded a new version of RMagick, version 1.8.2. With this
  145194 [chipped_up@h] that's excellent! Thanks for taking the time to do this and for writing such

RDoc
145000 [sanchez_jesu] I noticed that it generated ri docs, but there
145003 [drbrain@se m] Neither of these libraries are usefully RDoc'd.  You would get little
145008 [sanchez_jesu] But for example it run rdoc --op -html-docs inside
145010 [drbrain@se m] No, it reads .document files to learn what to RDoc.  I believe
145012 [sanchez_jesu] OHHHHHH, Thanks, :)

gnu readline ruby vs. perl
145011 [wybo@se va y] I'm translating a Perl script into Ruby, but can't reproduce a readline
+ 145017 [matz@ru y- a] Ruby's readline takes input from stdin.  Perhaps Perls takes from
+ 145028 [nobuyoshi.na] The test exited immediately after printing the prompt, on my box.
  145030 [nohmad@gm il] I've experienced same problem with OP.

Combining XmlMarkup objects?
145013 [drew.cox@gm ] Is it possible to create an XmlMarkup object and then populate the
145046 [jim@we ri hh] class TestResultsLogger
145050 [drew.cox@gm ] Perfect!  Thank you very much.  I was about to e-mail you first, but

howto write rtf directly?
145015 [Nuralanur@ao] ...
+ 145021 [logancapaldo] Silly question, but judging by screenshots of Jarte you are on
| 145040 [Nuralanur@ao] ...
+ 145043 [sanobast-200] You want to write this text snippet into a file? Nothing else? Do the
+ 145044 [ruby.brian@g] Don't know if it helps you, but google gave me the spezification at
  145045 [Nuralanur@ao] ...
  145047 [logancapaldo] Just had another thought about Jarte. Since you are using Cygwin its

Re: [Rails] Ajax on Rails
145026 [curt@hi bs c] Thanks for bringing this to everyone's attention!

[RFC] framework of Ruby/Tk + VNC
145031 [nagai@ai ky ] I'm working on a framework of Ruby/Tk + VNC.
+ 145048 [logancapaldo] Neat! Once upon a time I read up on the RFB protocol, I don't believe
| 145091 [nagai@ai ky ] I think so too. :-)
+ 145208 [hramrach@ce ] Isn't there already some rfb support for tk? I beleive I found it while
  145252 [nagai@ai ky ] I couldn't find such library.

newbieQ: new array from old array w regex
145032 [csnyder1@kc ] As an exercise to learn to use Ruby, I am trying to search large xml files
145035 [nobuyoshi.na] Enumerable#each just returns the receiver itself.
145037 [bob.news@gm ] You still get the complete string.  This one might work better

[ANN] RDoc Dashboard Widget
145036 [david.felste] don't normally post here...
+ 145054 [gavin@re in ] ...
+ 145057 [gavin@re in ] ...

dedTUNIA: Gegen kreisrunden Haarausfall - Against circular loss of hair - Contre Alop?cie Areata
145038 [dedTUNIA@ya ] Betroffen von Alopecia Areata: dedTUNIA hilft auch Ihnen

Re: Ajax on Rails
145042 [google@er kv] This results in: Application error (Rails)
145055 [rampant@gm i] ...
145058 [curt.hibbs@g] Its unfortunate timing, but co-location center which houses my ISP's
145067 [rampant@gm i] Could you replace it with a 404 page then? Atleast it won't look like
+ 145068 [rampant@gm i] That link is the one which has "Ajax is great, see it in action"
| 145074 [curt.hibbs@g] Unfortunately, its out of my control. Hopefully, it'll be back up as
| 145621 [carl.youngbl] ...
| 145651 [curt@hi bs c] Its been back up. Unfortunately, its now suffering from the infamous
+ 145081 [chneukirchen] Wouldn't that be *lying*?

duck-typing allows deeper polymorphism
145049 [eric_mahurin] I've seen many posts on what duck-typing is, that Ruby doesn't
+ 145051 [bob.news@gm ] <snip>a lot of good stuff</snip>
+ 145060 [Ara.T.Howard] <snip good comments>
| + 145066 [twifkak@co c] Not entirely true... The argument 'x' must also respond to whatever parseargs wants from it (respond_to?, I assume), whatever the 'pa.x' method wants from it (well, nothing, I assume), and whatever 'p' wants from it (to_s, I assume).
| | 145075 [Ara.T.Howard] sure - everything in :ducktype=>list AND what parseargs needs - quite true.
| + 145077 [eric_mahurin] a. if you put this all over the place, it will significantly
|   + 145078 [twifkak@co c] Not just parseargs, but any other methods that the method calls. In your case, it was simply p, but in some other case, I might be passing a parameter all around the system, in which case, who knows what it'll need. (Is that bad design? If so, that's precisely one of the things I want to flesh out as an extra restriction we need to place on ourselves because we're using Ruby.)
|   | 145087 [Ara.T.Howard] ah.  true true.  at least the docs could show the rhs of the '=>' sign which
|   + 145086 [Ara.T.Howard] i strongly disagree here.  in the case of short examples it is roughly
|     145095 [eric_mahurin] I could see this being useful.  But, I don't care for
|     145100 [Ara.T.Howard] well, me too for the most part and i rarely use the the :type/:ducktype
+ 145385 [netghost@gm ] READABLE = [:open, :read]

[QUIZ] Chess Variants (I) (#35)
145053 [james@gr yp ] 1.  Please do not post any solutions or spoiler discussion for this quiz until
+ 145056 [gavin@re in ] This looks like a fun problem and (as my past two quizzes have shown)
| 145061 [james@gr yp ] No, probably not.  The time "goal" is, and has always been, a rough
| 145062 [gavin@re in ] ...
| 145065 [james@gr yp ] My biggest challenge in running Ruby Quiz is always coming up with
+ 145070 [gavin@re in ] ...
| 145071 [james@gr yp ] You nailed it.  That's exactly how it's done in most of the software
+ 145072 [ jimm@io co ] Can I start with Bangkok (http://bangkok.rubyforge.org), the
| 145073 [james@gr yp ] Please do!
+ 145151 [kristof@vl e] for Ruby-Gtk.  It doesn't implement an engine, but it is particularly well

Re: framework of Ruby/Tk + VNC
145059 [greg.kujawa@] This is a very interesting project. One question. The server isn't
145092 [nagai@ai ky ] Thank you. :-)
145098 [greg.kujawa@] Oh I see now. In the past I have used VNC on everything from Sharp
145206 [nagai@ai ky ] Although I don't know details of Windows version of VNC server,
145234 [greg.kujawa@] You are correct. There are options under the various Windows VNC

Ruby/LDAP on Windows
145079 [greg.kujawa@] Here is a message I sent to the maintainer of this particular project.
+ 146643 [greg.kujawa@] I am still banging my head against the wall trying to get this compiled
| 146644 [no@sp m. le ] winldap.h and winber.h are both in c:/Program Files/Microsoft Visual
| 146654 [greg.kujawa@] Looks like I am off to download the hundreds of megs of MS Platform SDK
| 146683 [greg.kujawa@] As the final nail in the coffin I downloaded the just the 32-bit x86
+ 148448 [ian@ca ib n.] Apologies for the shamefully late response. My wife recently gave birth
  148596 [greg.kujawa@] No apologies necessary! Congratulations and it sounds as if you have

PostgreSQL -Ruby
145082 [paniagua@pc ] library?  It say to use make, but I use Windows XP, so I dont quite get

Is there a Ruby equivilant to Python's exec_file?
145085 [shalofin@gm ] I'm working on a white-box security auditing framework, which is
145093 [vjoel@pa h. ] Check out "script" on RAA: http://raa.ruby-lang.org/project/script.
145099 [Ara.T.Howard] that's very cool joel!  i did something with a similar intent, but slight
145114 [vjoel@pa h. ] One difference: using script.rb, the loaded file doesn't have to know
145117 [Ara.T.Howard] yes exactly.

[ANN] constraint 0.1 -- ensure that object always satisfy a specified set of constraints
145090 [sanobast-200] I would like to announce 0.1 of contraint.rb. This is a first draft.

Test::Unit: setup & teardown around an entire suite?
145094 [michael@sc u] Is there a way to wrap setup and teardown methods around an entire
147656 [nathaniel@ta] require 'test/unit'

(none)
145104 [tsuraan@xy n] fam-ruby?

get username of file owner?
145116 [ruby@jo nf y] I'd like to get the username of the owner of a file in my Ruby
145123 [fredrikfornw] Once you have the uid of a user you can get the user name by using

embed yoshi's opengl in ruby/tk?
145118 [imifumei@im ] How can i run opengl (specifically I want to run the webcam example in
+ 145121 [claudio.espe] There are two packages for embedding opengl in a tk window: togl and
+ 145145 [nagai@ai ky ] What decides the posibility is whether the library has some ways

WEBrick default index page
145120 [ffsnoopy@gm ] Instead of using an index.html, index.rhtml, index.cgi, etc. as the
145122 [nospam@lu ac] I am not sure I really understood what you want to do but I think you
145172 [ffsnoopy@gm ] Thank you, that worked. I do remember trying that earlier, but

Regex help
145125 [ezra@ya im -] Hey there list
+ 145126 [mailing-list] "SPT_051205.jpg".scan(/(\d\d)(\d\d)(\d\d)/) do |a|
| 145128 [ezra@ya im -] Thanks so much Nikolai it works perfect!
+ 145127 [pete@pe ta t] #!/usr/bin/env ruby
  + 145129 [ezra@ya im -] Thanks Pete, that helps a lot as well. I guess I should have picked a
  + 145130 [mailing-list] Are you sure %G is what you want here?  Im betting that the dates

My Rails presentation is available for download
145131 [curt@hi bs c] I just posted the latest iteration of my Rails presentation and its
145149 [botp@de mo t] #I just posted the latest iteration of my Rails presentation and its

Please help me get "Ajax on Rails" Slashdotted
145132 [curt@hi bs c] I really like to get this slashdotted in my ongoing effort to get more
145158 [snail@ob me ] writes
145160 [camboris@gm ] You are on Slashdot now.
+ 145162 [curt@hi bs c] Thanks!
+ 145174 [snail@ob me ] <camboris@gmail.com> writes

Ruby way of handling this?
145134 [greg.kujawa@] This is a Rails-related question. I have several RHTML input forms
145143 [james_b@ne r] You might want to ask this on the Rails mailing list

blocks, scope/context confusion
145135 [corey_s@qw s] I'm reading pages 358 & 359 in the pickaxe2 and having a tough time
+ 145136 [corey_s@qw s] Quick correction/clarification -- in my post, the references/questions
+ 145137 [matz@ru y- a] Because "return 99" at the toplevel causes an exception as well.
| + 145138 [twifkak@co c] Ah! Thanks (I was curious, too). That makes sense.
| | 145141 [corey_s@qw s] Yes, that was _extremely_ helpful - thanks a ton!
| | 145167 [gavin@re in ] ...
| | 145176 [corey_s@qw s] This is good - thankyou for the link.   It's one thing to know how closures
| + 145140 [corey_s@qw s] Aha!      That makes sense, thanks!
+ 145139 [gwtmp01@ma .] I'm still climbing up the Ruby learning curve so I hope someone
  145142 [corey_s@qw s] Wow... that was a phenomenaly informative explanation for each of my

Win32API and frozen objects?
145144 [djberg96@gm ] Ruby 1.8.2

(newb) installing rails
145146 [lduncalfe@em] and installed the ruby 1.82-16 one-click installer, but when i open a
+ 145189 [daniel.amela] Good luck!
| 145197 [lduncalfe@em] thanks dan for the welcome! will try posting to the rails list in a few days
+ 145209 [tirado.carlo] gem (and Rails) use *.cmd extension batch files. These don't work on
  145231 [jim@we ri hh] We do try to make an attempt to "do what's right" on whatever platform we are
  145266 [paul__mcardl] It sounds to me like a PATH problem.

Persistence of Ruby sessions/programs
145148 [orsini@ds .u] I know there are several ways of saving ruby objects on files, but
145152 [surrender_it] well, using irb you have an hackish solution: you could do an eval of
145169 [orsini@ds .u] This could be of some help, in effect, but only for simple cases.

problem matching accented chars on OS X
145153 [alex@de et m] I'm finding words within strings in Western European languages, so I
145154 [Nuralanur@ao] ...
145155 [Nuralanur@ao] ...

Trouble using Net::HTTP.new / get a la page 133 pickaxe
145159 [xeno@es im .] #!/usr/bin/ruby -w
145163 [lorisx@gm il] host = "www.pragmaticprogrammer.com"
145165 [xeno@es im .] Yeah, that was it.  Sorry.  I guess it was too early on Saturday Morning.

extend(Module) and inheritance
145161 [clr5.10.rand] I would like to extend an object with a module. That is no problem so
145164 [nobu.nokada@] include A::WithDash
145171 [clr5.10.rand] Yeah! Thats it.

Only if the object exists
145166 [gavin@re in ] ...
+ 145170 [rampant@gm i] result = foo
| 145183 [gavin@re in ] So you've added 1-2 more options to my list, but the intent of my
| 145210 [bob.news@gm ] Why change the parser if there are ways to do this that don't require such
| + 145213 [discordantus] IMHO, it wouldn't be a "heavy language modification" (irrespective of
| | 145250 [rampant@gm i] irb(main):001:0> class Foo
| | 145258 [bob.news@gm ] Yes, of course!  Syntax analysis comes before execution.  Every
| + 145216 [gavin@re in ] ...
|   145249 [rampant@gm i] { i = i ? i+1 : 1 } is a new block. Setting i inside this block
+ 145262 [nobuyoshi.na] Not impossible, but a dirty hack because current implementation is one
+ 145268 [dave@bu t. d] The following method was mentioned a while back, and is a solution to this

how to extract url's from html source of google search result
145175 [sujeetkr@gm ] I want to make a Tk window where you give some input string and it
+ 145184 [marcel@ve ni] The URI.extract method from the uri library can extract an array of uri's from
| 145185 [alex@ve k. n] A universal regexp that finds URIs from an abstract text is a
+ 145188 [drbrain@se m] Why not use the Google API?

Behavior of $* in String subclasses
145177 [jamis@37 ig ] class Substring < String
+ 145179 [mailing-list] def a
+ 145187 [nobu.nokada@] m = eval("proc{$~}", b).call	# get caller's MatchData
  145191 [jamis@37 ig ] Hmmm. Either I'm misunderstanding you, or you misunderstood me. :)
  145192 [nobu.nokada@] $~ = eval("proc{$~}", b).call

LinuxJournal awards are open for voting...
145178 [tom@in oe he] ...and Ruby is on the list of programming languages.  Good times!

FXRuby 1.2 with Fox 1.4?
145180 [imifumei@im ] (sorry if this is not quite on topic) Apparently FXRuby 1.2 is designed
145193 [mailinglists] This will not work as one of the goals for 1.4 was the great renaming

Regular expression problem
145181 [sujeetkr@gm ] I want to sepearte a pattern from a string using regular expression
145182 [mailing-list] /#008000>(.*?)</font>/
145195 [simonced@gm ] What about this one ?
145202 [mailing-list] Sure, but he didnt want to match just any <font></font>,

Re: comp.lang.ruby FAQ
145186 [ng@jo nw on ] ? The other URL gives a 404.

File.link() error message
145190 [lorisx@gm il] Why does File.link() report that the source file exists? It really
+ 145224 [Ara.T.Howard] ENOENT is returned only if
+ 145227 [matz@ru y- a] I guess it's a matter of description.

Re: python/ruby benchmark(don't shoot the messenger)
145196 [ptkwt@ar cn ] I have to say that I tend to agree with the astonishment.
+ 145199 [the_mindstor] #: the mind was *winged* after Phil Tomson said on 6/12/2005 9:20 AM :#
+ 145203 [langstefan@g] Im slowly getting fed up with this whining, "Ruby is so slow".
+ 145207 [steven.jenki] That's putting it politely. The argument against, which has merit, is
| 145212 [halostatue@g] And there's the real tragedy. People who buy into the crap that is benchmarks.
| + 145214 [the_mindstor] #: the mind was *winged* after Austin Ziegler said on 6/12/2005 5:53 PM :#
| | + 145215 [michael.camp] How does this issue relate to *ruby*?  The same charge could be levied
| | | 145255 [mailinglists] If a language is a few times faster then the risk factor that this
| | | 145265 [halostatue@g] Sometimes yes, sometimes no. More often than I would like, but less
| | + 145218 [the_mindstor] #: the mind was *winged* after Alexandru Popescu said on 6/12/2005 6:15 PM :#
| + 145219 [steven.jenki] What's more amazing is that these fools why buy into this "crap" have
|   145223 [halostatue@g] Huh. They didn't do it with benchmarks. (And I could very easily point
|   + 145225 [curt@hi bs c] Yeah, I rely on the speed of airborne swallows at least three times as
|   | 145229 [Ara.T.Howard] it's 42 right?
|   + 145233 [igouy@ya oo ] -snip-
|   | 145235 [halostatue@g] Not an Ackermann recursive. Only simple recursive. Most of the time, I
|   | 145242 [igouy@ya oo ] And in some other language implementations that change is unecessary -
|   + 145240 [steven.jenki] They did. I was there; you weren't. But don't let facts get in the way.
|   | 145241 [halostatue@g] Bully for you. Were you there when they mixed unit systems, too? Did
|   | 145246 [steven.jenki] Yes, I was there. It's irrelevant to the discussion, but I was there.
|   + 145257 [ptkwt@ar cn ] No, but as you've said, you need quick response from a game in order for
|     145263 [Nuralanur@ao] ...
|     145279 [igouy@ya oo ] -snip-
|     145280 [tanner.burso] I've tried to stay out of this thread, because I don't feel it's
|     145292 [igouy@ya oo ] Sorry.
|     145302 [Nuralanur@ao] ...
|     145310 [mrcode@ne ro] My problem regarding these (or any) benchmarks is that a language could be
|     145311 [igouy@ya oo ] Surely that would show the power of algorithms. (Yes, memoising
+ 145211 [halostatue@g] If you don't have time to see why Ruby did so poorly in the alioth
+ 145220 [igouy@ya oo ] The quarrels about what was and wasn't OO became really boring.
+ 145351 [lypanov@gm i] luckily there is work on this.
threads.html
top