40578-42449 subjects 41009-41711

(newbie?) storing object in files
40784 [matthias.wol] I'm looking for a way to write objects into files. It should be
40785 [ekarttun@cs ] It is very simple to do it in ruby, just use Marshal.

standalone files
40789 [adamss@as in] Is there a way to bundle ruby scripts into a standalone distribution?
40793 [chris.morris] see http://www.rubygarden.org/ruby?DistributeARubyAppInASingleExecutable

RE: RDoc automatic documentation of tests
40802 [chris.morris] Why can't we keep the tests in a separate file anyway? We can append the
40819 [W.L.Kleb@la ] This is what we do.  We call them "mobility tests" and
40831 [chris.morris] In my example, the tests were merely appended to MyClass, instead of their

Seattle Ruby Brigade, May Meeting
40804 [pate@ey er a] ***********************************************************************

parrots, cardinals, and rubys - oh my!
40810 [pate@ey er a] I just posted a call for questions for a /. style interview with Dan

Zmodem Module ?
40814 [dennisn@pe n] Does anyone know of, or has written a Ruby extension implementing the
+ 40815 [peter@se an ] Under Unix you could use the rz/sz package.
+ 40818 [dossy@pa op ] iI doubt there's a Ruby binding available, but if you're handy with
| 40825 [dennisn@pe n] I appreciate the pointer.  However, the developer's kit referred to
| 40836 [dossy@pa op ] You can probably buy an old Simtel CD from the early 1990's or so for
| + 40846 [charleshixsn] I can't answer for him, but where I work anything that isn't in a
| | 40851 [dossy@pa op ] The ZMODEM library is in C, if I'm not mistaken.
| | 40862 [dennisn@pe n] I was somewhat familiar with dsz, although I wasn't aware that the
| + 40849 [dennisn@pe n] Dennis
+ 40857 [joe@vp p. et] Zmodem!  wow, you just put me in the wayback machine.  As others have
+ 40985 [pc000@pa st ] You can try lrzsz - this is a derivative of the original public-domain

DBI access to mysql auto_increment record numbers?
40826 [bcox@vi tu l] How do you get the auto_increment record number for mysql in
40833 [sean@ch tt n] sql = 'INSERT INTO foo (foo_name) VALUES (?)'
+ 40860 [bcox@vi tu l] Thanks! That's two I owe you.
+ 40873 [uu9r@rz un -] Not yet!
+ 40899 [uu9r@rz un -] dbh.func(:insert_id)
+ 41195 [bcox@vi tu l] Sean, sorry if I'm being obtuse, but this isn't working out.
  + 41200 [sean@ch tt n] Yeah, I was wrong about that.
  | + 41208 [uu9r@rz un -] Yes, only the first works.
  | + 41219 [bcox@vi tu l] Another way I found on my own
  + 41205 [uu9r@rz un -] As insert_id is a driver-specific funtion, you have to call it via method func

ruby-dev summary 17048-17127
40839 [aamine@mx ed] This is a summary of ruby-dev ML in these day.s
40868 [dsafari@xt a] ruby-talk please - I really like these. Thank you for your work.

Something different !!!
40847 [pam10@ya oo ] This is a multi-part message in MIME format.

Re: Xml Serialization 1.0.pre3
40861 [nahi@ke na t] Excellent.  I added TrueClass and FalseClass to
40863 [home@cl bs o] Wow, thanks for your page -- that's an excellent collection of marshalling
40865 [nahi@ke na t] thought
40879 [chris.morris] Not a problem -- I just thought if it'd been updated recently that I should

Memory consumption.
40875 [erik@so id o] Is there some method that tells me how much memory a certain object
40876 [ruby-talk@je] This is all my guess from scanning ruby.h. Perhaps wrong, but should
+ 40877 [erik@so id o] Hmmm thanks, but I'm affraid that doesn't really help me when I want to
| + 40878 [ekarttun@cs ] A good design is important, not generating lot's of intermediate
| | 40882 [ruby-talk@je] That means you have to be careful not to do too much
| | 40884 [pbrannan@at ] a = "foo" + "bar" #=> a == "foobar"
| | 40885 [ruby-talk@je] I meant foo = "foo" and bar = "bar" and the example should be
| + 40901 [dennisn@pe n] Basically, if you are that concerned about memory efficiency, a few
| | + 40910 [dossy@pa op ] I think Ruby would make an excellent language for building applications
| | | 40917 [dennisn@pe n] I've done quite a bit of work on embedded systems,  I think that
| | + 40926 [erik@so id o] I am aware of that.
| + 40904 [r2d2@ac .u u] I guess
|   40919 [erik@so id o] Thanks for the help.
+ 40883 [matz@ru y- a] matz.

