## 204596-207794

204456-207560 subjects 204882-239839

Ruby on WRT54G(L)
204596 [jim@fr ez .o] Has anyone installed Ruby on a WRT54GL router?
204607 [nahteecirp@g] I would definitely be intrested in your results. Out of curiousity,
204616 [jim@fr ez .o] I'll be building an ipkg and putting it on the WRT54GL.
204667 [nahteecirp@g] Oh, ok, I jurt assumed you might be doing this through a third party
204672 [jim@fr ez .o] Actually, openwrt. I've heard bad things about dd-wrt wrt the nvram state.
204682 [robert.dober] ...

Manning Ruby/Rails contest
204602 [pat.eyler@gm] Manning is running a contest:  If you make the winning entry, you'll
204823 [david.riccit] ...
204825 [ellisdee@gm ] Ruby is to Rails as Chuck is to Norris

[QUIZ] Chip-8 (#88)
204610 [james@gr yp ] 1.  Please do not post any solutions or spoiler discussion for this quiz until
+ 204613 [james@gr yp ] I know this quiz is a bit longer (to read) than we normally prefer,
+ 204627 [james@gr yp ] It was just pointed out to me that I didn't attach the program.  You
+ 204669 [martin@sn wp] What's not specified here is that the opcodes are written to the file
| + 204710 [lukfugl@gm i] I think you mean 1000 and 1002 in the description above. :)
| | 204724 [nahteecirp@g] ...
| | 204753 [lukfugl@gm i] Ah, gotcha. I was thinking in instruction addressing, rather than
| | 204760 [nahteecirp@g] ...
| + 204732 [james@gr yp ] I would think nils would be more likely to blow up with a problem in
+ 205053 [sander.land@] I implemented pretty much all the opcodes and used Tk to display the
| + 205064 [aleks0@gm il] Heres my solution.  I was more shooting for brevity of code than cool
| + 205182 [james@gr yp ] You can also use HighLine for this.
|   205270 [sander.land@] I installed highline and checked the docs as well as the source and
|   205271 [james@gr yp ] My apologies.  I misunderstood.
+ 205132 [mitchell@ko ] My solution for managing binary numbers was to make a new class
+ 205230 [adam.shelly@] My solution:  It's like a clone of my ICFP solution.  Where's the codex.chip8?

