198654-227029

198446-303004 subjects 198810-202106

Object browser
198654 [johnatl@ma .] Is there a graphical, hierarchical object browser available for Ruby?
+ 198680 [benjohn@fy h] And wouldn't it make a lovely little easily "require"d web server?
+ 198705 [jmg3000@gm i] Well, I think FreeRIDE has one built in.
| 198730 [schapht@gm i] Eclipse too!
+ 198707 [jason.sweat@] Regards,
+ 198721 [gene.tani@gm] ...

[QUIZ] pp Pascal (#84)
198657 [james@gr yp ] 1.  Please do not post any solutions or spoiler discussion for this quiz until
+ 198678 [alexandru@gl] 1     1
| 198681 [bulliver@ba ] charset="iso-8859-1"
| 198690 [cdc@cy he s.] =20
| + 198697 [M.B.Smillie@] It's not the last row, but each row where the length of the longest
| | + 198698 [schapht@gm i] Anyone have any critique on this one?
| | | 198700 [lukfugl@gm i] A)  --- -- -- -- ... (spaces between the ones) .. -- -- -
| | + 198702 [alexandru@gl] I'm also curious what is the policy in asking for clarifications,
| | | 198710 [james@gr yp ] I'm fine with most discussion.  Let's let code out of it, and try not
| | | 198718 [alexandru@gl] I didn't know that, that's why I was trying so hard to understand
| | | + 198726 [schapht@gm i] I quite enjoyed right aligning on one side, left on the other and
| | | + 198727 [james@gr yp ] 1.  Find the longest number in the result set.
| | |   198744 [alexandru@gl] Yes, but you can never center a 2 bytes long string on 3 bytes
| | + 198709 [james@gr yp ] James Edward Gray II
| + 198704 [bulliver@ba ] charset="iso-8859-6"
|   198711 [lukfugl@gm i] I agree, it doesn't need to be perfectly equilateral, etc. I've
|   198716 [louis.j.scor] I suppose that, due to the nature of Pascal's triangle, the important
+ 198703 [lukfugl@gm i] (Obviously this won't display well in 80 columns, you'll want to copy
| + 198715 [SimonKroeger] 1    1
| + 198859 [matthew.moss] Reminds me of certain chaos theory problems, where a simple rule turns
|   + 198860 [matthew.moss] Hmmm, I doubt copy-n-paste will work, but just try running your own
|   + 198882 [rretzbach@go] Awesome! Did you find them on accident or did you think about the
|     198889 [matthew.moss] Found one of them on accident, typing the wrong number. Then I started
|     198893 [louis.j.scor] #!/usr/bin/env ruby
+ 198712 [erikveen@dd ] Did you know that you need only 36 bytes of Ruby code to build
| 198762 [pbattley@gm ] I've got 32 bytes here :-)
| 198764 [erikveen@dd ] That was an easy one: map is 4 characters shorter than collect.
| 198774 [pete@no ah t] Damn. I'm stuck at 37. This is going to drive me nuts all day. :)
| 198784 [brian.matter] Does that 31 bytes include storing the result of the statement?
| 198793 [erikveen@dd ] No, not storing, just building. The right hand side of the
| 198796 [pbattley@gm ] If you don't want to store it, and predefine a certain function (which
| + 198797 [erikveen@dd ] Personally, I don't build the triangle at all. I mean, I don't
| | 198854 [eric.duminil] You really don't need to build the whole triangle to know the length of the
| | + 198855 [eric.duminil] Wow....
| | + 198856 [erikveen@dd ] gegroet,
| + 198815 [erikveen@dd ] Personally, I don't build the triangle at all. I mean, I don't
|   + 198823 [znmeb@ce ma ] Not a spoiler, but a hint from someone who learned about Pascal's
|   + 198826 [brian.matter] Its fairly easy to calculate the maximum digit in the triangle without
|     + 198835 [erikveen@dd ] I found a pretty good explanation on [1].
|     + 198851 [znmeb@ce ma ] If you've got a really wide screen, think Stirling's approximation. :)
+ 198731 [brian.matter] How about something like: http://rephorm.com/files/dump/pascal28-2.txt
| 198733 [erikveen@dd ] No, you don't... ;]
| 198734 [brian.matter] Oops :)
| + 198742 [erikveen@dd ] I added erroring to the left on the left hand side and erroring
| + 198754 [SimonKroeger] looks realy nice.
|   198760 [dbatml@gm .d] Wow, very interesting!
+ 198861 [rretzbach@go] I had fun doing this, but my output - and thus way of thinking - is a
+ 198881 [rretzbach@go] I think my solution ist not very fast, though I don't use recursion to
| 198883 [eric.duminil] That's indeed pretty slow!
| 198884 [erikveen@dd ] That's not slow at all, for an old 486 with 8MB of memory... ;]
| 198885 [eric.duminil] I totally agree, that was rather silly.
| 198995 [erikveen@dd ] clock_cycles = elapsed_time * cpu_speed
+ 198902 [eric.duminil] here's my solution, next to few examples.
| + 198909 [ma3oxuct@gm ] The output is almost perfect on a console, plus different fonts have
| + 198957 [erikveen@dd ] ...
+ 198918 [gregory.t.br] require "rational"
| 198941 [chneukirchen] Given this, I can't resist but "break the rules" even further---by not
| + 199145 [pbattley@gm ] Aha! I had a go at it in Haskell, too, and used the same zipWith technique.
| | 199166 [chneukirchen] Nice to see you doing Haskell... :-)
| | 199219 [logancapaldo] Yet another great use of enumerator
| + 199200 [louis.j.scor] Muhuhaha.  Would it be too horrible to say that I like the common lisp version?
+ 198919 [james@gr yp ] ...
| 198922 [lukfugl@gm i] ...
+ 198928 [matthew.moss] My first solution, a straightforward implementation that was
| 198939 [ma3oxuct@gm ] Here is another solution that I came with up with. The output is not
+ 199046 [farrel.lifso] numberOfRows = ARGV[0].to_i
| + 199052 [dpoon@oc .b ] $ time ./pp_pascal.rb 185 > /dev/null
| + 199157 [james@gr yp ] Just thought you might want to know that we generally use this_style
+ 199057 [seanacarley@] ...
| 199158 [skurapat@uc ] IMHO there is too much re-computation of nth_row() in this
| 199251 [seanacarley@] ...
| 199310 [skurapat@uc ] Ah, good approach. :) I keep hearing about this, but it's hard for
+ 199186 [brian.matter] I realize I'm late submitting this, and its already been swamped by all
+ 199189 [matthew.moss] Wow...  If this quiz hasn't set the record for number of entries and
| + 199197 [brian.matter] Definitely. Vastly differing styles, also. I've been following the
| + 199362 [james@gr yp ] It's the most popular quiz ever by no small margin!
|   + 199377 [hawkman.gelo] ...
|   | 199394 [james@gr yp ] <laughs>  I'll survive.  Thanks for the terrific quiz Dirk!
|   + 199444 [knorton@me i] Ok, I wasn't going to send this in, but if it means making the most
|     199549 [mouyigang@gm] ...
|     199553 [botp@de mo t] # puts (0...ARGV.first.to_i).inject([[1]]) { |a,x|
+ 199205 [matthew.moss] I had one more try... to see how small I could make the code without
  199214 [louis.j.scor] [snipped run-times]

