174579-175553

174367-175363 subjects 174746-178487

^ Sippet needed to convert from a string
174579 [w3gat nwlaga] Snippit needed
+ 174646 [lyndon.samso] eval is your friend for these type of tasks.
| 174729 [w3gat nwlaga] Thanks for the help.  This is just what I needed to get unstuck.
+ 174653 [wilsonb gmai] There's no way yet to "meta-programmatically" set local variables.  If

^ Redesign (was: Re: Snakes and Rubies Video and Audio Online!
174588 [f andreas-s.] By the way, because I saw it on your site: what's the status of the

^ Re: Redesign
174591 [ng johnwlong] It's going slower than we would have liked, but much of that has been

^ Splitting strings on spaces, unless inside quotes
174593 [richard livs] I want to split a string into words, but group quoted words together
+ 174600 [ruby-ml magi] s = 'foo bar "baz quux" roo'
+ 174603 [theaney cabl] How about the csv module? Despite the name, you don't have to use
| 174633 [ara.t.howard] briliant!
+ 174610 [james graypr] => "some words \"some quoted text\" some more words"
| + 174613 [mictro gmail] impressive
| + 174619 [dblack wobbl] Me too (end of disclaimer :-)
|   174621 [james graypr] You're right, that's better all around.
+ 174612 [matthew.moss] s = 'some words "some quoted text" some more words
| 174614 [matthew.moss] Just realized that Range responds to zip, so the to_a is unnecessary.
+ 174617 [fxn hashref.] Curiously, someone asked exactly that on freenode#perl tonight.
+ 174632 [florgro gmai] ...
+ 174935 [w_a_x_man ya] s = 'some words "some quoted text" some more words'
  174947 [geoffjacobse] s='one two"  "\'with quotes\' "three "'
  + 174949 [bob.news gmx] %r{"(?:(?:[^"]|\\.)*)"|\S+}
  + 175034 [w_a_x_man ya] This is not a "more complex case"; it is an invalid case.
    175110 [geoffjacobse] I agree my example doesn't match the originators request but *I think*

^ Problem Connecting to Oracle
174598 [mcarlson wsg] Howdy,
174652 [wilsonb gmai] Try taking the whole (((LOTS)OF)PARENS) definition for your DB from

^ state pattern?
174601 [mictro gmail] I found this State-pattern example on [1], and was interested to
174682 [bob.news gmx] Hm, I think you probably did not get there completely.  For example the
175026 [mictro gmail] =20

^ Re: Using ri inside irb -- error in Pickaxe?
174607 [ssmoot gmail] "*names.map" should be "names.map". The * before a variable name in a