204623 [rxv@ho ma l.] does the colon operator have an anolog in say, Java or C++ ? It seems to be
+ 204628 [perrin@ap th] I tend to guess you're referring to uses of the : character such as the
| 204635 [chiology@gm ] A simple way to describe it may be to look at it as a singleton object
| + 204640 [perrin@ap th] I'm perfectly happy with "object-oriented symbol", but that might be
| | 204663 [dblack@wo bl] I'd just call them symbols, or Symbol objects (just as with strings,
| | + 204666 [ara.t.howard] i like 'symbol literal' as in
| | | 204678 [perrin@ap th] . . . except that doesn't point out the object-orientedness of it.  The
| | | 204684 [chiology@gm ] In my example, using a symbol would be the same as creating a symbol
| | | 204688 [dblack@wo bl] Sorry, I'm not following.  What purpose would the hypothetical
| | | 204693 [chiology@gm ] Really as an example of its objectness. It's a way to look at the
| | | 204696 [dblack@wo bl] You might as well save the round trip, though :-)  It's in the same
| | | + 204703 [chiology@gm ] Indeed. I understand that, just trying to illustrate it to those
| | | | 204708 [dblack@wo bl] I see what you mean.  Symbols do seem to present problems -- they're
| | | | 204711 [nothinghappe] Well, that just makes it even *more* like Lisp than I was thinking.  It hadn't occurred to me
| | | | + 204714 [kevin.clark@] for my take on symbols.
| | | | + 204715 [dblack@wo bl] eval(b)
| | | + 204713 [tom@he me st] => 23208408
| | + 204677 [perrin@ap th] Even better -- more succinct, makes the same point.  Thanks.
| + 204662 [dblack@wo bl] In the general case (i.e., unless you override Foo.new), x and y will
+ 204642 [sastph@sa .c] Tokens that start with colon are called "symbols".
| + 204653 [chiology@gm ] Yep, that's about it, as far as I can tell.
| | 204657 [nothinghappe] Sorry if anyone's beat me to this, I find it hard to keep up with such a busy list...
| | + 204668 [dblack@wo bl] Ruby symbols aren't exactly used as variable names, though.  If you
| | + 204790 [rxv@ho ma l.] Doesn;t that therefore make it the same thing as a reference in c++ ? -Ike
| | | 204797 [kmgaughan@ei] No, because unlike a reference, a symbol doesn't actually refer to
| | | + 204815 [chiology@gm ] Think of a uniquely identifiable, primary key in a database. You would
| | | + 204980 [aleks0@gm il] As far as an analogue in other languages, I tend to think of symbols
| | |   205040 [dblack@wo bl] True, but only if the method that uses them takes a symbol.  For
| | + 207296 [strobel@se u] busy list...
| |   + 207605 [rick.denatal] And by the way the equivalent to
| |   + 207770 [strobel@se u] I think I know :)
| |     207794 [toalett@gm i] - Simen
| + 204789 [rxv@ho ma l.] Ok....so why not just use a String then, and test for equality of the values
|   204792 [dblack@wo bl] Well... if they're not useful, then I don't think it matters whether
|   204852 [martin@sn wp] Note that for this particular use case - faster internal processing on
+ 204694 [kmgaughan@ei] As mentioned elsewhere, Smalltalk and Lisp have operators which allow
+ 204791 [rxv@ho ma l.] No wonder this language is and has been taking off! Not only is the language
+ 207351 [toalett@gm i] My take on explaining Symbols (from the "From other languages" page on
| 207376 [ngoc@ya oo c] Many persons use advanced language to explain Symbols to make it more
| + 207396 [paul@pl ys c] What works for me is to think of a symbol as a uniqued constant (or
| + 207404 [nsmith5@um c] There's (at least) one more key fact (which was hidden inside of the 'use
+ 207558 [pollak@gm il] Ike,

XML2RB, day 2
204624 [erikveen@gm ] gegroet,

Ruby/Tk code critique
204632 [nbnntp1@ml .] I have a bunch of Tk buttons tied to code. They're wrapped in an array
204745 [nagai@ai ky ] Probably, using bindtag' is not so bad idea.

Bug in ruby printf/sprintf
204644 [paul.dlug@gm] I have encountered what appears to be a bug in ruby's printf/sprintf
204649 [jromano@bu i] The equivalent C program under RedHat Linux 3 update 6 x86_64 produces
204654 [paul.dlug@gm] That's interesting. I just tried the same on linux (Gentoo) and you're
204843 [matz@ru y- a] 0      The  value  should be zero padded.  For d, i, o, u, x,
204846 [leslieviljoe] print "|#{str.rjust(10, "0")}|"

find_all wierdness
204655 [oleg@th wo k] book.chapters.find_all{ |chapter| !chapter.pages.empty? }.size
+ 204681 [kenosis@gm i] Can you send any more context for your use?  I've used find_all on many
+ 205026 [dan-ml@da 42] Try to use select instead of find_all. In this case I think you are actually
205541 [oleg@th wo k] Thank you Daniel. That was it.

Finding "\" in a string
204665 [Eric.Armstro] I'm going crazy, right? Surely it is possible
+ 204674 [abergeron@gm] => nil
| 204716 [Eric.Armstro] You would think so, wouldn't you? But note that
| 204719 [pbattley@gm ] That's right. The replacement string understands back-references of
| 204746 [Eric.Armstro] Very helpful. At least now I have a good idea that it
| 204752 [pbattley@gm ] However, in order to be able to produce a literal \1, it also needs to
| 204757 [logancapaldo] gsub(%r{\}) { '\\' }
| + 204759 [pbattley@gm ] s = "\\foo" * 1000000
| | 204765 [logancapaldo] I'm sure it is. I'll learn how to decipher backslashes in gsub when I
| + 204761 [Eric.Armstro] Omigawd. I'm more confused than ever! But
| + 204767 [Eric.Armstro] That's odd. I would have expected that to work,
|   204770 [logancapaldo] Sorry, that wasn't meant to be a _real_ example. It was just the idea
|   204776 [Eric.Armstro] No problem. If I had sufficient understanding, I would
+ 204717 [pbattley@gm ] You're not going crazy. You just need eight of 'em. Yes, really!
+ 204772 [w_a_x_man@ya] \\foo\\bar
204774 [pbattley@gm ] Nice solution.
204778 [Eric.Armstro] I'll say! Wild! What makes /that/ work???
204784 [w_a_x_man@ya] \& is simply what was matched by the regex.
204925 [Eric.Armstro] Too cool. I love it.

Custom Exception classes
204686 [clark.snowda] I'm new here so please be gentle (i.e. if I'm posting in the wrong place
204730 [vikkous@gm i] The following works for me. If you have code that doesn't work, then
204935 [drbrain@se m] Please don't subclass Exception as a plain rescue won't catch these.
+ 204952 [vikkous@gm i] Ah, good point. Thanks for the tip; it hadn't occurred to me. I've
+ 205143 [sean.ohalpin] I'm sure that used to be the case but it must have changed around 1.8
+ 205144 [nobu@ru y- a] AFAIK, it has never changed.
+ 205254 [drbrain@se m] Are you sure?
205309 [sean.ohalpin] No - you're right. I keep getting this mixed up :/

calling a task in rant at any time (not just as a prerequisite)
204687 [jtprince@gm ] task :test => [:build] do    # calls :build before :test
204743 [Eric.Armstro] In Rake, I put the contents of the :myaction

Regex for whitespace plus vertical bar
204689 [robertlaferl] I am trying to quote arguments that have whitespace or a pipe (vertical
+ 204695 [dblack@wo bl] irb(main):008:0> "abc|".index(/[\s|]/)
+ 204697 [M.B.Smillie@] matches a or b, where a and b are arbitrary regexes.
| 204758 [w_a_x_man@ya] Not in a character class.
+ 204701 [jason.sweat@] $irb Calling a dynamically generated Ruby script from a .rb 204691 [robertlaferl] I have a Ruby script that dynamically generates a Ruby script. I would + 204698 [chiology@gm ] require name | 204699 [chiology@gm ] Or, maybe, in the generated file, have the main bit of code you want | 204740 [chiology@gm ] Also, another option could be to call... | 204780 [caldridge@gm] irb(main):002:0> load 'module.rb' | 205021 [robertlaferl] % cat rtest.rb | 205023 [decoux@mo lo] f.close + 205134 [interfecus@g] Why not just eval the generated code? Fwd: [UPDATE] RubyConf 2006 registration pre-info 204712 [jim@fr ez .o] On one hand, perhaps the hardcore, with their polling scripts and high 204806 [znmeb@ce ma ] Ah, but for performance, shouldn't you write the script in C? [ANN] ZenTest 3.3.0 204720 [ryand-ruby@z] ZenTest version 3.3.0 has been released! + 204804 [devlists-rub] gem install ZenTest | 204827 [devlists-rub] working now.. thanks! + 204834 [the.mindstor] [quote] 204856 [user@do ai .] Honestly, you should ! If you use autotest for more than 5 minutes 205148 [joevandyk@gm] Say, how do I get the Rails view tests to be ran by the default rake 205255 [drbrain@se m] Eric Hodel - drbrain@segment7.net - http://blog.segment7.net 206711 [robmnl@gm il] ... Puts bypasses access restrictions on to_s? 204726 [leslieviljoe] I read somewhere that "puts" calls "to_s" on an object to get a string + 204738 [khaines@en g] irb(main):008:0> rs.__send__(:to_s) + 204741 [pbattley@gm ] Interesting question. I had a look at the C source, and it uses 204844 [leslieviljoe] That seems wrong! Not that you can bypass access restrictions, which I RubyConf: Standard conference tactic. 204748 [Eric.Armstro] The organizers may already know about this, but (none) 204779 [shodson@gm i] ... Wild ideas: Finding a missing 'end' 204788 [schapht@gm i] I was just reading a nuby question from the rails list and I had this + 204828 [wrecklass1@g] Yes, it has been considered. Unfortunately allowing the | 204858 [dblack@wo bl] But surely just a warning can't be harmful, even if it mentions what | + 204860 [shevegen@li ] I agree as far as giving the coder the exact error line in a better way | + 204861 [drnicwilliam] I think its better for it to guess than to just return the last line of | 204899 [masukomi@gm ] ... | 204900 [dblack@wo bl] The solution could be to give a specific hint if it's a simple case, + 204910 [pbattley@gm ] Like this? Re: Heredocs and white space 204795 [dblack@wo bl] The thing is, the mechanism depends on an exact match. Here's an 204798 [dblack@wo bl] Actually I don't think I answered your question. Looking at your 204810 [johnwilger@g] Seems to be specific to the "<<-" notation. Rails in Fink 204807 [rangerrick@g] I went to OSCON this week, and after all the great stuff on RoR I just Using http-access2 to get peer_cert 204813 [dsutch@gm il] Is there a way to use http-access2 to obtain the peer's SSL 206718 [nakahiro@sa ] No choice but to use (awful) verify_callback. It must be doable. I'll Debug history, a la irb/ext/save-history 204818 [the.chrismo@] ... What method should a class provide for printf's %c format string ? 204835 [gerr41@sh om] #!/usr/bin/ruby 204845 [florgro@gm i] I guessed that it would try to implicitly convert the object to an 204850 [gerr41@sh om] Yes, that was the solution, thank you very much. I must say it is a bit 205317 [logancapaldo] The rule for things like to_int, to_ary and to_str are basically if How to md5 a file? 204838 [bjohnson@me ] Basically I want to generate an md5 hash from considerably large files + 204839 [bjohnson@me ] I neglected to include some neccessary details, sorry about that. | + 204847 [langstefan@g] There are basically two options. | + 204881 [ssmoot@gm il] I use the SHA1 digest for this since it's "more unique", so that gives + 205157 [interfecus@g] I conducted a few tests to compare the performance of different + 205159 [rasputnik@gm] Won't this return true for cases where the files are of different | 205160 [interfecus@g] There's a separate check for file size. It checks first that both files + 205166 [vincent.four] ... + 205167 [garbagecat10] I notice that MD5-generation is not twice as time-consuming as string 205172 [jan.svitok@g] The choice of CRC32/md5/sha1 is a time/space vs false positive Ruby comprehensive "slow" reference 204849 [leslieviljoe] I tried to find online explanations for the '%' and '?' operators used + 204854 [jan.svitok@g] In fact, it's not an operator, it's an integer literal. + 204855 [alexandru@gl] which may have references to other ruby quick refs as well, haven't cgi vs. fcgi question 204853 [tallison@ta ] cgi = CGI.new("html4") 204909 [chiology@gm ] Or you could use another library, such as Builder or Markaby. 204927 [tallison@ta ] never heard of them. How do I install these? + 204928 [TimHunter@nc] You are in for a treat. http::rubyforge.org is the home of both | 204938 [tallison@ta ] Looks like CPAN.org to me. | 204944 [james.britt@] Go to RubyForge and locate the rubygems library. There's a search field | 204995 [tallison@ta ] I started playing with this and ran into a lack of PATH (I guess). | + 205060 [james.britt@] Does your code include | + 205063 [TimHunter@nc] You don't have to stumble around in the dark while waiting for some kind + 204929 [chiology@gm ] [sudo] gem install builder keystroke logger 204859 [derekhaskin@] ... 204919 [perrin@ap th] This question looks awfully familiar. build error on cygwin 204864 [uval@rz un -] I am trying to install ruby1.8.4 204893 [znmeb@ce ma ] Do you just need Ruby on CygWin, or do you need to build it from source? 204894 [znmeb@ce ma ] Oops ... didn't see that. It looks like you don't have enough privileges 204932 [uval@rz un -] actually I am logged in as administrator on XP + 204940 [nobu@ru y- a] It occurs at compile time, not installation. The privileges + 204958 [wrecklass1@g] That's very odd. I've installed Cygwin with Ruby on several Win XP 204963 [znmeb@ce ma ]$ irb
+ 204964 [hal9000@hy e] Try unsetting your RUBYOPT or installing rubygems (which has
| + 204965 [wrecklass1@g] I have seen that, and usually you need to unset RUBYOPT. The problem
| + 204971 [znmeb@ce ma ] Yep ... first undefine RUBYOPT, then re-install rubygems, then re-set
+ 204993 [uval@rz un -] yes, this is what it says
205042 [znmeb@ce ma ] The fix was posted. What was happening on my system was that I installed

RUBY "for the rest of us"  conference   Was: About last night ...
204868 [gsc@om ga og] ...
204872 [dblack@wo bl] **Please** don't write "RUBY", especially if you're going to give and

Webrick serving php pages?
204878 [shevegen@li ] I carry many .php pages, but I mostly write in Ruby these days.
204888 [jan.svitok@g] It should be possible to use command line php (php.exe on win)
204905 [chiology@gm ] Mongrel's plugin support will be available soon, and I'm going to take

Re: Nitro/Og 0.31.0
204879 [jp@je fp it ] Mea Culpa.  My appologies to the Nitro team.  Poor choice of words on my
204885 [anne@wj .h r] Just one file and I got a redirect in nitro, whereas rails has millions
`