search for: each_slice

Displaying 3 results from an estimated 3 matches for "each_slice".

Did you mean: each_line
2006 Aug 11
2
Array#chunk method, maybe someone will find this useful
class Array # break an array up into <size> chunks def chunk(size=1) return self if self.empty? raise ArgumentError if !size.kind_of? Integer y = self.length.divmod(size) rows = (y[1] > 0) ? y[0] + 1 : y[0] arr = Array.new(rows) (0...rows).each do |i| arr[i] = self.slice(size*i, size) end (arr.last.length...size).each { |i| arr.last[i] = nil }
2006 Nov 01
2
How to: Individualized mass email with ActiveMailer - separate thread?
Hi, We are building a rails application that''s sort of a CRM + room/course booking. Among other things, it provides a centralized database of all the people the company has been in contact with. We want to provide the possibility of sending customized email messages to groups of contacts, for example a newsletter to 500 people starting with "Hi [:name:]". The naive approach
2009 Jul 08
2
RuntimeError (JPEG marker not found!):
Hi, while generating the PDF file , i am getting following error.. please help for me. RuntimeError (JPEG marker not found!): C:/Ruby/lib/ruby/gems/1.8/gems/pdf-writer-1.1.8/lib/pdf/writer/ graphics/imageinfo.rb:176:in ` measure_JPEG'' C:/Ruby/lib/ruby/gems/1.8/gems/pdf-writer-1.1.8/lib/pdf/writer/ graphics/imageinfo.rb:174:in ` loop''