^ [SOLUTION] Dice Roller (#61)
174615 [billk cts.co] Hehe, sorry, it's too early.  I'm just happy because I finally

^ Oniguruma lookbehind question
174622 [dblack wobbl] For some reason, lookbehind and alternation seem not to be playing
+ 174625 [sndgk393 ybb] Is this pattern work for you?
| + 174629 [dblack wobbl] [[nil, "\""], ["ghi jkl", nil], [nil, "\""]]
| + 174638 [dblack wobbl] Sorry -- I tested that accidentally with an old 1.9.0.  Yes, with
+ 174626 [rosco roscop] I'm not at all sure about this, but this is my take on it. Firstly, is
| + 174627 [rosco roscop] Oops, I mean nested regexps.
| + 174634 [rosco roscop] Argh, I meant 'if not'. I'm too tired now, I've spent too long perfecting
|   174636 [dblack wobbl] See Xavier's post.  My mistake was, essentially, expecting the first "
|   174640 [rosco roscop] Oh Damn it, yeah I see now. Wish I'd held my tongue now :D
+ 174630 [fxn hashref.] It shouldn't, since pattern-matching goes left-to-right \S will match
  174635 [dblack wobbl] OK, I see.  I was somehow discounting the fact that the first "

^ Iterator Fu Failing Me
174641 [james graypr] I have a group of classes, all implementing a parse?() class method.
+ 174642 [marcel verni] do/end doesn't bind tightly enough for the assignment to 'elements'. Using {}
| 174644 [james graypr] ?>   n * 2
+ 174648 [GFunk913 gma] Are "Write a new Enumerable method that mimics find but returns the
+ 174650 [ara.t.howard] module Parser
| 174695 [p.barbierder] Could you explain this module ?
| 174697 [ara.t.howard] yes.  just symetry/clarity.  is use this pattern alot.  even if someone
| 174734 [dblack wobbl] Wouldn't it be clearer just to write instance methods for a module?
| 175102 [ara.t.howard] generally i do just this.  however, i've found it extremely useful to be able
+ 174651 [ruby-ml magi] # Not tested
| 174688 [ara.t.howard] fails when no kind parses.  in this case the result will be
| 174720 [ruby-ml magi] You are (of course) absolutely right, it should be 'return result'
+ 174661 [gfunk911 gma] Are "Write a new Enumerable method that mimics find but returns the
+ 174671 [henrik.marte] I am not certain if this solution fits, but...
+ 174672 [binary42 gma] elements = tokens.map do |token|
+ 174678 [bob.news gmx] elements = tokens.map do |tok|
| + 174691 [ara.t.howard] nice.
| | 174692 [bob.news gmx] Yeah, but #detect is better here.  And if *I* say that another solution is
| + 174713 [james graypr] That's what I was looking for.  Thank you.
+ 174693 [hutch recurs] elements = tokens.map do |token|
| 174694 [bob.news gmx] Because this won't return the proper value from the block.  You need at
| + 174696 [p.barbierder] Well, looking at the documentation of ruby1.8, detect and find are
| + 174702 [hutch recurs] cut'n'past-o... oops
| | + 174706 [bob.news gmx] #detect - because it stops as soon as it has a hit while #select will return
| | | 174716 [hutch recurs] The trouble is that detect returns the 'x' not the result of
| | | 174732 [bob.news gmx] Aargh!  I shoul've tested more carefully.  Yes you're completely right.  But
| | | 174787 [hutch recurs] Personally, I don't like the break. It'd be very nice if there were
| | + 174708 [hutch recurs] That's wrong! That's twice I've done that. I'm going to go have a nap
| | + 174709 [hutch recurs] elements = tokens.select do |token|
| + 174710 [ mfp acm.org] Actually,
+ 174878 [justin.w.smi] Perhaps I'm missing the point, but wouldn't the following work: (?)
  174881 [james graypr] It works just fine, yes.  Just doesn't feel very Rubyish to me.
  174883 [rosco roscop] class Parser
  + 174885 [rosco roscop] For crying out loud I've done it again }:-{. Please ignore me.
  + 174887 [rosco roscop] r = tokens.inject([]) do |arr,token|
    174891 [rosco roscop] Damn it...
    174961 [hutch recurs] This thread is jinxed. :-)
    175028 [adam.shelly ] module Enumerable

^ ruby install conflict and ruby-dbi-all on debian 3.1
174654 [bill.comer.t] I am running debian 3.1(sarge, I think).

^ Re: - Requesting Comments for Process Definition and Presentation
174656 [gene.tani gm] I've said it before, i'll say it again; medical insurance premiums
175074 [ilias lazari] ...

^ compiling from the svn repository
174663 [didier.proph] Ok, so this might be a stupid question, but I just got the latest ruby
174668 [pan erikveen] $ vi README
+ 174776 [joevandyk gm] Just for clarification, autoconf is a program that generates a
+ 174917 [didier.proph] Oh my god, I feel like such a newbie, that's not even funny...
  174982 [Bill.Dolinar] I was playing around with the same thing over the weekend and found

^ make test-all with 1.8.4 on os x gives me 1 failure and 79 errors
174664 [didier.proph] Ok, so I just got the latest ruby 1.8.4, compiled, ran the tests and I
+ 174908 [didier.proph] Ok, so after closer analysis, all these errors are related to 'drb'
| 174909 [unixwzrd mac] I just successfully installed ruby-1.8.4 on my Mac.
+ 175248 [nakohl gmail] Didier,
  175256 [unixwzrd mac] I was able to get Ruby 1.8.4 to successfully compile on OS X 10.4.3

