369773-395827 subjects 370191-379768

How to initialize the object of expression?
369980 [imelody@ms .] It has a lot of expressions in a file.
369983 [botpena@gm i] ri String#split

ruby regexpresion
369989 [ruwanb@gm il] I want to parse the following few things from the above string
+ 369992 [b.candler@po] bits about regular expressions.
+ 369993 [jeremy@bo p.] The following example will work for your singular example, but it's
| 369999 [ruwanb@gm il] Jeremy thanks so much for your help......it works.
| 370002 [jeremy@bo p.] Sure thing.  Especially when you're learning about regular expressions
+ 370000 [pfharlock@gm] another answer is
  370001 [pfharlock@gm] sorry, I lied, the first captured group would be " mamamea this "

Re: More seats on sale today
369990 [ymendel@po o] re announced? That just seems really backwards to me.

search and replace
369991 [edvelez.g@gm] I want to be able to run a program that will do a bunch
+ 369994 [pfharlock@gm] try
| 369996 [pfharlock@gm] forgot to add, the output is
+ 369995 [b.candler@po] Have you got something simple working yet? For example, you could write
+ 369998 [jeremy@bo p.] changes = [
| 370005 [edvelez.g@gm] That one almost works but it needs to do the
| 370007 [jeremy@bo p.] I'm not sure what you mean by only replacing the first occurrence.  Are
+ 370009 [angel_steel@] search=%w[one four]
  370025 [edvelez.g@gm] Both solutions almost work, only that I want the first instance to be
  370026 [jeremy@bo p.] Alright, so you only want a search/replace pair to apply to a single
  370027 [edvelez.g@gm] Hmm it works perfect for what I asked.. but I realized I will probably
  370033 [jeremy@bo p.] The example I sent should do exactly what you're saying here.  Are you

composition vs 'leaf-class mixins' (vs class inheritance)
370003 [woody.peters] I have a design question inspired by Rails 3 internals. In Design
+ 370016 [b.candler@po] That to me is awful. The logic is obfuscated; the order in which the
| 370030 [robert.dober] I have given this post quite some thoughts (for a change ;) and I
| 370368 [woody.peters] Robert, if I understand you correctly, you're saying my 'composition'
| 370377 [shortcutter@] I believe inheritance is overrated and often overused.  In teaching
+ 370375 [shortcutter@] That would be a poor Neo who's skill set never changes.

open for exclusive read
370008 [ralphs@do 32] ...

using send to define object methods
370010 [dmiller@te o] If I want to add a method to a class, I can use send as shown below.  Is
+ 370012 [nobuoka@r- e] If you execute your script on Ruby 1.9, you can use
+ 370013 [b.candler@po] object_poof = Object.new

Ruby regexpresion, error? :-(
370018 [imelody@ms .] I want to match last chars of the line,
+ 370019 [b.candler@po] /as$/ means "match 'a' then 's' then end-of-line". But there is a
| 370020 [imelody@ms .] Dear Brian Candler, thank you very much, but still have problem.
| + 370022 [angel_steel@] then do this
| | 370023 [imelody@ms .] Thank you,Steel Steel,But why cannot use regexpresion?
| | 370024 [angel_steel@] yes you can use regexp. But your requirement is simple. So simple string
| + 370029 [b.candler@po] Change
|   370067 [shortcutter@] OP, I suggest you do this and post the outcome - then we can see what
+ 370021 [angel_steel@] i see that you are actually wanting to match "as" at the end of

Problem on an example from ruby-lang.org
370031 [awvalenti@gm] I'm new to Ruby and I've been taking a look at the "Getting Started"
370037 [b.candler@po] Which bit of "please don't do this" don't you understand? :-)

Ruby-based data language
370039 [transfire@gm] Has anyone ever endeavored to create a data/configuration file format
370040 [b.candler@po] Which bit of Ruby syntax are you thinking of?
370203 [transfire@gm] Yes, I should have been more specific. This is what I mean. A longer
+ 370208 [wyhaines@gm ] Enough for what? To trust arbitrary configurations that are executable Ruby?
+ 370217 [b.candler@po] You could make a parser for that fairly easily - or transform it to JSON
  370226 [transfire@gm] nice advantage with blocks.
  370254 [b.candler@po] I'd have said most packages use YAML. If you can provide examples which
  + 370269 [b.candler@po] That is, to parse that record using eval I think you need something
  | 370440 [transfire@gm] You make a good point about arrays. I'm thinking about configuration
  + 370272 [transfire@gm] I think a Gemfile is a pretty good example --yes you can use
    + 370280 [b.candler@po] Do you mean a Gemfile from Bundler? e.g.
    | 370437 [transfire@gm] That's one way. The parser could just offer a couple of options to
    + 370301 [sean.ohalpin] require 'doodle'
      370438 [transfire@gm] Close. The only thing with Doodle is that you have to pre-define the

Learning Shoes - Have some questions!
370042 [ruby.student] I recently started playing with Shoes to learn it during my Ruby
370060 [steve@st ve ] Hey, thanks for trying out Shoes! What would make the documentation better
370114 [satoshi@ri -] `.org`?
370465 [ruby.student] I truly appreciate the help from everyone.
370472 [ashbbb@gm il] Okay.
370494 [ruby.student] Well, I re-tried AGAIN, yesterday. I replied to the first email as requested
370548 [ashbbb@gm il] requested

Re: A new Ruby book
370043 [b.candler@po] (1) This appears to be a pay-for only publication. You can pay either
+ 370044 [ruby.student] Female underwear?
| 370048 [b.candler@po] Yep. I guess I should have said that :-)
+ 370049 [xeno@ba en u] Euh, sure you can browse the ToC (and the first 12 pages). Click the
| + 370056 [angel_steel@] IT IS when you start asking to pay for it :)
| + 370071 [b.candler@po] In Chrome under Linux (Ubuntu Lucid x86_64), that just opens up a blank
+ 370057 [mindaslab@gm] The free version is in http://mindaslab.in/ilr , but its a beta one. It
  370063 [mindaslab@gm] People my website is temporarily down. Don't know what really happened,

