257072-265834

256859-261010 subjects 257300-266662

^ Class instance into included module
257072 [galevsky gma] here is my problem: I would like to handle class instances into a module
+ 257073 [johnwilger g] Is Module#included what you want, perhaps? http://ruby-doc.org/core/classes/Module.html#M001683
+ 257074 [transfire gm] The way you have it paradoxical b/c "method_HelloWorld.call if iwant"
  257076 [galevsky gma] Thanks for your posts guys ;o)
  257077 [galevsky gma] But what I think I'll do is make TestModule a class, and my TestAClass
  257082 [robert.dober] If I am not mistaken Test::Unit does instantiate an object of all
  257085 [galevsky gma] for fun :o)
  257093 [robert.dober] Hmm I am quite sure Mixin will do the trick, why should we let you
  257106 [galevsky gma] You got it !!!

^ Ruby script that will restart a Windows server...
257086 [ryangs mac.c] I have been researching on how to write a script that will restart a
257088 [jan.svitok g] it depends whether you want a local restart or a remote one.
257089 [ryangs mac.c] Thanks for the reply Jano.
257091 [damnbigman g] You could just do `shutdown /r`
257095 [ryangs mac.c] I just found that.  Using that is probably much simpler than trying to
257159 [shortcutter ] cygwin also has a package with a reboot / restart command.  And you can

^ [ANN] Gecode/R 0.3.0
257090 [ruby-talk lo] Gecode/R version 0.3.0 has been released.

^ Getting an <iframe> in Watir
257097 [ jack ss.com] I am new to Ruby and Watir. I need to access a frame (iframe) in a
257247 [list.rb gmai] What does ie.frame("facframe") yield?

^ SslRequirement module
257099 [ryansobol gm] This is a question is about the SslRequirement rails plugin.  However,

^ Encoding of strings received from db
257101 [zorglub76 ya] I swear I searched this forum and couldn't find the solution!
257162 [AEtzold gmx.] Dear mare,
257170 [zorglub76 ya] Unfortunately it doesn't, because rails has some kind of configuration
+ 257174 [AEtzold gmx.] Dear Marko,
+ 257180 [grzm seespot] I think your issue is that your Ruby script doesn't know what
  257195 [zorglub76 ya] Thanks a lot, guys!

^ oniguruma : can't get it to search for \ (backslash)
257103 [deanholdren ] I can't seem to get Oniguruma to look for a single backslash, am I
257107 [dan fluentra] In a regex literal a backslash is a metacharacter, so you need two

^ Fun about inspect
257105 [vshepelev im] By some complex reasons, I've made an interesting conclusion: for
+ 257109 [sonoflilit g] I've given up on #inspect.
+ 257160 [shortcutter ] No, they don't.  See below.
| 257230 [vshepelev im] There is a bit of misunderstanding. I'm not talking about some "strict
+ 257167 [erikveen gma] In one specific situation, I use a journal to resemble a small

^ how to get data from database as string
257118 [maung atc-on] How can i read a cell from database and retrieve as a string in ruby
257173 [B.Candler po] There are working examples in the documentation at
+ 257191 [maung atc-on] Thank you for your response, Brian. Actually what i am trying to do is
| 257283 [AEtzold gmx.] Dear Maung,
+ 257284 [B.Candler po] r = cursor.fetch    # fetch just one row
  265834 [maung atc-on] What about if I want to fetch multiple rows? Any suggestion would be