^ custom attribute accessors ?
174665 [akonsu gmail] i need to define a number of custom attribute readers on my class. so
174666 [ruby-ml magi] Hm, by your examples it would seem to be OK to

^ RMagick exporting pixels as string
174669 [ilmari.heikk] I'm exporting pixels to an OpenGL texture from Magick::Imageusing export_pixels.
174670 [ilmari.heikk] Did some more timing and pinpointed the problem:export-bgra: 0.557612pack: 4.761164
174673 [detlef.reich] try image.to_blob, that will return the image data as a string.
174683 [ilmari.heikk] Thank you so much, that did the trick.

^ regular expressions for beginners
174689 [narf968 gmai] There's been a number of questions about regular expressions in recent
+ 174690 [pere.noel la] i don' get colors even with the ansi termianl over MacOS X...
| 174719 [dharple gene] Works here[1]. What is your $TERM set at?
| 174722 [pere.noel la] thanks, right now i get reverse video for match.
+ 174727 [agafonkin gm] There's also a small tool (GUI) bundled with Ruby Development Tools for
  174934 [gene.tani gm] some other things that might help
  174954 [perrin apoth] The clearest explanation I recall seeing was . . . I think it was
  174959 [m.j.stott gm] There is an excellent book from O'Reilly -
  174962 [m.j.stott gm] If you don't have access to the O'Reilly book, here are some regex resource=

^ Re: One-liner for regex subsitition (with upcasing)!
174707 [bob.news gmx] It's especially silly as it matches the RX *twice* against the string.
174730 [bob.news gmx] I hope nobody's hurt. :-)

^ Plist parser for ruby
174717 [patrick hexa] The method Plist.parse_xml( filename ) returns a plist file as a tree

^ module_eval: create method that contains value passed to it?
174721 [henrik nyh.s] This is a Rails example, but I think the problem is a general Ruby
+ 174724 [james_b neur] Perhaps, but it would be more helpful to isolate the problem by removing
+ 174733 [bob.news gmx] class X
+ 175100 [ara.t.howard] this can be done with closures or a storage/search-path scheme.  the traits

^ Ruby after the tutorial
174743 [daren.reavis] I am a PHP developer and have just begun to investigate Ruby.  I have
+ 174745 [agorilla gma] Poke through the archives, when you find one that interests you, give it a shot.
+ 174748 [ruby anthrop] } I am a PHP developer and have just begun to investigate Ruby.  I have