Have some Shoes questions!
370050 [ruby.student] I recently started playing with Shoes to learn it during my Ruby

370051 [antonio.gale] Arcadia is a Light Integrated Development Environment (IDE) for Ruby

SSLSocket -- Connection reset by peer
370052 [michael.vast] I'm having a weird (to me, at least) problem trying to connect to an SSL
370072 [b.candler@po] You're really running an SSL server on the telnet port on your local
370111 [michael.vast] Haha. No. I change the port/hostname to mask what it really was.
370113 [michael.vast] sslSock.write(data + "\n")

Getting GUI for ruby for Linux running (QT or wxWidget)?
370053 [markus@fi ch] I'm trying to evaluate GUI development with Ruby on Linux and Windows
370054 [markus@fi ch] There's a slight but important to note error here: of course I didn't
+ 370097 [mohammedrash] try FXRuby
+ 370099 [chauk.mean@g] Chauk-Mean.
+ 370116 [sutniuq@gm .] wxRuby doesn't work out of the box with Ubuntu 9.10 and newer, because
  370164 [ryanmelt@gm ] gem install qtbindings
  + 370188 [markus@fi ch] That sounds great, I'll test that for sure when I'm home later. Thanks
  + 370201 [eregontp@gm ] Yeah, that's quite cool.

to_json / to_xml: where to find?
370055 [ajfrenzel@we] "The builder options are the same as to_json / to_xml, except for the
370058 [m.fellinger@] Michael Fellinger

how to get Mycompute.sum([1,2,3,4]).mean=2.5?
370059 [myocean135@y] class  Mycompute
+ 370061 [daniel.gayta] I don't know if you tried to say how you can write a code that accepts
+ 370064 [botpena@gm i] uh,uh, you cant because you get a conflict: your sum returns a value

[ANN] TryRuby on 1.9.2 with all lessons working
370062 [sophrinix@gm] Greetings,

need Help Simulation in ruby
370065 [winshocker.2] An Ambulance are dispatched at a rate of one every 15 + 10 minutes in a
+ 370066 [winshocker.2] Ambulance(Dispatch Rate) ??? 15sec ->10 Minutes
+ 370070 [b.candler@po] Yes, remarkably similar.
  370166 [winshocker.2] thx for the response i'll try your advice thanks brain
  370167 [winshocker.2] An Ambulance are dispatched at a rate of one every 15sec to 10 minutes
  370184 [b.candler@po] As I said before, I'd replicate exactly what you'd do on paper. For

Nokogiri error
370073 [logan.senthi] I am getting the below error when I am working with nokogiri version
370082 [b.candler@po] Can you post the full error with backtrace? All I can tell from that is

