371571-373214

371317-372187 subjects 371731-378302

Re: Excuse me!! Would you stop for a moment?!
371571 [alpardal@gm ] No, I don't.

Objective-C Ruby Extension
371575 [scott@ai ru ] While toying around, I decided to start work on a trivial Objective-C

more idiomatic way to avoid errors when calling method on variable that may be nil?
371580 [cbciv@ya oo ] I'm using Ruby 1.8.7 patchlevel 249
+ 371581 [wyhaines@gm ] var = hash[key].downcase rescue nil
| 371593 [scott@ai ru ] No! :(  Blanket rescue statements are not to be used.  It's a trivial
| + 371594 [scott@ai ru ] Because I love dead horses (or just low productivity). Two more code exampl=
| + 371601 [dblack@ru yp] You should never get a NoMethodError on #to_s; it's defined on Object.
+ 371582 [josh.cheek@g] hash = { :key1 => nil , :key2 => "aBcD" }
| + 371585 [joelvanderwe] Absurd? It's an easy to get symbols where strings should be...
| + 371615 [cbciv@ya oo ] Using the short-circuit evaluation of && to avoid calling downcase.
+ 371584 [joelvanderwe] cheat a little?
| 371616 [cbciv@ya oo ] Well, yes, I suppose that I could do that. :)  I think that the
+ 371592 [dblack@ru yp] It actually will work if var has not been initialized before. But that's
| 371617 [cbciv@ya oo ] Exactly.  Plus, it's programming by side effect, which gives me the
+ 371606 [keeperotphon] var =3D hash[key] && hash[key].to_s.downcase
| 371618 [cbciv@ya oo ] In my use case, true, because the type of the value will either be
+ 371611 [tony.arcieri] Haskell solves the "may be nil" problem with the Maybe monad (from Haskell).
| 371641 [rick.denatal] Nobody seems to have mentioned it, I guess since this is the place for
| 371697 [tony.arcieri] That's pretty cool, but I'd prefer it return a proxy object for all non-nil
| 371711 [shortcutter@] il
| 371768 [tony.arcieri] Yes :)
+ 371614 [ara.t.howard] var = hash[key].downcase if hash[key]
| 371619 [cbciv@ya oo ] var = hash[key].downcase unless hash[key].nil?
| 371620 [joelvanderwe] var = (hash[key].downcase if hash[key])
| + 371748 [cbciv@ya oo ] While that would clearly work, it makes me a little nervous as it
| | 371767 [joelvanderwe] I agree. It reduces readability, and it's easy to forget the parens.
| + 371769 [tony.arcieri] The parens are unnecessary. The "var" variable will be implicitly bound to
|   371774 [joelvanderwe] var = 1
|   371781 [tony.arcieri] Well, avoiding destructive assignments is an alternative to wrapping the
+ 371786 [showell30@ya] I'm not sure if this is the most common idiom, but you can write a
| 372245 [cbciv@ya oo ] [snip example]
+ 371787 [shettysuman7] is World Sight Day, 14th October 2010 get your eyes tested by your
+ 372291 [w_a_x_man@ya] var =3D (t =3D h[key] and t.upcase) or nil
| + 372331 [cbciv@ya oo ] Using short circuit evaluation to avoid the call to upcase if h[key]
| + 372336 [eregontp@gm ] h[key] will return nil if key is not found, so you do not need that "or nil=
+ 372365 [w_a_x_man@ya] s =3D hash[:foo] and s.downcase!

Ruby 1.9.2: How to sanitize text with invalid characters?
371586 [x-ruby-lang@] I process a lot of text files of which I know the encoding, but that
371595 [scott@ai ru ] Code / Data samples?
371596 [x-ruby-lang@] "#{0xFF.chr} abcde".force_encoding("utf-8").gsub(/a/,'')
+ 371597 [scott@ai ru ] Will this work?
| 371600 [x-ruby-lang@] Only if the desired encoding is ASCII.
+ 371598 [x-ruby-lang@] Iconv.conv('utf-8//IGNORE','utf-8',"#{0xFF.chr} abcde")
  371628 [sutniuq@gm .] ============================================

dddddddddddddd
371589 [x-ruby-lang@] ddddddddddddddddddd
+ 371590 [x-ruby-lang@] ddddddddddddddddddd
+ 371591 [x-ruby-lang@] dddddddddddddddddddd

