152641-153992

152422-154877 subjects 152777-155231

^ Re: Job Opportunity in Redwood City, CA
152641 [john gravity] If anyone local to Silicon Valley is interested in learning more about

^ YANQ: Nesting in YAML
152648 [basi_lio hot] How does one tell YAML to use an array substructure rather than a hash?
+ 152651 [lists kalama] require 'yaml'
| + 152654 [zdennis mkte] {"an"=>
| | 152658 [basi_lio hot] Yes, I screwed up the description of the problem big time. Here's a
| | 152661 [bg-rubytalk ] irb(main):051:0> h = {"x"=>{"aa"=>[2, 3], "bb"=>["boo"]}, "y"=>{"aa"=>[5],
| | 152665 [basi_lio hot] Thanks much. yeah, very useful.
| + 152767 [basi_lio hot] Your tip to use
+ 152659 [bg-rubytalk ] This doesn't look like a hash containing an array to me.  The "ps" entries
  + 152660 [basi_lio hot] You're right. Please see my posting more recent posting.
  + 152662 [basi_lio hot] in YAML
    152663 [basi_lio hot] But now I cannot get at the values ["weed", "sick"]
    152674 [jamal.hansen] I think h["y"]["cc"][1]["sea"][1] would return "sick" since "sea" is a
    152771 [basi_lio hot] Jamal,

^ is there a shorter way to compare these 2 objects?
152650 [lkirsh cs.ub] I have a class called foo and I want to make it comparable so that I can
152652 [james graypr] def <=>( other )
+ 152679 [bob.news gmx] Here are some other possible implementations using #inject... :-)
| + 152681 [simon.kroege] def <=>( other )
| | 152805 [lkirsh cs.ub] Cool, I didn't realize nonzero? returned anything useful other than
| + 152806 [lkirsh cs.ub] Those solutions are definitely cool but I find James' to be more
|   152862 [bob.news gmx] Yes definitely!  I just had some fun playing around with this. :-)
+ 152702 [james graypr] I misspoke a little here.  Arrays are NOT Comparable, but the DO
+ 152804 [lkirsh cs.ub] Great, this is *exactly* what I was looking for :)

^ Google's Sawzall
152655 [chaotrope jp] (abstract with pointer to PDF of full 29 page paper)
+ 152656 [lyndon.samso] Interesting timing, I've been doing some XQuery work and pondering how easy=
+ 152791 [meta pobox.c] You mean like AppleScript?
  + 152794 [gavin refine] FWIW, there is a JavaScript OSAX which allows you to write
  + 152809 [lyndon.samso] And Arexx on the Amiga ( and probably Rexx on MVS as well )

^ Novice Q: What's the difference between /\s*/ and /(\s)*/?
152666 [meng.yan gma] I'm new to Ruby and reading 'Programming Ruby 2/e' now. I encountered
+ 152673 [w_a_x_man ya] Without the captures, the substrings on which the string is split
| 152675 [meng.yan gma] Thank you, William.
+ 152676 [dooby d10.ka] You're not seeing the difference because of your assignments.
+ 153407 [julian coret] I'm not sure if someone's already answered this, but...
  + 153411 [gavin refine] Actually, using parentheses here will not affect what is matched,
  | 153416 [gavin refine] "Hello".match( /^\s*(\w+)/    )  #=>  "Hello" , nil
  | 153434 [jeff.darklig] Ok, now for a clean and simple answer...
  | 153438 [dblack wobbl] I believe that would be 10 :-)
  | + 153442 [jeff.darklig] Regarding nil values for groups
  | | 153481 [dblack wobbl] Oh, well, yes -- if there's no match for the group.  I was taking you
  | + 153443 [decoux moulo] moulon% ruby -e '"The gateway is broken ? yes / no ?" =~ /(yes)|(no)/; p $1,$2'
  + 153992 [meng.yan gma] Thank you, Julian.

