385547-385935

385353-385802 subjects 385777-387494

^ copy range of lines to another file based on regex match
385547 [neubyr gmail] I am writing a script to search for a particular string in a file and
+ 385550 [jgabrielygal] Forget about line numbers, you are already iterating over the lines,
+ 385555 [shortcutter ] $ sed -n -e '/rx/,$ {s/foo/bar/g; p}' a_file

^ File copy from Client to Server via web-services
385556 [mail2sanand ] I am trying to use Apache Thrift for creating an API offering many
385558 [jgabrielygal] File.new('<new_file_path>','wb'){|f| f << transferred_file_content}
385569 [mail2sanand ] Hats Off to you Jesus. Thanks for the help. I got it. Will revert if any =

^ error building ruby p290
385565 [devguy.ca gm] I get the following build error on my Linux box while trying to build
+ 385566 [devguy.ca gm] i currently have ruby 1.9.2p136 install with rdoc 3.8
| 385567 [shortcutter ] Obviously the wrong rdoc is invoked.  Strange, this did not happen to
| 385584 [devguy.ca gm] my evn: i have rdoc 3.8 installed, still getting build error?
+ 385587 [drbrain segm] ./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb
| 385588 [devguy.ca gm] i assume that's all in one line? here is what I got
| 385589 [drbrain segm] build
| 385646 [devguy.ca gm] cument'
| + 385648 [devguy.ca gm] btw I am seeing the exact same issue on my other Linux box
| + 385649 [drbrain segm] 1.9.1 is the API compatibility version.  1.9.1 is expected.
|   385651 [devguy.ca gm] workaround fixed my issue. i've opened a new ticke and assigned it too
+ 385727 [shevegen lin] Don't forget to add a ticket so that other pure souls are not running

^ [RDoc internals] Changing the RDoc formatter
385568 [sutniuq gmx.] I'm currently writing on a PDF generator for RDoc based on LaTeX. I'm
385581 [drbrain segm] and
385674 [sutniuq gmx.] (Sorry for the late response, been busy last days)
385675 [drbrain segm] in needing it.  I'm also not sure what I should write about it. Using =

^ StringScanner using skip_until not detecting special characters
385577 [bcfruin gmai] I am trying to parse a string until the first occurrence of a word. This
+ 385578 [bcfruin gmai] I am trying to parse a string until the first occurrence of a word. This
+ 385579 [bbxx789_05ss] #encoding: utf-8
+ 385580 [bbxx789_05ss] 1.8.7

^ [ANN] rubygems-sandbox 1.0.0 Released
385583 [ryand-ruby z] rubygems-sandbox version 1.0.0 has been released!

^ [ANN] omnifocus-github 1.0.2 Released
385585 [ryand-ruby z] omnifocus-github version 1.0.2 has been released!

^ ArgumentError - invalid byte sequence in UTF-8
385590 [iainspeed gm] Every now and then I get errors relating to UTF8 encodings, and each =
+ 385594 [bbxx789_05ss] 1) No matter what you do, there can always be an invalid byte sequence.
+ 385601 [b.candler po] Are you sure it's that particular line which splits out the error?
  385739 [iainspeed gm] design=20

^ Net:FTP hanging
385591 [patrick redb] I have an odd situation occurring with Net::FTP.

^ array max value
385595 [dickyhide gm] When I set an array k = [3,5,6,0,1,4,5,6,9,1]
+ 385596 [adgar carbon] k.index(k.max) will work. It's not completely optimal, but it's concise =
| 385597 [shortcutter ] Here's another approach which is a tad more involved and iterates the
+ 385599 [list.push gm] What if you have an array like this [3,5,6,0,1,4,5,6,9,1,9] ?
| 385600 [adam apresco] Excellent example. :)
+ 385916 [eshadesai_88] irb(main):035:0> k = [9, 9, 6, 0, 1, 4, 5, 6, 9, 1, 9]
+ 385924 [lleoem gmail] @esha_d you walk the n-element array once for the collect call. And
+ 385927 [list.push gm] k = [3,5,6,0,1,4,5,6,9,1,9]
+ 385935 [lleoem gmail] @Harry Thanks. I am new to ruby. I look at these kinds of things to help