How can this Java method header be represented in Ruby
370075 [abder.rahman] public static short[][] setFile(String fileName)
370076 [peterhickman] def setFile(fileName)
+ 370078 [abder.rahman] Thanks @Peter. And, of course, the second form is more suitable
+ 370079 [abder.rahman] @Peter. Ruby is a dynamic language, sure it is :-)
+ 370080 [b.candler@po] def file=(filename)
  + 370081 [abder.rahman] Thanks @Brian. A nice one!
  + 370108 [hassan.schro] However, the 'static' in
    370109 [abder.rahman] Thanks all for your replies.

Installing files outside /usr/lib/ruby/ using  rubygems
370077 [stefano.croc] I'm writing an application using the KDE ruby bindings and I'd like to package

Constructor (Java) ---> initialize (Ruby)
370083 [abder.rahman] Like constructors in Java, I understood that in Ruby, we use
+ 370085 [markus@fi ch] class ReadFile
| + 370086 [abder.rahman] Thanks @Markus.
| + 370088 [b.candler@po] There is an implicit constructor: it calls 'allocate' to create the
+ 370087 [b.candler@po] No. You can't nest defs (or at least, they won't do what you expect).
+ 370090 [shortcutter@] That seems pretty weird Java code.  A method named "setFile" with a

installation of Ruby 1.8.7 on fedora .
370084 [avijit.shand] I got this
370089 [b.candler@po] Which Fedora? http://fedoraproject.org/wiki/Releases
370091 [avijit.shand] it's Fedora Release 13(Goddard).
370098 [b.candler@po] OK. Next thing I'd suggest is to try building the latest 1.8.7, which is
370168 [avijit.shand] Thanks Brian, Now it's working..

Ruby 1.8.7 from 1.8.6
370092 [avijit.shand] I have been given a project to understand the ruby and rails so every
+ 370100 [b.candler@po] The most appropriate place for questions about or problems with Rails
+ 370135 [msfaas@no .g] "Awijeet Mr." <avijit.shandilya@gmail.com> schreef in bericht

How to handle authentication pop-up when the machine is lock
370094 [parulg@co el] I am facing issues while handling authentication pop-up when my machine

name =  upload['datafile'].original_filename
370095 [abder.rahman] name =  upload['datafile'].original_filename
370102 [b.candler@po] def self.save(upload)
370105 [abder.rahman] Thanks a lot @Brian for this nice clarification.

File.open(path, "wb")
370101 [abder.rahman] File.open(path, "wb")
370104 [b.candler@po] and in the top right pane select open(IO). This is because File is a
370106 [abder.rahman] I got it @Brian. Thanks a lot.

[SOLVED] Re: Mechanize file save on generated link
370103 [dan@bl ck ie] Thanks to everyone who helped. Writing the file in Binary mode did the

Obtaining metadata from a url or web to for avoid loadit
370110 [sak@pr xe to] I was googling a lot with very different queris to find an answer, lets
370112 [hassan.schro] See the request methods section of
370146 [sak@pr xe to] Thanks for the info, but I can't find anything about the question.
370149 [hassan.schro] <quote>

370115 [wfinn@fu lr ] My client, a leading academic research institution, is looking for a

Problem install mysql Gem OS 10.6.4
370117 [w3bwizart.be] I'm trying to install  the Mysql Gem but getting error's.
370120 [edmond.kacha] Younes,
+ 370122 [edmond.kacha] 2010/9/20 Edmond Kachale <edmond.kachale@baobabhealth.org>
+ 370125 [luislavena@g] On Sep 20, 12:34=A0pm, Edmond Kachale <edmond.kach...@baobabhealth.org>
  370126 [w3bwizart.be] if it works with you can you tel me how for snowleopard. For you it is
  370128 [luislavena@g] How you installed MySQL? using binaries form dev.mysql.com or using
  370148 [w3bwizart.be] Everybody   thanks voor the help, also i have to apologize to all of

convert time to ruby time to calculate the time difference.
370119 [ruwanb@gm il] I have following two time stamps,
370123 [ravenz@o2 ie] require 'time'
370130 [b.candler@po] => true
379617 [abhidsm@gm i] If you got the ruby time, you can use the gem 'time_diff' to get the
379618 [wyhaines@gm ] I haven't looked at the gem, but....it's all just simple math, except

