47824-50175

47692-48851 subjects 48040-49851

Seattle.rbbq 2002-08-27
47824 [ryand-ruby@z] Who  : Seattle.rb members and the local ruby curious

[BUG?] File::SEPARATOR (was Re: What makes a "good" Ruby extension?)
47830 [ oct@zo .o g] Maybe this is a feature, but on my ruby -v ruby 1.7.2 (2002-06-29)

Palindrome for integers
47832 [john@jo nk i] Alan McConnel pointed me to this problem.
47845 [gsinclair@so] An article on slashdot recently pointed out that of all the numbers under
48788 [JasonADoucet] Gavin,
48789 [gsinclair@so] Thanks for that.
48834 [JasonADoucet] Yes, once I realized that 196 was not the only number that never

Newbie question. How to install a new package?
47842 [bilotta78@ho] Well, I installed URI by simply popping it into the \lib\ directory,
+ 47843 [bilotta78@ho] Dumbly forgot the details. Running Ruby 1.6.7 from the 167-2
+ 47859 [decoux@mo lo] See the file README.en
  47860 [bilotta78@ho] Oops. Do I need some extra library for the package? Where can I get a
  47861 [decoux@mo lo] Well, bdb is just an interface to Berkeley DB distributed by Sleepycat
  47862 [bilotta78@ho] Doh. I had hoped for a native win32 port ... oh well, I'll see what I
  47867 [CRIBBSJ@oa w] Go to http:://www.ruby-lang.org/~eban/ruby/binaries/mingw/ext/.  You should
  47868 [bilotta78@ho] Got it, but still tought luck with the Ruby part ... it says it can't
  47870 [decoux@mo lo] What is the error message ?
  47878 [bilotta78@ho] This is what I did. I got the .so and put it under
  47879 [decoux@mo lo] The .so that you have is the result of the compilation of bdb
  47882 [bilotta78@ho] I see. And where do I get it?
  47884 [decoux@mo lo] Guy Decoux
  47888 [CRIBBSJ@oa w] I could be totally wrong, but if you put the .so (which is the library
  47900 [bilotta78@ho] Bingo! You're totally right!
  47989 [eban@os ri .] Unzip and copy mingw32-ruby16.dll to c:\ruby\bin, then it will work.
  + 47993 [bilotta78@ho] Thanks. I'll give it a try when I'm back online. (Not that I like
  + 47997 [bilotta78@ho] (Take two).

blocks and lambdas, or blocks as first-class entities
47849 [dido@im er u] As I'm a fan of functional languages as well, feeling comfortable with
+ 47851 [rich@in oe h] for
+ 47852 [jweirich@on ] A Proc object is an objectified block.  You can create a proc object

nohup -g and ruby-1.6.7 on Solaris9
47864 [hgs@dm .a .u] neelix hgs 100 %> ps -o pid,pgid,time,args -u hgs
47865 [meier@me st ] Has the process been started from the same shell where you call nohup?
47873 [hgs@dm .a .u] No, it is still in the foreground, but it is one of my shells...
47886 [hgs@dm .a .u] ^Z to stop but not kill the job,

Source for latest Ruby binaries?
47866 [christopher.] All,
47871 [chrismo@cl b] download
47874 [christopher.] Chris,
47876 [ADATE@kc rr ] "Ruby 1.7.2 for Windows is now available, see

spreadsheet.rb, alpha 2
47869 [djberge@v5 h] ######################################################################
47919 [djberge@qw s] Oops - changed @big_endian? to just @big_endian.  Should work then.
47975 [nobu.nokada@] Why not pack("E")?

Using DRb on a Linux box ...
47887 [dmartenson@m] ...
+ 47894 [hgs@dm .a .u] Would it be a big hassle to try this with ruby compiled without
| 47908 [dmartenson@m] ...
| 47922 [hgs@dm .a .u] [table]
+ 48098 [uu9r@rz un -] Does that mean that the same "getnameinfo" error occured after recompiling ruby?
  48099 [dmartenson@m] ...
  48189 [dmartenson@m] ...
  48191 [decoux@mo lo] Yes, this is the way to do it

split warning
47890 [mengx@ni ls ] With the laster cvs version, ruby gives warning
47898 [transami@tr ] see ruby-talk 44019 and subsequent responses
+ 47917 [mengx@ni ls ] Thanks.
| + 47935 [transami@tr ] i believe the final decision was to change it per the overall opinions.
| | 47937 [mengx@ni ls ] Thanks for the info. It is a relief.
| + 47963 [batsman.geo@] I've read the thread and matz' last word on this is that split will work
+ 48027 [matz@ru y- a] But still, warning for "\r\n" is too much.  I will fix.

select?
47891 [perry@pi rm ] Is there a way in ruby to do the equivalent of the select(2) unix
+ 47899 [decoux@mo lo] pigeon% ri Kernel::select
+ 47905 [perry@pi rm ] Never mind -- I seem to have found it.
+ 47916 [dossy@pa op ] # ri IO#select

BlackAdder
47892 [NSODEN@CO RT] To All Ruby(heads)

SV: A Repeat: New Language After Ruby?
47913 [tsondergaard] ...
47921 [Dave@Pr gm t] No, I don't think I've changed my mind. The difference between the
47979 [rich@in oe h] Here is an example of a domain specific library/language I have created

Win32 Scripting
47918 [elanthis@aw ] As someone who's barely touched a Windows system in 4 years, I'm in
+ 47927 [hal9000@hy e] Sorry I can't comment on the technique you want... but I
| 47930 [elanthis@aw ] Um, dunno what to say; RTF works perfectly, and is quite documented.  I
| 47998 [rc@va ca er ] One thing to watch out for is that any graphics inside an RTF file can
+ 47931 [danny@fr uk ] Hey,
| 47983 [james@ja es ] Recording a macro is a really good idea.  You may want to let Ruby call the
+ 47933 [a.bokovoy@sa] RTF isn't really an open standard. It isn't fully specified and exporting
| 47934 [elanthis@aw ] Hmm, I've been under a totally different impression... perhaps I'd be
| 47994 [dsafari@pa a] I was resisting the temptation of using windows for donig all my essays and
| 48023 [elanthis@aw ] Well, on the other hand, this is true of any format.  If we continued
+ 47941 [chrismo@cl b] Check out the win32ole bit in the pickaxe book -- it has an Excel example.
  47942 [elanthis@aw ] Ah, OK.  Will have to go find that book again (buried somewhere...).
  + 47943 [CRIBBSJ@oa w] I haven't done this yet in Ruby, but I do have a tcl script that makes use
  + 47946 [chrismo@cl b] It's also buried at rubycentral.com :)

Net::AIM
47924 [michaelvera@] Is there any interest out there for a Ruby Net::AIM? I am thinking of
47928 [rick@be rd i] sounds really cool, but what does that gain you over emailing alerts?

Can I write to DATA?
47932 [jfreeze@fr e] How would I modify the text below __END__?
+ 47949 [gotoken@no w] You mean like this?
| 47977 [nobu.nokada@] This fails for a script contains __END__ inside string.  I
| + 47982 [vjoel@PA H. ] The following script prints -1. Is there some other way to get the
| | 48083 [nobu.nokada@] This code gave 19 for me.  What's your ruby version (and
| | 48101 [vjoel@PA H. ] puts RUBY_VERSION       # ==> 1.6.7
| | 48112 [nobu.nokada@] All of last 1.4.6, 1.6.7 release and CVS latests of 1.6 and 1.7
| | 48113 [vjoel@PA H. ] Well, you're right. It works from the command line. I was running it
| + 48107 [vjoel@PA H. ] Here's an example of the data stream approach.
|   + 48108 [vjoel@PA H. ] I guess it should really be called "substream". If there is interest, I
|   + 48109 [jfreeze@fr e] DATA.pos works on 1.6.7 unix.
|     48111 [vjoel@PA H. ] But does it return the position relative to the start of the file or
|     48115 [jfreeze@fr e] It returns the position relative to the start of the file.
+ 47950 [vjoel@PA H. ] Take a look at "roof" on RAA. It uses the DATA as a stream to keep

Paul Graham essay on language popularity
47945 [HotFusionMan] I don't read the list/group anymore, so I'm not sure whether this
+ 48004 [adamon@ma la] The latest hot language, Python, is a watered-down Lisp
| + 48030 [boognish23@y] I think he is referring to the functional aspects of the language.  In
| + 48080 [olczyk@in er] Simple explanation. Common Lisp programmers are so frustrated with
| + 48212 [mirian@co mi] To a true Lisper, the only relationship between Lisp and Python is
+ 48655 [qrczak@kn .o] First few hits talk about interesting comparisons of these languages.

GUtopIa Minutes - Aug. '02
47955 [transami@tr ] ======================================================================

Tk and Gtk
47958 [cleeker@gm .] Okay this isn't exactly a ruby question, but in the near future I want
+ 47959 [elanthis@aw ] Netscape is deinitely not done in Tk.  ~,^
| 47965 [cleeker@gm .] Well netscape sure looks like Tk ugliness (down to the menus checkboxes
| 47966 [elanthis@aw ] Oh, wait, are you talking about ancient Netscape?  I'm thinking current
| + 47967 [michael_s_ca] Current Netscape seems far too slow for TK too.  =)
| | 47969 [elanthis@aw ] Heh.  Thank the gods for Galeon.  ^,^
| + 47971 [cleeker@gm .] Think your favorite Blackbox clone. http://openbox.sunsite.dk/
| | 47972 [elanthis@aw ] Oh.  I didn't know I had a favorite Blackbox clone.  ^,^  Only one I'd
| + 47978 [rawlins@cs u] Netscape 4 on unix was motif.  I'm pretty sure all earlier netscape/unix
+ 47960 [harryo@zi .c] This is an interesting point.  I've only written a couple of GUI programs, but
| 47961 [elanthis@aw ] I was thinking the same thing.  The problem arises I think in how
+ 47970 [lyle@us rs s] Actually, Netscape (a.k.a. Mozilla) is using its own
  50175 [kgergely@ml ] Ehh? modern look-and-feel? What about the combobox and the slider? They

[OT] Re: What New Language After Ruby?
47962 [batsman.geo@] I've never used (or seen :) Fortran, but I can think of a number of

RGL-0.2 tarballs coming up short?
47964 [W.L.Kleb@la ] I can't seem to get a good RGL tar ball from sourceforge, e.g.,
47973 [W.L.Kleb@la ] I was able to get source from CVS, but the irb example does
48059 [horst@hd ch ] This should be fixed with V 0.2.1 (see http://sourceforge.net/projects/rgl/).

Why  does this hang?
47968 [putsch@mx m.] Howdy,
47980 [nobu.nokada@] IO#eof? tries to read next data to examin EOF reached.  Use
48028 [putsch@mx m.] Much thanks to Nobu for his explanation and his correction of my sample code.

New Windows Installer version
47974 [andy@pr gm t] For the adventerous, I just put up a new version
+ 47992 [bilotta78@ho] Would it be possible to have Berkeley DB in it as well? (It's not
+ 47996 [bilotta78@ho] (Take two).
+ 47999 [dsafari@pa a] Great work Andy! I am glad to see RubyMock make it in. I don't have any

Month-Year in raa.html?
47976 [W.L.Kleb@la ] I always find myself wondering when the last

idiomatic write
47986 [nvivek@ko ar] I want to search for a pattern in a file, replace it with something and
47987 [eban@os ri .] % ruby -i~ -pe 'gsub(/pattern/, "replace")' myfile
47988 [tim@ve et .a] Does this work if /pattern/ spans lines?
48010 [djberge@qw s] And doesn't this secretly generate a tempfile in the process?
48029 [michael_s_ca] It does generate a secret tempfile, but the original poster *MIGHT*

installing ruby/dbi failed, please help
47991 [res@vh -h .d] may be this problem has nothing to do with ruby in general

converting rows into structs
47995 [Eugene.Scrip] I have a methods that converts all DB rows into structs using Struct
+ 48002 [dossy@pa op ] Can I ask what the advantage of storing it as a Struct is?
| 48003 [Eugene.Scrip] people.each { |man| puts "#{man.name} #{man.surname}" }
| 48006 [dossy@pa op ] class Hash
| 48007 [Eugene.Scrip] You can easily misspell method name (man.sername) with method_missing
| + 48008 [decoux@mo lo] Well, in this case you can use anonymous struct
| | 48012 [Eugene.Scrip] Yes, this is exactly what I want. Thank you.
| + 48021 [list@NO PA c] class Hash
+ 48017 [pit@ca it in] If you pass a name as the first parameter to Struct.new, those

Converting Perl scripts to Ruby?
48000 [bilotta78@ho] Is there some (semi)automatic way to attempt such a thing? Or does it
+ 48009 [djberge@qw s] If only there were...
| 48015 [bilotta78@ho] I see, thank you. Guess abusing Ruby's OO paradigm to bend it to
+ 48026 [peter@se an ] I converted some of my Perl scripts to Ruby and a first attempt which
  48077 [tim@ve et .a] [ the points below are included to clarify
  48285 [peter@se an ] For some programmers (myself included) the creation of a surrogate
  48332 [tim@ve et .a] I'm not sure why you value name real estate so highly. Var names
  48398 [peter@se an ] It's not something as esoteric as namespaces but just the use of
  48402 [tim@ve et .a] Thank you for explaining.  I think I understand what you mean
  48449 [dan@si he or] That turns out not to be the case. Constant ranges or lone arrays in
  48510 [tim@ve et .a] [ snip ]

new ruby from cvs
48001 [Eugene.Scrip] I installed new ruby 1.7.2 (2002-08-21) from cvs and get warning in
+ 48011 [decoux@mo lo] Have you stopped and restarted your server after the installation of
| 48018 [Eugene.Scrip] I don't understand what happens - the same configuration on another
+ 48019 [hermit-jah@y] just a guess... mybe you should recompile pgsql-ruby?
| 48020 [Vitaliy.Mora] It get no results. Solution was to rollback ruby && mod_ruby to 2002-07-01
+ 48033 [comp.lang.ru] - - I've been tracking the latest cvs and there has been at
  48073 [matz@ru y- a] Don't forget to tell what the bug is.  I'd be glad to fix.
  48079 [comp.lang.ru] - - Already Done. Submitting to ruby-bugs is the First thing

[OT] What New Language After Ruby?
48005 [tsiivola@cc ] So that is really doable and worth the trouble? Can you give any good
48214 [Tim.Hunter@s] Yes, calling FORTRAN from C is do-able and worth the trouble if 1)
48440 [comp.lang.ru] - - There's a package floating around called cfortran that provides

Perl Exegesis 5
48013 [wmwilson01@h] Anyone else get more and more glad that Ruby exists every time they see a
48051 [billk@ct .c ] Yeah, on some of the prior occasions.  :)   This one, though - wow!

no echo gets on mswin
48022 [chrismo@cl b] From poking around, there doesn't seem to be a way to do this. Termios was

inetd and getpeername
48031 [pbrannan@at ] Is there any way, from within Ruby, to get the peer name of a process

Why Ruby Uses Mark-and-Sweep GC?
48035 [billtj@z. lu] As I am developing my code in Ruby/C, I cannot help to ask the question,
+ 48037 [dan@si he or] That's one problem. Reference counting is also more expensive over
| 48041 [perry@pi rm ] There are, of course, better gc's than mark and sweep -- compacting
| + 48043 [dan@si he or] Believe me, I'm well aware of that pain. :(
| + 48048 [justinj@mo i] It certainly used to be the belief that moving collectors are better than
|   48066 [batsman.geo@] There's however a problem with bringing generational GC to Ruby. If your
|   48078 [perry@pi rm ] This is no different from the generational GC problem in most
|   48088 [batsman.geo@] But having an automatically managed remembered list (or equivalent
|   + 48102 [dan@si he or] Extensions in C generally need less glue to the GC system with a
|   + 48155 [perry@pi rm ] There are languages like Elk (a Scheme dialect) that dealt with
+ 48038 [rawlins@cs u] I'm curious how (or if) you've evaluated this empirically.  I've been
+ 48039 [elanthis@aw ] A) Reference counting breaks.
  + 48047 [billtj@z. lu] Thanks for all the responses.  So I guess we are already dealing with a
  | 48055 [pbrannan@at ] loop do
  + 48049 [lyle@us rs s] Sure it does. Python 2.0 did, however, add a garbage collector that
    + 48050 [elanthis@aw ] Ah.  "My bad."  I had thought Python 2 switched over to a full GC.  (I
    + 48052 [billtj@z. lu] Probably I should ask this question instead, to people who are really
      48074 [batsman.geo@] By using rb_global_variable (which simply calls
      48193 [billtj@z. lu] Thanks for the response.  Yes, after examining the codes further, it seems
      + 48197 [decoux@mo lo] rb_gc_force_recycle()
      | 48198 [billtj@z. lu] Thanks for the pointer, but if I am not mistaken, rb_gc_force_recycle() is
      + 48200 [matz@ru y- a] I think what you want is contradicting with mark&sweep GC, which Ruby
        48426 [billtj@z. lu] Thanks for the suggestion.  However, I think NArray is different, because
        48452 [matz@ru y- a] I now understand what you want.  But still, I don't think it is the
        48472 [billtj@z. lu] Do you think it will be beneficial to add C API for Ruby objects that will
        + 48478 [comp.lang.ru] it?
        + 48511 [perry@pi rm ] Why are you contrasting garbage collection and real time programming?
        + 48527 [matz@ru y- a] I don't think so.  What if non GCed objects refer GCed objects?
          + 48541 [justinj@mo i] And having a "remembered set" automatically catered for usually relies on
          | + 48546 [billtj@y. lu] Did you indeed add incremental sweeping (I will assume that it also means
          | | 48547 [justinj@mo i] Unfortunatly not.  It's in my implementation of Ruby which is a long way off
          | + 48570 [matz@ru y- a] It doesn't do this yet.  I guess it is worth adding in the (near) future.
          + 48545 [billtj@y. lu] Thanks for your consideration.  I think generational GC will be good
          + 48550 [billtj@y. lu] This is my second thought.  Can the non GCed objects simply use
          | 48572 [matz@ru y- a] Hmm, I'm just not sure how it works.  Perhaps your idea requires some
          + 48794 [michaels@on ] I am working in a major CAD system, and we manage our own memory (Once
            48828 [matz@ru y- a] Just don't use Make_Data_Struct and use Wrap_Data_Struct to wrap
threads.html
top