Accessing content_type locally
198660 [larrytheliqu] ...
198772 [logancapaldo] I think this is as close are you are going to get: http://raa.ruby-
199181 [larrytheliqu] ...

Global Exception Rescue
198663 [james@gr yp ] I need to run a script in a special environment.  I need to change
+ 198666 [shortcutter@] - use at_exit
| 198677 [james@gr yp ] Is there any way for me to tell, at the time these are invoked, that
| 198802 [chneukirchen] IIRC, $! is set.
+ 198675 [schapht@gm i] begin
| 198676 [james@gr yp ] This is what I've been using, that had to be replaced.  :(  The
+ 198687 [ara.t.howard] STDIN.reopen(open(__FILE__))
  + 198708 [james@gr yp ] You are my hero!  Thank you so much.
  + 198732 [schapht@gm i] Can you explain why you have STDIN.reopen(open(__FILE__)) there?
    198738 [ara.t.howard] james had said in the original message that his 'wrapper' was doing some

Warning message about "initialized constant"
198667 [pbailey@bn .] This is part of a script I use that simply ftps a bunch of files over to
+ 198669 [tony@tw nc d] o=20
| 198672 [tony@tw nc d] Sorry,
+ 198670 [cremes.devli] One of the conventions of the Ruby language is that capitalized
+ 198673 [farrel.lifso] Variable names beginning with uppercase are treated as constants by
  198701 [pbailey@bn .] Thank you to all of you. I guess this is pretty important stuff. Because