An elegant way...
370127 [fred@la av .] I've written a method to solve a little problem, but I find my solution
+ 370131 [jgabrielygal] S1', 'S2' ])
| 370139 [fred@la av .] /.../
+ 370132 [james@gr ys ] either
| 370141 [fred@la av .] Where does the slice_before method comes from ?
| 370144 [james@gr ys ] =3D> "1.9.2"
| 370145 [fred@la av .] => "1.9.1"
+ 370133 [brabuhr@gm i] S1', 'S2' ])
+ 370134 [joelvanderwe] a = [ '1', '2', 'S3', 'S4', 'S5', 'O6' ]
| + 370136 [mentionuse@g] ...
| + 370138 [joelvanderwe] a = [ '1', '2', '3', '4', '6', '7', '9', 'S1', 'S2', "10", "11", "12" ]
|   370140 [fred@la av .] => "T0"
|   370142 [joelvanderwe] => "S10"
+ 370165 [list.push@gm] This is not a complete solution but *maybe* it is something worth looking a=
| 370169 [list.push@gm] A slightly shorter but still unreadable version :-)
| 370171 [list.push@gm] r = [ '1', '2', '3','4', '6', '7', '9', 'S1', 'S2' ]
| 370182 [b.candler@po] Here is a very traditional imperative solution.
| 370183 [b.candler@po] In fact, I forgot it's OK to run off the end of an Array in ruby :-) So
| 370185 [shortcutter@] Fred, for the contrast here's my engineering approach.  It may not be
| 370186 [shortcutter@] Forgot the end handling and mixed up two versions. Sorry for that.
+ 370193 [botpena@gm i] S1', 'S2' ])
+ 370320 [fred@la av .] Right.  I've written a sligthly better version in my project.

[ANN] stickler 2.0.2 Released
370147 [jeremy@hi eg] Stickler version 2.0.2
370158 [tim.pease@gm] repository.

Is this a bug?
370150 [gjenkins@lb ] ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-darwin9.7.0]
370152 [rimantas@gm ] For me it looks like you are rounding -32.05, not -32.50.
370153 [gjenkins@lb ] Yes, I intend to round -32.05 to the nearest 1 decimal place not to a
370154 [gjenkins@lb ] irb(main):007:0> sprintf("%.0f",-1.5)
370155 [gjenkins@lb ] sprintf("%.0f",10.5)
370156 [bg-rubytalk@] rsion_and_rounding
370157 [gjenkins@lb ] Thank you Ben,
370172 [shortcutter@] Since you are coming from a Java background I guess you are aware that

[ANN] treequel 1.1.0
370151 [ged@Fa ri MU] Treequel is an LDAP toolkit for Ruby. It is intended to allow quick, easy

gruff graphs and labels
370159 [ruwanb@gm il] I am a newbie....and there are very less documentation when I google

New Programs
370161 [askany.co.cc] Office 2010 BLACK EDITION x86 - ProPlus Only

New Programs
370162 [askany.co.cc] Office 2010 BLACK EDITION x86 - ProPlus Only

Date#parse assume a EU format - can it assume a US format?
370163 [josh.m.sharp] Before you jump to an answer here, please don't suggest that I use
370187 [b.candler@po] It is U.S. middle-endian format in 1.8.7. But try this monkey-patch for

Retrieving Motherboard Serial Number
370170 [jayaoscarlok] May I know that how to retrieving Motherboard Serial Number, please?
370189 [no@sp m. le ] Use Win32OLE and the WMI interface. Sorry, no code to hand, but googling will

Sphink issue
370173 [avijit.shand] I get this if I execute  "script/server"
370176 [b.candler@po] .. which is a part of Rails.
+ 370178 [avijit.shand] Sure will follow you.. thanks
+ 370180 [diego.viola@] Please ask in a Rails forum.

Changing protocol or urls in will_paginate
370174 [constantin.n] Hey,
370175 [b.candler@po] Please post questions about Rails to a Rails forum.
370177 [constantin.n] Hey Brian,
370179 [diego.viola@] Please ask in a Rails forum.
370181 [constantin.n] Alright, cheers guys.

{Detached} Mysql Gem and beyond: Fixing, Supporting and Celebrating
370190 [edmond.kacha] 2010/9/20 Luis Lavena <luislavena@gmail.com>
370194 [luislavena@g] On Sep 21, 8:02=A0am, Edmond Kachale <edmond.kach...@baobabhealth.org>
370231 [groups.2009a] meant