46773-47326

46553-47644 subjects 47053-48836

is_clonable?
46773 [transami@tr ] is there a way to determine if an object can be cloned or not?
46782 [pbrannan@at ] If it is not clonable, then the clone method should be private or

Unit testing is considered harmful
46776 [mikkelfj-ant] I'm sorry, I could help it. I just find this considered harmful thing
+ 46779 [billk@ct .c ] Coincidentally, I submitted a question about this--CodingChallenge0002
| 46790 [dblack@ca dl] I can't suppress a smile at the idea of my being used as an example of
| + 46803 [gsinclair@so] Spreading the requirements around is a problem, but in these circumstances
| + 46813 [rich@in oe h] Not being "schooled" in unit test development, but contributing several
|   46949 [cjs@cy ic ne] This is actually a very important part (or consequence) of the "test
+ 46817 [lyle@kn lo y] I suspect that Mikkel worded the opening line for his post this way
  + 46818 [hal9000@hy e] W.
  + 46819 [mikkelfj-ant] I actually I meant couldn't - but of course I could help it. The ironey of
  + 46848 [alwagner@tc ] I still have his book "a discipline of programming" here at my desk.  I never

The problem with using $1 in regexps
46780 [pmak@an me l] sub _num_quotes {
+ 46781 [tom@li ux ri] return length($1) if $_[0] =~ /^(>+)/;
+ 46784 [x@ic im nk .] The advantage to the OO syntax is that a non-match would raise an error
| + 46785 [x@ic im nk .] For the sake of correctness you would not be calling MatchData#size, but
| + 46820 [matz@ru y- a] Ruby's $digits are *not* globals, despite of their appearance.  They
|   46936 [gsinclair@so] Good programmers use $1 etc when porting Perl to Ruby.  They're not *that*
+ 46814 [nobu.nokada@] # If you were really made a subroutine, you must not meet the

rd2 no longer part of Windows Ruby distribution?
46795 [james@ja es ] I'm rebuilding a PC, and have installed the one-click-install Windows

Economics of E-books? ( was re: Dr. Dobbs Ruby Article)
46827 [james@ja es ] Recently I was shopping online, looking on bn.com for a particular book.  I
+ 46931 [nojgoalbyspa] without
+ 46935 [gsinclair@so] Charging the same price for an e-book as a hardcover seems ludicrous to me.
  + 46938 [Dave@Pr gm t] The reality is that no technical book author writes with the
  | 46944 [patrick.benn] Well, if it's any consolation Dave, I knew your book was available
  + 46939 [james@ja es ] Had I gone on using Java I likely would have bought Thinking in Java.  I had

Benefits of PragDave's MSVC install
46829 [mikkelfj-ant] There were a long discussion on taking the Ruby Windows install to MSVC.
46831 [Dave@Pr gm t] That's great to hear.
46833 [mikkelfj-ant] Uh sorry, it was Andy I was thinking of, really.
46858 [ptkwt@sh ll ] How about PragDave and AgileAndy?

Embeding Ruby in C++ code.
46837 [kmak@cs .a t] #include <ruby.h>
+ 46879 [batsman.geo@] Maybe you need to use the C linkage conventions, ie 'extern "C"'.
+ 46990 [pbrannan@at ] VALUE do_something(VALUE /* self */, VALUE str)

def sqr x = x * x end
46839 [mikkelfj-ant] I find
46840 [harryo@zi .c] Surely, though, the first implies the method has a side-effect of changing the
46842 [mikkelfj-ant] the

Ah, I'm finally back from Japan ...
46841 [dossy@pa op ] Not like anyone cares (or noticed) but my two week stay in Japan
+ 46857 [transami@tr ] glad to have you back. did seem like something was missing around here
+ 46865 [michael_s_ca] So go the other way and cross it "correctly".  =)
  46873 [dossy@pa op ] Heh.  Well, I departed Narita Airport at 12:30 PM on 8/10, and
  + 46890 [armin@xs .d ] Did you find the time to wonder in a big
  | 46926 [dossy@pa op ] Yeah.  The "256" series books are really popular in Japan,
  + 46920 [hal9000@hy e] Yes, warp drive is a wonderful thing.  :)
    + 46922 [james@ja es ] In Phoenix, AZ, it has been known to go below 112 F during the day, though
    + 46928 [gehlker@fa t] Pardon *me* while I laugh, Hal. I have months in Phoenix where it reaches
    | 46930 [jfreeze@fr e] Yeah, but it's a dry heat. :)
    + 46929 [dossy@pa op ] After having been there, I don't think I'd bother going to
    + 46934 [michael_s_ca] Having spent 14 years around Orlando  and Tampa, and the past 5 in Atlanta, I'm

