178883-334450

178712-187864 subjects 179092-365237

calling child methods in parent
178883 [daverubie@gm] ...
178891 [M.B.Smillie@] That's the default behaviour, actually.  In C++ terms, all methods

mixing in modules ?
178892 [konsu@ho ma ] 1. class C that implements some arbitrary methods
+ 178981 [konsu@ho ma ] is it a bad programming style in ruby to use 'super' in a module definition?
| + 179002 [lukfugl@gm i] I don't think so. I myself haven't yet run into the need to call super
| + 179015 [david@va ln ] Actually, I'll go a bit further than Jacob and say that is -exactly- what
+ 178994 [malteNOSPAM@] I don't see a (stylistic or whatever) problem in directly referring to @x

[ANN] Camping 1.3, the Microframework
178899 [ruby-talk@wh] Good people of the town: Maybe some of you are interesting in the
+ 178900 [ruby-talk@wh] _why
+ 178966 [lukfugl@gm i] Wondering... is that a typo or is it really 'blog_post' instead of
+ 179011 [james_b@ne r] Is ActiveRecord a requirement?
  179014 [mental@ry ia] No more than it is for Rails.
  179049 [james_b@ne r] Ah, I see. It does not include its own persistence lib.

Writing an image to file
178901 [m-lists@br s] I have images stored in a database. I now need to read those images from
+ 178902 [matthew.moss] Does using "wb" instead of "w" in File.open make a difference?
| 178903 [m-lists@br s] Yep, that worked. Thank you very much.
+ 334450 [jazzezravi@g] Get all images from given URL

get blog
178906 [bh@iz .k u. ] First time on this list so I should start by saying thanks for a great
178917 [chrisjroos@g] You could try typo[1], written using Ruby on Rails[2]
178919 [bh@iz .k u. ] Thank you for your comments!

Re: [QUIZ][SOLUTION] Splitting the Loot (#65)
178907 [bdolinar@xm ] =begin
178974 [kasten.m@gm ] It doesn't split
179012 [bdolinar@xm ] So it doesn't.  But it says it won't split quickly! :)  Do you have a
179016 [SimonKroeger] 64 64 35 6
+ 179025 [james@gr yp ] I believe it is.  I couldn't break it while writing the summary
+ 179219 [bdolinar@xm ] Thanks.  Helped me track down a fix... I think. :)  How did you guys

c api, getting class
178915 [clr8.10.rand] I have a mixed ruby/c class and I'd like to throw an exception that is
178918 [flori@ni e. ] Use rb_path2class("Myclass::UnknownFormat").
178921 [clr8.10.rand] This is exactly what I was looking for; seems somewhat undocumented.
178922 [simon.kroege] Without having a chance of testing right now, I would say

Using Classifier::LSI
178916 [chrisjroos@g] I've just spent some time looking at the ruby classifier[1] library.
178923 [cameron.mcbr] Hey Chris,
179118 [chrisjroos@g] Ok, so it took just over 7 hours to build the index of 3000 items.
+ 179120 [interfecus@g] I'm doing a project at the moment cataloguing publications where I've
+ 179137 [cameron.mcbr] Chris,
| 179150 [chrisjroos@g] Ok, so I'm thinking (taking into account what Matthew Smillie has said)
| + 179152 [cameron.mcbr] sounds like the right approach, glad you found something that worked.
| + 179185 [cameron.mcbr] There is also a Classifier::Bayes available that might be more in sync
+ 179148 [M.B.Smillie@] Can't comment on the time it takes, but the data you're using doesn't
+ 179177 [dfayram@gm i] Depending on the size of your inputs, it can take longer.

[ANN] NP
178925 [vanek@ac .n ] If anybody else finds NP-complete problems interesting then you may want
+ 178932 [ruby@an hr p] } If anybody else finds NP-complete problems interesting then you may want
| + 178933 [vanek@ac .n ] The algorithms are fast, but still exponential. The knee in the curve,
| + 178945 [chneukirchen] Wheehee, a meta-quiz-solution!
| + 178958 [james@gr yp ] suggestion@rubyquiz.com
| + 178969 [ehames@gm il] One implementation to solve them all ;-)
+ 178935 [ara.t.howard] very cool lou - thanks for this contribution!
+ 179010 [ptkwt@ar cn ] Cool.  Though I was hoping that perhaps you were going to announce that P=NP
  179020 [vanek@ac .n ] Many, many more problems will seem to run in polynomial time. Psuedo-Polynomial

