220421-221860 subjects 220813-222719

^ rtags, function extraction how to use?
220625 [impalapete20] Hey all,
220659 [banjo users.] You could run [ec]tags on the non-ruby files and then load both tag

^ array trouble
220634 [gijs.nijholt] ret = ""
+ 220636 [shortcutter ] irb(main):001:0> "abcd".to_a
+ 220639 [peter rubyra] How about
| 220644 [louis.j.scor] 'abcd'.scan(/./).join(' ')
| 220647 [peter rubyra] but
+ 220643 [tom.armitage] "abcd".split("").map do |w|
+ 220835 [rick.denatal] Others have already given y
  220839 [gijs.nijholt] Thanks for all the replies, I really learned some important basics here.

^ ruby/vim competition
220638 [ara.t.howard] show off your (ruby/vim).fu
220676 [ mfp acm.org] I've tried to upload
220738 [ara.t.howard] ask one of the other members.  any members can add more members.
220740 [botp delmont] # >> show off your (ruby/vim).fu
220745 [ara.t.howard] writes ups to follow
220747 [botp delmont] #    http://sciruby.codeforpeople.com/sr.cgi/VimInAnger
220832 [jmg3000 gmai] Wait. Religious about the background image, or about using Vim instead of Emacs?
220908 [markonlinux ] as a Vim user I'm happy to have it restricted to Vim ;-)
220924 [jmg3000 gmai] Thanks for the great link Mark!
220925 [jeff dark-li] The original author of the screencast did shed a bit of light on his

^ [OT] Re: Is anyone using Ruby for 24/7 financial applications?
220646 [ara.t.howard] linux-ha is amazing isn't it?  have you made use of the drb sub project too?

^ Okay, Cheap RubyConf ticket
220650 [wgrosso wgro] Nobody wants to buy it and I don't want to see it wasted.
220681 [james.britt ] You have to make sure the RubyConf organizers (i.e. Chad or Rich) know

^ newbie: Strings and RegExp
220651 [Diego.Viraso] given an instance of String, str, how do you select/copy the section of
+ 220654 [shortcutter ] First, you do not need this alternation if you use /m (multiline mode).
| 220665 [Diego.Viraso] Yes, I'd like to but it's the Univeristy computer so I have to live
| 220701 [shortcutter ] in your home directory.  That of course works only if your quota is high
| 220746 [jpywtora cal] You absolutely can compile and install to home, just set the --prefix to
+ 220661 [gavin refine] STRING_BEFORE = "hello"
  + 220663 [louis.j.scor] You should also be able to do this with split.  Then you can use
  + 220666 [Diego.Viraso] Perfect, it works. Thanks a lot, and to Robert and Louis too, thanks.
    220668 [gavin.kistne] ...

