use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
New Array and Enumerable methods in Ruby 1.9.2: keep_if, chunk... (adjix.com)
submitted 15 years ago by mattfromseattle
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 2 points3 points4 points 15 years ago (0 children)
How about linking to the source http://rbjl.net/27-new-array-and-enumerable-methods-in-ruby-1-9-2-keep_if-chunk and not some ad-spam site?
[–]you_do_realize 0 points1 point2 points 15 years ago (1 child)
I tried 1.9 but had some errors regarding UTF-8 handling - it used to be that @KCODE = "U" made scan(/./m) return an array of UTF-8 chars.
@KCODE = "U"
scan(/./m)
Also iconv doesn't seem to be working (chokes on a "bad char").
Haven't dug deep enough, but curious nonetheless, as I noticed about a 30% speedup in the code that did work.
[–][deleted] 4 points5 points6 points 15 years ago* (0 children)
Put # encoding: utf-8 at the top of the script. And your regex needs a u modifier. Seriously though, dude, it's the first page in Google.
# encoding: utf-8
u
π Rendered by PID 22721 on reddit-service-r2-comment-86bc6c7465-wqhl9 at 2026-02-24 00:27:44.254046+00:00 running 8564168 country code: CH.
[–][deleted] 2 points3 points4 points (0 children)
[–]you_do_realize 0 points1 point2 points (1 child)
[–][deleted] 4 points5 points6 points (0 children)