315239-346109 subjects 315676-319095

Extending Erubis
315461 [axyd80@gm il] <tr>

Re: One-Liners Mashup (#177 again)
315465 [matthew.moss] And if it wasn't clear from the very top... no no-spoiler period this
315492 [matthew.moss] I think you're going to have to explain what periodicity is, or
+ 315494 [matthew.moss] []=3D
| 315502 [matthew.moss] Oops... I forgot to put up a new one-liner question! (Don't forget you
| + 315505 [matthew.moss] Here ya go. Non-negative parameter to the function is recursion depth,
| | 315540 [hmack.gm@go ] ...
| + 315506 [jcoglan@go g] ...
|   315517 [pit.capitain] I don't think that your method rolls the dice s times.
|   + 315518 [pit.capitain] ...and I got n and s reversed :-(
|   + 315638 [kbloom@gm il] Here's a ruby 1.9 version that doesn't use semicolons or mutable data
|     315713 [matthew.moss] I was tempted to port the C++ next_permutation code, but then I
|     + 315733 [matthew.moss] I'm not sure that providing your succinct solution right alongside the
|     | 315734 [matthew.moss] Too many solvers not providing additional problems!
|     | 315735 [martindemell] def prog_sum(ary)
|     | + 315736 [eduard@ll ll] And what about
|     | + 315803 [hmack.gm@go ] ...
|     + 316367 [kbloom@gm il] I've done it, and posted it here, but It's not one line. I'm not sure
+ 315530 [hmack.gm@go ] ...
  315571 [jcoglan@go g] ...
  315590 [sepp2k@go gl] It produces 0 for 6 though (because printf rounds instead of truncating so =
  315591 [jcoglan@go g] ...
  315592 [sepp2k@go gl] =2Dh[x]):h[x]=3Di;

Re: RDoc 2.2.0 released
315472 [transfire@gm] On Sep 19, 7:38=A0pm, Tony Strauss <tony.stra...@designingpatterns.com>
+ 315481 [drbrain@se m] There's nothing wrong with it, just an oversight.
| 315495 [transfire@gm] 26&atid...
| 315585 [tony.strauss] I think that I'm able to reproduce the symptoms.  This occurs for me
| 315603 [matt@ti bi s] Perhaps my focusing on "File" is a bit misleading; I presume that 1.8.6
| 315937 [tony.strauss] I think that we fixed this in RDoc 2.2.1.  In order to see the fix,
| + 315938 [tony.strauss] Thanks!  The issues might take a bit of time to fix, as rdoc's markup
| + 316048 [matt@ti bi s] Cool! I had some trouble updating the gem, apparently because rubygems
|   316141 [drbrain@se m] Can you file bugs in the tracker?  This way they won't be forgotten.
|   316151 [matt@ti bi s] Done. m.
+ 315936 [tony.strauss] RDoc 2.2.1 should fix both issues.

update a field in CSV file using fastercsv
315476 [chen_li3@ya ] Is it posssible to update a field  of CSV file using Fastercsv?  For
315529 [james@gr yp ] Sure.  You would do this as you would change any file.  Here are the
315539 [chen_li3@ya ] Thank you very much.
+ 315547 [james@gr yp ] I'm not sure I completely understand this question.  It is similar to
| 315552 [chen_li3@ya ] Thanks,
+ 315556 [gregory.t.br] An atomic save, as James suggested by the 4 steps above, is
  + 315562 [chen_li3@ya ] They really make sense.
  + 315844 [pit.capitain] Sorry, Greg, but that's not correct. See the following example.
    + 315847 [gregory.t.br] I've always wondered how r+ is used, but I guess it's not clear to me
    + 315851 [james@gr yp ] This has pretty limited use.  It's rare that you can get away with
      315858 [Rob@Ag le on] If you're dealing with a file containing fixed-size records (even if

Marketing On Internet
315487 [marketingsre] The majority of people fail online. Why do so many people fail online?

315489 [transfire@gm] Came up with a great little extension today for the Symbol class. One
315508 [tpreal@gm il] Nice idea. After some modification (using method_missing) it could be
+ 315524 [transfire@gm] I'm curious to see which methods. But I take it just some methods have
| 315525 [dblack@ru yp] ...
+ 315632 [renard@nc rr] irb(main):002:0> :HELLO.to_s.downcase.to_sym
  315633 [stephen.celi] What fun is a new version if you can't even re-factor?
  315682 [transfire@gm] lock)
  + 315684 [tpreal@gm il] I think that it's a better idea to have a constant table with names of
  | 315699 [transfire@gm] That limits the utility too much, because then one can't extend String
  + 315696 [stephen.celi] ...

system(" rake db:sample_data:hoop)
315496 [emekamicro@g] I need help , why is it that the above code would not run on windows
315499 [mguterl@gm i] It is likely that I won't be able to help further, but if you could
315500 [emekamicro@g] ved.
315504 [mguterl@gm i] Well maybe I can help.
315507 [emekamicro@g] my mistake.....it was in the code.
315594 [emekamicro@g] Things have starting moving in the right direction, however,
315597 [mguterl@gm i] Once again, the actual error would be helpful.  Be sure to include
315681 [emekamicro@g] It worked, I only changed Fixnum 0 to string. Could you explain the
315688 [mguterl@gm i] Great, I'm glad you got things working.
316803 [emekamicro@g] Some strange result, on my console Rake::Task["db:migrate"].invoke

dl taint fixes in Ruby 1.8.7-p72 broke Ruby/Tidy
315497 [angdraug@gm ] Greetings,

iterating methods on multiple parameters
315510 [jason.lillyw] I'm thinking there must be a great Ruby-way to do the same thing to many
315512 [tpreal@gm il] h={:yn=>"feet",:yc=>"feet",...}
315558 [jason.lillyw] Thank you.
315570 [jason.lillyw] I just saw a similar issue (#163350 of this forum).
+ 315580 [caduceass@gm] With your example...
+ 315613 [b.candler@po] hash = {'x'=>2, 'y'=>5}
  315616 [jason.lillyw] Thanks everyone!
  315618 [Rob@Ag le on] Sure it is.  In my Programming Ruby, 2 ed., on page 492 it say that
  315622 [jason.lillyw] You can see I don't know very much about this language. I've been trying

Ncurses Panel userptr issues
315513 [sentinel.200] I am having issues with the userptr in Ncurses Panel. The C program I

Question about Mixins and calling a method
315516 [caof2005@ya ] I tried to reproduce a Mixin example that is include in the Pick Axe
+ 315521 [tpreal@gm il] It is not 'invoking a method with "<<" notation,' it is simply calling
+ 315522 [rick.denatal] ...

How to fill out textarea in html form
315520 [todd@mc as e] So sorry for this naive question ... I'm new to ruby as of several days

for or each?
315527 [twarlick@gm ] I just used the new roodi gem to check out some of my code that has a
+ 315533 [phlip2005@gm] It leaves you closer to a refactor to .map or .inject or .select or .reject or
| 315532 [phlip2005@gm] str.each do |ch|
| + 315534 [sepp2k@go gl] That'd be each_char, I suppose. String#each is each_line.
| | 315535 [phlip2005@gm] ... or .each_char or .each_line or .each_byte or ...
| | 315537 [sepp2k@go gl] What?
| | 315550 [phlip2005@gm] I illustrated that you augmented the "or" list from my first post.
| + 315536 [twarlick@gm ] So, it's a code-readability issue and not a functional or complexity
|   + 315554 [phlip2005@gm] 'for' is arguably more readable. And it's not a performance issue - I suspect
|   | + 315557 [fxn@ha hr f.] I don't think the minimal editing distance between #each and #map and
|   | | 315582 [phlip2005@gm] You have probably never pair-programmed with me during a savage refactoring session.
|   | + 315601 [charles.nutt] For is generally faster because it doesn't instantiate a new scope for
|   | + 315656 [sylvain.joye] Nope. each { } needs one new scope for each iteration while "for ... in"
|   |   + 315662 [fxn@ha hr f.] In what sense does #each create objects? Assuming a block with just
|   |   + 315670 [b.candler@po] By 'scope' do you mean 'stack frame'?
|   |   | 315693 [sylvain.joye] Yes. Except that
|   |   | 315695 [b.candler@po] OK, I see that certain objects are not yielded, including T_SCOPE.
|   |   | 315911 [namekuseijin] Come on!  Is it so hard to realize that foo.each {|i| ...} is used
|   |   + 315672 [b.candler@po] P.S. Here's a simple experiment, and I can't see any of these
|   |     315690 [sylvain.joye] Thanks but nope...
|   + 315565 [ninja@sl ph ] These things are not entirely separate -- readable code is more likely to b=
+ 315553 [joe@ta kh us] It's interesting that array access using 'each' seems to be much
| + 315555 [phlip2005@gm] Does 'for' reevaluate its range after each tick? That would give 'for' a single
| | + 315559 [joe@ta kh us] You can try my test if you like.  I haven't checked it carefully.  =20
| | | + 315563 [fxn@ha hr f.] Hey that's not the for-version of #each, nobody iterates by index in
| | | + 315564 [phlip2005@gm] I just experimented with 'for' and found it does not reevaluate its header each
| | | | + 315566 [fxn@ha hr f.] There's a technical difference in scopes between them, but for indeed
| | | | + 315567 [joe@ta kh us] Philip, I hadn't thought about your refactoring arguments.  I think =20
| | | |   315569 [fxn@ha hr f.] You cannot rationalize a convention. Conventions happen, it is
| | | + 315602 [charles.nutt] Odd, now that I try it, each *is* faster than for. I'm going to have to
| | |   315604 [joe@ta kh us] It's hard to predict performance in advance.  I think it's gotten =20
| | + 315584 [kbloom@gm il] class Numeric
| + 315572 [why@ru y- an] Actually for loops are faster than `each`.  Since it doesn't
|   + 315574 [phlip2005@gm] Tx that's why I said 'for' can be more readable - even though I know nobody in
|   | 315667 [b.candler@po] FWIW, the skeleton code which Rails generates uses the 'for' loop.
|   + 315576 [joe@ta kh us] ...
|     315599 [fxn@ha hr f.] Relative speed between for (2) and each are similar in JRuby. That 1.9
+ 316087 [tucano@re ip] external or internal iterators

ThreadError: not owner
315531 [tpreal@gm il] some old Windows One-Click Installer (now I don't know which version it
+ 315626 [vikkous@gm i] Hmmm. I'm guessing that the ability to use a Mutex like a semaphore
| 315658 [tpreal@gm il] Thanks for your responses.
| + 315660 [tpreal@gm il] I'm sorry, my mistake. It will work no matter which happens first, as
| + 315663 [vikkous@gm i] Really? After I looked into it, it seemed like maybe you could use a
|   315665 [tpreal@gm il] As far as I know, the only difference between Mutex and Monitor in Ruby
+ 315654 [b.candler@po] Would a Monitor do the job?
+ 315666 [b.candler@po] Hmm, so you just need some way for the thread to signal that it has
  315671 [tpreal@gm il] Thanks! That seems to be a good solution.
  315673 [b.candler@po] That's what it is - a first-in, first-out queue. However it is nicely

Download a file from a site that needs authentication
315541 [pteale@gm il] I have a membership to a web site that needs authentication before you
315664 [pteale@gm il] No one ever needed to logon to a web site using basic http
+ 315668 [billk@ct .c ] Regards,
+ 315669 [phasis@gm il] require 'open-uri'

Explaination of a bit of code
315542 [davidinanhui] Hey, another question.  This is kinda putting several concepts together
+ 315545 [sepp2k@go gl] each is supposed to whatever it has been defined to do. It's not special.
+ 315548 [davidinanhui] And while we are at little samples of code...
| 315551 [sepp2k@go gl] Yes.
| 315561 [davidinanhui] Thanks all.
| 315614 [b.candler@po] The throw has to be *inside* a corresponding catch block, and it drops
+ 315549 [tpreal@gm il] The method each is working just as you programme it. For Arrays (and

Grouping array elements while preserving order?
315546 [designmc@gm ] I've run into a number of situations where I need to group an array
315579 [w_a_x_man@ya] class Array
315643 [shortcutter@] You're loosing keys there.  Maybe rather

[ANN] mechanize 0.8.0 Released
315568 [aaron@te de ] mechanize version 0.8.0 has been released!

hi everybody
315573 [rajko.mackic] Bosnia and Herzegovina, also known as Cvrcko
315575 [jdoe@us ne l] Another glaring example of Google Groups massively negative
+ 315600 [steamer@so i] "Steamboat Ed" Haas         :  "Hold on! we're passing
+ 315628 [transfire@gm] Please, that is way over the top. You act like spam had never been

[ANN] Terminator 0.4.4
315577 [raasdnil@gm ] NAME

ruby gem to watch file
315578 [junkone1@gm ] is there any gem that will watch for a file and if the file exists, or
315581 [tim.pease@gm] Take a look at directory_watcher. It works on all platforms.
315701 [junkone1@gm ] i tried as you suggested and have a few q.
315740 [s.korteling@] Hm, I can't get it to work either (on WinXP).
315780 [tim.pease@gm] The whole program is blocking on the "gets".

Help with MacRuby and NSError** args
315596 [has.temp3@vi] Wondering how to get an NSError instance back from an ObjC method, in

CSV Goes M17n
315606 [james@gr yp ] I've just finished an extensive reworking of the standard CSV library =20=
315707 [jeremy@hi eg] Awesome James!

comparison of Array with Array failed
315608 [tefflox@gm i] I am passing this hash to a method to sort it, which works in irb but in
315609 [tpreal@gm il] You are creating one array and assigning references to it to all your
315610 [tefflox@gm i] I fixed the problem by passing a ternary operator to the assignments in
315611 [tefflox@gm i] **your solution _solves_ the problem :-)

Instance variable acting like class variable?
315612 [johnma@mu hi] I've written a Node class that I'm using to write a few programs for in
+ 315615 [tpreal@gm il] 1. The method << is an in-place modifier, you don't have to assign the
| 315617 [johnma@mu hi] I do have an array of Node objects, but I'm calling Node.new(args) each
+ 315624 [rick.denatal] ...
  315625 [johnma@mu hi] Rick,

Iterating through a string
315619 [jody.glidden] If I try the following...
+ 315620 [stefano.croc] String#split doesn't take a block, so that the block you pass to it is
| 315621 [jody.glidden] Ahh, I understand.  I must have missed the map/collect functionality.
| 315623 [s.korteling@] "I love guitar playing".split.each{|s| s.capitalize}.join(" ")
| 315653 [b.candler@po] FYI, there's another pattern for "building the result" without the
+ 315627 [w_a_x_man@ya] "I love guitar playing".gsub( /\S+/ ){|s| s.capitalize}
  + 315629 [rhkramer@gm ] Just for kicks, I managed to modify your approach to make it work (at
  + 315630 [botpena@gm i] it would be great if #split accept a block, too
    315634 [stephen.celi] When ".map" is only another 4 characters, is it worth the pollution?
    315635 [botp@de mo t] # When ".map" is only another 4 characters, is it worth the pollution?

synchronize clock
315631 [junkone1@gm ] is there any gem or library that would synchronise the xp clock with
315636 [phasis@gm il] system("CMD /C NET TIME /SETSNTP:clock.isc.org & NET STOP W32TIME &

extract contents from pdf (pdf reader)
315639 [rajmohan@mo ] ...
315694 [gregory.t.br] AFAIK PDF::Reader is the only serious option, and I see you've posted

Using Ruby as a scripting language within a C app
315640 [phrexianreap] I'm working on building a MUD, and I would like to be able to use Ruby
+ 315652 [b.candler@po] Scroll down to "A Sponsored Dragon-Slaying" and enjoy.
| 315730 [kbloom@gm il] Aside from being entertaining, what does this have to do with embedding
| 315731 [b.candler@po] OK, I missed the smiley, <aside> tag etc.
| 315749 [phrexianreap] I'm starting off of an existing codebase, and trying to rewrite it into
| 315799 [shevegen@li ] I am not the original author, but personally I always enjoy it when
| 315816 [ninja@sl ph ] If there's an easy way to do what I want to do, I'd like to know it.
+ 315657 [huw@da kn on] If you are using C/C++ (or indeed C#) in .NET you can embed Ruby

about regexp...
315644 [kdream95@gm ] => "a 2 b"
+ 315649 [shortcutter@] Because neither " *" nor "* " are word boundaries.
+ 315650 [patrick.he@g] ...

Ruby GSUB question
315645 [binh@pi ba y] <a href="#" onclick="new
315647 [botp@de mo t] # <a href="#" onclick="new
315648 [etaern@ya oo] I understand the first \\ , as it will produce \ when it's displayed ,
315651 [b.candler@po] Inside a single- or double-quoted string, \ is an escape character, and
315655 [botp@de mo t] #...
315659 [b.candler@po] Interesting; I wasn't aware those worked inside the replacement string,
315661 [botp@de mo t] # ..enlightening talk..

hornygamer - for Free
315674 [sashlnsolomo] hornygamer

www efukt - for Free
315675 [earlsoliloqu] www efukt