Idea for a book
40890 [peter@se an ] How about 'Design Patterns in Ruby' so those of us that went to Uni
+ 40891 [jyeung@di co] ...
+ 40892 [a.bokovoy@sa] Just read it: http://www.rubygarden.org/ruby?ExampleDesignPatternsInRuby
+ 40897 [james@ru yx ] When did OO go mainstream?
| 40920 [peter@se an ] When CompSci lecturers worked out that Modula 2 wasn't going to take the
+ 40921 [Steve.Merric] Many patterns are language-independent, so you don't need a specific
  40923 [nat.pryce@b1] Cheers,

printing under windows
40900 [ms@ia ta e. ] So I want to send a postscript file to a printer under windows...
40903 [dennisn@pe n] 1. AFAIK, unless your printer itself is a postscript printer,
40905 [ms@ia ta e. ] 1. Yup, we're talking about native PS printers.
40913 [dossy@pa op ] You can tell Windows that a network printer is to "capture" a

method_missing is cool (was: are there unit tests for cgi.rb?)
40902 [ian@ca ib n.] I saw this as a great opportunity to try out Object#method_missing.
+ 40960 [wakou@ru y- ] a little tricky extension.
| 40971 [ian@ca ib n.] That's a nice extension, since it keeps the namespace clean by
| 40983 [avi@be a4 co] It would go nicely with a little demo I've been playing with for an
+ 40994 [jim@fr ez .o] Very nice Ian. I played a little golf with your
  41024 [wakou@ru y- ] I think method_missing is not good. because, real error is hidden.
  + 41026 [jim@fr ez .o] Yes, that has been said before, but in another way. This method
  | 41040 [wakou@ru y- ] ??
  + 41030 [jean_hugues_] Nature loves diversity. After this minimalist solution, here is the
    + 41034 [jim@fr ez .o] [much code snippage]
    + 41041 [wakou@ru y- ] Oh, this is a good code using method_missing.

Segfault - [Bug]?
40906 [mitch@co ce ] ./class_pg.rb:162: [BUG] Segmentation fault
40956 [pbrannan@at ] 1) There is a bug in an extension you are using.  This seems likely to
40958 [nobu.nokada@] I'm not sure about that library.
40963 [gilles.filip] Sure ? I've recently had a segfault signal which IMO was caused by a
40964 [pbrannan@at ] I think what he meant was that in this case you should just see a
40969 [nobu.nokada@] Thank you for explaination.

Re: Golfing in OOLs
40907 [tgagne@am ri] I was staring at a score card from Rackham earlier today and
41172 [peter@va ro ] Tom,

Rewrite this without using eval...
40908 [jeff.gray@in] I happened upon a situation where I wanted to apply a sequence of operations
+ 40911 [jweirich@on ] Interesting problem.  Here's one solution, but you might find it a bit
| 40931 [chris.morris] It's interesting (and presumably you're aware of all this, but I'll ramble
+ 40933 [chr_news@gm ] what about?
| 40934 [kentda@st d.] This doesn't appear to change the values of @a and @b, which it seems
| + 40936 [chris.morris] Right - after this line, the array now is [2, 3], but @a still points to 1
| + 40941 [chr_news@gm ] Okay what about
+ 40939 [kentda@st d.] If I'm allowed to make accessors methods for the variables, (albeit
+ 40973 [vjoel@PA H. ] Is it cheating to use C?
  40990 [jeff.gray@in] That's not bad and seems like the closest to what I was hoping to achieve.

Oracle 8i Clob data type
40914 [waya208@ho m] Has anyone had success with Oracle 8i CLOB type fields?

Third meeting of ba.rb (the Bay Area Ruby Group)
40915 [jack_d_herri] Ba.rb will be hosting it's third meeting on Sunday, May 25th, in the early

Accessors how to create a new one ?
40922 [henry@be ca ] Is there any possibility to create my own accessor like standard accessors
40924 [jim@fr ez .o] class Module
40935 [henry@be ca ] accessors

Implementing concatenation in a subclass of Array
40925 [sera@fh an .] I'm trying to subclass Array, and I'm finding it would be useful to
+ 40967 [vjoel@PA H. ] Use Array#concat. In general, the destructive array methods preserve
+ 40977 [patrick-may@] This might be easier if you used simple delegator to handle the array

