220813-222719

220625-221947 subjects 221011-225351

^ about require
220813 [chen_li3 yah] In Ruby why do we wirte code as  require 'enumerator', instead of
+ 220819 [gavin.kistne] Because you are specifying the name of the file that the Enumerator
| 220822 [chen_li3 yah] Where is the default path that Ruby looks for? What if I want to ask
| 220825 [gavin.kistne] ...
+ 220829 [aredridel nb] Because classes and files don't have a 1:1 mapping, and filesystems on

^ ANN: JRuby 0.9.1
220836 [enebo acm.or] The JRuby team is pleased to announce the release of JRuby 0.9.1.

^ Easy way to check is sub!() succeeds?
220837 [nwiger scea.] the language. This code is part of a script called "untar", which is a
220841 [gavin.kistne] Er, no it doesn't.
220867 [nwiger scea.] Ok, that makes more sense. Turns out I was upsetting Ruby's

^ how to calculate file number in  a folder
220842 [chen_li3 yah] I write a script to find out all the file names and the number of files
+ 220843 [gavin.kistne] Here's one way. (There are many, I'm sure.)
| 220853 [chen_li3 yah] Thank you,
+ 220855 [snacktime gm] files = Dir.entries('/tmp')

^ Dynamic websites?
220845 [jonsdenni gm] can ruby be used to create dynamic web pages? for example, using ruby to
+ 220846 [amerine gmai] No.
+ 220848 [james.britt ] That happens in the browser.  Browsers understand JavaScript, but not Ruby.
+ 220875 [ jupp gmx.de] Please explain "to create rollover images". Thank you.
+ 220889 [nospam nosit] In order for server-side code to roll images over, it would have to push new
+ 220899 [david vallne] o=20

^ Template question (easy)
220847 [justingoodma] So I originally took up a project of making a simple blog for myself
+ 220849 [curtis.schof] Would
+ 220850 [curtis.schof] Wait..
| 220851 [justingoodma] I haven't had much practice with partials yet. I assume from what I
| 220852 [gavin.kistne] Step 1) Start on the ruby on rails group instead of the ruby mailing
+ 220854 [payton foolo] It sounds like what you're looking for is layouts.

^ rexml difficulties
220856 [cs5b yahoo.c] I am using REXML and at times, it seems to have difficulties "seeing" a
+ 220858 [james.britt ] What do you mean by "XML escaped"?
+ 220888 [nospam nosit] Show us the problem. There are many kinds of character sequences that are
  220893 [hhausman gma] It sounds like you might have some experience in this area. Not to
  + 220900 [james.britt ] "Base64 encoding, specified in RFC 2045 - MIME (Multipurpose Internet
  | 220901 [greg.kujawa ] This is something that I personally use for a Ruby routine I have that
  | 220902 [cs5b yahoo.c] I was just calling REXML::Text.normalize...I guess that is not
  + 220912 [nospam nosit] Okay, you need to know I am famously lazy. In fact, I think Larry Wall was
    220917 [hhausman gma] Thanks for this insight.
    220958 [nospam nosit] / ...

^ [ANN] Dependency 1.0.0
220861 [twoggle gmai] class StockWatcher
220868 [vjoel path.b] require 'observable'

^ Ruby and Perl
220862 [chen_li3 yah] I teach myself some Perl before I change to Ruby. I am just curious: If
+ 220865 [khaines enig] No.
+ 220887 [nospam nosit] Another poster has given you the answer, but I am curious about why you
  + 220906 [squeamz hotm] Such as... ?
  | 220911 [nospam nosit] 1. The next version of Windows, the one that Microsoft had intended to
  | + 220928 [paul plsys.c] Add to that virtually any government funded large project.
  | | 220957 [nospam nosit] / ...
  | + 220934 [david vallne] at
  + 220926 [adrianh quie] Because some of us have used Eiffel, Smalltalk and Lisp
    220956 [nospam nosit] / ...

^ multi dim array?
220866 [gijs.nijholt] I have a multi-dimensional array.. walking through an incoming string
+ 220869 [wilsonb gmai] some_alphabet.detect {|e| e == "c"}[1]
| 220871 [gijs.nijholt] hm, tried several things with detect() and they all gave a nil error
| + 220873 [gavin.kistne] I think you want the String#tr method. It replaces each character in a
| + 220874 [gijs.nijholt] nevermind, it does work but something else was throwing nil errors..
+ 220876 [shortcutter ] Is this what you want?
  220877 [gavin.kistne] Ooh, that's elegant, using gsub's block like that.
  220886 [vjoel path.b] reg = Regexp.new(r.keys.map {|k| Regexp.quote(k)}.join("|"))

