340038-345706 subjects 340446-341590

Send file to printer
340275 [dimascyriaco] I'm having some trouble to print things...
+ 340285 [globyy3000@h] Instead of ShellExecute, try ShellExecuteEx
| 340384 [dimascyriaco] Thank you Mac, that helped a little. Now the Adobe Reader screen opens
+ 347806 [chris@mo fo ] Shameless self-promotion: cups - cups.rubyforge.org

Strings to int conversion
340278 [pwu.380@gm i] s = "1234" [0..1]
+ 340279 [aaron@te de ] "1234".split('')[1].to_i  # => 2
+ 340280 [vjoel@pa h. ] s[1,1]
| 340281 [pwu.380@gm i] Thanks, guys.
+ 340282 [lists@be tr ] The answer has already been given.
| 340336 [dan-ml@da 42] Wow, I've been using ruby for many years but there's
+ 340287 [ruby-bucket@] One of Ruby's problems is that  it invites clever solutions, which are
+ 340296 [dblack@ru yp] In 1.9 it returns the character rather than the character code.
+ 340495 [pierr.chen@g] p s[1].chr.to_i    #=> 2

Win32API keystate issue
340283 [globyy3000@h] Win32API.new('user32','GetAsyncKeyState',['i'],'i')
340284 [phasis@gm il] Here is a code snippet I used in the pure ruby readline.

Shibuya Rubyists?
340286 [paradisaeida] I'm in and around Shibuya for a couple of weeks.
340289 [james@gr yp ] How long will you be there?  I reach Toyko on the 16th.
340331 [paradisaeida] Ruby-Kaigi next month around 16th.
340359 [james@gr yp ] Yeah, that's what I'm coming out for.

Why does this include fail in instance_exec?
340290 [charlton.wan] The following code will dynamically create a class, C, inside of module
340291 [charlton.wan] I found a post that address this. I guess the nature of

question about IO.select
340292 [dmiller@te o] I was looking at some code in a textmate bundle support library that
340300 [mat@pa ch co] Dave,
+ 340315 [dmiller@te o] Thanks Mat
| 340341 [dmiller@te o] For anyone who cares, this seems to be an issue unique to the 1.8.6
+ 340431 [shortcutter@] Normally I would expect "ready for reading" to mean that it is open

340293 [572849@go gl] ...

Spelling mistake in comment in sample files
340294 [elias.kuthe@] ...
340318 [b.candler@po] Best thing to do is create a ticket on redmine.ruby-lang.org and attach

How ruby can solve this:network programming
340295 [rajib.chakra] I am not sure whether this is ruby question or networking question..
+ 340342 [rajib.chakra] can any one pl share some ideas
+ 340344 [rubfor@re it] Firstly this seems like a political rather than technical problem. Get

