<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>opensoul.org - Splitting Hairs and Arrays Comments</title>
  <id>tag:opensoul.org,2008:/2008/6/19/splitting-hairs-and-arrays/comments</id>
  <generator version="0.8.0" uri="http://mephistoblog.com">Mephisto Drax</generator>
  <link href="http://opensoul.org/2008/6/19/splitting-hairs-and-arrays/comments.xml" rel="self" type="application/atom+xml"/>
  <link href="/2008/6/19/splitting-hairs-and-arrays" rel="alternate" type="text/html"/>
  <updated>2008-07-13T12:23:25Z</updated>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Brandon</name>
    </author>
    <id>tag:opensoul.org,2008-06-19:6549:6782</id>
    <published>2008-07-13T12:23:25Z</published>
    <updated>2008-07-13T12:23:25Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2008/6/19/splitting-hairs-and-arrays" rel="alternate" type="text/html"/>
    <title>Comment on 'Splitting Hairs and Arrays' by Brandon</title>
<content type="html">&lt;p&gt;Bill,&lt;/p&gt;


	&lt;p&gt;Not quite.  I want 3 arrays total, not n number of 3 element arrays.&lt;/p&gt;


&lt;pre&gt;
&amp;gt;&amp;gt; (&quot;a&quot;..&quot;z&quot;).to_a / 3
=&amp;gt;
[[&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;d&quot;, &quot;e&quot;, &quot;f&quot;, &quot;g&quot;, &quot;h&quot;, &quot;i&quot;],
 [&quot;j&quot;, &quot;k&quot;, &quot;l&quot;, &quot;m&quot;, &quot;n&quot;, &quot;o&quot;, &quot;p&quot;, &quot;q&quot;, &quot;r&quot;],
 [&quot;s&quot;, &quot;t&quot;, &quot;u&quot;, &quot;v&quot;, &quot;w&quot;, &quot;x&quot;, &quot;y&quot;, &quot;z&quot;]]
&lt;/pre&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Bill Horsman</name>
    </author>
    <id>tag:opensoul.org,2008-06-19:6549:6780</id>
    <published>2008-07-13T07:31:29Z</published>
    <updated>2008-07-13T07:31:29Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2008/6/19/splitting-hairs-and-arrays" rel="alternate" type="text/html"/>
    <title>Comment on 'Splitting Hairs and Arrays' by Bill Horsman</title>
<content type="html">&lt;p&gt;Brandon: Andrew&#8217;s is almost right, isn&#8217;t he? Just skip the transpose (which I didn&#8217;t know about incidentally) and it works&#8230;&lt;/p&gt;


	&lt;p&gt;(&#8220;A&#8221;..&#8221;Z&#8221;).to_a.in_groups_of(3)
 [&#8220;D&#8221;, &#8220;E&#8221;, &#8220;F&#8221;], [&#8220;G&#8221;, &#8220;H&#8221;, &#8220;I&#8221;], [&#8220;J&#8221;, &#8220;K&#8221;, &#8220;L&#8221;], [&#8220;M&#8221;, &#8220;N&#8221;, &#8220;O&#8221;], [&#8220;P&#8221;, &#8220;Q&#8221;, &#8220;R&#8221;], [&#8220;S&#8221;, &#8220;T&#8221;, &#8220;U&#8221;], [&#8220;V&#8221;, &#8220;W&#8221;, &#8220;X&#8221;], [&#8220;Y&#8221;, &#8220;Z&#8221;, nil]]&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Brandon</name>
    </author>
    <id>tag:opensoul.org,2008-06-19:6549:6760</id>
    <published>2008-07-11T12:09:22Z</published>
    <updated>2008-07-11T12:09:22Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2008/6/19/splitting-hairs-and-arrays" rel="alternate" type="text/html"/>
    <title>Comment on 'Splitting Hairs and Arrays' by Brandon</title>
<content type="html">&lt;p&gt;Andrew,&lt;/p&gt;


	&lt;p&gt;Except that I want them group as A-I, J-R, and S-Z, not every 3rd letter.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Andrew Vit</name>
    </author>
    <id>tag:opensoul.org,2008-06-19:6549:6754</id>
    <published>2008-07-10T23:57:57Z</published>
    <updated>2008-07-10T23:57:57Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2008/6/19/splitting-hairs-and-arrays" rel="alternate" type="text/html"/>
    <title>Comment on 'Splitting Hairs and Arrays' by Andrew Vit</title>
<content type="html">&lt;p&gt;(&#8220;A&#8221;..&#8221;Z&#8221;).to_a.in_groups_of(3).transpose&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Sam Flowers, jr</name>
    </author>
    <id>tag:opensoul.org,2008-06-19:6549:6691</id>
    <published>2008-07-03T16:44:48Z</published>
    <updated>2008-07-03T16:44:48Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2008/6/19/splitting-hairs-and-arrays" rel="alternate" type="text/html"/>
    <title>Comment on 'Splitting Hairs and Arrays' by Sam Flowers, jr</title>
<content type="html">&lt;p&gt;Very well done code..
Thanks&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Nolan Eakins</name>
    </author>
    <id>tag:opensoul.org,2008-06-19:6549:6551</id>
    <published>2008-06-20T03:19:52Z</published>
    <updated>2008-06-20T03:19:52Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2008/6/19/splitting-hairs-and-arrays" rel="alternate" type="text/html"/>
    <title>Comment on 'Splitting Hairs and Arrays' by Nolan Eakins</title>
<content type="html">&lt;p&gt;Facets has something like this. Uncovered this with Eli back when we reworking some Rake tasks: http://facets.rubyforge.org/doc/api/core/index.html&lt;/p&gt;


	&lt;p&gt;That was way after I created a Multiterator to do the same thing. IT went something like: Multiterator(array, 3).each { |a, b, c| puts a + b + c }&lt;/p&gt;


	&lt;p&gt;+1 for Ruby 1.9 having something that does this.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Aaron Pfeifer</name>
    </author>
    <id>tag:opensoul.org,2008-06-19:6549:6550</id>
    <published>2008-06-20T00:53:56Z</published>
    <updated>2008-06-20T00:53:56Z</updated>
    <category term="Code"/>
    <link href="http://opensoul.org/2008/6/19/splitting-hairs-and-arrays" rel="alternate" type="text/html"/>
    <title>Comment on 'Splitting Hairs and Arrays' by Aaron Pfeifer</title>
<content type="html">&lt;p&gt;Something similar was actually talked about here: http://blog.jayfields.com/2007/09/ruby-arraychunk.html&lt;/p&gt;</content>  </entry>
</feed>