boolean annoyance
178942 [cjeker@di ha] there is one thing in ruby that annoys me most (at least for now).
+ 178949 [matthew.moss] It's actually the most illogic part of languages like C that treat 0
| 179039 [cjeker@di ha] If you are inspecting a integer against nothing end everything is just
| + 179052 [matthew.moss] I didn't say everything was legal; I said zero could be legal. That
| + 179063 [halostatue@g] Sorry, but that doesn't work. If you have something that returns an
|   179071 [cjeker@di ha] This is not correct. strtol(3) does not return 0 in case of an error. It
|   + 179077 [logancapaldo] ...
|   | + 179094 [david@va ln ] This made me smile and laugh and giggle. And also hover my hand on the button
|   | + 179130 [cjeker@di ha] RETURN VALUES
|   + 180105 [halostatue@g] It is correct. I had looked at the man page for strtol(3) beforeposting. Trying to convert a non-numeric value (say, ":") or using abase of 40 will result in 0 with a result of EINVAL (although it isoptional to have EINVAL in case of a non-conversion result).Therefore, you *cannot* trust a result of 0 and must always checkerrno if you get 0, LONG_MAX, or LONG_MIN.
+ 178957 [mental@ry ia] That's the point, isn't it?  0 isn't a boolean value.
| 179044 [cjeker@di ha] Have you ever looked at boolean algebra. The use of 0 as false is just
| + 179054 [matthew.moss] The problem is, if you do that one place (i.e. "oh, this is
| | 179055 [cjeker@di ha] Until here I agree with you.
| | 179062 [matthew.moss] Ooops...  Yup, that was wrong given the context.
| + 179068 [david@va ln ] Recalling the earlier "Why Ruby isn't <insert language name>" thread, someone
+ 178960 [lopexx@au og] 0 is a proper instance of the Fixnum class, how can it be considered as
+ 178978 [alex@de et m] class Person
| 178988 [mental@ry ia] def has_children?
+ 179004 [david@va ln ] This is in my opinion a matter of convention.
+ 179040 [mail@ko fe n] When I started using ruby I had exactly the same problem as you, porting
| 179053 [cjeker@di ha] Does flags[0x01] work with any kind of mask. I thought that flags[3] would
| + 179074 [M.B.Smillie@] The symbols used in Boolean algebra to indicate true and false values
| + 179123 [bob.news@gm ] You are correct.  It should have read
| + 179174 [mental@ry ia] Just because similar symbols are used in entirely different branches
| + 179176 [mental@ry ia] ( x & mask ).nonzero?
+ 179058 [halostatue@g] if (flags & 0x01 == 0x01)
+ 179112 [faker@ya oo ] I just thought I would add to the history of zero being false in C. C was

Relocatable Ruby executable
178952 [ayZIG0106@qa] How can I create a relocatable Ruby executable?  Meaning, that I can
+ 178986 [vjoel@pa h. ] Are you aware of rubyscript2exe? It packages the interpreter + libraries
+ 179017 [david@va ln ] I -think- on Windows the ruby interpreter semiautomagically sets up the paths
  179033 [ayZIG0106@qa] I don't think rubyscript2exe is feasible for a game - think something like
  179126 [matt.mower@g] After initializing the interpreter you can use rb_eval_string() to
  179139 [ayZIG0106@qa] Ah....

block_given? vs defined? yield
178954 [Daniel.Berge] Is there any difference between "block_given?" vs "defined? yield" ?
178961 [matz@ru y- a] They are almost same.  The only difference is the former is a method,
+ 178980 [vjoel@pa h. ] I didn't know block_given? was a method. So there's another possible
| 178983 [chneukirchen] And I didn't know "defined? yield" even existed. ;-) It looks pretty
+ 178982 [vjoel@pa h. ] I didn't know block_given? was a method. So there's another possible
+ 178987 [logancapaldo] I didn't know yield could be considered "defined" or not. Does this
  + 179006 [pan@er kv en] p defined?(:yield)
  | 179007 [pan@er kv en] Sorry. That's nonsense. Ignore me... :)
  + 179178 [florgro@gm i] defined? will usually change the meaning of things following it.
    179208 [david@va ln ] On a slightly related note, "defined? def" doesn't seem to parse as a complete

Re: What's the difference between copying and sharing in clo
178962 [jim@we ri hh] def test_callback_gets_called

c extension: symbols
178963 [clr8.10.rand] { :foo => "this", :bar => "other" }
178971 [cmills@fr es] rb_intern() returns an ID (ID type is defined in ruby.h).  To convert
178973 [clr8.10.rand] thanks for ID2SYM, works like a charm. Is that documented somewhere?
178989 [rmagick@gm i] A lot of the C extension API is undocumented. If you're going to be

Re: plruby
178972 [Daniel.Berge] I don't know that any has submitted it to the PostgreSQL community.

Sandboxing eval'd code
178975 [eastcoastcod] I'm working on a web app with complicated and ever changing business
+ 178979 [pan@er kv en] class String
| 178984 [jgbailey@gm ] Could you elaborate a little more on what you are showing here?
| 179005 [pan@er kv en] I'm showing 3 ways of doing what you want to achieve, in
+ 178992 [google@er kv] class String
| 179000 [konsu@ho ma ] i have been looking for a solution to almost the same problem. but have not
| 179009 [billk@ct .c ] time ruby -e '100000.times { Thread.new { }.join }'
| + 179013 [konsu@ho ma ] could you elaborate a bit? are these numbers good or bad? what about memory
| | 179027 [billk@ct .c ] in about one second seemed to me to indicate that Ruby has pretty
| + 179026 [pan@er kv en] $ time ruby -e '(1..100000).collect{Thread.new{sleep 1}}.collect{|t| t.join}'
|   179034 [billk@ct .c ] Right.  I didn't mean to imply having thousands of live threads
+ 179067 [ruby-talk@wh] Try Ruby uses fork.  I setup the basic environment and then fork new

Why do I have three objects instead of one?
178976 [BPaatsch@ac ] ...
178990 [BPaatsch@ac ] ...

Re: Camping 1.3, the Microframework
178996 [sethrasmusse] Is that the AR convention, or is that how AR operates in the context of
179060 [ruby-talk@wh] Jacob was right about that typo: it's `blog_posts'.

distributing native and ruby version of a library
178998 [clr8.10.rand] I have a simple library, one in a pure ruby version and one in a
+ 179099 [ptkwt@ar cn ] begin
| 179142 [clr8.10.rand] OK, that makes sense. Thanks. I wonder if this could be combined with
+ 179100 [david@va ln ] begin

can't get multipart_form from cgi.rb to work
179003 [ruby@un ie e] I'm fairly new to ruby and wanted to write a very simple cgi program,
179008 [konsu@ho ma ] try running your script from the command line. but set the url and method
179021 [ruby@un ie e] thank you for the suggestions. I set the variables as you suggested
179030 [konsu@ho ma ] i was just suggesting to mimic the web server's behaviour and simulate form
179233 [ruby@un ie e] as I couldn't reproduce the described multipart_form error (see
179237 [ara.t.howard] the problem is in your source i'm afraid.  you can call CGI.new more than once
179270 [ruby@un ie e] Thank you very much, for pointing to the error and for sending two very

[ANN] Subversion Handy Backup, rev 8
179019 [neoneye@gm i] I added a script that sends backups to a FTP server.

[ANN] Geocoder 0.1.0
179035 [paul@cn .o g] Geocoder is a library for Ruby developers and a command-line utility
+ 179037 [ksruby@gm il] Thank you! I've been looking for something like this.
+ 179043 [jeff@op nd m] Hey Paul,
| + 179129 [dsisnero@gm ] ...
| + 179188 [paul@cn .o g] Let me know how you fare: I'd like Geocoder to provide the flexibility
+ 179111 [pjhyett@gm i] Wayfaring.com thanks you :-) This appears to be much more flexible
+ 179180 [ed.howland@g] Paul,
| 179186 [paul@cn .o g] Hm, I don't know of any system, commercial or otherwise, that does
| 179315 [tsuraan@gm i] For my gf's senior project, she made a device for the blind that
+ 179193 [vanweerd@gm ] ...
+ 179211 [wilsonb@gm i] Cool. I'm getting this error on Win32, though..