Ruby Sanity Check
371599 [flebber.crue] Just a quick check. I am starting into Ruby with little interest in
+ 371602 [jstewart@fu ] Ruby provides wonderful tools to do all of this. So no, you're not
+ 371603 [steve@st ve ] Nope, you're quite sane.
+ 371604 [steve@st ve ] ...
| 371605 [flebber.crue] Thanks for the links I was hoping I was not nuts :-;, I didn't think
| + 371608 [ninja@sl ph ] Possibly. It would also likely be faster and more stable, and I would guess
| + 371621 [steve@st ve ] This question is a bit more complicated than you'd imagine... there's
+ 371625 [josh.cheek@g] By "extract data from websites" I assume you mean screen scraping. Here are
| 371636 [flebber.crue] re
+ 371699 [piyush.pr@gm] stuff, use celerity http://celerity.rubyforge.org/
+ 371708 [djonavarro@g] For excel I would reccomend win32ole it is available natively on windows

[ANN] map-1.3.0
371609 [ara.t.howard] NAME
371668 [tony.arcieri] That's a cool idea I may have to steal for Reia :)

Helping with Ruby, where to start?
371623 [devguy.ca@gm] How does one start to help the Ruby community? I figure the best way to
371651 [jeremy@bo p.] I'm sure there are many ways to start helping, but for me I found a task
371709 [devguy.ca@gm] I discovered the ruby-core website, instruction on there is lacking.
371746 [jeremy@bo p.] You should build the code and install the binaries so that you can start
371759 [devguy.ca@gm] thanks for your assistance. I got the source off the trunk and built
+ 371761 [cremes.devli] There is no need to limit yourself to working *only* on MRI Ruby (MRI = Matz's Ruby Interpreter).
| 371938 [devguy.ca@gm] The Rubinius project sounds like something interesting to work on, but
+ 371762 [jeremy@bo p.] No problem.  This is how you get started with pretty much any open
  + 371844 [reachme@ch r] Yeah, that's a good point - Luis has recently written a post
  + 371937 [devguy.ca@gm] Yes I am a Windows developer, but at home I am exclusively using Linux,

Bit Manipulation for a Pure Ruby SHA1 implementation
371624 [jason.larsen] I'm trying to write a pure Ruby implementation of SHA1. In order to do
+ 371626 [josh.cheek@g] the standard library.
| 371679 [jason.larsen] in
| 371680 [jason.larsen] ne in
+ 371632 [shortcutter@] I would create a class which is a thin wrapper around a String
+ 371801 [b.candler@po] A String in ruby is a collection of bytes, not bits.

ruby bug with fork and signals (SIGTERM)
371627 [aotto1968@us] I writing a C-Extension for ruby using "rb_fork(0,0,0,Qnil)" to create a
371629 [shortcutter@] Only in the parent?
371637 [aotto1968@us] I just test the parent.

rake aborted! Validation failed:
371633 [nguyen.ander] Trying to populate a database with some users using rake db:populate.
+ 371638 [luislavena@g] This is Ruby-Talk, mainly covering Ruby specific topics, not Rails
| 371653 [nguyen.ander] Can admin move this question to the rails thread.
| 371657 [cmdjackryan@] I doubt it, since the ruby forum is a gateway to the Usenet group /
| 371659 [josh.cheek@g] It's called RMagick.  http://rubygems.org/gems/rmagick
+ 371701 [nguyen.ander] Ive installed ImageMagick already :S

email sending issue with ar_mailer + rails 2.3.5
371634 [saurabh.purn] I am using rails 2.3.5, for simple Action mailer the emails are getting sent

HAY... HERE REAL HOT COPLES R SEARCHING 4 U FOR GOOD FUN FREE....
371635 [iamforufrien] HAY... HERE REAL HOT COPLES R SEARCHING 4 U FOR GOOD FUN FREE....

OT: file attribute serialization in Windows
371639 [ralphs@do 32] ...
+ 371650 [shortcutter@] Hm, maybe you can use xcacls command line utility to help with that.
+ 371652 [djberg96@gm ] k up ALL of a file's attributes.
  371655 [jeremy@bo p.] -Jeremy

Using DRB as a secure interface
371640 [anthony@ov r] Is it possible to implement a secure interface exposed to the internet
371643 [shortcutter@] ing

How to do this
371642 [d_rems@ya oo] template = 'some text #{variable}' # single quotes for reason
+ 371645 [josh.cheek@g] require 'erb'
+ 371646 [shortcutter@] I would consider using double quotes an "easy way".  Either way, some
| 371698 [d_rems@ya oo] Robert thank you for this.
+ 371649 [stefano.croc] #note the double quotes inside the single ones

Help with regexp's
371644 [thiagown@gm ] Is there any way to a regexp allow any character but the comma?
+ 371647 [shortcutter@] Use a negated character class [^,] or use negated matching !~.
+ 371648 [josh.cheek@g] Use a negated character class /[^,]/

wxWidgets +wxRuby + wxFormBuilder
371654 [b1368810@lh ] I create GUI-program, based on wxWidgets, in wxFormBuilder.
+ 371673 [b1368810@lh ] I posted topic in the top of discussion. Anyone know what I must do?
| 371676 [sutniuq@gm .] Maybe ask on the wxRuby forum? http://www.ruby-forum.com/forum/wxruby
+ 371678 [b1368810@lh ] Thanks. I'm newbie here, now will be know this.

Ruby simple browser base source level debugger
371656 [artonx@ya oo] I  recently start to develop a ruby source level debugger (ruined) with

Re: map-1.3.0
371658 [transfire@gm] There is also Stash library (gem install stash -or- gem install
371660 [ara.t.howard] map does use strings: http://github.com/ahoward/map/blob/master/lib/map.rb#L123
+ 371671 [unbewusst.se] require 'rubygems'
| + 371674 [djberg96@gm ] While you're at it, can we get hash slicing, too?
| | 371694 [ara.t.howard] dan.  what's you github name - i'll add you.
| + 371693 [ara.t.howard] 1) symbols are not GC'd
+ 371685 [transfire@gm] #L123
  + 371692 [ara.t.howard] steal away brotha - it's open source ;-)
  + 371695 [ara.t.howard] this one.

if the variable is set.
371661 [leonelsantos] How can I create an if statement to check if a variable contains a
+ 371662 [josh.cheek@g] your question is about Rails, the web framework. Since you posted from
+ 371663 [astahl@hi .c] Looks like you're checking whether or not the variable itself exists, as
| 371665 [leonelsantos] @Josh: I'm sorry I thought since all I need to create is a Ruby if
| 371667 [rick.denatal] No, this is clearly a Ruby question, albeit in the context of Rails.
+ 371670 [leonelsantos] I was supposed to check for empty? because it's an empty string.

attach to an external thread end with core dump
371669 [aotto1968@us] I have an problem ....

error while executing the code
371675 [basa.ravikir] i run the below code with ruby interpritor(1.8.7)
+ 371677 [stefano.croc] The error you're seeing doesn't depend on your code, but it's caused by the
+ 371681 [basa.ravikir] Thanks Stefano,
+ 371682 [basa.ravikir] ok i did

subversion-ruby
371684 [mateusz.kyc@] I need to create functionality to access svn repository in my
371754 [david_v_wrig] gem install svn_wc
371800 [mateusz.kyc@] thanks for info. I see that you are author of gem. I will test

More Malt Engines?
371686 [transfire@gm] I'll be working on an update to <a href="http://rubyworks.github.com/
371689 [ninja@sl ph ] Mustache. Also, Erector, if it makes sense at all.

Trouble installing 1.9.2
371691 [raul.c.jara@] I've been having a frustrating time installing 1.9.2 on my 2.16 Ghz
371773 [raul.c.jara@] To anyone else searching the web with this problem, I found the

Do you need a cert to make a gem?
371700 [pal@pa be gs] I'm trying to learn how to make my own gem. I just wondered about
371720 [jeremy@bo p.] No, a certificate is only required if you want to sign your gem, and
371742 [sutniuq@gm .] Interesting. I didn't know it was even possible to sign a gem. I already
371745 [jbarnette@gm] Best place to start is `gem help cert`.

sort_by: multiple fields with reverse sort
371702 [sentinel1879] I need to use *sort_by* to sort a table, since the user could select
+ 371703 [stefano.croc] Are you sure the one criterium version works as you think? !x[1] returns a
+ 371710 [nobuoka@r- e] The one way to do a reverse sort is wrapping a sort target in a class
| + 371721 [sentinel1879] Thanks, i will have to consider this.
| + 371776 [ryand-ruby@z] class.
+ 371725 [sentinel1879] When i sat down to code, i realized that i could not just put the
| + 371732 [Rob@Ag le on] While it is not strictly equivalent to array_of_strings.sort.reverse,
| + 371782 [showell30@ya] I definitely feel that sort_by has a compelling advantage over sort
+ 371784 [showell30@ya] It would be nice if Ruby supported a sort_by on steroids.
| 371788 [jeremy@bo p.] module Enumerable
| 371814 [showell30@ya] =A0 =A0 =A0 =A0 =A0 =A0 =A0["radio", 30, 5]]
+ 371818 [showell30@ya] Here is a solution that allows you to lazily evaluate keys and specify
  371824 [showell30@ya] Oops, I forgot to verify that I was actually caching results.  Here is
  371857 [ryand-ruby@z] This doesn't do what you think (or at least imply that) it does.
  + 371885 [showell30@ya] Care to explain?
  + 371888 [showell30@ya] Ok, I found and fixed a bug (*) and reworked the example to