Marshal error: "singleton can't be dumped"
40927 [sera@fh an .] I'm trying to dump an object with Marshal.dump, but it gives me the
40929 [kentda@st d.] Then perhaps it is refering to singleton methods?
+ 40937 [sera@fh an .] Marshal error: "singleton can't be dumped"
| 40997 [patrick-may@] ahh... b/c cgi params can have singleton methods.
| 41010 [sera@fh an .] It's not necessarily that big of a deal. You can take in a singleton
+ 40953 [matz@ru y- a] Yes.

xml data binding for Ruby ?
40928 [mjais@we .d ] is there an xml data binding module / library for Ruby similar
40942 [tobiasreif@p] On

rubycookbook.org down for indeterminate time
40930 [colin_steele] Sadly, and coincidentally, both the server hosting
+ 40938 [ruby-talk@je] Anything we can do/help?
+ 40970 [ptkwt@sh ll ] That's bad news.  I really think rubycookbook was/is an important site for
| 40974 [djberge@qw s] I second this motion.  Thoughts Dave?
| + 40975 [pate@ey er a] I've got a pair of (contradictory) thoughts.
| | 40982 [ptkwt@sh ll ] Good point.  The recent problems with rubygarden and now rubycookbook are
| | 40984 [pate@ey er a] I don't have any good ideas yet, but will think about it for a while.  I'm
| | 41059 [nospam@fa ed] You can always set it up on a few servers and just do a simple DNS
| + 40976 [Dave@Pr gm t] I'd be happy to do that, although it'll have to wait until I get back
|   40981 [olczyk@in er] 1)I believe the Lisp cookbook is held at sourceforge.
+ 41131 [bcox@vi tu l] Send me an email offline with space/bandwidth/infrastructure requirements.
+ 41257 [dennisn@pe n] You might try a company that offers remote web hosting services.

using IMAP
40932 [roy@mi ic n.] Greetings,

-e oneliners with File.open
40940 [tobiasreif@p] I wanted to see how well Vim handles large files, so I entered something
+ 40943 [jason@jv eg ] Try swapping the single and double quotes.  Also, you don't need the
| 40961 [tobiasreif@p] works, thx :)
+ 40944 [jim@fr ez .o] ruby -e 'File.open("foo.txt","w") do |f|; f.write 6; end'
| 40945 [chris.morris] Try it without the semi-colon after |f|? I dunno -- your version ran for me
+ 40947 [kentda@st d.] <SNIP>

ba.rb meeting on Sunday 5/26/2002
40946 [jack_d_herri] I got the date wrong in the original posting.

FAQ for newcomers familiar with lower level language
40948 [ruby-talk@je] I have been on this list for about a year. I have noticed that many
+ 40949 [kentda@st d.] Fixnum is one of those types that is stored directly into the
+ 41104 [ruby-talk@je] Thanks to those who fixed my errors in the first release of the FAQ.
+ 41128 [rawlins@cs u] I saw this sentiment expressed earlier in a post, and resisted the chance to
  + 41129 [ruby-talk@je] Thank you Kyle for reminding me of this issue. Sometimes, as better
  + 41130 [kentda@st d.] I concur. I haven't noticed any memory usage profilers for Ruby and I
    41167 [pbrannan@at ] It would also be nice, from a debugging perspective, to be able to ask

Stymied by Ruby's garbage collector
40950 [mattbee@so p] This one is driving me crazy: I've got an about-to-be-deployed
+ 40952 [nat.pryce@b1] I had the same problem writing a game in Eiffel, also using the SDL.  Here's
| 40955 [mattbee@so p] So even when I call GC.start before EventQueue.poll (since null events
+ 40957 [cboos@bc -t ] It's indeed a mark and sweep algorithm, everything is first
  40978 [ataylor@fo t] Is there a particular kind or kinds of object being created in huge numbers?
  40986 [hutch@xa pl ] This is the optimisation that has had the largest impact on programs I've
  41006 [mattbee@so p] Sure, that does make sense but I feel it's a bit against the grain of a
  41031 [patrick-may@] A gc language prevents memory leaks, it makes no performance guarantees :-)
  41037 [pbrannan@at ] It helps to alleviate memory leaks, but it does not prevent them.  I can
  + 41039 [hutch@re ur ] Funny how meanings shift over time. Yes what you are saying is a usage of
  + 41053 [sean@BU BY S] In C++, I use the stack to create/destroy objects and if the objects
    41084 [nat.pryce@b1] Managing memory by allocating objects on the stack is fine, as long as
    41133 [sean@BU BY S] Collection does too much...it takes longer the more objects there
    41139 [nat.pryce@b1] This is a common complaint from people used to C++ or Java, probably because
    + 41141 [sean@BU BY S] Yeah, I know...it's not the same thing.  I hope we get real destructors
    | 41181 [nat.pryce@b1] hope we get real destructors
    | 41239 [cjack@cj ck ] C++ destructors are invoked at a known point in time (usually when someone explicitly calls delete on the object).
    | 41253 [nat.pryce@b1] I've never missed the lack of destructors in languages other than C++.
    | 41258 [pbrannan@at ] C++ destructors are also used to clean up when an exception is thrown.
    + 41149 [ruby-talk@je] I read the discussion page you referred to at
    | 41156 [ned@bi e- om] Part of the problem is that your create_finalizer is an instance
    | 41159 [ruby-talk@je] beside
    + 41150 [ruby-talk@je] I read the discussion page you referred to at