extend Html4?
46845 [pmak@an me l] <P>Hello, <B>world</B>!</P>
+ 46851 [x@ic im nk .] class MyCGI  < CGI
+ 46853 [dblack@ca dl] You can include the module, but keep reading below....
  46854 [pmak@an me l] Hmm, it's a little weird that the html, h1, etc. methods won't work
  46855 [dblack@ca dl] That's because cgi.rb does a bunch of dynamic creation of methods.
  46856 [harryo@zi .c] Isn't that just a design issue, though?  Since Ruby is a totally dynamic
  46859 [dblack@ca dl] I'm not quite following.  Do you mean this specifically in relation
  46862 [harryo@zi .c] Sorry, I should have been clearer.  The original issue that was mentioned
  46863 [dblack@ca dl] That is what we were talking about, but it's all based on trying to do

ming for Ruby on windows
46866 [rich@li hi o] Does anybody know where I can find the windows binaries to play with

writing Internet Macros
46870 [ADATE@kc rr ] I wish to automate some of  our Internet activity so that I can relegate low

Q) about singleton methods and access control
46874 [patrick@th b] Recently, I was rather surprised to learn that singleton methods aren't
47056 [chr_news@gm ] Hm I not quite sure to what access problem you are
47057 [Patrick.Benn] class A
47070 [chr_news@gm ] internalHelperMethod is an ``instance method'' not a Class method
47071 [chr_news@gm ] the
47072 [Patrick.Benn] Maybe I'm missing something here, but.... I called it from an instance.
47078 [chr_news@gm ] No, the call is on the  ``class Level'' -  for example I get
47079 [patrick.benn] No it's not.  I was calling testObj.xxxxx -  that's definitely an
47107 [kentda@st d.] You are missing the point. When you call testObj.xxxx, yes you are
47131 [Patrick.Benn] Hmmm...  doesn't make much sense to my C++ mind and freshly battered Ruby mind, but I'll accept it.
47149 [chr_news@gm ] mind, but I'll accept it.

To be a Module, or not to be...
46875 [dsafari@pa a] I am attempting to write a transparent persistence framework and am having a
46876 [decoux@mo lo] It really depend on what you want to do
46878 [dsafari@pa a] Thank you for the quick response Guy! Although I'm not sure how the initialize
46880 [decoux@mo lo] Yes,
+ 46881 [transami@tr ] i did not realize this either. what happens if you include more then one
| 46884 [decoux@mo lo] It do the same, for example
| 46885 [dsafari@pa a] Ok, with this nice illustration of how it works, I should definately call
| 46886 [decoux@mo lo] no, with
| 46887 [dsafari@pa a] I don't see how that is a bad thing?
| 46888 [decoux@mo lo] pigeon% ruby
+ 46882 [dsafari@pa a] Thank you for the solution and the explanation :)
+ 46923 [dossy@pa op ] module M

ANN: TomsLib
46877 [transami@tr ] ANNOUNCING TomsLib

Ruby Tutorial at the Netobjectdays in Erfurt, Germany, 8th of October
46883 [armin@xs .d ] Dear Ruby-fans,

empty file returns nil not empty string?
46892 [thomass@de t] In ruby-1.6.7 reading an empty file returns an empty string before returning
46893 [decoux@mo lo] Can you give an example ?
46895 [thomass@de t] require 'test/unit'
+ 46896 [thomass@de t] $ /C/ruby167/bin/ruby --version
+ 46897 [decoux@mo lo] The modification is perhaps
  46898 [decoux@mo lo] I've said a stupidity
  46899 [thomass@de t] I don't understand what you mean by "... use the default value of 8192 to
  46900 [decoux@mo lo] For 1.6.7 if the result of fstat == 0, ruby return "" and force eof

"ri test" tells me to see page 430?
46902 [pmak@an me l] $ ri test
+ 46903 [decoux@mo lo] Guy Decoux
+ 46904 [kentda@st d.] It is refering to the PickAxe book, since that is where the information

Self-awareness of methods
46905 [pmak@an me l] Given a class and the name of a method in that class, is it possible
46994 [chrismo@cl b] Maybe debug.rb and tracer.rb can give you some help. Tracer reads in the

subclassing and @@variable
46906 [pmak@an me l] class XSuperClass
46908 [kentda@st d.] Because class variables are some kind of wierd black magic. Once a class