Excel and Ruby
371704 [djonavarro@g] I'm just doing some data entry work and thought it would be fun to
+ 371750 [djonavarro@g] oops sorry I initialized alot of Constants there.
| 371838 [dejan1@gm il] Why do you have a nested loop?
| 371839 [djonavarro@g] Thank you very much! :) Like I said I am new, I found an example this
| 371841 [dejan1@gm il] ny
+ 372007 [bhjdownload@] thanks for the info posted thus far.  I am a new convert to Ruby after
+ 372012 [jethrow@gm .] First off, I'd recommend finding some VB examples for reference (the
| 372015 [d_rems@ya oo] If your table is not too complex you may look at
+ 372123 [bhjdownload@] great start BevJ
+ 372719 [bhjdownload@] _____________________________________________________________
| 372959 [djonavarro@g] just put
+ 372960 [djonavarro@g] Let me know what you are trying to do. I would love to help you because
+ 373187 [bhjdownload@] Sorry about the delay in replying but I have been wandering around the
+ 373192 [bhjdownload@] Your suggested format works like a charm (thanks so much) so I am now
  373200 [djonavarro@g] Not a problem, try interpolation with a for loop.
  373213 [djonavarro@g] ~ *****With regard to your question about what I am trying to do... The
  373214 [djonavarro@g] eek and the last little bit should be