^ Using Mocha to mock an object
220882 [joevandyk gm] class Order
220883 [joevandyk gm] Order.stubs(:export_unshipped_orders).returns("what's going on?")

^ threaded Socket call blocks main thread
220891 [joost spaceb] any insights.
220910 [nospam nosit] Obviously when you join the thread, it can block the main thread. But in my
220915 [joost spaceb] It seems very limited then. Just an easy way to parallelize (sp?)
220919 [snacktime gm] ...
220922 [joost spaceb] Truly a hidden ruby gem. I would have never found it on my own. Many

^ Writing IMAP->GMail proxy... Where to go for IMAP RFC help?
220894 [exabrial gma] Hey everyone, this is only a partial ruby question... I discovered a
+ 220896 [garbagecat10] I'm unaware that Gmail even supports access by IMAP clients. Do you know for
| 220897 [cdcarter gma] for
| 220948 [garbagecat10] It would have to be a gateway rather than a proxy. (Of course these terms
| 220961 [ruby anthrop] } >
+ 220904 [phasis68 hot] If you know python, iGmail :: An IMAPv4 gateway to

^ uninitialized constant Locale::System (NameError)
220905 [reid.thompso] Can anyone point me to a resolution for this error?
220909 [nospam nosit] "Locale::System". Please post the actual "require" line so we can make a

