155783-165976

155543-157530 subjects 155990-159395

Re: [sydney-devel] Re: [RFC] The Early Demise of Myriad (Thanks To Ruby Threads)
155783 [jos@ca no k.] One obvious thing would be to make sure the Sydney changes are available

Fwd: [SOLUTION] NDiff (#46)
155786 [james@gr yp ] ...

Re: [SOLUTION] NDiff (#46)
155787 [jim@fr ez .o] That's interesting. Did you try

Assert_throws
155789 [Peter.Fitzgi] ...
+ 155791 [drbrain@se m] You want assert_raises.  Exceptions are raised, Objects are thrown.
+ 155792 [james@gr yp ] assert_raise(WIN32OLERuntimeException) { bad_call_goes_here() }
  155793 [Peter.Fitzgi] Ok.  I just read assert_raises is deprecated in 1.9 and will be deleted
  + 155794 [Peter.Fitzgi] Hmm..
  | 155805 [drbrain@se m] Try ::WIN32OLERuntimeException
  + 155812 [drbrain@se m] $ cat test.rb
    155815 [Peter.Fitzgi] There's a comment in the docs
    + 155817 [james@gr yp ] Then doesn't that just mean that we should be using assert_raise()
    + 155822 [drbrain@se m] $ ruby
      155920 [chneukirchen] But the docs say it *will* be deprecated in 1.9, not it *is*

Install Ruby under Windows
155796 [pete.barlow@] Sorry if I'm missing something here but I can't get the links to the
155797 [langstefan@g] You can download the One-Click Installer for Windows
155799 [pete.barlow@] Sorry, Stefan I get the same error - I'm using Firefox but tried with
155804 [halostatue@g] I can navigate to it.
155900 [pete.barlow@] It looks as though my ISP's DNS is resolving the name incorrectly as I
155977 [pete.barlow@] Something very wierd going on. I can tell that 66.92.150.242 is
155985 [wilsonb@gm i] Assuming you trust me not to have trojaned the installer, I've

Re: NDiff (#46)
155802 [paul.vaillan] I didn't mainly because I wasn't subscribed to ruby-talk or the news

best way to create an XML form editor using ROR?
155813 [xpamela9223@] using XML schema. Is there a fairly simple way to do this in general?

win32ole and associators
155820 [Daniel.Berge] Ruby 1.8.2

BEGIN and END vs. blocks
155823 [leonardo.pir] I know that { ... } and do ... end have differente precedente. But,
155829 [drbrain@se m] $ ruby
155864 [leonardo.pir] I think that's partially true. The curly form has a higher precedence
+ 155882 [bob.news@gm ] It's evaluated and the result is the argument to foo: your code is
+ 155903 [chrisgame@ex] So where does precedence come in?
  + 155905 [leonardo.pir] "Braces have a high precedence; do has a low precedence. If the method
  | 155973 [drbrain@se m] if (in_def || in_single) {
  + 155919 [gavin@re in ] foo goo { 'bar' }
  + 155925 [rhkramer@gm ] Maybe this will help (this is Hal Fulton's reply to me from about a month

[ANN] RUnits 0.0.0 - basic unit conversions
155825 [richard@li s] I had the need to implement some unit conversions and so used it as an
155950 [ehames@gm il] I already posted this comment on your website, but I send it to the
155955 [richard@li s] Thanks.

Adventures in html decoding.
155828 [taria@th -a ] From the "If you want it done right, do it yourself... maybe"
+ 155830 [jim@fr ez .o] This may be off topic, but I always wonder why all the flags to File.
| 155832 [taria@th -a ] Well, in this case, I don't believe it's possible to
| 155834 [Ara.T.Howard] O_EXCL When used with O_CREAT, if the file  already  exists  it  is  an error
| 155837 [taria@th -a ] ... And I barely understood a word of that. `.`
| 155839 [Ara.T.Howard] it means that O_EXCL fails silently on some kinds of filesystems, including
+ 155831 [SimonKroeger] the moral is, there is always a simpler way :)
  155844 [w_a_x_man@ya] require 'cgi'
  155855 [taria@th -a ] I think you might have reached the point where
  155869 [jim@fr ez .o] ARGF is a reference to $stdin.
  155889 [w_a_x_man@ya] An object providing access to virtual concatenation of files
  + 155892 [simon.kroege] that just proofed my moral :-D
  + 155924 [gavin@re in ] ...
  + 155954 [meta@po ox c] I disagree. ARGV is familiar to anyone who's ever written C, C++,
    + 156023 [w_a_x_man@ya] class, map, join, __END__, DATA, <<HERE, grep, flatten
    + 156024 [dblack@wo bl] You make it sound like learning something from a ruby-talk thread is
      156526 [martindemell] Nicely put :)

[Rails] form_tag & form_remote_tag html id
155843 [brian.takita] Is there a way to set the html element id for the form_tag and
155845 [drbrain@se m] Eric Hodel - drbrain@segment7.net - http://segment7.net

[SOLUTION] NDiff (#46)
155846 [daniels@pr n] ...
156154 [james@gr yp ] Nice solution.
156166 [daniels@pr n] yeah - I played around with that section a bit and the collect was from

[OT] Choosing an open source license
155847 [debbie@th an] I'm working on a server program and I'm trying to decide which open
+ 155850 [drbrain@se m] I don't suspect you'll get anybody to use your software then.
| 155853 [blargity@gm ] You'd discover them advertising their server for open use and notice it's not
+ 155852 [robby.lists@] This isn't very typical of the open source model. One of the attractions
+ 155881 [snacktime@gm] ...
+ 155897 [chanezon@gm ] ...
  155997 [christophe.g] Damn! Someone beat me to it :) .
  + 156000 [halostatue@g] I will not use software that has this restriction. Period. Over time,
  | 156001 [Ara.T.Howard] i always release my stuff under the ruby liscense - any problems with this?  i
  | + 156011 [jtregunna@bl] If that's the case, then you'll want to opt for something less
  | + 156012 [halostatue@g] No, because of the nature of dual licensing. Let me be clear -- I
  + 156010 [jtregunna@bl] I would disagree with that portion of your statement, in that the goal
  + 156025 [snacktime@gm] ...
  + 156027 [rhkramer@gm ] +1

Lazy and Data Flow Variables REDUX!
155848 [nugend@gm il] Since my last correspondance on making Lazy evaluation and Data Flow

Re: Choosing an open source license
155859 [debbie@th an] I agree to the two things that you stated above: (1) "allow you to take
+ 155862 [james_b@ne r] I believe this issue has come up with regards to companies such as
+ 155868 [robby.lists@] I don't belive there are any well known licenses that will meet #2.
+ 155871 [blargity@gm ] I now have a much better idea where you're coming from.  I'm still not sure if
| 155915 [rhkramer@gm ] I would suggest that you join two other mail lists, lurk a little while, and
+ 155887 [jtregunna@bl] Well your idea here wouldn't stand up in a court of law (in the USA or
  + 155890 [jtregunna@bl] Sorry for the extra post, but I thought it prudent I mention that I am
  + 155943 [ news@ja .f ] jtregunna@blurgle.ca says...

Quick question.
155863 [blargity@gm ] Alright, I feel like an absolute idiot, but the question is simple, and 30
+ 155866 [daniels@pr n] or maybe
+ 155867 [ef@al m. it ] t's=20
+ 155883 [bob.news@gm ] => [" 123.46", "-123.46"]
  155921 [ruby.brian@g] Or you can use the % operator on a string which I like better. I.e.
  155923 [gavin@re in ] Just remember that if you have multiple formatted pieces in the same
  165974 [netcam@gm il] ...
  + 165975 [drbrain@se m] printf(3) completely explains format strings.
  + 165976 [ljz@as as .c] Try this:  printf("%07.2f", val)

Some suggestions
155872 [christophe.p] Dear,
+ 155874 [nobuyoshi.na] There's no such method Thread#stop.  Threads can stop only
| 155875 [christophe.p] Indeed, I noticed that too late.  So please disregard the comment about
+ 155884 [bob.news@gm ] => "ccc"
  + 155904 [christophe.p] Yip, thank you :)
  + 155918 [gavin@re in ] Isn't #strip for leading/trailing only? (A combined lstrip and
    156064 [bob.news@gm ] Right!  Thanks for the correction.

[ANN] acts_as_taggable 1.0.4 now gemified!
155878 [demetriusnun] The acts_as_taggable mixin is now available as a shiny gem.
155879 [jqshenker@gm] Woohooo!Great work, keep it up!

Problem with Tcl/Tk in Ruby
155893 [untzkhan@ya ] I am a Ruby newbie... I use Mac OS X Tiger and tried building a
155894 [nagai@ai ky ] Probably, your tcltklib is compiled to use X Window System.

possible bug?
155895 [skaes@gm .n ] I have a piece of code which I think should be working, but it doesn't.
+ 155896 [skaes@gm .n ] ...
+ 155898 [pierre.barbi] def standard_dev(a, mean)
  155899 [skaes@gm .n ] Dang. I copied this from code for computing the average, which is

hash and "=="
155908 [briankbuckle] In the Java world when one overrides "equals" in a class it is also
155971 [drbrain@se m] You'll need to define #hash and #eql? as well.
156256 [briankbuckle] What is the difference between "eql?" and "=="  in Ruby?
+ 156258 [bob.news@gm ] => false
+ 156300 [drbrain@se m] #eql? is only used by Hash to determine if two keys (#hash) collide.

find executables on windows
155922 [Ara.T.Howard] def find_bin bin
+ 155926 [nobu.nokada@] See find_executable in lib/mkmf.rb.
| 155931 [Ara.T.Howard] 10 minutes to wait for an answer and it's already written - i don't know what
+ 155927 [dave@bu t. d] Ara.T.Howard asked...
  155929 [simon.kroege] ...If the filename does not contain a directory path, the system
  155933 [Ara.T.Howard] i think i'll settle for PATH ;-)
  155935 [Daniel.Berge] require "ptools"
  + 155937 [simon.kroege] You asked...
  | + 155940 [Ara.T.Howard] glob = File::join(dirname, basename) << '*'
  | | 156008 [dave@bu t. d] The order _is_ important. With PATHEXT=.com;.exe;.bat..., foo.com will be
  | + 156020 [nobu.nokada@] Currently, ruby.exe doesn't see PATHEXT.
  + 155939 [Ara.T.Howard] lot's of good stuff in there - i'll take it ;-)

RubyGems hangs while updating the source index.
155928 [itsnotvalid@] Again. Since last time I asked this question it was a month. Still no
155934 [halostatue@g] What's your OS and pertinent configuration information (Ruby version,

How to tell ruby where header files are?
155930 [tuupola@ap e] I have sqlite3 installed in /usr/local/sqlite3. Thus
155936 [tuupola@ap e] #gem install sqlite3 -- --with-sqlite3-dir=/usr/local/sqlite3

reopening stdin
155932 [    v@vs .r ] I have a script.rb which reads some data from stdin.
155942 [Ara.T.Howard] well, here you setup stdin of the script.rb to be a pipe and therefore it has
155945 [    v@vs .r ] Yes, it was exactly what I was asking

yet another simple command-line option parser
155941 [eric_mahurin] It is a simple option parser that has option defaults and
155946 [jim@fr ez .o] That's pretty interesting Eric, to grab the type off the default.
155952 [eric_mahurin] Thanks for the input Jim.  Comments below.  I'm also putting
155967 [jim@fr ez .o] I was just thinking it would be strange for me to write
155995 [eric_mahurin] From my perspective, the only reason for the distinction
156002 [jim@fr ez .o] In one way what you are suggesting is just a serialization
+ 156013 [eric_mahurin] obj.class.from_s(obj.to_s) == obj #=> true
| 156077 [gavin@re in ] #from_s is a good design pattern for your own classes. Do it.
| 156102 [eric_mahurin] It is not for consistency.  It is for converting a string to a
+ 156040 [ruby.brian@g] We don't have puts, but we have display
  156119 [eric_mahurin] I forgot about that one.  This would be great to override if

Help finding a leak
155948 [awertyui@gm ] I'm having trouble finding out why my program leaks like the titanic.
155956 [ttate@tt ky ] To be sure, the program leaks,  but I won't be able to fix it soon.
156132 [awertyui@gm ] Thanks for your help everything almost works now.  The only problem I
156296 [awertyui@gm ] I'm an idiot. I was calling it with the wrong parameter.  Everything

Sets, uniqueness not unique.
155949 [hgs@dm .a .u] I have been splitting a comma separated values file, and putting
+ 155953 [dblack@wo bl] I notice you mentioned comma separation but you're splitting on a
| 155961 [hgs@dm .a .u] Yes, sorry, I was using the generic term for this, to facilitate
+ 155958 [Ara.T.Howard] s0 = Student::new 'a', 'b', 'c', 'd', 'e'
| 155964 [hgs@dm .a .u] Hmmm.  Yes, I should have more unit tests!
| 156118 [chneukirchen] class Student
| 156127 [hgs@dm .a .u] That does seem to preserve the properties I need for strings, and is
| 156260 [chneukirchen] Well, you just list all instance variables that define the
| 156263 [bob.news@gm ] Kind regards
| 156266 [hgs@dm .a .u] code << "def hash() " << fields.map {|f| "self.#{f}.hash" }.join(" ^
| 156273 [bob.news@gm ] Definitely!
| 156278 [hgs@dm .a .u] Oh, then it's exclusive or.  I'm clearly being as sharp as a sponge
| 156394 [bob.news@gm ] I'll have to remember that phrase - I could use it myself from time to
| 156413 [hgs@dm .a .u] Yes, good point, the result of the block....
| 156416 [bob.news@gm ] Yep.
| 156421 [hgs@dm .a .u] I wasn't following closely enough. :-)
| 156423 [bob.news@gm ] Someone talked about his brain behaving like cottage cheese today... :-))
| 156426 [hgs@dm .a .u] There is that. :-)
| 156463 [bob.news@gm ] Erm, if you want to use bit AND instead of modulo you have to use
| 156470 [hgs@dm .a .u] Looks like it still is then...
| 156472 [hgs@dm .a .u] Which, (having tested it) means my previous reply was complete
+ 155962 [dblack@wo bl] def include?(o)
  + 155965 [hgs@dm .a .u] Yes I was, but it turns out that it was with the certainty that comes
  + 156069 [hgs@dm .a .u] Right, there is some definite wierdness going on here.  I removed
    156080 [ mfp@ac .o g] VALUE
    156088 [hgs@dm .a .u] ...
    + 156108 [Ara.T.Howard] < snip code >
    + 156115 [ mfp@ac .o g] batsman@tux-chan:~$ cat /tmp/fdsfdsdsd.rb
      156126 [hgs@dm .a .u] ...