^ read excel data in an array, doesn't work
152667 [saudaziz gma] I am trying to read entire row (with as many non-null columns are
152668 [saudaziz gma] Found it guys, nvm.
152687 [no spam.plea] Please post your working version! I need to use Ruby to load values
152696 [kevin.olbric] Are you trying to dump output to an excel file, or are you trying to add
+ 152718 [saudaziz gma] Nah, what i am trying to do is simply read row by row in excel file and
+ 153019 [no spam.plea] I know I can do the CSV route, but I wanted to progressively

^ Split up Excel row and assign cells to variables
152669 [saudaziz gma] Ok guys, so far i have the following. Right now as it is, it reads in
152833 [saudaziz gma] nvm, it was just piece of cake!

^ Erb on the Herb?
152671 [lyndon.samso] There seems to be some issue with the binding in ERB, any ideas?
+ 152689 [Stephan.Kaem] This line -^ is just some other output of ERB - there are no '<%' ...
| 152691 [twifkak comc] Not, according to the rdoc, when '%' is passed to ERB.new.
+ 152701 [james graypr] Works fine here.  I pulled the code right out of your email and
  152811 [lyndon.samso] Hmm, it would be interesting if a few others could try it, it may be=20
  152825 [twifkak comc] Works for me. Sorry!

^ gem & rdoc: How to avoid "Could not find main page name" warning when using gems?
152680 [sanobast-200] When I automatically the rdoc documentation of a gem I made, I always
152773 [chadfowler g] Chad Fowler

^ Getting an array back in xmlrpc?
152706 [greg.kujawa ] I started off passing back a single SQL record to my xmlrpc client
152708 [pit capitain] If this works
152710 [greg.kujawa ] Digging deeper into the docs I see that xmlrpc can only handle a one

^ [SUMMARY] Scheduling (#42)
152707 [james graypr] The problem space of scheduling is vast and complicated, but it's not too hard

^ #puts inside ERB
152709 [gavin refine] I see this has been suggested before, in [ruby-talk:126986] and [ruby-
+ 152845 [gavin refine] Here's my horrific hack that does it. It's particularly hacky because
| 152865 [discordantus] How about this? Still somewhat hacky, but maybe less breakable. It
| 152909 [gavin refine] charset=US-ASCII;
+ 152871 [lyndon.samso] Maybe replace _erbout with an IO object ( including StringIO? )
  152896 [gavin refine] It already works to have explcit _erbout.concat or _erbout.<< calls;

^ unless statement... why oh why?
152717 [zdennis mkte] thr = Thread.new{}
+ 152719 [zdennis mkte] ignore the "short-circuting" comment in reference to the or statement.
+ 152720 [brockweaver ] DeMorgan's theorem and operator precedence in ruby.
| + 152721 [patrick.fern] When you check thr directly, since thr is not nil (it is still a
| | + 152724 [brockweaver ] Sorry, to be a little more clear, the following 3 lines are all
| | | + 152728 [ruby.brian g] I am quite shure that the above is not correct.
| | | | 152734 [brockweaver ] Thank you for correcting me, Brian.  I got a little post happy I guess. :)
| | | + 152731 [dblack wobbl] I don't think its goal is to be shorter (apparently :-) but rather to
| | + 152726 [zdennis mkte] Yes this lets my brain see things in a very simplistic fashion. Thank
| + 152725 [zdennis mkte] Yep, thank you for the quick response!
| + 152736 [gavin refine] * Change all ANDs to ORs, and vice-versa
+ 152722 [ruby.brian g] (not a) or (not b) <=> not (a and b)
+ 152818 [hal9000 hype] I don't think it's a matter of short-circuiting, but

^ Idiomatic ruby version of this code?
152723 [brockweaver ] Showing off ruby to a coworker, and I want to emphasize how succinct yet
+ 152727 [ruby.brian g] If it where a one time solution, I'd do something like this. Though
| + 152733 [brockweaver ] Perfect!  Thank you for your quick response.  I decided to take the
| | 152744 [pit capitain] Note that all the offered solutions including your original version
| | + 152746 [Daniel.Berge] def switch(old, new)
| | + 152747 [pit capitain] Sorry, Ben's version works if you choose a non-existing temporary ending.
| + 152745 [gavin refine] mappings = { '.mp3' => '.temp', '.temp' => '.mp3' }
+ 152729 [bg-rubytalk ] def switch_endings(current_ending, new_ending)
+ 152730 [Daniel.Berge] Dir["*.mp3"].each{ |file|
+ 152732 [zdennis mkte] arr1, arr2 = Dir["*.mp3"], Dir["*.temp"]
+ 152742 [ruby-talk wh] You could use the tertiary operator to switch file names, but the (exp
| 152743 [Daniel.Berge] gsub and backreferences?  Why take that approach when File.basename is
| 152750 [ruby-talk wh] You understand he's trying to swap extensions, right?  (I think?)  Well,
| 152761 [Daniel.Berge] djberge@~/programming/ruby/temp-670>cat switcher.rb
| 152765 [brockweaver ] Thank you all for your replies.  I've chosen to use a cross between
+ 152800 [probertm acm] I know that this is kind of heretical, but in a situation like this, I'd
  153350 [pat.eyler gm] Sorry for being late to the party (and wildly off topic for a ruby-talk thread).

^ First Ruby Program
152735 [Tanton.Gibbs] I thought I would try my hand at a ruby program.  I am a C++/perl programme=
+ 152748 [james graypr] Welcome!
+ 152749 [gene.tani gm] the best thing to smooth perl > ruby conversion is Hal Fulton's purple
+ 152753 [gene.tani gm] i think the best thing to smooth perl > ruby conversion is the chapter
+ 152783 [meta pobox.c] I used to think the same. However, I eventually decided Ruby does the

^ any messaging frameworks in ruby
152737 [sunh11373 ho] Is there a messaging framework in Ruby like JMS in Java?
+ 152739 [Ara.T.Howard] check out ruby spread - it's on the raa.
+ 152741 [brianm apach] I have a client (protocol really, with a ruby impl) for talking to

^ MySql module for windows ?
152738 [ahidalgo bel] Where can I find the MySQL module for windows Xp?
152815 [demetriusnun] ...

^ Ruby Specifications
152740 [binary42 gma] Over the past few days I've been working on implementing my own (yet
+ 152752 [acharlieblue] I don't think now is a very good time to write out a specification,
| + 152756 [josh.charles] Is there a roadmap somewhere that contains a list of planned features
| + 152760 [binary42 gma] This might be the exact reason to use specs. Forward looking
+ 152759 [ptkwt aracne] There are probably some good things that could come out of a spec-driven
| 152763 [binary42 gma] Right. I guess some work could be done to expand those to complete
| 152764 [dion almaer.] Who needs specs when you can just have exegenesis/apocalypse style fluffing
| + 152766 [the.mindstor] #: Dion Almaer changed the world a bit at a time by saying on  8/18/2005 9:33 PM :#
| + 152787 [ptkwt aracne] I don't get it, what's the issue?  Ruby as it exists in it's current form
|   + 152829 [mailinglists] I think a language needs a formal specification.
|   | + 152870 [zimba.tm gma] It could be intereting to make specifications, it could show where the
|   | + 152890 [tesla.nicoli] I think this is one of the reasons that PHP is controlled mostly by Zend
|   |   152932 [Peter.Fitzgi] current
|   |   + 152943 [tesla.nicoli] Microsofts breaking of compatibilty is the reason I was looking for
|   |   + 152947 [clr7.10.rand] Isn't that where (unit) testing comes into play? So that errors like
|   |   + 152952 [josh.charles] in the case of .NET, however, the changes that are going to happen
|   |     152980 [tesla.nicoli] Yes a road map is a better way. Mostly because the specifications don't
|   + 152880 [the.mindstor] #: Phil Tomson changed the world a bit at a time by saying on  8/18/2005 11:26 PM :#
+ 152769 [dblack wobbl] My memory is that Matz said, at one or more of the RubyConfs, that he

^ require question
152751 [gaston.garci] =20
+ 152755 [ruby.brian g] Unlike with php ruby does not simple include the sourcefile at the
+ 152758 [ruby-talk wh] Gaston, welcome to Rubydom.  We've proven that we can be funny, but now
| 152770 [gaston.garci] Thanks Brian and Why. I see why it wasn't working.
+ 152768 [acharlieblue] That's because require doesn't import local variables from a file. They

^ How would I make object revision storage?
152757 [chris ambigc] in a system in something like Og.  It would be similar to how Zope (I think)
152762 [halostatue g] I'm not sure that this will work at this point, as running code can't
152797 [chris ambigc] Yes, I think I confused and simplified some issues in my mind here.

^ Protecting commercial ruby code with public/private key encryption
152772 [lists source] I was speaking with a co-worker today about the disappointment we feel
+ 152778 [mrcode netro] Things like this have been suggested before, but the basic problem is that
| 152802 [lists source] As a matter of fact, I just looked through an older thread that I had
| 152827 [mailinglists] If you ask matz for this it's no problem he can give you his
| 152954 [steven.jenki] Many security experts assert that transparency of mechanism enhances
| 152959 [mailinglists] For academics: yes.
| + 152962 [derek derekw] Maybe i'm reading this wrong, but it looks as though you're saying
| | 152967 [mailinglists] With such a simple stupid implementation that it can be written on
| | 153046 [meta pobox.c] In that case, public key encryption is way overkill. Just use AES, or
| + 152963 [steven.jenki] Sorry, that's just wrong. I'm not an academic, and what I know about
|   152964 [lists source] I believe all Lothar was trying to say is that on an academic level it's
|   152966 [kero chello.] "protect security IP", wth is that supposed to mean?
|   152968 [mailinglists] It's not the goal to make you believe it's secure.
|   + 152982 [kero chello.] Myeah, I think I misunderstood what you meant (no security IP, but just
|   + 153045 [meta pobox.c] Well, if that's your goal, you're a snake-oil company, not a security
|     153097 [kero chello.] That's wat I misinterpreted at first. He isn't selling security.
+ 152779 [florgro gmai] If your computer can run it I can see it.
| 152823 [rwoliver2 gm] This is just not an option sometimes. There still is a large place for=20
| 152844 [florgro gmai] I don't see why we would need to obfuscate source code on the server
| 152848 [rwoliver2 gm] With Zend, you can distribute your PHP scripts in an encoded fashion.=20
+ 152826 [lyndon.samso] Just like putting software logic into silicon, you could compile your=20
+ 152937 [derek derekw] If the code is encrypted, how are you going to decrypt it?
| 152948 [lists source] You're absolutely right...I did flub that in my description, didn't I?  I
| 152951 [josh.charles] The mono project allows you to create machine executable code by
+ 153009 [rhkramer gma] I'm not sure if you're talking about a specific type of encryption, but most
| 153013 [steven.jenki] Correct.
| 153027 [rhkramer gma] Thanks for the amplifications/corrections!
+ 153020 [druid.bpg gm] You can use Exerb (http://exerb.sourceforge.jp/index.en.html) fow
| 153050 [lymans gmail] (Unless it has changed recently) Please understand that if you open an
+ 153038 [tesla.nicoli] I use zend encoder now and again when I have a good idea and I don't

^ Python vs Ruby!
152776 [joevandyk gm] Which is better, Python or Ruby?
+ 152824 [twifkak comc] Joe,
+ 152828 [jcribbs twmi] Yesterday I had to give a short presentation to the big boss about Ruby
| + 152831 [Ara.T.Howard] thanks alot - very interesting.
| + 152911 [bret pettich] Could you show us an example of this? I'm sure i should be using blocks
| | 152923 [cribbsj oakw] Ok, here is a somewhat simplified code example.  Let's say you have a
| | 152930 [khaines enig] I *heart* that sort of query syntax.  You'll see much the same thing in the
| | + 152958 [igouy yahoo.] Good ole Smalltalk :-)
| | + 152985 [twifkak comc] def select
| |   153032 [jcribbs twmi] Well, it's like I said in my original post, this was an example of a
| + 153076 [rcs bgoark.n] You must be kidding! It is Python that has had the object oriented stuff
| | 153077 [rcs bgoark.n] My bad (it's late).
| + 153081 [the.mindstor] #: Jamey Cribbs changed the world a bit at a time by saying on  8/19/2005 3:18 AM :#
|   153083 [jcribbs twmi] I think I mentioned Python's lambda a paragraph or two above the one you
|   + 153084 [the.mindstor] #: Jamey Cribbs changed the world a bit at a time by saying on  8/21/2005 4:48 AM :#
|   + 153085 [jcribbs twmi] Oops!  I should have said, "because a Python lambda can only have an
|     153109 [adrianh quie] Of course Python might not have lambda's much longer. See <http://
+ 152832 [bg-rubytalk ] (checks the mailing list)
| 152841 [james_b neur] I find this somewhat baffling.  I'm aware that Matz was influenced by
| + 152847 [joevandyk gm] The style is different, sure, but a lot of the Perl shortcuts ($0, $$,
| + 152863 [khaines enig] I came to Ruby from many years of Perl zealotry, and one of the things that
| | 152874 [jim weirichh] Same here.  After using Perl for a number of years I was trying to move to a
| | 152879 [lucsky mac.c] According to my experience, it's because Python is just insanely
| + 152936 [snowzone5 ho] imho, this completely alienates newbies from the language.
| | + 152996 [james_b neur] Absolutely.  Over time, one hopes to acquire good taste in coding style
| | | + 153000 [jeff.darklig] or
| | | + 153022 [chrisgame ex] Is that what they teach in schools these days? What happened to
| | | | + 153025 [kero chello.] He makes a prototype, good engineering practice.
| | | | | 153044 [james_b neur] And "run right" can mean all sorts of things depending on the
| | | | + 153036 [khaines enig] That is software engineering when one has a list of business requirements, and
| | | | | 153080 [the.mindstor] #: Kirk Haines changed the world a bit at a time by saying on  8/20/2005 4:06 PM :#
| | | | + 153040 [twifkak comc] They taught software practice when you went to school? I learned from
| | | | | 153041 [khaines enig] I didn't say it was.  But the consideration of beauty is secondary.  Sometimes
| | | | + 153043 [james_b neur] Well, school never taught me to refactor, period.  But "software
| | | | + 153066 [corey.ssf.la] Well, in "hardware engineering", the first thing is probably a
| | | + 153073 [meta pobox.c] Unfortunately, beauty is difficult to retrofit.
| | + 153008 [w_a_x_man ya] Is something like this difficult in Python?
| + 153051 [adrianh quie] As somebody who used/uses Perl a great deal I found Ruby felt very
+ 152834 [james graypr] James Edward Gray II
+ 152836 [james_b neur] What makes Rails so appealing is that it is *not* bleeding edge.  Rails
+ 152864 [gene.tani gm] Besides SWIG, py has several mature well-documented libraries for
| 152867 [simon.kroege] At least for someone who never coded Perl, the mere existance
| + 152878 [halostatue g] I've been programming in Ruby for a while now, and I only know the
| | + 152884 [jim weirichh] I will tend to use $: for one-off scripts because I can never remember if it
| | | 152886 [simon.kroege] examples?
| | + 152910 [khaines enig] Austin, if you use the object interface for dealing with regular expressions,
| |   152924 [halostatue g] I know. That's why you won't see $1 .. $9 in my code. ;)
| |   + 152926 [dblack wobbl] Let's be fair, though.  It's $1 to $n :-)
| |   | 152935 [matt technor] In the interest of m18n, shouldn't that be USD1 to USDn?
| |   + 152928 [khaines enig] Hah.  Sorry.  After I sent the message it occured to me that I probably
| + 152939 [snowzone5 ho] $!, $_ $0 are my favorites.
+ 153809 [joevandyk gm] Well, good news.  While Ruby's not on the companywide "approved" list
threads.html
top