[OT] Re: ruby-lang.org redesign?
198671 [ara.t.howard] indeed - there is a rash of it lately - i can barely follow threads it's so
198691 [M.B.Smillie@] what's so confusing?

RubyForge in Ruby?
198682 [pollak@gm il] ...
+ 198684 [sambient@gm ] what about building it in .NET ?
| 198706 [alexandru@gl] Without disrespect, why? :)
| + 198713 [james.britt@] Is it?  Because that's pretty much how this would happen.  Someone with
| | 198816 [hramrach@ce ] Well, I am not going to write rforge as I got other stuff to waste my time on.
| + 198714 [sambient@gm ] It was meant as humor and sarcasm.  I was not being serious.
+ 198694 [jmg3000@gm i] IMO, there's already quite a bit of excitement in the Ruby community.
+ 198729 [schapht@gm i] I'll add my vote to this one.  Is RubyForge running the sourceforge
| 198735 [tom@in oe he] Yours,
+ 198749 [drbrain@se m] Lots of people use GForge and submit patches to GForge and make it
| + 198750 [tom@in oe he] So true.
| + 198753 [M.B.Smillie@] My suggestion would be something to complement RubyForge rather than
+ 198765 [listbox@ju i] What strikes me is that we still have to resort to absolutely abysmal
  + 198788 [ryand-ruby@z] Red Flag! Red Flag!
  | 198789 [james.britt@] Replace "Could we just have ..." with "I'm going to prototype ... " and
  | + 198791 [znmeb@ce ma ] Hmmm ... why not something "more agile" than GForge? I've always been
  | | 198833 [james@gr yp ] Amen brother, amen!
  | | 198868 [ml.chibbs@gm] ...
  | | 198907 [james@gr yp ] That's a neat sight.  Thanks for sharing!
  | + 198811 [listbox@ju i] I can try that in July, but I need to know how far Rubyforge deviates
  + 198822 [james.britt@] This brings to mind some comments I've read about Dave Thomas' talk on
    198832 [listbox@ju i] I am talking about something completely different. What I am talking
    + 198850 [ryand-ruby@z] Or you could quit being a drama-queen and be a bit more realistic.
    | 198853 [listbox@ju i] It was not my intention to insult anybody. A very odd response, if I
    | 198869 [ryand@ze sp ] If you're going to exaggerate things out of proportion, I'm going to
    + 198964 [halostatue@g] Which ones have you tried? Have you tried the variants in Net::LDAP?

Newbie question
198686 [sambient@gm ] Sorry because this is probably lame but I've been trying to think this
198689 [james@ne la ] You could initialise input before you go into the while loop, and then
198693 [sambient@gm ] Yes, thank you James. Works as expected.  In some of the examples in

Just joined - messages in duplicate
198688 [sambient@gm ] I'm noticing my messages are coming to me in duplicates.  Something
+ 198695 [M.B.Smillie@] If it's only your messages that are doubled, then it's a quirk of
+ 198696 [jmg3000@gm i] It's a harmless gmail thing. There was a recent thread about this very
  198699 [sambient@gm ] k-thanks for the clarifications.

Queston: array.push
198717 [sambient@gm ] Well, I can't believe that I'm back already with another question.
+ 198719 [jeff@op nd m] Problem is you're calling gets way too much.
| 198722 [sambient@gm ] Thanks Jeffrey,
+ 198723 [louis.j.scor] This is similar to the problem you were having earlier.  You have to
  198728 [sambient@gm ] Yep, I was focusing on looping that I forgot it was also asking for input :)
  198741 [louis.j.scor] Because if you look at the code again, I took the "gets" out of the