C and Ruby...
46909 [kmak@cs .a t] How can i add an instance variable in a ruby class object?

Choosing ruby?
46911 [raims@do .c ] I'm a Python - OO developer (on Win2K) and a few days ago one friend
+ 46912 [james@ja es ] You don't.  Python is a very capable language.  That said, many people with
| 46913 [raims@do .c ] Thanks for the link. I decided to take a look at the Ruby doc (I've
| + 46914 [dblack@ca dl] Many, many Ruby programmers don't like Perl's syntax at all :-)  I'd
| + 46915 [kentda@st d.] Not to worry, the syntax of Ruby is (IMHO?) alot cleaner than Perls, and
| | 46961 [raims@do .c ] LOL, you're right. I still consider switching to it. It seems very
| | 46963 [transami@tr ] ...
| | 46968 [raims@do .c ] Thanks a lot. It seems not so hard for me to learn Ruby's way of
| + 46918 [james@ja es ] Hm. I tend to think Ruby syntax is more like Java or C than like Perl,
| + 46933 [tim@ve et .a] Yup, with an anti-Perl attitude that strong, you're definitely a
|   + 46940 [dblack@ca dl] str = "Ruby is an extraordinary language."
|   | 46942 [tim@ve et .a] Yes, but even Python can do that! ;)
|   + 46959 [raims@do .c ] Mmm my (little) Perl experience was terrible. I know that is very
|   | + 46967 [kentda@st d.] module ... end
|   | | + 46969 [raims@do .c ] It's not so bad. But I prefer Python's style.
|   | | + 46981 [tim@ve et .a] begin ... end
|   | | + 47001 [gsinclair@so] if ... [elsif ...] [else ...] end !!!
|   | + 46983 [tim@ve et .a] [ snip ]
|   |   46993 [DDouthitt@cu] ...
|   |   46997 [raims@do .c ] Python has the same features :)
|   |   46998 [chris@da kr ] A lot of languages have the same features, it's just that most
|   |   46999 [djberge@qw s] I think I'll add that one to my collection. :)
|   + 47069 [g_ogata@op u] The only problem with it is editors can't know how to indent it for you
+ 46916 [jacekpodkans] When I was looking for a better programing language to suit one my problems
| 46958 [raims@do .c ] What do you mean?
| 47055 [jacekpodkans] I mean Ruby
+ 46921 [hal9000@hy e] I think there's no compelling reason to switch. I don't know Python,
  46960 [raims@do .c ] Do you speak Italian?
  47041 [hal9000@hy e] Heh, no. One semester only, long ago.
  47062 [raims@do .c ] It's not so funny in English, because it's a padory of an italian tv
  47115 [ontologist_2] To begin with, I did not know (and still do not know) what X-box is nor

Website for ruby.vim?
46919 [pmak@an me l] Is there a website for ruby.vim? The vim syntax file for Ruby mentions
+ 46924 [james@ja es ] There's www.vim.org
+ 46932 [djkea2@mu ca] Regards,

Ruby Development Environment (Continued)
46941 [davey@it -e ] OK, it's been a while.

Version 2
46952 [nojgoalbyspa] I have seen a couple of posts recently that mention version 2 of Ruby.  Is
47023 [batsman.geo@] I believe there isn't, or at least nobody was able to point me to it

Handling forms on database driven websites
46957 [pmak@an me l] Ever since I learned Perl, Ruby and MySQL, I've built several database
+ 46962 [waisun.chia@] Yes it is. It has long has many of the features that MySQL is only
| 47043 [avi@be a4 co] The only solid one I know of is GOODS
| 47063 [pmak@an me l] That open source database (previously proprietary) claims to support
| 47075 [mikkelfj-ant] Doesn't seem to be much native OODB. Core interface is ODBC, JDBC. Some OLAP
+ 47034 [patrick-may@] class Form
+ 47040 [hal9000@hy e] I've only done this once or twice, but I've felt
  47045 [Dave@Pr gm t] I'll be giving a short talk at RubyConf on just that. For my current
  47050 [chrismo@cl b] Looks cool.
  47052 [Dave@Pr gm t] It's not really an OODB: it's just a veneer on top of a relational

RE: Fun with shifting bytes / Python translation
46964 [mark.firesto] Thanks for your help!  That fixed it.  The rest of the math was
47012 [matju@sy pa ] Wow. Some people are actually still using QWK, or is that an effort in
47014 [mark.firesto] Well, it's kind of, both.
47326 [matju@sy pa ] I have written only a very small BBS software, no colours, in QuickBASIC.

