1 2 3 4
FIELDS = [ 'first', 'last', 'band' ] DATA = [['Kurt', 'Cobain', 'Nirvana'], ['Jimi', 'Page', 'Led Zeppelin'], ...
Ruby Map fields array and data a...
First posting here. I just ...
1 2 3 4
public static int[] zigzagify(int[] array, int xmax, int ymax) { int[] zz = new int[array.length]; //zigzag array if (array.length != xmax * ymax) { ...
Java Zig Zag ordering of array
This is the code that is su...
1 2 3
artists = [1, 2, 3] column_1 = artists[0..artists.size/2] column_2 = artists[artists.size/2+1..artists.size]
Ruby Split an array into half
The example works if the ar...
1 2 3 4
times.each do |time| events.each do |event| if time.strftime("%I:%M %p") == event.datetime.strftime("%I:%M %p") ...
Ruby two for loops cleanup?
times is an array of dateti...
1 2 3 4
module Enumerable def cluster sort.inject([[]]) do |out, n| ...
Ruby Enumerable#cluster
%w[app noot app mies zoo m...
1 2 3 4
xml = REXML::Document.new(data) artists = [] ...
Ruby cleaner way to limit result...
by timmyvontrimble.myopenid.com,
July 14, 2008 19:12,
9 refactorings, tagged with rails, xml, array, iteration, ruby
Wow! All of these refactori...
1 2 3 4
<?php /* * This is a test of a rules based iterative algorithm... ...
PHP Rules Based Iterator
by James Stansfield,
June 15, 2008 13:52,
1 refactoring, tagged with php, loop, iterate, rules, array
I had need for an iterative...
i have a simple array that ...