M = [["a", "b"], ["c", "d"], ["e", "f"]]

x = []
...

Ruby Array parsing in a block

by https://www.google.com/accounts/o8/id?id=AItOawmWMRp7fAci9domcwhxD3fNikoTak9bkYc, January 26, 2012 05:59, 1 refactoring, tagged with arrays, blocks, loops, array syntax

x should be ["a","c","e"] i...

55502f40dc8b7c769880b10874abc9d0 Talk
@visits_by_day_and_hour = visits.group_by{|day| day.created_at.strftime("%Y-%m-%d")}.map {|d, items| [d, items.group_by{|hour| hour.created_at.strftime("%H")}.map{|k,v| [k, v.length]}]}

Ruby Group array elements by day...

by https://www.google.com/accounts/o8/id?id=AItOawlsPHX5ps6aEa58SFp7fTjKFgMmK9Hi-Dg, August 07, 2011 23:45, 2 refactorings, tagged with ruby, arrays, group_by, map array

Hi, I have a set of objects...

55502f40dc8b7c769880b10874abc9d0 Talk
screen = [
  [9,9,4,7,4,8,9,9,9,9,2,5,6,7,8,9],
  [1,2,3,9,9,6,7,8,9,9,9,9,9,9,9,9]
...

Ruby find a horizontal line in a...

by slothbear, June 27, 2011 18:59, 6 refactorings, tagged with images, arrays

Somewhere in an image, I kn...

563e3eea8bb7750b2d555085a547f97a Talk
class Item
  def raw_tag_list; "one, two, three, four, five"; end
  def public_tags; [<#Tag name=two>, <#Tag name=five>, <#Tag name=one>, <#Tag name=four>, <#Tag name=three>]; end
...

Ruby Tag ordering code

by k776, March 30, 2009 22:48, 12 refactorings, tagged with speed, class, ruby, arrays

Is there a faster way to do...

74198b06bc9e68739debfe6c23e070d3 Talk
def first_day_of_month(selected_date)
...

Ruby Splitting array into define...

by Bonobo, March 25, 2009 14:04, 4 refactorings, tagged with ruby, date, arrays, split, calendar

I'm mainly interested in op...

4e0322e79d041875f3ef7db64e2d5b18 Talk
pools = {1 => [1,2,3], 2=> [3,4,5], 3=> [5,6,7]}
intersection = []
pools.each do |k,v|
...

Ruby Find the Intersection of Ar...

by AviFlombaum, July 31, 2008 21:28, 13 refactorings, tagged with hash, arrays, intersection

Find the intersection of ar...

Fafb062f6e8c394dd6b0689c13db2b88 Talk