wikibooks wiki [was Re: ruby suggestion: officially sanctioned  tutorials/howto's]
340307 [martindemell] That's great - who set it up? I've been missing the rubygarden wiki.

Gem mirror rubyforge.iasi.roedu.net not working
340308 [twarlick@gm ] Anybody know what the proper procedure is for reporting a rubyforge

Gem mirror rubyforge.iasi.roedu.net not working
340310 [twarlick@gm ] Anybody know what the proper procedure is for reporting a rubyforge
+ 340317 [ryand-ruby@z] file a bug on the support group on rubyforge.org
+ 340325 [rogerpack200] I get this too
  340339 [ryand-ruby@z] Thank you AOL... thanks a lot.

Display content depanding on url
340311 [henry@tu or ] I am sorry if this question has been answered before but I am unable to
+ 340313 [benjamin.lov] You're going to have to provide some more context. Are you using rails or
| 340319 [henry@tu or ] I asked the company which language the template is written in and the
| 342613 [bbxx789_05ss] The language is ruby.  ruby on rails is a piece of software written in
+ 342584 [kinraw@gm il] So, how do you do this in PHP? I am trying to do this in php.
  + 342612 [bbxx789_05ss] if ($url== "http://whatever.co.uk/package?chosen=something")
  + 343154 [henry@tu or ] This is how I do it in PHP

Compiling 1.9.1 p129 with Borland C++
340312 [taracatum@gm] The "bcc32"-folder in 1.9.1-p129-source archive is empty. Is there any
340314 [TimHunter@nc] I believe the core team abandoned Borland support for 1.9.1 after

Ruby 1.9.1 load path craziness!!
340323 [swhirsch@ny ] Ok, I've just spent the 4 hours trying to figure this one out without
340327 [matt_neuburg] I am no expert, but my guess would be to look (at the command line) at
340330 [swhirsch@ny ] Setting GEM_PATH solved the problem!  Thanks very much!! Funny thing is

Need Advice Help On Parsing A File
340326 [mrsolarlife@] I'm creating an application that will parse mbox files, extract the
+ 340343 [shortcutter@] It would probably be more efficient to just store the file position (see
| 340347 [ryand-ruby@z] Unfortunately, no. It is server (both smtp and imap) and OS dependent.
| 340397 [b.candler@po] There are a handful of variants (from top of head: flock locking, and
+ 340346 [ryand-ruby@z] Is it bad design? What happens when the user deletes the first email
| 340348 [shortcutter@] I don't fully agree.  It does not hurt to waste a quick thought about
| 340366 [mrsolarlife@] Thank you for the great advice and especially on the hint of (IO#tell
| 340370 [eleanor@ga e] Depending on the way the file system's configured, you could probably
| 340393 [shortcutter@] code I presented (which was untested anyway).  Sorry for any
+ 340481 [ninja@sl ph ] I'd address this on several levels.

amatch .so/.dll's?
340329 [dm@ac es ca ] Anyone know of a  v1.8.6 windows source for the approximate string match

[ANN] heel 2.0.0 Released
340332 [jeremy@hi eg] heel version 2.0.0 has been released.

[ANN] readorder 1.0.0 Released
340334 [jeremy@hi eg] readorder version 1.0.0 has been released.

Looping Problem
340337 [scottandrech] while not answer3.upcase
340338 [cmdicely@gm ] The String#upcase method returns a string which is equal to the string
+ 340340 [scottandrech] Thanks alot. It works perfect now :)
+ 340354 [lists@be tr ] class String

how to make a variable based on array length and member value
340353 [nope@no he e] I have an array full_array[] of an arbitrary number of transaction objects.
+ 340357 [ian.hobson@n] Build up a suite of tests and the code in parallel, like this.
| 340428 [nope@no he e] As I am a relative beginner do you know any sites/articles/tutorials on
+ 340398 [b.candler@po] year_to_members = {}
| 340406 [shortcutter@] Since you asked... :-)
+ 340414 [dblack@ru yp] full_array.group_by {|transaction| transaction.date.year }
  340426 [nope@no he e] Thanks for the reply..(Robert, Brian also)

Legacy code and aliases to user input
340356 [shevegen@li ] I have a rather old code with a very long case/menu, which
340364 [vjoel@pa h. ] when /^f(oo(bar)?)?$/

[ANN] RubyInstaller: Building installers story and news
340362 [luislavena@g] Hey guys,
340363 [aaron@te de ] XML files?  There's a gem for that.  ;-)

[QUIZ][SUMMARY] Tetris (#210)
340367 [yahivin@gm i] Though there were no solutions submitted this week, we learned of

Playing with
340372 [fguillen.mai] <pre>
340382 [mat@pa ch co] Though I am not knowledgeable on the specifics, I would recommend you

Playing with Net::POP3
340373 [fguillen.mai] Sorry the subject of the previews message was wrong.

[ANN] hitimes 1.0.3 Released
340374 [jeremy@hi eg] {{ Release notes for Version 1.0.3 }}

aboout DRb...
340375 [jykim@al ib ] ...
+ 340376 [jykim@al ib ] code should be like this . ;)
| 340377 [ammarabuali@] return is a keyword, it is returning after def.
| 340378 [ammarabuali@] Never mind that. Completely wrong. Sorry.
| 340379 [jykim@al ib ] please, skip the syntaxes. I rewrite codes to explain about my problem
+ 340383 [jykim@al ib ] I got the answer :)

[ANN] amalgalite 0.10.0 Released
340381 [jeremy@hi eg] amalgalite version 0.10.0 has been released.

RDoc-style documentation for Ruby keywords
340385 [dblack@ru yp] I've put together some RDoc-style documentation for the Ruby keywords.
+ 340388 [james.britt@] Sweet.
+ 340429 [james.britt@] James Britt
| 340572 [flo@an er gr] 1.9 keywords
| + 340573 [dblack@ru yp] That's what we call a "quadruple-u". It's a near-relation of the
| + 340574 [james.britt@] Thwanks, I wwill fwix it.
+ 340430 [matt_neuburg] Not true that rescue "Must occur either inside a begin<code>/<code>end
| 340433 [dblack@ru yp] It's still there -- I'll add it. Thanks.
| 340435 [Rob@Ag le on] Since its related to 'rescue', I'll point out that you can also use
| + 340437 [dblack@ru yp] Very timely reminder -- I'm now going to go back and revise an answer
| + 340441 [ymendel@po o] On Jun 29, 2:35=A0pm, Rob Biedenharn <R...@AgileConsultingLLC.com>
|   + 340448 [Rob@Ag le on] If there is something that isn't valid in the face of an exception and
|   + 340449 [Usenet@Go gl] begin
|     + 340452 [dblack@ru yp] ...
|     | 340457 [ymendel@po o] Basically, yes.
|     + 340453 [ymendel@po o] On Jun 29, 3:35=A0pm, J=F6rg W Mittag <JoergWMittag+Use...@GoogleMail.Com>
+ 340458 [drbrain@se m] Using RDoc 2 will remove all the spurious links for common words like
  340469 [dblack@ru yp] Cool. Do you think there's a fundamentally better way to do the whole
  340474 [drbrain@se m] ##
  340561 [rogerpack200] Hmm.  Could I request a full file example of how to use :method: ?  The

Push Inputted Words
340386 [scottandrech] I'm trying to make a program that gets you to input words and when you
+ 340387 [scottandrech] words=[]
| 340389 [wishdev@gm i] Try this
| 340390 [scottandrech] It workes great I just don't what @ does :S [would to know for future
| + 340391 [wishdev@gm i] Scott,
| + 340394 [lists@be tr ] Is it asked too much that you read the first seven paragraphs
|   340401 [wishdev@gm i] Is it too much for you to ignore a thread that you find objectionable?
+ 340392 [sascha.abel@] words = []

Methods optional arguments
340399 [ibon.castill] I was learning about methods, and when I was trying to use optional
340402 [uzimonkey@gm] Optional arguments must be passed in the order they're declared, and
340407 [b.candler@po] I agree that's probably the best approach in most cases. If you really
340413 [ibon.castill] Thanks for the code. I'll print it out to keep it safe, and not to hold

Automate Word OLE32 merge printing with Ruby
340400 [d_rems@ya oo] What I would like to do is automate merge print documents without user

Get file from web page that require user and pass
340404 [lord_kga@ya ] I want to connect to a web site that require user name and password.
340405 [uzimonkey@gm] ml

340408 [htruax@st .c] ...

Best OS packages for Ruby?
340409 [mjijackson@g] I know the question in the subject of this thread might seem a bit
+ 340427 [karottenreib] I'm running ArchLinux on my Laptop and I'm very, very, ... , very happy with
| 340484 [ninja@sl ph ] To me, this is a major selling point of Ubuntu -- if I run apt-get frequently,
| + 340487 [karottenreib] With a system like Arch -- which is much unlike Gentoo, I've tried that
| + 340515 [vjoel@pa h. ] Not to open a can of worms, but when this statement came up last, the
|   + 340518 [james.britt@] Perhaps.  But if you are running 1.8.7, and writing code for general
|   | 340588 [karottenreib] That's exactly why the Java guys have the worst API ever conceived
|   | + 340591 [jordon@en yg] I think people would be asking for a deprecation period, a key part of
|   | | 340636 [karottenreib] I never said you shouldn't do that. I just said you shouldn't go
|   | | 340639 [hramrach@ce ] These features alone are a problem. If you write your shiny new script
|   | | 340669 [karottenreib] well, then just write your scripts in 1.8.6, where's your problem?
|   | | 340872 [mjijackson@g] Fabian,
|   | | 340924 [karottenreib] you should let the RDoc folks know. They probably know where to turn with
|   | | 340935 [shevegen@li ] Try an approach like GoboLinux. Basically everything goes into one dir -
|   | | 340953 [karottenreib] Hey, Archlinux has a pretty nice userbase as well.
|   | + 341154 [ninja@sl ph ] This is a separate issue, and one you didn't address.
|   |   341167 [karottenreib] Yes I did: Write in 1.8.6 if that's gonna be an issue for you. If you want
|   |   341168 [TimHunter@nc] The conclusion was that 1.8.7 didn't actually break _any_ legacy code
|   |   341185 [karottenreib] great, thank you! I totally agree.
|   + 340528 [jbarnette@gm] Nope, you're right. I started that thread, and we really couldn't get
|   + 340546 [sastph@sa .c] ...
+ 340489 [ftf3k3@gm il] Posted via http://www.ruby-forum.com/.
+ 340556 [rogerpack200] I use ubuntu 9.04 32 bit on linode and it seems to run fine.  You'll

Making a random string
340410 [lloyd@2l ve ] I have been trying to generate a random string.  One approach in, say,
+ 340412 [citizen428@g] def get_random_char
| 340418 [citizen428@g] def generate_string(len)
| 340423 [lloyd@2l ve ] That works wonderfully.  Thanks for the help.
+ 340415 [fred@la av .] => ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
+ 340439 [shortcutter@] Kind regards
+ 340450 [billk@ct .c ] def gen_random_string(len)
| 340455 [shortcutter@] Benchmark time!
+ 340492 [b.candler@po] def get_random_char
  340493 [shortcutter@] Interesting idea!  Does rand have enough precision to fill arbitrary
  340494 [b.candler@po] rand(36 ** 8).to_s(36).rjust(8,"0")
  340531 [lloyd@2l ve ] All very groovy stuff!  The final version I think I shall use is a bit
  340535 [shortcutter@] I'd prefer len.times but this is just cosmetic.
  340549 [b.candler@po] A very bad idea IMO. Why make your code larger and less readable for the
  + 340554 [eleanor@ga e] I agree that "s.upcase!; s" is ugly, and I really wish the bang
  | + 340557 [b.candler@po] "Doing the job" is the critical part of that sentence.
  | + 340560 [dblack@ru yp] I don't think the distinction is between success and failure, though.
  |   340563 [eleanor@ga e] I'm still adjusting to these 1.9 conveniences ;)
  |   340567 [dblack@ru yp] I'm still very skeptical about #tap. I can invent use cases for it but
  + 340558 [shortcutter@] I do not subscribe to the "less readable" assessment of yours -
    340564 [eleanor@ga e] I share that view. Being promiscuous with resources just because it's

TK Directory question
340416 [htruax@st .c] ...
340454 [antonio.gale] a way is
340500 [htruax@st .c] Cool! Thank you very much!

How to interrupt unit tests if a library is not present.
340417 [rozziite@gm ] I am developing support for PhyloXML in BioRuby as Google Summer of Code
340419 [dblack@ru yp] no_xml = false
340421 [rozziite@gm ] Thanks a lot! It worked like a charm!
340438 [dblack@ru yp] Rob Biedenharn, in another context, reminded me that
340445 [dblack@ru yp] OK, third time a charm.
340468 [rozziite@gm ] Yes indeed! Thanks!
340521 [matt_neuburg] without penalty in case of failure, and here it is (as you'll see, it

[ANN] LSRC 2009: Don't Miss Your Chance To See Matz!
340420 [jimfreeze@gm] The 2009 Lone Star Ruby Conference is just around the corner

Does anyone have experience with the Moneris Ruby API?
340422 [rubyforum@th] I have run into some trouble with the Ruby API for Moneris (a.k.a

attr_writers within blocks
340432 [wijnand@vi e] It seems writer methods don't work within blocks, the names are
+ 340434 [lists@be tr ] You don't even need an instance_eval. It won't work in a module
| 340485 [ninja@sl ph ] Well, on that note... After using metaid, I hate the class << self
| 340488 [karottenreib] I can only recommend this thread: http://www.ruby-forum.com/topic/190337
| 340589 [wijnand@vi e] I actually like one of the proposed ways in that topic.
| 340596 [dblack@ru yp] You could test to see whether args is empty (see my earlier post).
+ 340436 [msassak@gm i] class Foo
| + 340479 [lists@be tr ] def set_bar v = nil
| | 340502 [dblack@ru yp] That only sets @bar if @bar hasn't be set (to a true value) already.
| | 340517 [lists@be tr ] You're right. Sorry!
| + 340503 [dblack@ru yp] Assuming your DSL depends on the lack of equal-signs :-) There's
|   340512 [msassak@gm i] Of course! I was thinking of ActiveRecord's macro method syntax--not the
+ 340440 [dblack@ru yp] It's not a block thing. Writer methods always need an explicit
  340443 [wijnand@vi e] Thank you for your answers, I was too block focussed to see the

Re: Plot the Shape (#211)
340442 [truce.trings] -divide and conquerer until a '@' is found

Parallelizing a ruby task
340444 [mark@th ma z] I have a long-running batch job that I would like to speed up.
+ 340447 [matthew.hinm] How difficult it your task? If you were able to reduce (heh) it to a
| 340464 [mark@th ma z] Yes, it fits a MapReduce problem but most MapReduce implementations I
| 340466 [globyy3000@h] What if you just created a daemon controller that threaded each process
| + 340467 [eleanor@ga e] Yep, multiple processes are your friend - especially on Unix :)
| + 340499 [mark@th ma z] That's the idea behind using a message queue -- it does that kind of
+ 340501 [b.candler@po] I have gone down option 2, it works well.