Re: pp Pascal (#84)
198720 [taitbp@ya oo] I must say through tweaking my output i have figured out a way as far as
198820 [miken700@ya ] I'd qualify this statement. This is subject to the whim of the user. The

Trying to make a Digest Auth extension for Net::HTTP
198724 [bhs128@gm il] I've been trying to implement (client-side) Digest Authentication
198748 [drbrain@se m] Set the third argument to true if authenticating against an IIS
227029 [me@ph ll po ] did you successfully integrate digest auth into net::http? if so, yould

Parsing files
198725 [johnatl@ma .] One thing I find myself doing over and over is parsing some type of
198737 [tom@in oe he] Looks nifty to me!

class << self?
198736 [roger.johans] Can someone please explain exactly what "class << self" does , I just
+ 198740 [pertl@gm .o ] class Test
| 198743 [roger.johans] thanks, Ive figured this part out.
| 198747 [erikveen@dd ] Data is stored in objects. Code is stored in classes. You can't
| 198751 [dblack@wo bl] Classes are objects, though (as you point out later in a slightly
| 198759 [roger.johans] Ok, thanks I think im sort of getting the picture now :-P
| + 198776 [dblack@wo bl] I'm tired too (and a little spacy, having just spent 1.5 hours at a
| + 198886 [pit@ca it in] Roger, I think you haven't gotten an answer to this part of your
|   198899 [roger.johans] Thanks,
+ 198906 [jperkins@sn ] It looks like I'm really late in responding, but David is being too
  198926 [jperkins@sn ] I should clarify that my previous statement doesn't exclude the

method attributes in ruby?
198746 [roger.johans] Is there any standard way of creating c# like attributes for ruby?
+ 198752 [james.britt@] Have you looked at attr_accessor and related methods?
+ 198755 [transfire@gm] Facets has Annotations. (http://facets.rubyforge.org)

mysql-ruby + ruby-mysql + activerecord == confusion
198757 [ro@pa er mi ] I have rails working and activerecord works, and I can create
198761 [the.mindstor] I have asked a similar question when reading the announcement about
198768 [ro@pa er mi ] Ok here it is documented that ruby-mysql does not work with mysql > 4.1
198795 [the.mindstor] It is really weird. A couple of days ago I made InstantRails work fine

What is good design? (Was: ruby-lang.org redesign?)
198763 [ jupp@gm .d ] Please let me workt out the question what this statement actually

Deploying ruby daemon processes (capistrano?)
198766 [mark@st ee l] ...
198849 [drosihn@gm i] I don't know about Capistrano, but if you are writing scripts which

X screen capture
198767 [brian.matter] I started rewriting a screen capture application of mine in ruby in order
198770 [TimHunter@nc] You can use Magick::Image.capture to capture individual windows.  Set
198779 [brian.matter] Yeah, I realized that. Meant to say "entire window" in the original

Hide methods from debugger?
198771 [roger.johans] Is it possible to hide methods from the debugger.

best openssl module?
198777 [snacktime@gm] I'm looking for a ruby openssl module that implements most of the
198780 [halostatue@g] Have you looked in the standard library?
198786 [snacktime@gm] Was just looking at it now, didn't realize it was there.
198798 [garbagecat10] ...
198838 [snacktime@gm] That's what we have used for a few years, but since we are redoing the

Re: gets, etc (was RE: Newbie Questions)
198778 [botp@de mo t] # Double Ctrl-D sends a text without a newline.

Carats are irreplaceable? (String#tr quandry)
198781 [makenai@gm i] str = 'kame^hame^ha^'
198783 [mvette13@gm ] irb(main):003:0> str = 'kame^hame^ha^'
198787 [makenai@gm i] Oops - thanks for the reality check, Mark.

Missing parantheses maybe ?
198799 [sambient@gm ] Trying to do some fancy formatting and getting an error message.
198800 [shortcutter@] I'm not sure what you're implying here, but as the error message
198801 [sambient@gm ] Hopefully it was a beginners mistake and not a pattern of my own logic :)
198803 [sambient@gm ] .rjust dosn't seem to be working correctly, no error, but it's not
198953 [shortcutter@] For this scenario sprintf / printf are probably better suited.

prop = x => y
198805 [roger.johans] my_prop = :foo => :bar
+ 198806 [roger.johans] also , is it wrong to use the x => y construct in other context than
| 198809 [dblack@wo bl] I don't know of any meaning for => other than hash separator.
+ 198807 [dblack@wo bl] my_prop = { :foo => :bar }
+ 198808 [sitharus@si ] When you do my_method :foo => :bar Ruby turns this in to
threads.html
top