dual pipes?
155969 [transfire@gm] Is there a way to fork a seperate ruby process (i.e. a clean
155982 [Ara.T.Howard] might want to check out my slave lib... it sets up a drb object in a child
156006 [transfire@gm] That's an interesting solution. I noticed mention of unix socets in the
156016 [Ara.T.Howard] probably not that way...  if you look at the source i imagine you could tweak

Surprising Regexp Behavior
155970 [james@gr yp ] I keep running into some surprising points with Ruby's Regexp engine
+ 155974 [pit@ca it in] James, what did you expect? Both examples look perfectly valid to me.
| 155975 [Daniel.Berge] What's the bug to you?  The fact that the second set of <p></p> wasn't
| 155979 [james@gr yp ] Yep, that's what I was forgetting.  Thanks for the lesson.
| 155983 [Ara.T.Howard] thank dave thomas - the pickaxe (html version I) is always open in my browser
| 155988 [Daniel.Berge] Also see http://www.zenspider.com/Languages/Ruby/QuickRef.html#10
+ 155978 [Ara.T.Howard] irb(main):001:0> html = "<p>one</p>\n\n<p>two</p>"
+ 155980 [dblack@wo bl] In both cases, if you use the /m modifier, the dot will match \n, and
+ 156066 [bob.news@gm ] Maybe I overlooked something but I didn't see anybody mention it: the
  156076 [james@gr yp ] So I could check to see if there was more content after the first
  156081 [bob.news@gm ] html.sub!(/(<p>)(.*?)(<\/p>)(.*)/) { $1 << $2.strip << $3 }
  + 156082 [james@gr yp ] The method takes a chunk of HTML and pulls the first paragraph out of
  | 156084 [bob.news@gm ] def excerpt( textile, id )
  | 156087 [james@gr yp ] That's not equivalent.  You're missing a space between html's content
  | 156092 [bob.news@gm ] Right.  But hey, that's an easy change, isn't it? :-)
  + 156090 [Ara.T.Howard] it never occured to me that regexes could be made to be context sensitive in
    156094 [bob.news@gm ] No.  The block is just for the replacement.  It doesn't change anything

Re: Win32 gem for RMagick 1.9.1
155984 [rmagick@gm i] Nick, did you run postinstall.rb?
155994 [vanweerd@gm ] Thanks. I just realized that an ran it.
156007 [cyclists@nc ] These are the kind of messages that I'd expect if you somehow loaded
156014 [vanweerd@gm ] It was loading twice, as I noticed with some debug statements.

Ruby-VTK on windows.
155987 [gnanavel.s@g] I wanted to use Ruby-VTK, on windows, how can I use it? I don't have

Assigning to dynamic class attributes
155989 [dba@gi de s.] Ruby n00b here, but experienced in Perl and Python and many others,
+ 155991 [jeem.hughes@] @@cols.each { |c| self.__send__ "#{c.to_s}=".to_sym, arec.shift }
+ 155999 [dooby@d1 .k ] If you're going dynamic, the need for attribute accessors is reduced.
  156072 [gavin@re in ] While :@cremote is a valid symbol, it sort of implies that the @
threads.html
top