replacing values in some files: line endings etc
46965 [tobiasreif@p] 1. ff
+ 46966 [tobiasreif@p] P.S.
+ 46971 [decoux@mo lo] Well, I don't like golf but
| + 46974 [decoux@mo lo] regexp are stupid :-)
| + 46975 [tobiasreif@p] thanks for your tips
|   46986 [tobiasreif@p] Oops, sorry; should read
+ 47022 [batsman.geo@] (untested)

TomsLib Note
46984 [transami@tr ] just FYI i fixed some bugs with DBize (the database-ify your object

reading without process blocking.
46985 [mark.firesto] This may have come up before.  This blocks all my processes when running as
47193 [nobu.nokada@] It's one of implementation issues under Windows.  See the thread from

Re: Benefits of PragDave's MSVC install
46987 [andy@to ls e] Hmm.  Don't know about that.  Sounds like I'd
46988 [andy@to ls e] And believe me, I do appreciate the nagging!  Otherwise months would go by...
46989 [mark.firesto] Well, it's better than Biff and Skippy.

Re: ambiguity backtrack - accessors and persistent locals
46991 [transami@tr ] i'd like to refocus on this aspect of the ambiguity thread. from what's
+ 46992 [dblack@ca dl] I have to admit that neither of those things bothers me at all.  Ruby
+ 47046 [charleshixsn] It has been asserted.  I don't think that it has been generally agreed.
  47141 [gsinclair@so] Charles's points are sensible.  My own experience is that I *hardly ever*
  47151 [dblack@ca dl] That's an interesting way to look at it, though I'm not sure it scales
  47183 [gsinclair@so] You obviously have quite specific requirements in this case that demand a

Primary Key Hash help
47000 [chrismo@cl b] AL Prattville  36066  01001 US  01-001-0870 01 001 1 3 0162328 1
+ 47002 [meier@me st ] require 'md5'
| 47006 [chrismo@cl b] Cool - I had inklings of something like this in my head ... but I couldn't
| + 47008 [michael_s_ca] As a purely theoretical "nit" here, I don't think any hash function
| + 47009 [elanthis@aw ] Yes and yes.  MD5 is a standardized specification (thus it will always
|   + 47028 [batsman.geo@] 128 bits.
|   + 47036 [Tim.Hunter@s] ...
+ 47003 [angus@qu va ] Given
| 47007 [chrismo@cl b] single
| 47010 [Dave@Pr gm t] As it's a hash, of course, it is not guaranteed to generate unique
| 47013 [chrismo@cl b] Yeah, I did a little reading between there and here -- it does seem quite
| 47082 [jfreeze@fr e] If you find a duplicate in your small dataspace, you will be famous
| 47123 [chrismo@cl b] Excellent. I'll be in touch ;)
+ 47214 [tsiivola@cc ] Just wondering: I saw the MD5 solution, but feel that I am missing
  47215 [decoux@mo lo] pigeon% ruby -e 'p "Robertsons".hash == "Sutton".hash'
  47226 [michael_s_ca] I think we addressed the non-uniqueness of any hash algorithm
  47253 [batsman.geo@] But it seems collisions are frequent with String#hash.

Ruby for Windows Problems - BUG??
47015 [mark.firesto] the following routine...
47018 [andy@to ls e] open(name,"rb")
47021 [mark.firesto] Thanks for the advice.  I'll try that.  Will that cause problems in the
47077 [matz@ru y- a] "rb" on the Unix causes no effect.

More code about Ruby and Microsoft Word
47017 [james@ja es ] I so enjoyed Ralph Mason's dictionary.rb script (a console script for
47025 [ian@ca ib n.] Ian
47033 [james@ja es ] Oh, very nice.  Thanks!

[ANN] Sys::ProcTable 0.3.0
47031 [djberge@v5 h] I am happy to announce the release of Sys::ProcTable 0.3.0.
47035 [batsman.geo@] I'd be more than happy to add UNICOS support if someone gives me a
47039 [djberge@qw s] Heh - wouldn't we all?

non-greedy regexp
47047 [tom@al al .s] The following regexp is supposed to chop off the last / of a string
+ 47048 [dblack@ca dl] You're missing the notion of a leftmost match.  The regex engine reads
| 47051 [dblack@ca dl] Whoops, having seen Mauricio's I now see a meaningless "/?" has
+ 47049 [batsman.geo@] irb(main):001:0> "http://www.x.com/y/z.html".sub(%r|/[^/]+\.html$|,'')
threads.html
top