Newbie
179036 [dishmael@wi ] I just started learning Ruby and as my first project I'm trying to migrate
179056 [logancapaldo] Well I don't know much (if anything) about XMLRPC or SOAP, but if you

how to do instance_eval with arguments
179038 [jim@we ri hh] I'm prototyping a DSL and came across a situtation where I have a lambda
+ 179045 [ mfp@ac .o g] # The following script was annotated with my xmp filter
| 179073 [jim@we ri hh] [... solution elided ...]
+ 179046 [matz@ru y- a] CVS HEAD (1.9) has instance_exec method that works exactly what you
  179072 [jim@we ri hh] Excellent!  I think Matz's time machine is every bit as good as

help using facets?
179041 [anonymous@fo] i just discovered facets and would like to begin using them, but am
+ 179076 [david@va ln ] Couldn't reproduce this with whatever ruby there is in the Ubuntu
| 179080 [anonymous@fo] i'm not anonymous :)
+ 179106 [transfire@gm] Be sure RUBYOPT="-rubygems" then
  179145 [david@va ln ] Gah. #stamp is an instance method? Ah well, I thought it was a class method
  179239 [transfire@gm] Is this what you want?
  179255 [david@va ln ] Yep, something like that. I have no idea how often people need textual

[SOLUTION] Splitting the Loot (#65)
179042 [dbatml@gm .d] Here is my solution.

[ANN] Savannah Ruby Brigade Meeting
179047 [bradleyktayl] The Savannah-area Ruby user group meets every third Thursday of the

About GetoptLong and exceptions
179048 [jaco@ne tt a] I try to play with GetoptLong but i don't know how to handle
179065 [akovbovich@g] Quiet flag
179128 [jaco@ne tt a] Thanks!

Ruby IDE and remote development
179050 [neowulf@ii e] I just thought I'd throw this out there are find out how other people
179075 [M.B.Smillie@] Are you using X over SSH?  If not, that might be an idea.  If so,

Yahoo! Widgets (JavaScript) - do we have a anything like this?
179051 [noSpam@no pa] There is a challenge on Pixel Corps (http://www.pixelcorps.com/)
179086 [david@va ln ] Wouldn't bindings to Linux desktop / window managers let you implement applets
179125 [Nuralanur@ao] ...
179138 [david@va ln ] I believe Glenn called for something that lets him do desktop applets, not
+ 179143 [Nuralanur@ao] ...
+ 179154 [tsumeruby@ts] A standard GUI toolkit could be used to create the widgets, using the
  179162 [david@va ln ] Ah well, here it comes... That is very, very true. Cross-platform GUIs are IMO
  179168 [tsumeruby@ts] Have you even used Tk/Tile?
  179184 [david@va ln ] I had a look at Tile, and it looks promising too. But I tried doing some
  179216 [tsumeruby@ts] Well, I'll reply in the middle of the paragraph. I usually think about ruby
  179226 [david@va ln ] Hmm, how "rubyish" are the Qt and GTK bindings anyway? I have personally a
  + 179243 [mark@sc tt s] That particular thing is solved for Qt4 -
  | 179250 [mark@sc tt s] I think I was wrong. I haven't tried it out, but the README from the latest
  | + 179258 [david@va ln ] Utterly. It seems there's more people around with pet peeves like me. (Run for
  | | 179259 [Nuralanur@ao] ...
  | | 179265 [david@va ln ] I'm not quite running away, since I don't do GUIs, and as it seems, things are
  | + 179319 [tsumeruby@ts] The possibility to use either has been in qtruby for a long time.
  + 179271 [lyle.johnson] FOX uses Hungarian notation in its class names?
    179294 [david@va ln ] Well, sort of. The fact that all the classes start with FX, -and- are in a FOX

how to create singleton methods in script
179057 [cbowmanschoo] Here is a simplified version of a little timekeeper app that I've been
+ 179059 [logancapaldo] [code omitted]
+ 179061 [neowulf@ii e] You may want to try putting your method def's above the code that calls
| 179064 [cbowmanschoo] The following code works but it's awfully ugly putting a method at the
| + 179069 [logancapaldo] Well yes and no. If you stick display_bad_action in the TimeKeeper
| + 179078 [james_b@ne r] There seems to be a conflict of aesthetics.
|   179087 [cbowmanschoo] I Generally agree with you but there are certain circumstances where you
|   179160 [lukfugl@gm i] Third option: I'd put it into an extension module, than have the
+ 179066 [jgbailey@gm ] Just move the method definition to beforer you call it (i.e. above puts

Web Host
179070 [resty_cena@y] I'm looking for a web host that supports Ruby. I'd like to runn Ruby on
+ 179081 [david@va ln ] Someone else over here or on the rails lists might actually have personal
+ 179093 [akulbe@gm il] I am going to be offering Virtual Private Server space for $30-40/mo.depending on the amount of storage space.  You will have root access,and 20GB of space.  I run Gentoo, and you'd be free to install whatyou wanted.
+ 179110 [fred.grott@g] Site5.com seems low cost
  179131 [eain.jones@g] I found the dreamhost to be excellent. Full support for Ruby. I run

can map/collect return fewer values than are found in the target?
179084 [railsinator@] ...
+ 179088 [logancapaldo] new_items = items.reject { |item| VOWELS.include?(item) }
| 179122 [bob.news@gm ] new_items = items.select { |item| not VOWELS.include?(item) }
+ 179090 [marcel@ve ni] Looks like you want Arry#select. In fact, take a look at the docs ;)
+ 179091 [ksruby@gm il] items.inject([]){|a,i| a << i unless VOWELS.include?(i); a}
+ 179096 [david@va ln ] The difference seems to be that Ruby's interpretation of map seems to be
| 179115 [railsinator@] ...
+ 179124 [jeremy@ch os] Strictly speaking, no (AFAIK), but it's easy to fake it.  Use
threads.html
top