^ Ideas on "Why Living Dangerous can be A Good Thing" in Ruby?
174744 [gregory.t.br] After my first day back at my University, I was quickly reminded that
+ 174749 [ruby anthrop] } After my first day back at my University, I was quickly reminded that
| + 174752 [gregory.t.br] These two.
| | + 174755 [gwtmp01 mac.] If there are vulnerabilities, who are the attackers?  I think there are
| | | + 174756 [gregory.t.br] Actually, this is not the issue at hand.  This really *does* boil down
| | | | + 174757 [james_b neur] Prevent what? One can build twisty, loopy, self-modifying code in Java,
| | | | | 174759 [gregory.t.br] Though that's funny, I really think it was part of the plan for Java.
| | | | | 175492 [pete flooble] ....which is all part of the appealing-to-management[0] concept of
| | | | + 174760 [gwtmp01 mac.] Yes but the testing should identify if the modifications and
| | | | | 174765 [gregory.t.br] I agree with this and actually am not one who has concerns at all
| | | | | 174801 [james graypr] It's a blessing and a curse, like most things.  Infinite power,
| | | | + 174800 [james graypr] Sentences like the above always read to me as:  "Java was designed to
| | | |   174839 [slitt earthl] I like being protected from myself. I'm an excellent analyst, designer, and
| | | |   + 174841 [james graypr] James actually.  ;)
| | | |   | + 174852 [perrin apoth] Surprised, at least.
| | | |   | + 174853 [slitt earthl] Compare them to C :-). Or Perl.
| | | |   |   174855 [gregory.t.br] I'm really not sure at all on this but could well written C or Perl be
| | | |   |   174857 [slitt earthl] C is like using a punch press without safety interfaces. A very careful person
| | | |   |   174871 [perrin apoth] C is a punch press with no particular safety features, and in fact it
| | | |   + 174847 [gregory.t.br] ...
| | | |     174856 [slitt earthl] Everyone says that, but I don't see it (til it hits me in the eye? :-).
| | | |     + 174863 [gregory.t.br] Well, that's kind of what this whole thread is about.  There are a lot
| | | |     | 174903 [james_b neur] I think my message-oriented programming post on O'Reilly demonstrates
| | | |     | 174907 [ryansobol gm] Indispensable uses of Ruby meta-programing.
| | | |     + 174865 [dblack wobbl] I'm not sure what you mean by adding an instance variable to a class,
| | | |     | 174897 [slitt earthl] I don't know for sure, because when I read about this stuff my first reaction
| | | |     | + 174899 [hal9000 hype] No, that is a little more dangerous.
| | | |     | | 174906 [gregory.t.br] Not all objects, but if your goal is to hold a ton of 'never before
| | | |     | + 174960 [dblack wobbl] I think you mean method_missing.  It has nothing to do with instance
| | | |     + 174867 [gwtmp01 mac.] I'm not sure I follow this.  You think that subclassing at runtime is
| | | |     | + 174875 [james_b neur] Really? I  thought they were simply reparsed by method_missing into
| | | |     | | + 174880 [gwtmp01 mac.] I'm not a rail's guru, but that was my recollection when I looked
| | | |     | | + 174894 [gregory.t.br] I'm a lot more liberal (and maybe naive) in my definition of metaprogramming.
| | | |     | |   174895 [dblack wobbl] Interestingly, <finish me later> is, in a sense, what yielding
| | | |     | |   174905 [gregory.t.br] But is that yet another piece of the puzzle?  Is the fact that ruby
| | | |     | |   174963 [dblack wobbl] It's not that central a question to me.  In my own work with Ruby, I
| | | |     | |   175030 [gregory.t.br] Same here.  My concern is with the fear it seems to cause in people
| | | |     | |   175036 [gwtmp01 mac.] What is being feared?   I'm still not entirely
| | | |     | |   + 175047 [gregory.t.br] If you remember from our first New Haven Rubyists meeting, there was a
| | | |     | |   | 175054 [gwtmp01 mac.] I remember.   I'm just trying to understand the concern at a finer
| | | |     | |   | + 175056 [gregory.t.br] I've asked my CS advisor to come up with her concerns in the form of
| | | |     | |   | + 175060 [gwtmp01 mac.] Just to be clear.  I'm not thinking of Greg as the patient.  I'm talking
| | | |     | |   |   175071 [gregory.t.br] However, this does NOT neccessarily mean I am in no need of therapy ;)
| | | |     | |   + 175050 [gregory.t.br] The fear in part has to do with type checking.  Ruby being typeless
| | | |     | |     175055 [james_b neur] Ruby is not typeless.
| | | |     | |     175070 [gregory.t.br] Aren't all ruby objects under the hood of type VALUE?
| | | |     | |     + 175077 [dblack wobbl] But Ruby != Ruby-under-the-hood :-)
| | | |     | |     | 175083 [gregory.t.br] True. :)
| | | |     | |     + 175079 [james_b neur] How far under the hood do we want to look?
| | | |     | |       175088 [gregory.t.br] This page did explain what I was wondering, thanks.
| | | |     | |       + 175201 [novakps gmai] Some of the anxiety that those from a statically-typed background
| | | |     | |       | + 175205 [ryansobol gm] Well put.
| | | |     | |       | + 175210 [slitt earthl] Or for some of us it's just the opposite. I started on a Heathkit ET6800
| | | |     | |       + 175404 [james_b neur] These links may be relevant to the general thread
| | | |     | + 174898 [slitt earthl] I'm trying to understand this. If Model.find_by_city was never defined, how
| | | |     |   + 174900 [hal9000 hype] What you're missing is method_missing.  :)
| | | |     |   + 174904 [gwtmp01 mac.] I think Hal already answered this, but yes.  If your class defines
| | | |     + 174924 [henrik.marte] REXML attribute list  based on its name and namespace. The REXML
| | | + 174758 [gregory.t.br] This is a good point.  It's hard to make a general statement about
| | | | + 174761 [gwtmp01 mac.] I can understand the namespace issues.  How can I as a programmer
| | | | | 174766 [gregory.t.br] Honestly, I don't see this issue either.  It's just a common point the
| | | | | 174794 [gwtmp01 mac.] One of the things I really liked about Bertrand Meyer's _Object Oriented
| | | | | + 174806 [james graypr] not_my_object.instance_eval { @secret_value += 1 }
| | | | | | + 174822 [gregory.t.br] This is definitely a point worth making, that *most* people know that
| | | | | | | 174826 [james graypr] If you are compiling this information for a written piece, I suggest
| | | | | | | 174827 [gregory.t.br] Well that depends on who put the secret value there, doesn't it? ;)
| | | | | | | + 174828 [james graypr] Code that writes code.
| | | | | | | | + 174830 [gregory.t.br] "Metaprogramming is the writing of programs that write or manipulate
| | | | | | | | | 174832 [dblack wobbl] I'd make a distinction between the "classes are objects too" thing,
| | | | | | | | + 174831 [dblack wobbl] Do you mean it's synonymous with code generation?  I don't think I'd
| | | | | | | | + 174918 [toddkennethb] Ruby?
| | | | | | | | | 174923 [gregory.t.br] I'd like to quote this snippet as the beginning of my article, is that okay?
| | | | | | | | | + 174965 [dblack wobbl] I agree -- really "Ruby" in the sense we're talking about is more than
| | | | | | | | | | + 174993 [slitt earthl] To get Ruby to do bad stuff, you need to enunciate quite clearly that you want
| | | | | | | | | | + 175029 [gregory.t.br] David, if it wasn't fully clear, I was being somewhat facetious when I
| | | | | | | | | + 174987 [toddkennethb] [snippet]
| | | | | | | | |   174995 [toddkennethb] BTW, I should mention that using a quote like that may -- to your
| | | | | | | | |   175027 [gregory.t.br] I plan to go in reverse of that ;)  I *want* it to sound pretentious,
| | | | | | | | + 174926 [toddkennethb] A shiver goes up my spine :)
| | | | | | | | + 174937 [toddkennethb] A shiver goes up my spine :)
| | | | | | | + 174835 [james_b neur] An element (the key element?) of meta-programming is the creation or
| | | | | | |   174836 [gregory.t.br] "When code is designed to dynamically write or modify it's own code or
| | | | | | |   174838 [dblack wobbl] s/'// :-)
| | | | | | |   174846 [gregory.t.br] Thanks :)
| | | | | | |   174848 [dblack wobbl] I still don't have what I consider a complete fix on what we
| | | | | | |   174850 [gregory.t.br] Agreed. It's what makes us barbers instead of butchers, a nice big mirror :)
| | | | | | + 174823 [gregory.t.br] Let's think of examples where this certainly is true and results in
| | | | | + 175229 [brian.takita] If you like, you can use the method_added callback to see when a class gets
| | | | + 174957 [eeklund gmai] I hope that's useful; feel free to edit and add/change/add discussion.
| | | | | 175022 [igouy yahoo.] Does a language with type-inference require as many type and variable
| | | | | 175059 [eeklund gmai] Does a reference to declaring types and variables make it clear to you
| | | | | 175072 [igouy yahoo.] No
| | | | + 175084 [gavin refine] There seems to be some sort of logical fallacy at play here, but I
| | | |   175085 [gregory.t.br] I am not trying to prove that Ruby's openness is right for everything
| | | + 174774 [joevandyk gm] From who?  Probably stupid programmers who would look up the library's
| | + 174764 [ruby-ml magi] You might perhaps point out that professional Smalltalk, Lisp and other
| |   174767 [gregory.t.br] This is a good point.  In languages like C++, your security can really
| |   + 174778 [henrik.marte] It is a good point when comparing Ruby and C++, but it is unlikely to
| |   + 174803 [placey wande] Don't let the java guys off so easily, either.
| + 175553 [Mail Jonas-H] 4) is about social security. the private and protected stuff I know of java and all those things enable the tool language to be used by management to enforce devision of work.
+ 174754 [james_b neur] Here's a common case for me.  I often have some code that needs to
threads.html
top