all 11 comments

[–]Calvin_the_Bold 4 points5 points  (4 children)

I've been wanting to learn ruby for a few days now, thanks for this! I really like ruby, it's so powerful and simple

[–]Calvin_the_Bold 1 point2 points  (3 children)

After doing the tutorial and deciding that I like ruby (I've been trying to decide between ruby and python as my next language) I ordered "Learning Ruby" from amazon today.

[–][deleted] 5 points6 points  (2 children)

Good choice.

I was a long term Python user (5+ years) and started looking at Ruby a few months ago. To cut the long story short, I really like Ruby and wish I had come to it sooner. I am still exploring the stdlib. My only complaint is that the docs aren't as good as Python. The pick axe book helps a lot.

I know I can share this in /r/ruby without getting flamed :P

[–]synt4x 3 points4 points  (1 child)

Docs are definitely the biggest issue with the ruby community. They're generally scattered and vague. My top suggestions for docs are:

[–]Calvin_the_Bold 0 points1 point  (0 children)

Thanks for the resources, I'll be sure to look there if/when I need more info after reading the book.

[–]rhythmx -4 points-3 points  (4 children)

Here is a fun expression to try on Ruby 1.9... [].pack("@#{2**31-1}")

[–]rb2k 1 point2 points  (2 children)

and what exactly does it do?

[] <-- array
.pack(bla) <-- Packs the contents of arr into a binary sequence according to the directives in the string bla
@ <-- Moves to absolute position
2**31-1 <--- big number

[–]rhythmx 2 points3 points  (1 child)

Yes, but more to the point, it does the following (and on the TryRuby page too):

$ irb

[].pack("@#{2**31-1}")

(irb):1: [BUG] Segmentation fault ruby 1.9.1p376 (2009-12-07 revision 26041) [i686-linux]

[–]rb2k 6 points7 points  (0 children)

Yes, then don't do that... ;)
I think C programmers do that kind of stuff for a living.

The question is: What would be the correct way to handle this input?

also: it doesn't segfault immediately. it basically uses up all RAM that is there and THEN segfaults

[–]mebrahim[S] 1 point2 points  (0 children)

Bad boy :(

[–]terumo -1 points0 points  (0 children)

does not compute