^ Non-directory, non-file "files"
220652 [gavin.kistne] charset="us-ascii"
+ 220653 [gwtmp01 mac.] symbolic links?
| + 220660 [banjo users.] Only if they were broken symlinks (otherwise they would be followed to
| + 220702 [shortcutter ] Named Pipes
+ 220656 [ara.t.howard] irb(main):010:0> File.file? '/dev/cdrom'
  220657 [gavin.kistne] Ah ha, good to know.

^ Re: [WANTED] - New leadership for ruby-spreadsheet
220655 [dsisnero gma] Where is the Rubyforge project for ParseExcel.  I saw the rubyforge project

^ New To Ruby
220667 [pons32 hotma] I just installed the Ruby 1.8.5 One-Click Installer Stable version
220744 [ml.chibbs gm] Just ignore them. For some reason they started appearing for FXRuby
+ 220765 [david vallne] ons
| 220828 [pons32 hotma] Thanks, will play around with it.
+ 220826 [pons32 hotma] OK, as long as it's not just me who's seeing these errors; I thought I

^ [ANN] WxSugar 0.1.2 released
220669 [alex deletem] WxSugar is a set of syntax extensions to sweeten up the WxRuby GUI library.
+ 220673 [phurley gmai] Looks nice, FYI
+ 220677 [alex deletem] gem install wx_sugar

^ Sizing Widgets
220672 [ramsayw1 com] I'm new to Ruby/Gtk and find it, so far, exactly what I want for a GUI.
+ 220675 [shevegen lin] Can not help you but I would like to say that I am interested in an easy
+ 220682 [Reid.Thompso] see section on child props
| 220806 [ramsayw1 com] In the statusbar code, I'm using pack_start as defined in  the section
| 220834 [Reid.Thompso] <http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3ABox#query_child_packing>
| + 220878 [ramsayw1 com] I get false, false, 0, and a pack_type of 0 (start)
| + 220879 [ramsayw1 com] I get false, false, 0, 1 (start) fror the first three and true, true,
|   220895 [reid.thompso] A glade file that gives the effect that you want ( i believe -->
|   + 221184 [ramsayw1 com] I am sure this will work, but I would rather not use glade.    It seems
|   | 221198 [Reid.Thompso] understood -- my hope was that looking at the glade generated framework
|   | 221245 [ramsayw1 com] I plan to do exactly that.   (I have been travelling and unable to
|   | 221250 [ramsayw1 com] Why is it that when you figure a problem out the solution is always so
|   + 221186 [ramsayw1 com] One other comment....
+ 220683 [Reid.Thompso] alternatively, use glade-2 and ruby-glade-create-template.

^ How to format an array
220680 [chen_li3 yah] I have an array [1.0, 2.0, 3, 4,5,6]. I want to format all the elements
+ 220684 [noah.easterl] [1.0, 2.0, 3, 4,5,6].map { |num| "%5.3f" % num } #=> ["1.000", "2.000",
+ 220686 [peter rubyra] [1.0, 2.0, 3, 4,5,6].map { |n| sprintf "%5.3f", n }
+ 220808 [johan.veenst] ar = [1.0, 2.0, 3, 4, 5, 6]

^ handle a pipe (|) character inside backticks?
220688 [christopher.] # ps efxl |grep "grep"
+ 220694 [banjo users.] The problem might be the interaction of ps with termcap/terminfo.  It
+ 220696 [david vallne] Dump, replace with sys-proctable?
+ 220784 [vincent.four] =3E =23 ps efxl =7Cgrep =22grep=22=3CBR=3E=3E 0     0  9095  2224  15   =

^ Registered for RubyConf - Unable to Go
220693 [GENIE prodig] add, please e-mail me at GFunk913@gmail.com

^ Parsing Ruby to get info about method signatures?
220695 [lyle.johnson] I'm interested in parsing some Ruby code for the purpose of extracting
220706 [ mfp acm.org] $ ruby method_args.rb csv
220831 [lyle.johnson] Thanks, Mauricio! I will check this out too.

^ challenge: correctly handling Accept-Language HTTP header
220697 [khaines enig] I've been pondering the best way of writing a piece of code that will,
220727 [david vallne] I have some doubts you'll ever see that sort of header in the wild.

^ Array#to_s in Ruby 1.9 Head
220698 [gwtmp01 mac.] Mauricio Fernandez writes in http://eigenclass.org/hiki.rb?Changes+in
+ 220703 [gavin.kistne] print a.join('')
| + 220707 [gwtmp01 mac.] Sure. But both solutions fail with nested arrays.
| + 220729 [david vallne] For less typing, omit the string to
|   220732 [tobias.luetk] Liquid depends on the current Array#to_s for speed. It builds nested
|   + 220733 [transfire gm] print a.flatten.join
|   | 220734 [gwtmp01 mac.] Yeah, sure, there are lots of ways to work around it but why should
|   | 220743 [matz ruby-la] The official purpose of #to_s method is that returning string
|   | 220980 [gwtmp01 mac.] OK, I grabbed ruby 1.9 so that I could actually play with it.
|   + 220742 [matz ruby-la] Do you mean Array#join does not work for you this case?
+ 220885 [rossrt rosco] FWIW I find I need 'puts ary.inspect' much more often than 'puts ary',
  220890 [vjoel path.b] (Why 'puts ary.inspect' instead of 'p ary' ?)
  220927 [rossrt rosco] Good point. I'm not sure where that 'puts' came from anyway, I blame

^ How to the output in 12x8 format
220699 [chen_li3 yah] I have an array containing 96 elements. I want to print the array in
+ 220700 [tim.pease gm] require 'enumerator'
| + 220705 [chen_li3 yah] Why should I write the code :require 'enumerator'?
| | 220709 [tim.pease gm] The 'each_slice' method is defined in the Enumerable module, but
| + 220817 [rick.denatal] ary = (1..8).to_a
+ 220704 [ jupp gmx.de] a = (1..96).to_a.reverse
+ 220788 [CHubas7 gmai] The slicing method is neat.

^ unsubscribe
220708 [bobcober mac] ...

^ MsSqlClient ActiveRecord Adapter initial gem-release!
220710 [ssmoot gmail] First gem-release of the MsSqlClient. MsSqlClient is an ActiveRecord
+ 220785 [drnicwilliam] How bad was the default AR SQLServer adapter? How much better is this
| 220840 [ssmoot gmail] I want to make it clear I have nothing but respect for the
+ 220805 [tom popdog.n] It's great you're working on improving the connectivity between rails
  220857 [ssmoot gmail] It's subtle, but getting the sqlserver adapter to be "stateless" was a

^ libiconv: iconv_open is missing?
220713 [mattwynne fa] I'm relatively new to unix/osx/ruby so please be as gentle as you
+ 220717 [billk cts.co] Sorry, I don't know the answer, but - have you tried just commenting
| 220749 [mattwynne fa] Hey Bill, thanks, I kindof did that by taking Nobuyoshi's suggestion and
| 220751 [billk cts.co] It looks like part of your compiler flags string was appended to itself, for
| 220844 [mattwynne fa] Very sharp Bill, I should have spotted that myself. It turns out I don't
+ 220730 [nobu ruby-la] have_library('iconv', 'iconv') fails, right?
  220748 [mattwynne fa] thanks Nobuyoshi,

^ how to print/write the result to a file
220714 [chen_li3 yah] Assume I have an array=[1,2,3]
220719 [jan.svitok g] It depends on the format you want, e.g.

^ Storing a Hash in a database table using YAML--anything better?
220721 [jbrains762 g] I'm a beginning Rails programmer, so please be gentle.
+ 220764 [david vallne] related. In personal code with low usage, those can be safely ignored,
+ 221092 [Bil.Kleb NAS] Regards,

^ Calling a Java Class
220723 [rxv hotmail.] Is there a way to invoke a Java class, from within Ruby, without using, say
+ 220725 [snacktime gm] I believe there are one or two jni libraries for ruby, but I've never
+ 220728 [david vallne] say=20
+ 220739 [jared-richRM] If you'll forgive me posting my own blog entry
| 220793 [rxv hotmail.] yeah....YAJB seems to be exactly what I am looking for. Any reason you know
| 220803 [murray.steel] I've used YAJB to power some PDF generation stuff using Apache FOP in a
+ 220762 [user domain.] You could use xml-rpc or something similar to call a java process from a
  220952 [Charles.O.Nu] Of course I need to chime in and say that although there are other
  221003 [rxv hotmail.] I have to add that JRuby 0.9.1 is just amazing. This truly melds the best of
  221015 [Charles.O.Nu] Cool, thanks :) And I'm sure all the previous contributors to JRuby
  221117 [david vallne] Any odds the Groovy JSR gets dragged out and shot^W^W^W^W displaced by a

^ WaterMark with file_column
220726 [rajads133 ya] property pictures uploaded by users; how do you do it with file_column.
221395 [halostatue g] This isn't a Ruby question; it's a Rails question. However, one can

^ Having trouble connecting to a site via net/http
220750 [jakattack2 g] In my app I have the need to screen scrape a HTTPS page and I'm
220760 [chrisjroos g] Use net/https to connect over ssl...
220773 [jakattack2 g] I tried the code that you suggest and I get the following error
220786 [chrisjroos g] Did you require net/https (NOT net/http)?

^ Etc.dir, Etc.name
220752 [ronaldf eml.] I found some of the Etc functions missing which are mentioned in
220755 [matz ruby-la] I don't have the book at hand right now (since I am staying at the
221143 [ro.naldfi.sc] Sorry, you are right. I did not pay enough attention to this. So, no

^ Etc.dir, Etc.name
220753 [ronaldf eml.] I found some of the Etc functions missing which are mentioned in

^ filling an array excepted first and last position...
220754 [josselin wan] ldom =  30  # variable (last day of a month...)
+ 220756 [rimantas gma] @obk = Array.new(ldom,0)
| 220768 [josselin wan] yes , it's better ....  avoiding  @obk[0] = nil in my writing...
+ 220757 [peter rubyra] You could do also
+ 220759 [shortcutter ] @obk = Array.new(ldom, 0)
| 220776 [josselin wan] better  ,  avoiding @obk[0] = nil ...
| 220777 [shortcutter ] ??? There is no test for @obk[bd] == 0 in the code above.  It's a bit
| 220914 [josselin wan] Thanks Robert, I solved the problem creating a sub-range without the
| 220931 [shortcutter ] This sounds as if the design is at least questionable.  If you have
+ 220766 [josselin wan] thanks to all of you, i'll try all your clues...
+ 220779 [josselin wan] obdays[3..5].to_a.each{|bd| @obk[bd] = 1}

^ cyclic prob with gem_origina_require
220763 [pere.noel la] I'd like to cure a cyclic prob with gem_origina_require, i get a prob

^ Neewby question: how to monitor a variable value
220767 [luc.juggery ] I remember reading in a book that we could very easily monitor the
+ 220770 [farrel.lifso] Farrel
| 220771 [luc.juggery ] Thanks a lot Farrel,
+ 220790 [gavin refine] While I'm sure many other similar libraries exist, I'd like to offer up
| + 220798 [luc.juggery ] Thanks a lot gavin,
| + 220880 [charles.rope] I just got back from reading this on Ruby Inside and though I'd give
+ 220870 [vjoel path.b] See also http://raa.ruby-lang.org/project/observable. (And see the

^ [OT:usage of uml]
220769 [gaurav.v.bag] I have just started to learn about Agile development and was told that in
+ 220780 [david vallne] t in
| 220872 [vjoel path.b] It would be interesting if it were possible to generate UML from ruby
| 220898 [itsme213 hot] Some of this would be simplified if the various flavors of #attr_accessor,
| 221021 [gaurav.v.bag] Thanks all for replies, it seems that UML does holds a place in agile
| 221081 [cybernet int] This is in C++ (from the book "C++ Template Metaprogramming" - Addison
+ 221041 [cdcarter gma] I use UML with Ruby, partially because I still consider myself "new" to OO
| 221088 [david vallne] And here I thought programming was an engineering discipline, and not a
| 221089 [thomas.adam2] "Wanting to feel; to know what is real.  Living is a lie." -- Purpoise
| 221512 [rick.denatal] Hmm, I'm having a deja-vu.
| 221525 [gilesb gmail] I was going to say, didn't UML have roots in Smalltalk?
| + 221574 [rick.denatal] I don't know about that.
| | 221586 [gilesb gmail] I can see my intolerance for script kiddies elsewhere on the Internet
| | 221673 [rick.denatal] Sorry, but having lived through some rather dubious IBM "Strategies"
| | 221947 [eeklund gmai] [about UML]
| + 221585 [david vallne] UML does feel overhyped when one is learning about it, and the various
| | 221588 [gilesb gmail] well, anomalous in that the other programming languages I've used have
| + 221602 [halostatue g] That's probably because UML is most often used for class models (more
+ 221248 [emiel vandel] I know the basics of UML and try to follow it as best as I can.

^ Ruby Sockets Vulnerable?
220772 [unni.tallman] I have a TCPServer listening on a port. I forked a 500 odd TCP Clients
220774 [shortcutter ] It is a limitation of the underlying network functionality not of Ruby.

^ break from block
220787 [farrel.lifso] block = lambda{|i| i > 5 ? break : nil}
+ 220792 [me michaelst] I'm not sure it's the Ruby way (I'm too new to Ruby to judge) but how
| 220795 [farrel.lifso] I tried that but it's a performance killer (nearly 3 times as slow in
| 220800 [gethemant gm] when you call 10.times {|i| break if i>5; p i}, it works because its
+ 220794 [gethemant gm] I am not sure about the solution, but the reason of the error is not
+ 220797 [shortcutter ] The direct form works.
| 220801 [farrel.lifso] I'm just trying to optimise some code and I was wondering if doing
| + 220809 [cbrown atbas] On a tangential note,  I'd be worried about the not-so-obvious flow
| + 220815 [shortcutter ] I do not know a single case where the lambda variant is faster than the
|   220881 [farrel.lifso] From my informal benchmarking there's a very slight constant speedup
|   220907 [ara.t.howard] block = lambda{|i| p i; i > 5 ? break : nil}
|   + 220930 [farrel.lifso] irb(main):001:0> block = lambda{|i| p i; i > 5 ? break : nil}
|   + 221001 [gethemant gm] uname -a
+ 220960 [matt tidbits] block = lambda{|i| p i; i > 5 ? throw(:done) : nil}
  220981 [farrel.lifso] I've tried using throw/catch but it's a serious performance cost.

^ Reverse Polish Ruby
220791 [jjthrash gma] Hey folks,

^ where to put require
220796 [rxv hotmail.] If I have a rails app and I need to put in
220802 [jan.svitok g] And be careful where you place include Yyy as the placement influences
220838 [CHubas7 gmai] def check

^ problem with reading file
220807 [chen_li3 yah] I read a file in the following format,extract the second column only,
+ 220810 [wilsonb gmai] You need to tell Ruby to coerce the strings into integers.
| 220814 [chen_li3 yah] Thank you very much,
+ 220820 [shortcutter ] This can be done by an awk style 1liner :-)

^ Problem modifying captured regexp results
220812 [Paul.vanDels] I'm using ruby to automatically generate Fortran95 code and I'm using a regular expression
+ 220818 [gavin.kistne] That's what you get for using the (thread-local) global variables that
| 220823 [Paul.vanDels] I agree with what you're saying. I actually have already switched to MatchData objects
+ 220821 [pit capitain] Paul, the problem is that #split with a Regexp internally executes some
  + 220830 [Paul.vanDels] Aha! That is the answer to the question (see my other post).
  + 220973 [jan.svitok g] In this case, it's really easy: just reorder the lines so that the one