^ [ANN] Only 3 Weeks Until LSRC V!
385602 [jimfreeze gm] Lone Star Ruby Conference V, held Aug 11-13 in Austin, TX, is only 21 days way.

^ How to replace "\" from string.
385611 [shahgomji gm] I have string something like
+ 385613 [shortcutter ] This is a topic which comes up over and over again.  I am sure you'll
+ 385614 [hanmac gmx.d] path =  "C:\Gaurang\ruby\demo.xls"
+ 385616 [yourelguapo ] I believe you need to add delimiters, it should look like
| 385625 [mcpierce gma] No, you don't. It's two separate arguments.
+ 385618 [hanmac gmx.d] 1. var is named wrong
| 385621 [shahgomji gm] I have used "\\" instead of "\" coz "\" is a escape character.
+ 385623 [hanmac gmx.d] ya
+ 385624 [mcpierce gma] Are you _assigning_ the return value of the above call to another object
+ 385668 [josh.cheek g] At this point, print the string and you will see easily what the problem is.

^ How to find the character in string
385612 [shahgomji gm] I have a string where i need to find out if particular character is
385617 [hanmac gmx.d] its because "\\" is not in your string see my post in your other thread
+ 385619 [shahgomji gm] yes you are right my string doesn't contain "\\", however I am using
+ 385620 [shahgomji gm] yes you are right my string doesn't contain "\\", however I am using

^ Building a tree from the leaves down
385615 [transfire gm] Have a algorithmic problem, I can't quite get a clear idea of how to
+ 385622 [shortcutter ] A single Hash can never be a tree.
| 385634 [zettabyte gm] For fun, here's my OO-oriented approach with inspiration (though different)
| 385791 [transfire gm] t)
+ 385643 [josh.cheek g] class CaseObject
+ 385645 [drbrain segm] This is already a tree.
  385658 [shortcutter ] So it's a forest and not a tree. :-)

^ Issue downloading an image from a URL (HTTP request)
385626 [mcmillhj gma] I am trying to download the image of a chart I created using the
385654 [jgabrielygal] I don't know why one of your attempts works and the other won't, maybe
385655 [jgabrielygal] 8720821661998,25.6022408963585,24.9859943977591,17.9831932773109,2.80112044=