^ `gem_original_require': no such file to load
220913 [pere.noel la] i get a cyclic prob using ruby gems , each time i upgrade Ruby and/or

^ One more way to parse XML...
220916 [pete jwgibbs] I thought I'd put this out to see if there's any interest.
+ 220929 [rossrt rosco] This looks pretty cool. It has echoes of the Jakarta Commons Digester,
| 220975 [pete jwgibbs] Hmm, yes.  I hadn't come across the "digester" before, but there
| 221023 [rossrt rosco] Yes, it is pretty useful in some cases. The Ruby version is rather
+ 221302 [pete jwgibbs] Yes, I took a brief look, but it didn't immediately seem to be what

^ Press any key, not any key + enter
220920 [jes luretank] Greetings
+ 220946 [matz ruby-la] Platform please.
| 220951 [jes luretank] ruby 1.8.4 on both
| 220955 [gene.tani gm] ...
| 221007 [jes luretank] Gene
| 221046 [gene.tani gm] ...
+ 221008 [james graypr] character
  221022 [jes luretank] Very nice, works flawlessly on both Linux(ubuntu) and WinXP.

^ sudo gem install -r webrick FAILED
220921 [pere.noel la] ~%> sudo gem install -r webrick
221091 [david vallne] I could've sworn WEBrick was part of the standard library.
+ 221093 [rob ocstech.] on the side, "webrick".
+ 221221 [drbrain segm] It is.

^ instance_eval && class_eval
220932 [am artbot.de] I'm just studing some metaprogramming and came across some problems.
+ 220933 [fxn hashref.] define_method defines an instance method both in the instance_eval
| 220938 [am artbot.de] yes (see also my solution I provided at the end of my msg), but this
| 220943 [fxn hashref.] Ah yes, I see it now. I join the question, a posteriori looks like
+ 220942 [gavin refine] I'm not surprised by that. I'm surprised that standard def...end syntax
  220944 [decoux moulo] def is a keyword and it don't use self to know where the method must be
  220950 [fxn hashref.] Good!
  220954 [decoux moulo] ruby_class : it's in the source, this mean that it's documented :-)

^ Signal handling behaviour change after ruby upgrade
220937 [andrew walro] I use an init system written in ruby for my Gnu/linux distro, and it
221013 [matz ruby-la] It was caused by a partial backport from the HEAD.  The problem was
+ 221016 [andrew walro] Well ok, but don't let it happen again ;)
+ 221122 [david vallne] Time machine batteries dead?
| 221137 [matz ruby-la] Usually I am living in the future.  But I am in the States now. ;-)
| 221138 [znmeb cesmai] Yeah ... it's tomorrow where you live. :)
+ 222719 [andrew walro] Fixed - thanks!

^ Is  GC a class or module?
220939 [chen_li3 yah] On page 8 of 2nd Pickaxe or when I type ri GC under a window prompt
220940 [ruby anthrop] } Hi guys,

^ BaseFactory -- problem in reusable metaprogramming
220945 [transfire gm] I'm playing with this simple Factory pattern whereby the base class is

^ [ANN] RMagick 1.14.1
220947 [TimHunter nc] I've just uploaded RMagick 1.14.1 to RubyForge. This is a very minor

^ calling Perl script from Ruby
220962 [petermichaux] I have a Perl script that takes an input and outputs a string. I would
220963 [zoso foton.e] output =3D `perl myperlscript.pl arg1 arg2`

^ A Comparison Of Dynamic and Static Languiges
220964 [atbusbook ao] I'm doing a report on the speed of develipment and executionin varius
+ 220965 [s-mar nospam] Perhaps you should do your own work so you'll understand the concept and
+ 220966 [nospam nosit] What you should be doing is learning basic literacy.
| + 220974 [gwtmp01 mac.] No comment on the whole homework issue, but I think it is important
| | + 221017 [nospam nosit] / ...
| | | 221090 [david vallne] =46rom my own wombling around various internet communities, the most
| | + 221178 [dingbat code] How many of those posting their class homework from AOL.com are
| | + 221180 [martin snowp] Sumimasen. Nihongo wa watashi ga sukoshi hanashimas.
| + 220986 [bik.mido tis] ++! We've had to argue some years ago (not that I expect you to
| + 221098 [Bil.Kleb NAS] Sad this response I am.
|   + 221115 [david vallne] It's not the bad grammar (or rather, spelling) that's being bashed, but
|   | + 221119 [billk cts.co] If I guess correctly at Bil's observation, it may be that a
|   | | 221121 [david vallne] Evidence would suggest...
|   | | + 221125 [billk cts.co] Good point.  =D
|   | | + 221264 [hal9000 hype] I've never seen "coo de tar" anywhere, but I have seen "wallah"
|   | + 221174 [Bil.Kleb NAS] Please just move on to the next post then.
|   + 221148 [nospam nosit] I was simply pointing out another language the OP should be learning, along
|   | + 221149 [paul iconopl] Can I suggest your lack of tolerance, combined with your brusqueness
|   | | + 221154 [nospam nosit] You have just advertised, not my intolerance, but your own. Physician, heal
|   | | | 221457 [poopdeville ] You're reaching.  No, he didn't advertise his own intolerance.
|   | | + 221181 [doodpants ma] I agree completely. However, your mistake is in assuming that the OP is
|   | + 221175 [Bil.Kleb NAS] Whatever the case, please try to convey a more gentle,
|   + 221267 [hal9000 hype] Can't we be both??
|     221275 [carl.lerche ] Heir's mai kode.
+ 220968 [ptmcg austin] yer dreemin sorry not intrestied due yer onn homework
+ 220976 [sturlamolden] And why would any of this tell you anything about static versus dynamic
+ 221019 [foamdino gma] Why would people want to send you code?  I can understand asking for
+ 221183 [martin snowp] You know, despite what everyone else has said, I don't think this is a

^ (none)
220969 [corey.baswel] unsubscribe

^ search file in a directory
220971 [chen_li3 yah] Which built-in method is used to search a file in a directory and all
+ 220977 [shortcutter ] As always, there are more ways, depending on what you want to do.  For
+ 220978 [TimHunter nc] timothyhunter$ ri Find
| 220991 [chen_li3 yah] Thank you for you all,
+ 221042 [ebonakDUH_ h] Yup, I was looking for something similar, a simple way
  + 221055 [chen_li3 yah] Me, too. I need to spend some time to read the documentation and figure
  | 221061 [shortcutter ] Didn't you see my last reply?  Do we have a gateway problem again?
  | + 221064 [chen_li3 yah] As  I reply to EB I need time to read the doc and write the script by
  | | 221069 [shortcutter ] Regards
  | + 221396 [james graypr] We took some pretty drastic measures when we addressed the last
  |   221399 [gavin.kistne] If "locked down" is meant to imply "dialed in", i.e. functioning
  |   221465 [gethemant gm] Just out of curiosity...
  + 221086 [chen_li3 yah] I think Robert kindly provies a pretty neat script which is what I want.

^ Re: Writing IMAP->GMail proxy... Where to go for IMAP RFC he
220972 [exabrial gma] Nope, better. The idea is a IMAP  interface to gmail. Call it a gateway
220979 [kashia.buch ] Hell, I'd use it!
220995 [email_here p] Hell, me too :)

^ How to test if a module/gem is installed
220982 [snacktime gm] Is there a way to test if a particular module/extension/gem is
+ 220989 [transfire gm] module Gem
+ 220994 [paul plsys.c] If you know the library name for a require statement, use require and
  221038 [james2mccart] you can find all the installed gems with a version of this;
  221039 [james2mccart] probably need brackets around trun in the return(true)
  221080 [snacktime gm] Thanks for all the tips guys, was a great help.

^ Conditional modifier syntax
220983 [pgquiles elp] charset="iso-8859-15"
+ 220984 [vincent.four] a if b
+ 221113 [david vallne] iers?

^ [ANN] Ruby-VPI 8.1.0
220987 [skurapat ucs] Version 8.1.0 (2006-10-21)

^ Turning off WEBRick server logging (XMLRPC)
220988 [adam usa.net] I've implemented an XMLRPC server using xmlrpc/server.
220992 [khaines enig] When you create your webrick httpserver instance, one of the paramters
220997 [adam usa.net] Thanks for your response. Yes, I see in the XMLRPC::Server source the

^ What is wrong with my code
220990 [chen_li3 yah] I write two srcipts to check  files in a given directory. Version 1 uses
+ 220993 [linguist gma] file in those cases should just be the file name, without the path info.  So
+ 220998 [tdenkinger g] Dir.each returns the file, without the path information.  You'll need to
+ 221006 [nospam nosit] Explain. What error messages did you see? You need to provide more
+ 221012 [vipeak gmail] Use File.extend_path to convert path to absolute path.I think there is
+ 221032 [shortcutter ] So you want to sum sizes of all files in a directory hierarchy whose
  221084 [chen_li3 yah] Thank you very much for the code. Based on what I understand and what I
  221104 [nospam nosit] / ...
  221116 [chen_li3 yah] Thank you very much. I have a Pickaxe but it is at home.

^ DRY fanatics?
220999 [gilesb gmail] Anybody know a way to make this DRYer?
+ 221000 [vjoel path.b] This doesn't help much, unless the 3 comes from a variable, but ...
+ 221002 [ruby-ml kitt] \1, \2 etc. may be used to refer to previous numbered groups.
| + 221005 [james.britt ] Indeed.  Irony at its best.
| + 221034 [shortcutter ] Which does not help in this case because that makes it match the same
| + 221102 [ruby-ml kitt] Giles, if the above came across snide--it was meant to. I do,
|   + 221128 [foamdino gma] I'm actually grateful that the Rails people have pushed the idea of
|   | 221224 [gilesb gmail] The acronym actually comes from "The Pragmatic Programmer" and if the
|   + 221223 [gilesb gmail] well DUH
+ 221004 [kbloom gmail] That's fine. I see no reason to make it more obfuscated. A couple tips
| + 221194 [lukfugl gmai] Using /.+?/ (which is really equivalent to /..*?/ and thus in the same
| + 221222 [gilesb gmail] Well, see, I used to be a Perl guy. I'm used to thinking of
| + 221292 [ml.morus.wal] Really?
+ 221317 [martindemell] grp = %{ '([^']+)'}
  221509 [rick.denatal] Still too WET!
  221516 [Gennady.Byst] rx = Regexp.new ['^([\w,]+)', *["'(.+?)'"]*3].join(', ')
  + 221529 [gilesb gmail] Beautiful! Or wait, did I mean beautiful? Maybe I meant sick and wrong.
  + 221575 [rick.denatal] NO NO NO!
    221589 [gilesb gmail] lol

^ rubygems only runs as root
221009 [jzakiya mail] Loaded the lastest rubygems (0.9.0) as root, like always,
221028 [lyle.johnson] The 'gem' command is just a front-end to code in the RubyGems library,

^ Pipe shell output to ruby -e?
221010 [caldridge gm] I know this has been done before but search yields nothing :-\
+ 221014 [billk cts.co] echo hello | ruby -e "puts gets"
+ 221033 [ebonakDUH_ h] echo "hello" | xargs ruby -e 'puts ARGV.to_s'
  221135 [caldridge gm] Awesome. Thanks so much!
threads.html
top