195231-277474

194978-195716 subjects 195446-220655

Passing an array to DBI statement execute
195231 [mail@pa lb r] ...
195232 [Daniel.Berge] sth.execute(*values)
195233 [mail@pa lb r] ...
195237 [mail@pa lb r] ...
195238 [Daniel.Berge] Are you doing dbh.commit before you're finished?  I believe autocommit
195241 [mail@pa lb r] ...

using AR and fixtures for testing *outside* of Rails?
195242 [cremes.devli] I'm working on a program that manipulates and stores a lot of data in
+ 195260 [ezmobius@gm ] Hey-
| 195263 [cremes.devli] You're a life saver! Thank you!
+ 195307 [jesusrubsyou] A bit away from your original topic (and perhaps this belongs on the
  + 195314 [cremes.devli] I'm using mysql 5.018 (latest AR, ruby 1.8.4 all on OSX 10.4.6) and
  + 195371 [zdennis@mk e] Let me guess, your IRC game is multi-threaded? AR stores connections based on the Thread.current_thread.id (or at least it does in
    195455 [jesusrubsyou] I think you're onto something there... :)
    195561 [zdennis@mk e] Pistos,
    195616 [jesusrubsyou] [much snippage above]

Search-result referrals in Net::LDAP
195245 [garbagecat10] ...
195246 [Daniel.Berge] Would you blame a company that has, say, 40,000 employees for
195249 [garbagecat10] ...
195262 [botp@de mo t] # This happens because many A/D servers are configured to
195277 [garbagecat10] ...

class from string
195251 [dangogh@gm i] Is there a better way to get to a class when you have the class name in
+ 195253 [vshepelev@im] Of Dan Kirkwood
+ 195257 [leavengood@g] This really gets asked a whole lot, especially from Ruby Forum. I
| 195293 [ruby@an hr p] } >Is there a better way to get to a class when you have the class name in
| 195299 [r.mark.volkm] Agreed!  Has there already been a formal request to add this in 1.9?
+ 195261 [ezmobius@gm ] In rails you can use #constantize
  + 195276 [rubytalk@ea ] ...
  + 195311 [dangogh@gm i] Thanks all for the responses -- it's obvious this is a FAQ, but just try
    277420 [ruby-forum@p] FWIW, I searched the Ruby forum for
    277474 [ruby-forum@p] Bah!  I was too quick on that -- now I'll probably end up asking FAQ'

Ruby-SDL/Opengl Tutorials
195259 [steviedizzle] I am making a game using Ruby-SDL called Nebular Gauntlet and the game
195306 [jmg3000@gm i] I'm working on this and hope to have something up this weekend. Work
195397 [steviedizzle] No hurry. This is just sort of a side-project as I have been wanting to

YAML - how to encode an empty string
195268 [cremes.devli] Learned something interesting (to me) today.
195273 [logancapaldo] % ruby -ryaml -e 'y ""'

Pub/Sub in Distributed setup
195280 [vinaykumar.j] ...
195335 [logancapaldo] Where's the other half of your code? What does the object that you
195414 [vinaykumar.j] ...
195625 [logancapaldo] Could this just be a typo in your code?
195676 [vinaykumar.j] ...

habtm on an array
195283 [daniel_mclea] I have three Models
+ 195284 [M.B.Smillie@] The Rails-specific list (http://lists.rubyonrails.org/mailman/
+ 195286 [khaines@en g] Step back from the problem a step.  Forget that you are working with models or
  195295 [simon.kroege] a.flatten.uniq ?
  195297 [khaines@en g] Doh!  Yeah.  I goofed.  Thanks.
  195301 [simon.kroege] We all do that - from time to time :)

Get folderlist in ruby
195287 [roman.leitne] i am quite new to ruby and I was wondering if there is a method in ruby
+ 195289 [rforum@gm il] The standard Find module should let you do this.
+ 195290 [shortcutter@] files = Dir[ 'root/**/data.txt' ]
+ 195291 [james@gr yp ] root/sub1/sub1A/data.txt
  195296 [roman.leitne] WOW!

[ANN] Ruby Manual
195294 [nshb@in mi .] www.rubymanual.org
+ 195298 [james@gr yp ] Where is rjust() for example?
| 195304 [simon.kroege] just a wild guess: only the .rb files are parsed.
+ 195300 [the.mindstor] Looks cool!
+ 195305 [ara.t.howard] is it running in testing mode?
+ 195478 [dsisnero@gm ] ...

Another Rails book announcement
195303 [pat.eyler@gm] Apress (www.apress.com) has announced one RoR book and

Passing a string as stdin to a popen
195309 [pedrocr@gm i] Say I have some content in a ruby string and I want to pass it as
195332 [logancapaldo] I'm not sure _exactly_ what the problem is, but I imagine that
195432 [pedrocr@gm i] Yes, this works. The problem with this is that since I only read after
195435 [shortcutter@] from (irb):1:in `write'
195442 [pedrocr@gm i] Yes, that was it. I was passing some wrong options to the program and

TMail question / ?error?
195310 [ro@pa er mi ] the first
195313 [decoux@mo lo] Well #new_port returns a new TMail::Port, which must be used with #wopen
195323 [ro@pa er mi ] Ahh, "new_port" does not do what I imagined it did.

OO Thinking - First Attempt at building an object
195312 [paul.kraus@g] ...
+ 195317 [schapht@gm i] I usually try to build OO systems that parallel the actual items or
+ 195320 [james@gr yp ] Classes are data, wrapped up with the behaviors for that data.
+ 195321 [agorilla@gm ] There is one store

Installation Issues - SCO Openserver 5
195315 [paul.kraus@g] ...

Compiling for mingw32 under Cygwin
195324 [alex@bl ck e] I'm trying to compile Ruby under Cygwin, but I want to target mingw32.
195327 [eban@os ri .] % ./configure --with-gcc='gcc -mno-cygwin'
195328 [alex@bl ck e] Thanks :-)  Looks like that's working - make test passes, at least.
195456 [nobu@ru y- a] CFLAGS have no effect to a preprocesser.  Leaving it as cygwin

I'm Collecting Media Refernces for Ruby and Rails
195326 [ml.chibbs@gm] ...
+ 195333 [schapht@gm i] It's not all "media" but I usually send the following links to people
| 195339 [kevin.clark@] I've got several Rails articles on my blog, http://glu.ttono.us. Look
+ 195349 [james_b@ne r] James Britt
  195429 [huw@da kn on] Huw

Trying to determine presentation author
195329 [james_b@ne r] There's a presentation on ruby-doc.org, in the Why Ruby? section, simply
196403 [assaph@gm il] That would be me. It's a presentation I gave to Avaya Labs (Australia)
196444 [james_b@ne r] Thank you!

Generating files with libsndfile
195330 [notmyprivate] I'm trying to generate sound files with the ruby wrapper around libsndfile.[1]
195345 [Daniel.Berge] Looks like a bug in the binding somewhere.  I recommend contacting the

OO / Private verse Protected
195337 [paul.kraus@g] ...
+ 195341 [joost@ze ka ] Personally, I think protected methods are completely useless, except _maybe_
| 195344 [the.mindstor] At least in Java these modifiers are quite usefull: a protected method
| + 195347 [joost@ze ka ] That's only true if you also find some way to stop the "public" from
| | 195352 [the.mindstor] Not sure I am getting your argument. For inheritance this is the exact
| | 195381 [joost@ze ka ] My argument was that you then have to disallow people from implementing
| | 195384 [the.mindstor] But I haven't worked on protecting them against overridding, but
| | 195390 [joost@ze ka ] Ofcourse.
| | + 195395 [headius@he d] ...
| | + 195692 [shortcutter@] Note though that it's usually harder to remove functionality than to
| + 195454 [vjoel@pa h. ] But Java != Ruby. In ruby, even private methods can be called from
| + 195457 [jim@we ri hh] Keep in mind that Ruby protected and private have slightly different
|   195467 [the.mindstor] Thanks Joel and Jim. I was aware that there are differences between
+ 195342 [james@gr yp ] => nil
+ 195343 [the.mindstor] I think you are looking at the problem from the wrong perspective: is

ruby-dev summary 28606-28636
195338 [aamine@lo er] This is a summary of ruby-dev ML in these days.

class << self ...end - how does this create class methods?
195348 [weyus@at .n ] I just ran into a seemingly weird problem until I discovered that the
+ 195353 [mental@ry ia] 1. Classes are themselves represented as objects.
+ 195354 [Gennady.Byst] Pickaxe2 in chapter 24 on page 362 ("Classes and Objects") goes into
+ 195356 [klancaster19] ...

Constant Hash strangeness
195351 [wmacura@gm i] This seems to be trivial, yet I can't find an explanation for it
+ 195360 [mental@ry ia] CONSTANTHASH = { :foo => "foobar" }
| 195448 [wmacura@gm i] Thank you. I was surprised by the way hash behaves, but I do
+ 195361 [halostatue@g] Constants don't work the way that you think they do. I'll be posting
  195447 [wmacura@gm i] Well, thanks for taking the time to do the article... and if you need

Newbie: Does Array.each guarantee an ordered result?
195357 [weyus@at .n ] If I do
+ 195359 [transfire@gm] They are the same. A for-loop is "translated" into an each-loop.
| 195377 [james@gr yp ] => [1, 2, 3]
| 195379 [weyus@at .n ] Valid.  But as long as you're not interested in manipulating that last
| + 195383 [weyus@at .n ] By the way, I just realized - I meant that I wanted the array elements
| | 195389 [rubytalk@ea ] ...
| + 195396 [hal9000@hy e] Yes... but more generally you should realize that a block
+ 195365 [M.B.Smillie@] I don't know if it's guaranteed (in the sense that it will never
  195368 [toalett@gm i] Array#each iterates over an array from index 0 to #length - 1. So,
  195378 [gilesb@gm il] yah -- and since each is almost the same thing as for, i.e., for is

Re: class << self ...end - how does this create class method
195363 [weyus@at .n ] Keith,

Re: [Rails] I'm Collecting Media Refernces for Ruby and Rails
195366 [agorilla@gm ] I'm assuming you mean 'print media'.  Not sure if any of these made it

[ANN] Ruby on Rails Workshop in Kansas City !
195367 [shanko_date@] ...

Tasks with Parameters: Can it be done?
195370 [transfire@gm] I've been working on a task library, on the surface similiar to Rake,
+ 195375 [drbrain@se m] $ ri Rake::TestTask
+ 195507 [logancapaldo] This may be the Lisp I just ate talking but...
  195547 [transfire@gm] Oh right. A clear solution that didn;t even occur to me (duh). But
  195621 [logancapaldo] Maybe make tasks objects....
  195694 [transfire@gm] Hmm... Yea I suppose one could do something like that. You particuklar

Better coding using ruby
195372 [paul.kraus@g] ...
+ 195374 [khaines@en g] def splitpipe (string)
+ 195376 [SimonKroeger] def splitpipe string
| 195380 [SimonKroeger] if datearray[2].to_i > 90
+ 195394 [agorilla@gm ] %w[a b c d e].each_with_index do |val,idx|

Web Services Issue
195388 [p.t.barnum@m] I am currently working on a simple WS Client and have run across a very
195408 [cremes.devli] Chuck Remes
195472 [p.t.barnum@m] OOPS! No that's a mistake in my not checking it closely enough when I
195481 [cremes.devli] Chris,
195491 [p.t.barnum@m] CR,
195492 [p.t.barnum@m] All,
202313 [nakahiro@sa ] Thanks.  I tried to download WSDL at

Parsing a string using multiple regexs
195391 [webmail716-o] To whomever can help,
+ 195407 [jp@je fp it ] I'm a newbie too, but thought I might be able to help on this one.
+ 195411 [ezmobius@gm ] def parse_tags(input)
  195412 [jp@je fp it ] Thanks Ezra,
  + 195504 [webmail716-o] Jeff, Ezra,
  | 195520 [M.B.Smillie@] You're right, that's what would happen.  The problem is that in the
  | 195539 [webmail716-o] Matthew,
  | 198510 [shortcutter@] ?> parse_tags '"my first tag", second tag, third_tag fourth_tag'
  + 195511 [logancapaldo] I must say this has to be the best breakdown of someone else's ruby
    195548 [jp@je fp it ] Thanks Logan,

A newbie question about scanf
195393 [kenkam@gm il] I tried to get user input by using scanf
195398 [hal9000@hy e] a, = scanf('%d')
195400 [kenkam@gm il] Hmmm... the * thing...
195401 [hal9000@hy e] No... it's what David Alan Black calls the "unary unarray" operator,
195402 [jp@je fp it ] As a fellow newbie, let me just say that this splat business is all very
195405 [hal9000@hy e] scanf typically returns multiple objects -- it reads a string and
195409 [jp@je fp it ] OH!  Now I remember.  Haven't used it in forever.  It uses a format

What hapenned the week of March 19th?
195410 [ml.chibbs@gm] ...

Re: Ruby Manual
195413 [rails@gm il ] Nathaniel is using my software Rannotate
195439 [rosejn@gm il] The idea here is cool, even if there are still some kinks to work out.
195451 [rails@gm il ] I don't have any access to railsmanual, that is something that Nathaniel
195480 [rails@gm il ] There is no differece and this is something that Nathaniel and I had a
+ 195482 [rossrt@ro co] I also strongly disagree with this kind of fragmentation - it's just not
| + 195485 [rails@gm il ] I can offer an opinion on why I think Rannotate helps improve things,
| | + 195487 [schapht@gm i] Just to offer my $.02 as someone who came from PHP to Ruby about 2
| | + 195540 [rossrt@ro co] I had a better look, and I agree that Rannotate has some promising
| + 195486 [agorilla@gm ] +1
+ 195493 [pat.eyler@gm] Sadly, this is not the first time there have been conflicts with Nathaniel
  195631 [rhkramer@gm ] (Aside: Sorry--I think I have the attribution right, but the threading may be

Ruby security question
195416 [jp@je fp it ] I work for a fortune 100 company in the telecom space.  They are
+ 195417 [drbrain@se m] The equivalent in ruby is "Never trust tainted data".
+ 195420 [dido.sevilla] Yes and no. The main thing with scripting languages like Ruby is that
+ 195421 [lutzky@gm il] Watch your 'eval's. If incorrectly used, they're a MUCH easier way for
+ 195422 [ml-ruby@th p] I know of specific examples of some interpreted languages experiencing
+ 195453 [znmeb@ce ma ] If you work hard enough at it, you can open anything. If you're sneaky

I Love The world
195418 [baby_ruby@we] i`m love this page

I Love The world
195419 [baby_ruby@we] I work for a fortune 100 company in the telecom space.  They are
+ 195426 [eeklund@gm i] No.
+ 195431 [xiaofeng.li@] This is called type-safety. The basic idea is you can only operate the

How I can check number?
195430 [iiskakov@gm ] How I can to check float value, with regular expression. Also need check
+ 195433 [Nuralanur@ao] ...
+ 195434 [iiskakov@gm ] params[:value] =~ /^\d+$|^-\d+$|^\d+\.\d+$|^-\d+\.\d+$/
| + 195436 [Nuralanur@ao] ...
| + 195440 [dave@bu t. d] /^ [-+]? \d+ (\. \d+)? $/x
+ 195437 [shortcutter@] => false

syslog lib/module for remote logging
195441 [botp@de mo t] I need to log remotely win/*nix server logs to central *nix syslog server. I search for ruby remote syslog but found none. There is syslog in ruby std lib but i only see sample for local logging. Maybe i am wrong, but i do not see any sample for remote logging.
195445 [garbagecat10] ...
195546 [botp@de mo t] # You have to configure your logging server to accept remote
195565 [phasis68@ho ] require 'socket'
195582 [botp@de mo t] #
+ 195593 [garbagecat10] ...
+ 195597 [d454d@we .d ] On unix side there are tcp base syslog implementations (see syslog-ng).
  195664 [botp@de mo t] fr Steph

An alternative to the class Foo < Struct.new(vars) idiom and SuperStruct
195443 [ mfp@ac .o g] ( http://eigenclass.org/hiki.rb?struct-alike+class+definition ) and was
+ 195444 [rosejn@gm il] I'm sold.  This will be great for easily defining event types in
| 195452 [ mfp@ac .o g] The problem with this is that it makes positional arguments impossible, since
| 195562 [hal9000@hy e] That's another example of why I would like a data structure
| + 195567 [transfire@gm] Facet's has Association which gives one something quite like that.
| | 195571 [ara.t.howard] require 'arrayfields'
| | 195678 [transfire@gm] Cool. Pair is a lot like Association but you've added the Map class
| + 195579 [logancapaldo] This is why I kind of like how in Perl => is just a synonym for comma
| | 196011 [steven@lu os] I stopped using Perl when I started using Ruby, but I seem to recall
| | 196035 [logancapaldo] True, but in perl you have to "force" the evaluation of variables
| + 195585 [daniel.schie] Wow, it would be great if we then could use #to_hash to determine
|   195660 [hal9000@hy e] What is your point? Please elaborate...
+ 195460 [ara.t.howard] thought i'd just chime in here and show how this would be done with traits
  195473 [ mfp@ac .o g] Please indulge some quick questioning on my part; all the answers are in the
  195475 [ara.t.howard] all true.  traits does alot.  in particular it gives 'pols' semantics to
  195991 [ mfp@ac .o g] Thanks for taking the time to answer my questions; it seems traits is very
threads.html
top