e ten glofiish MS Mobile 6.1 pro OS cell phone
371712 [dglnz2@gm il] anyone here had experience with this device?

Cannot install a gem on Windows x64
371713 [kadishmal@gm] I am trying to install CUBRID Database Driver through "gem install
+ 371743 [luislavena@g] ads/
| 371778 [kadishmal@gm] I did. In fact, extconf.rb automatically includes the path. But I tried
| 371811 [luislavena@g] Under "Software Requirements for CUBRID Manager": MS Visual C++ 2008
+ 371744 [luislavena@g] ads/

Help with require in 1.9.2 p0
371714 [michel@de az] I have this strange bug with a chain of requires, after a certain number
371723 [michel@de az] Actually, it is due to some method_missing hack in a previously loaded

openssl certificate fingerprint
371715 [guidoderosa@] Sorry folks,
371717 [zregvart@gm ] the fingerprint is MD5 digest over the certificate in DER (binary)
371736 [guidoderosa@] Great! Thanks.

Recursion in a class method
371716 [iainspeed@gm] If I've written a class method that calls itself recursively is there a =
371718 [shortcutter@] virgin sacrifices must be working their magic) but wondered if that's A Re=
371722 [iainspeed@gm] Ok, thanks very much. Nice to know my natural way was the best way :)

how to broadcast a service over the network for clients to discover without any need for server IP
371719 [dearsaravana] how to broadcast/multicast a service over the network for clients to
371726 [zregvart@gm ] zoran

Options in a class
371728 [pal@pa be gs] I have some problems understanding the basics of classes and modules in
+ 371729 [wagner.andre] module Abc
| 371734 [jgabrielygal] irb(main):010:0> module Abc
+ 371733 [transfire@gm] ke
| + 371735 [jeremy@bo p.] def initialize(arg1, arg2, opts = {})
| + 371739 [pal@pa be gs] There it is. Thanks :-)
+ 371737 [pal@pa be gs] What about being able to pass different values to :color, like :color =>
| + 371738 [jgabrielygal] irb(main):028:0> module Abc
| + 371740 [jeremy@bo p.] module Abc
+ 371911 [pal@pa be gs] What if I would like to pass several values, with some set with a
  371914 [jeremy@bo p.] module Abc

A use case for strmask gem?
371730 [transfire@gm] simply b/c it had a certain logical sense to it. However, to this day
371741 [shortcutter@] Frankly, from the description it's not clear to me what this is
371755 [transfire@gm] Fair point.
371794 [shortcutter@] The term "escape character" for me has a different connotation: it is
threads.html
top