Overriding TCPServer.accept
40951 [flifson@cs u] If I have a class SIPSocket that inherits from TCPSocket and SIPServer
+ 41000 [matz@ru y- a] In the latest CVS, there's TCPServer#sysaccept which returns a raw
| 41002 [flifson@cs u] Great! That's just what I need, will the CVS code be in the next stable
| 41005 [matz@ru y- a] The CVS code IS development version.  It will be next stable version
+ 41028 [jean_hugues_] I don't know of any other solution as of today. There is probably a

Found a new interpreted language
40959 [babbouux@ya ] I am since a long time a  programmer

testing: assert_html_equal
40962 [patrick-may@] wouldn't it be nice if...

OT: Re: -e oneliners with File.open
40966 [    s@xs .d ] Tobi,

installation of ruby-gnome
40968 [charleshixsn] I was installing ruby -gnome from the CVS, and everything was going well,

[OT] Vim (was: -e oneliners with File.open)
40972 [tobiasreif@p] Stefan,
41007 [    s@xs .d ] AFAIK, yes.

possible bug: stack dump with <<-String, #{...} and large loops
40979 [patrick-may@] I had (poorly) coded a #{} with a large loop, i.e.
41001 [matz@ru y- a] Hmm,
41032 [patrick-may@] def bug
+ 41064 [nobu.nokada@] This code can reproduce the bug.
| 41072 [nobu.nokada@] Patch.
| 41074 [matz@ru y- a] Here's mine.
| 41080 [nobu.nokada@] Unfortunately, rubicon failed.
| 41120 [matz@ru y- a] Hmm, OK, you win.  Commit your fix, please.
+ 41245 [nobu.nokada@] Fixed.

confused about access control
40987 [ian@ca ib n.] irb(main):001:0> class String
40989 [alan@di ik t] foo is an instance of String, but Foo isn't a subclass of String.
+ 40992 [michael_s_ca] foo (lowercase) IS a[n instance of] String, right?  So why can't an instance of
| + 40993 [dossy@pa op ] Stop saying "call" and instead say "send a message" because that's
| | 41011 [michael_s_ca] /k dossy Stop telling me what to do!  (For everyone else, inside joke; Dossy and
| | 41013 [dossy@pa op ] /k UG vengence is a bitch, bitch!  ;-)
| | 41016 [michael_s_ca] Worse; C++ then Java.
| | 41023 [bigbill.smit] Amen! For those of us who fell in love with Java because it was so much
| + 41003 [tsiivola@cc ] You are confusing caller and receiver. The caller is the "enclosing"
+ 41115 [ser@ge ma e-] The object that is /invoking/ undot! is Foo, not foo, and Foo has nothing to

mod_ruby binary
40988 [mhale@ro em ] Does anyone have a mod_ruby binary for windows?  I have spent about 3 hours
40995 [xlucid@us rs] Does anyone have a mod_ruby.so for i486?

dbi pg_dbd performance
40991 [alan@di ik t] Has anybody else found that the ruby dbi + pg_dbd performance to be slow?
41048 [sean@ru y- a] What version of DBI are you using?  Can you upgrade?  There have been
41117 [alan@di ik t] I thought I did, rechecked it and found out that I had installed DBI

def within def
40996 [ruby-talk@je] # append def b into class A

[OT] chindogu
40998 [vjoel@PA H. ] 'strange tool'.

Mac OS X / Emacs: M-x run-ruby gives no prompt
40999 [marick@te ti] I have two versions of Emacs on my new OS X mac. One comes with it and

Help: Ap fails for 1.7.2
41008 [W.L.Kleb@la ] On several occuassions over the last few months, I've tried to run our application
41020 [matz@ru y- a] Hmm, could you try this patch?
41045 [W.L.Kleb@la ] Perfect, this fixes the
41075 [matz@ru y- a] I guess this one was caused by Test::Unit, DEBUGGER__ is defined in
41108 [W.L.Kleb@la ] Correct again.