^ Questions on routing
385627 [tyrelrichey ] I have two questions on routing if any one has some space time.
+ 385628 [cmdjackryan ] One forum over you'll find the Rails guys. You'll find better (and
+ 385636 [steve stevek] Don't use :name, use :as.

^ Are Job Ads OK?
385629 [lee hughesys] Is it OK to post Ruby job ads on this forum?
+ 385631 [sophrinix gm] As long as they are real jobs and for ruby/ using tools in ruby, I am
| 385632 [stu rubyprog] There really should be a separate sub-forum called ruby-jobs.
| 385633 [marco-oweber] The funny thing is that exactly the same discussion happened 2 days ago
+ 385635 [mcpierce gma] -1
  385661 [shortcutter ] usually are locally restricted.
  385662 [richard.conr] I have found that many local/national Ruby User Groups are fine, and even
  385663 [josh.cheek g] On the other hand, someone like me more than happy to move. The last thing I
  385664 [ml convalesc] On 22 =CE=99=CE=BF=CF=85=CE=BB 2011, at 2:24 =CE=BC.=CE=BC., Josh Cheek =

^ Where to post Ruby job ads?
385630 [lee hughesys] Looking for advice on where to post (for free) Ruby job ads, besides
385637 [josh.cheek g] There's a LinkedIn group for Rails with lots of ads. IDK about Ruby w/o
385638 [josh.cheek g] Honestly, I don't think there is a job board for Ruby without Rails. Even

^ attr_accessor for hash keys
385639 [code apotheo] Is there a way to use attr_accessor, or something like it (without
+ 385641 [sean.ohalpin] module HashAccessor
| 385644 [tim.pease gm] don't
| 385666 [b.candler po] In which case, you might as well just use OpenStruct.
| 385669 [ajmahout gma] im new to this. i was wondering if the tutorial in try ruby is usefull
+ 385660 [shortcutter ] irb(main):001:0> Foo = Struct.new :one, :two
+ 385665 [josh.cheek g] require 'forwardable'
+ 385670 [code apotheo] Judging by the responses, the answer is basically "no".  I appreciate the

^ [ANN] isolate 3.1.1 Released
385642 [ryand-ruby z] isolate version 3.1.1 has been released!

^ create object by reflection
385650 [leandro.rhcp] My doubt is how create objects by reflection, when they need more than
+ 385652 [bbxx789_05ss] class Person
+ 385656 [b.candler po] def build(instance,clazz,args)
| 385657 [bbxx789_05ss] `initialize': wrong number of arguments (3 for 2) (ArgumentError)
| 385667 [b.candler po] Show your exact code. I would guess that you are passing an array of 3
+ 385672 [leandro.rhcp] Cool, thanks you all! =D
+ 385684 [leandro.rhcp] It's not working. Suppose I have the builder and RSpec and I tried to
+ 385691 [leandro.rhcp] I solved, stupid typo.

^ Re: net-ssh - execution expired
385653 [jp.billaud g] Hey,

^ [ANN] myrrha 1.0.0 Released
385671 [blambeau gma] myrrha version 1.0.0 has been released!

^ builder lib-a-like?
385676 [transfire gm] Wasn't there already a lib like this?
385677 [jgabrielygal] It reminded me of Tagz by Ara Howard, although I haven't used it.
385679 [transfire gm] On Jul 22, 1:47=A0pm, Jes=FAs Gabriel y Gal=E1n <jgabrielyga...@gmail.com>
385687 [steve stevek] This one appeared recently, too: http://krainboltgreene.github.com/dapper-dan/

^ regex oddity
385680 [rogerpack200] Anybody know why this occurs?
+ 385682 [zettabyte gm] #scan first matches "a" (whole string), then tries to match on remainder
| 385689 [josh.cheek g] "a".scan(/.*/) # => ["a", ""]
+ 385717 [shortcutter ] Yes.  Scanning will start at pos 0 of the string and match as long as

^ Regexp inconsistency
385681 [camargo.cr g] I observed a inconsistent behavior between ruby (ruby 1.8.6 (2009-06-08
+ 385685 [zettabyte gm] I just matched "net-snmpd.log-20110629.bz2 stuff blah blah" against that
+ 385686 [luizluca gma] Ruby is right. The regexp matches the string.
+ 385692 [camargo.cr g] Sorry, it was my mistake! I've changed regex putting ^ and $; now, it

^ open localhost url
385683 [sharnelp gma] When I call call the below code I get a timeout.
+ 385693 [sharnelp gma] app/controllers/documents/test_controller.rb:123:in `index'
+ 385694 [sharnelp gma] app/controllers/secure/documents/irisfli20_controller.rb:123:in
+ 385695 [b.candler po] Please realise that Ruby and Rails are not the same thing. This is a
+ 385696 [hassan.schro] Not using Webrick  -- that's a single-threaded server, so it can't
| 385699 [drbrain segm] WEBrick is not a single-threaded server.  It can be configured as a =
| 385700 [hassan.schro] Wouldn't be the first time I was wrong  :-)
| 385710 [b.candler po] It is - not because of an inherent limitation of webrick, but because
| 385716 [hassan.schro] Ah, right, I'd forgotten all about that. Thanks for the correction!
+ 385697 [drbrain segm] nil)

^ What's up with "Dir.glob"?
385688 [pbailey bna.] I'm having a hard time understanding why a simple Dir.glob sequence
+ 385690 [brabuhr gmai] $ mkdir /tmp/z
+ 385698 [ryand-ruby z] This doesn't address your issue, but I thought I'd point out that you =
| 385843 [pbailey bna.] Thanks. Well, that's a good point. Although, all of the incoming names
+ 385844 [hanmac gmx.d] hm the doc says that File::FNM_CASEFOLD is ignored but on my system it

^ using "puts" in ternary operator
385701 [jesse.breuer] I find that I get errors if I use "puts" in it's standard form in a
+ 385704 [hassan.schro] I think the lack of parens creates an ambiguous scope for the
+ 385705 [botpena gmai] imho,
+ 385731 [killavus gma] (exp)? <if true> : <if false>
+ 385768 [ryand-ruby z] puts x == 2 ? "two" : "one"

^ using net-ssh with interactive program
385702 [bellcolt hot] can anybody points me to  examples of using net-ssh with an interactive
385703 [ryand-ruby z] look at IO#expect

^ Time and UTC problems
385706 [rubyforum we] I have a time that is read in to the Time class. The time is UTC but
385707 [bbxx789_05ss] t = Time.now
385708 [johnf bitsbu] This is the shortest way I've ever seen to solve this problem. Well done, sir.

^ [ANN] ZenTest 4.6.0 Released
385709 [ryand-ruby z] ZenTest version 4.6.0 has been released!

^ Re: Is there any open source game in Ruby?
385711 [jrmair gmail] why are you only looking at rubygame? rubygame has been dead for a long
385755 [axyd80 gmail] One more interesting (and active!) project, see screenshots on their

^ [ANN] alf 0.9.3 Released
385712 [blambeau gma] I'm pleased to announce that alf 0.9.3 has been released and pushed to

^ code ok in ruby, but fails in irb
385713 [at.ruby-foru] The following statement, with the newline, is ok with ruby but generates
+ 385714 [bbxx789_05ss] Nope.  And that's why I never use irb (nor similar toys in other
+ 385715 [josh.cheek g] Works for me on 1.9, but not on 1.8
  385718 [b.candler po] ... apart from the train wreck of Encodings (IMO - just giving a

^ Top level function definition gets in Kernel module?
385719 [jp.billaud g] irb(main):001:0> def test_fun
+ 385720 [adgar carbon] returns the names of all the methods on the Kernel object itself. =
+ 385721 [bbxx789_05ss] Almost everything in ruby is an object.  All objects inherit from
+ 385722 [bbxx789_05ss] Aargh.
| 385723 [adgar carbon] The top-level scope creates private methods by default.
| 385724 [bbxx789_05ss] I know that.
| 385726 [adgar carbon] charset=us-ascii
+ 385725 [jp.billaud g] Thanks everyone for the explanation, I just got confused and forgot that

^ Bundler? or RVM issue? can you help?
385728 [codehacker c] you can see that the trace jumps from the rvm ruby into the system ruby.
385801 [wayneeseguin] There is not enough information provided in your gist to give an answer.

^ [ANN] Launchy 2.0.4 released
385729 [jeremy hineg] launchy version 2.0.4

^ best style for setting items in a collection
385730 [info marshal] I've only recently started learning Ruby and notice in Thomas'
+ 385732 [steve stevek] Upto isn't bad, but id probably use inject: [1,2,3].inject ([]) {|arr, elem|
+ 385734 [list.push gm] Does this #each give you what you want?
+ 385735 [drbrain segm] the
+ 385747 [josh.cheek g] It's hard to know how to answer this because you're overwriting the values
| 385757 [info marshal] Ok, sorry that my example muddled things so much. I did mean the latter.
| 385765 [drbrain segm] month_lengths = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
+ 385766 [list.push gm] If you make a new array you could try something like this.
  385767 [info marshal] Tx for all the nice ideas! I agree that with an array this size speed

^ [Ruby/C++] Say hello to Rarity, C++ wrapper for the libruby !
385736 [sexymimi64 g] Greetings everypony !

^ Exclusive operator in ruby
385737 [aef1370 gmai] I am C++ programmer and I start ruby programming about 1 month.I have 2
+ 385742 [vderyagin gm] 'Object#===' method is the same as 'Object#==', but is often overridden
| 385746 [sutniuq gmx.] - ------------------------------------------------------
| 385753 [vderyagin gm] Yes, you are right, there is no such operator. My mistake.
+ 385754 [adam apresco] You can if you're using 1.9. This isn't keyword arguments.
  385761 [shortcutter ] Nice!

^ [ANN] nanoc 3.2, a DRY static web site generator
385738 [denis.defrey] After a long wait, nanoc 3.2 has been released. Major new points in this
385796 [jon.forums g] Just installed on Win7 running `ruby 1.9.4dev (2011-07-22 trunk 32630)
385825 [denis.defrey] The documentation for the various filters can be found in the API

^ Run something on last test case
385740 [tcblues gmai] I need to run some code always on the last testcase that is run in any
+ 385748 [josh.cheek g] If this isn't what you're trying to do, then you need to take some time to
| + 385749 [josh.cheek g] This should be `def test_last` since TestUnit expects the names of test
| + 385787 [tcblues gmai] this is exactly what I was looking for.
+ 385764 [drbrain segm] Why do you need to run something after the last test case?
  385792 [code apotheo] Maybe one would want to collect some kind of aggregate data while testing

^ why doesn't return ascii code?
385741 [aef1370 gmai] when I type " puts ?a " irb doesn't return ASCII code of a
+ 385743 [bbxx789_05ss] $ multiruby ruby.rb
+ 385744 [aef1370 gmai] Excuse me, I don't understand what do you mean . please explain very
| 385762 [stu rubyprog] 'a'.ord
+ 385745 [bbxx789_05ss] Things change.

^ Help with Regex
385750 [g.marcilhacy] I need help with a Regular Expression, I need to split the text on "- "
+ 385751 [cmdjackryan ] =3D> ["I want this", "not that."]
| 385758 [code apotheo] =2E . . and if you want to split it into only two elements even if there
+ 385759 [code apotheo] I don't know what code you're actually using with this regex.  As already
+ 385779 [ruby slightl] Try the non-greedy version, /(.*?) -/i
+ 385784 [list.push gm] str = "part 1 - part 2 - part 3"

^ [ANN] flickr_airlift 0.2.0 released
385752 [beholdthepan] Once a user authenticates - cache his credentials in ~/.flickr_airliftrc

^ [ANN] Stickler 2.1.3 is released
385756 [jeremy hineg] stickler version 2.1.3

^ Re: Ruby in JavaScript, all projects are dead?
385769 [cmdicely gma] I think the most complete currently available way to use Ruby in the
385793 [darkintent g] It would be better to either fix or get rid of JS really.  I think

^ Please give simple example of when to use symbols
385771 [sbstn26 yaho] I'm still a bit confused on whether to use strings or symbols in certain
+ 385772 [bbxx789_05ss] Quotes are a shortcut for writing String.new--but not exactly.  In other
| + 385774 [adam apresco] This is really unhelpful. It is certainly possible to understand symbols
| + 385775 [shortcutter ] Why so grumpy?  I can but support what Adam said.  Symbols are useful
| + 385776 [josh.cheek g] I think when people say they take up more memory, they mean that symbols
+ 385781 [johnf bitsbu] If the exact sequence of characters is what's important, use a String.
+ 385783 [kd.gunderman] - use a String when handling external data, e.g.
+ 385804 [bbxx789_05ss] lol.
+ 385809 [jeremy bopp.] The difference is that every string literal in your code, whether it is
threads.html
top