^ Arguments into method calls?
257120 [disaffected ] I'm working on a program that takes user input via command line, then
257123 [TimHunter nc] Check out the __send__ method, which lets you call a method whose name
257168 [vasudevram g] You can create a hash that has the method names (as strings) as keys,
257169 [vasudevram g] Forgot to add this (which I checked online before writing the previous

^ Guess what this will do...
257122 [john.carter ] Without cheating (trying to run it) what will this pair of files do under Linux....
257196 [pi pihost.us] Linux....

^ Note to Self: Moving ruby, $:. Don't _do_ that.
257124 [john.carter ] With gcc you can build & install in /home/myname/opt/gcc and then tar it
257130 [m.fellinger ] ./configure --prefix=/opt --enable-shared --enable-pthread
257232 [john.carter ] Sigh! Tried that, didn't work quite. Something somwhere tries to

^ Help Installing a Ruby Module
257126 [whiteqt gmai] I downloaded roscar from RubyForge in hopes of sending automated AIM
257153 [leslieviljoe] Taking a quick look, you should be able to copy oscar.rb and the types

^ DateTime problem
257128 [coolwong85 y] DateArray = ["Apr", "2", "2007"]
+ 257129 [mike.cahill ] teach-a-man-to-fish answer: check http://ruby-doc.org/stdlib/   , under Date
+ 257134 [m_goldberg a] Something like this?
| 257138 [vjoel path.b] Same idea, but slightly simpler...
| 257141 [m_goldberg a] Yes, that's better. But don't you need a 'require "time"' at the
| 257145 [vjoel path.b] I think my irb required time ... (1.8.6).
+ 257149 [alin.popa gm] tt = Time.parse(da.join(" "))
+ 257166 [doodpants ma] day   = 01

^ Very easy question GET METHOD
257136 [drhenner gma] so I have an ID at the top of my page.  but how do i access the #?
+ 257139 [has.sox gmai] Perhaps you could work on wording your question a little better.  There
+ 257140 [drhenner gma] yep..  i told you it was easy.. thanks...

^ [ANN] singapore.rb meeting for June 2007
257144 [bianster gma] The next Singapore Ruby Brigade meeting will be held at the Geylang East

^ including modules - ordering question
257147 [tennisbum200] module A
+ 257148 [alexg kuicr.] Perhaps I'm missing something, but haven't you answered your own
| 257192 [tennisbum200] Well, basically Im looking for a solution where order doesn't matter.
+ 257156 [fred lacave.] Not sure how (if) it would work, but can't you just define an empty

^ [ANN] bee 0.4.0 Released
257154 [michel.casab] Bee is a build tool running YAML files. These build files have a clean

^ [RAILS] Send request to add application in Face Book using Rails
257155 [arunagrawal8] Does any one know how to send a request to friends to add an application
257163 [gregory.t.br] Please do not cross-post (send a message to more than on ML

^ Get Set-Cookie from Soap response
257161 [msims intell] I'm a newbie to Ruby but need to do a couple of soap requests over

^ RegExp & File read help
257164 [levandon gma] charset=US-ASCII;
257171 [AEtzold gmx.] Hpricot is a good choice.
257182 [dblack wobbl] irb(main):017:0> Regexp.new(/a-z/).match("a")
257190 [levandon gma] Thanks for your help. I don't have it solved yet, but you both have

^ CGI.escape accepts only ISO-8859-1 input?
257177 [martin.stabe] I'm not able to convert a string to ISO-8859-1.
+ 257179 [martin.stabe] require 'iconv'
+ 257183 [showaltb gma] message = Iconv.new('ISO-8859-1', 'UTF-8').iconv(message)

^ Re: snmp error
257178 [B.Candler po] The trouble is that you are printing the raw 6 byte string (note that hex 67

^ missing kEND for if statement, but not for a case statement?
257184 [onebitcipher] I am having some trouble figuring out why I keep getting an unexpected
257185 [cdcarter gma] The "else if" construct is elsif in ruby.  doing else if will start an
257187 [onebitcipher] That is excellent.  Thank you.  I thought it was elseif but when I used that

^ net/http for Googles Authentication api
257189 [stone1549 gm] def process_token(token)
257194 [dzwell gmail] A 404 not found is not something that a server usually spits out when

^ Bad Smells sing in a rails application
257193 [pedro.delgal] Sometime ago, i read the slides  "when V is for Vexing: Patterns to

^ Is there a ruby source code formatter?
257201 [vfcforums gm] Is there a ruby source code formatter somewhere out there?
+ 257212 [gavin refine] ...
+ 257213 [rubylearner ] I dont believe there is one out there, at least my google search drew a
| 257266 [rubylearner ] maintained.
+ 257302 [chris.hulan ] I've been using http://www.arachnoid.com/ruby/rubyBeautifier.html

^ Regexp rescue method
257202 [th8254 yahoo] How would I write a rescue method to recover from a failed regexp
257211 [TimHunter nc] I don't think that raises an error. You'd have to check for a nil result
257218 [james graypr] I took the question to mean, how would I recover from a malformed
257226 [florian.assm] I can't catch it even with rescue Object... wow.
257285 [B.Candler po] That's not surprising. Malformed regexps are a *parse* time error. Parsing

^ ActiveRecord (not necessarily rails)
257207 [nephish gmai] i have been using ActiveRecord in a couple of GUI applications recently and
+ 257214 [igor.sutton ] <code>
| 257215 [nephish gmai] no, i am sorry, i was not clear enough.
| 257216 [donald.ball ] You could probably do that using class_eval, but it wouldn't last past
| 257221 [nephish gmai] ok, i will look that up. I am not looking to build a rails app with this, i
| 257223 [donald.ball ] I suspect you'd be much happier if these related attributes inherited
| + 257229 [dblack wobbl] Foo.has_many :bars
| | + 257240 [nephish gmai] ok, gents, your comments are well heeded. I am still a newbie here and a
| | + 257326 [gregory.t.br] And even if you couldn't,
| + 257625 [caduceass gm] To shawn: I haven't used ActiveRecord yet, but there are probably ways
+ 257380 [showaltb gma] has_many is a class method.

^ ruby zoomify
257208 [donald.ball ] Howdy folks. I just finished the first version of my ruby zoomify

^ RCR 13
257209 [poopdeville ] day.  I intend to withdraw it for now, but I would still like to

^ Fwd: Please Forward: Ruby Quiz Submission #129
257220 [james graypr] ...

^ copying files to remote machine
257222 [tmac easystr] Hey all,
257261 [webs.dev gma] This issue has been discussed on the mail list before.  I would

^ Punch Card Tales (was Re: Regexp to split name?)
257225 [rick.denatal] Rick DeNatale

^ Ajax with Ruby problem
257228 [galecho gmai] I'm a newbie to both Ruby and Ajax. I'm trying to use Ruby to handle the
257233 [ondemannen g] Try renaming the script to test2.cgi and see if that helps.
257234 [galecho gmai] Tried both the approaches but neither worked.
257241 [dangerwillro] Make sure your shebang line is correct and that your Apache knows
257245 [galecho gmai] I'm pretty sure the shebang line is correct. I verified by doing "which
+ 257252 [list.rb gmai] Try referencing the full path to the script, i.e
| 257256 [dangerwillro] sounds like it is all about the Apache configuration.
+ 257270 [ondemannen g] Download the "web developer" plug-in for Firefox and enable while
  257273 [galecho gmai] Damn.. I really dont believe this!!
  257312 [dangerwillro] John Joyce
  257329 [galecho gmai] No, I dont think just pre-pending "/cgi-bin" would do any magic. Here's
  257403 [galecho gmai] I'm sorry to spam the board like this, but I had to correct myself on
  257696 [dangerwillro] Thanks for posting your solution! It may be useful to somebody else.

^ Is there a nifty ruby hack for this set of commands?
257235 [vfcforums gm] I have this sequence of commands to write a list of values to a file
+ 257236 [ezmobius gma] [header_commands, mysql_commands, dir_commands,
+ 257237 [has.sox gmai] Just a stab.  Besides a normal nested loop, you could add all the array's of
+ 257239 [botp delmont] # f = File.new(configfile, File::CREAT|File::WRONLY, 0700)
+ 257264 [gavin refine] File.new( configfile, File::CREAT|File::WRONLY, 0700){ |f|
| 257286 [shortcutter ] File.open configfile, File::CREAT|File::WRONLY, 0700 do |f|
+ 257563 [vfcforums gm] Thanks for all the examples.
+ 257568 [apeiros gmx.] You're almost there

^ File permissions w/Dir.mkdir
257238 [dangerwillro] Dir.mkdir(file_name, 755)
257242 [pi pihost.us] Dir.mkdir accepts octal numbers, which is standard notation for this

^ More Regexp and file load problems
257243 [levandon gma] I am struggling here and would be most appreciative of any help.
+ 257258 [botp delmont] # file = File.new('/Users/donlevan/Desktop/DDRs/Apple Dealer Price
+ 257260 [webs.dev gma] You use an xml library, possibly rexml

^ Hash banging #! - Distributing precompiled sharable linux binaries
257244 [john.carter ] This may, in a very odd set of circumstances, be useful to somebody....
257309 [kbloom gmail] Guess what. JRuby of all things runs into this problem[1], and they

^ Array Problem, sort Array
257246 [coolwong85 y] [code]
+ 257248 [list.rb gmai] ["a", "a", "a", "b", "b", "c", "c", "c","d", "d", "e"].uniq.sort
| 257249 [coolwong85 y] if the array include the "nil", it cannot sort, why??
| + 257250 [list.rb gmai] ["a", "a", "a", "b", "b", "c", "c", "c","d", "d", "e",
| | 257251 [list.rb gmai] w/ numbers also in case that's your next question :-)
| + 257255 [botp delmont] # if the array include the "nil", it cannot sort, why??
| | + 257262 [gavin refine] ...why wouldn't it be? Sorting an array of any 1 element should always
| | | 257271 [botp delmont] # > A little digression for everyone though...
| | | 257311 [dangerwillro] Let's do some philosophy!
| | | + 257319 [Rob AgileCon] This thread continues to remind me of a comment made by a colleague
| | | + 257320 [gavin refine] On Jun 28, 7:53 am, John Joyce <dangerwillrobinsondan...@gmail.com>
| | | + 257399 [botp delmont] # > # > A little digression for everyone though...
| | + 257280 [fred lacave.] => ["a", "b", nil]
| |   257290 [botp delmont] # > solution: a) convert elements to some common class (string
| |   + 257322 [dblack wobbl] This message is in MIME format.  The first part should be readable text,
| |   | + 257325 [juapdiaz gma] When i found a shoppyng under ruby?
| |   | + 257402 [botp delmont] #   class C; end
| |   |   257460 [dblack wobbl] This message is in MIME format.  The first part should be readable text,
| |   |   257549 [botp delmont] On Behalf Of dblack@wobblini.net
| |   + 257463 [fred lacave.] We're in an object paradigm here.  We're trying to sort an array of one
| |     257550 [botp delmont] # and only one object ; the nature of this object doesn't enter into the
| + 257263 [gavin refine] my_array.compact.uniq.sort
+ 257275 [coolwong85 y] [code]

^ when to Run the garbage collector?
257253 [gpygood 126.] GC.start
257259 [gpygood 126.] Thank you.
257268 [sylvain.joye] It may be difficult to benchmark (or profile for that matter) code under
257406 [mick hollins] Given that the GC runs during real world operation, and that benchmarks are generally about
257489 [sylvain.joye] vice.

^ Re: LSRC Name Picker (#129)
257257 [CHubas7 gmai] Here is my sollution, using Tk. It is not very fancy, as uses very

^ RCR: hybrid case expression
257265 [webs.dev gma] I always use a case expression with the target/comparison style, but

^ signal handler problem
257269 [rubylearner ] Consider the snippet -

^ Ruby versus Java threading ?
257272 [surfunbear y] This paragraph is part of the Java Performance tunning newsletter
+ 257287 [shortcutter ] The major - and crucial - difference between current Ruby's threads and
| 257308 [znmeb cesmai] I'd say jRuby is the answer here -- it uses the JVM threads which in
+ 257288 [snail objmed] <surfunbear@yahoo.com> writes
+ 257301 [james graypr] I see you already have some great answers, but this might be worth a
+ 257307 [aurelianocal] Well, you can use JRuby. Which is a Ruby implementation that runs ontop of a JVM and uses the threads provided by the JVM (the Java ones).
+ 257315 [rasputnik gm] With Ruby, you tend to do parallel operations with processes instead

^ Can i calculate the data number in array?
257276 [coolwong85 y] [code]
+ 257277 [gpygood 126.] d=["a", "a", "a", "b", "b", "c", "c", "c","d", "d", "e"]
| 257278 [gpygood 126.] But,I think ruby's Hash is not ordered,so...
+ 257279 [AEtzold gmx.] Dear Cool,
  257289 [shortcutter ] Yes, I'd agree.  Having tuples as return value is better because then
  257291 [robert.dober] Shame on you!!! ;)
  257294 [shortcutter ] Um, why?  Somehow I don't get the joke, sorry. :-)
  257314 [robert.dober] Really or are you metajoking?anyway to get out of recursive joke mode,
  257367 [shortcutter ] Umpf!  I actually overlooked that one.  Somehow I read it as (a||[]).

^ change path for require
257281 [mihai.bulhac] how can i change the path for require?
257282 [fred lacave.] require "tst/requiered_file.rb"

^ pretty_print woes
257292 [ronald.fisch] I like the formatting one gets by
257297 [shortcutter ] irb(main):009:0> puts "foo\"bar".pretty_inspect
257306 [ronald.fisch] Thanks a lot! Nearly perfect!! (Actually, I use pretty_inspect.chomp,
257310 [dangerwillro] Actually, puts is adding that \n to the string, but your result is
257370 [shortcutter ] irb(main):001:0> "a".pretty_inspect

^ Dynamic sort_by criteria, making it DRY...
257293 [josselin wan] I am presently using a sort_by on my array
257296 [shortcutter ] buddies = user_buddies.sort_by {|it| it.send @criteria}
257368 [josselin wan] Thanks Robert cannot be dryest....  I am so ashame of my solution that

^ splitting a string
257295 [lars.andren ] I've got a problem when trying to split a string after the thrid
+ 257298 [stefano.croc] str.scan(/(?:[^\/]+(?:\/|$)){3}/)
| 257303 [lars.andren ] Thanks a lot both of you! I can use Stefanos method since I only want to
| 257331 [robert.dober] In that case you can do
+ 257299 [shortcutter ] Depends on what you want to do, i.e. which part(s) of the string you
threads.html
top