<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: interpolate hex color vectors in one line of ruby</title>
	<atom:link href="http://www.sofasportler.de/dirk.blog/articles/interpolate-hex-color-vectors-in-one-line-of-ruby/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sofasportler.de/dirk.blog/articles/interpolate-hex-color-vectors-in-one-line-of-ruby</link>
	<description>on me and coding and some things</description>
	<lastBuildDate>Mon, 07 Mar 2011 23:56:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: crux</title>
		<link>http://www.sofasportler.de/dirk.blog/articles/interpolate-hex-color-vectors-in-one-line-of-ruby/comment-page-1#comment-73220</link>
		<dc:creator>crux</dc:creator>
		<pubDate>Thu, 10 Jul 2008 14:51:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.sofasportler.de/dirk.blog/2007/06/27/interpolate-hex-color-vectors-in-one-#comment-73220</guid>
		<description>&lt;p&gt;@bob, what harsh words you spell on me? No, don&#039;t worry, nothing could be farther away from me than bringing awefull perl style to the ruby world. the interpol code just serves as the exception to the rule,&lt;/p&gt;

&lt;p&gt;nichts fuer ungut&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@bob, what harsh words you spell on me? No, don&#8217;t worry, nothing could be farther away from me than bringing awefull perl style to the ruby world. the interpol code just serves as the exception to the rule,</p>

<p>nichts fuer ungut</p>]]></content:encoded>
	</item>
	<item>
		<title>By: bob</title>
		<link>http://www.sofasportler.de/dirk.blog/articles/interpolate-hex-color-vectors-in-one-line-of-ruby/comment-page-1#comment-73216</link>
		<dc:creator>bob</dc:creator>
		<pubDate>Thu, 10 Jul 2008 14:21:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.sofasportler.de/dirk.blog/2007/06/27/interpolate-hex-color-vectors-in-one-#comment-73216</guid>
		<description>&lt;p&gt;&gt;&gt;Sure, there must be a shorter version. Can you show it to me?&lt;/p&gt;

&lt;p&gt;If short obfuscated code is your aim then I think your writing in the wrong language. Have you thought of perl&lt;/p&gt;

&lt;p&gt;http://www.perlmonks.org/?node=Obfuscated%20Code&lt;/p&gt;

&lt;p&gt;try not to bring this kind of crap to ruby&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>&gt;&gt;Sure, there must be a shorter version. Can you show it to me?</p>

<p>If short obfuscated code is your aim then I think your writing in the wrong language. Have you thought of perl</p>

<p><a href="http://www.perlmonks.org/?node=Obfuscated%20Code" rel="nofollow">http://www.perlmonks.org/?node=Obfuscated%20Code</a></p>

<p>try not to bring this kind of crap to ruby</p>]]></content:encoded>
	</item>
	<item>
		<title>By: mono</title>
		<link>http://www.sofasportler.de/dirk.blog/articles/interpolate-hex-color-vectors-in-one-line-of-ruby/comment-page-1#comment-27775</link>
		<dc:creator>mono</dc:creator>
		<pubDate>Wed, 27 Jun 2007 16:55:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.sofasportler.de/dirk.blog/2007/06/27/interpolate-hex-color-vectors-in-one-#comment-27775</guid>
		<description>&lt;p&gt;132 Zeichen im ersten Versuch. Einzeilig wäre etwas länger. Und Ruby ist es auch nicht. Aber mindestens so cryptisch.&lt;/p&gt;

&lt;p&gt;h[]=[]::[Int]
h l=read(&quot;0x&quot;++(take 2 l)):h(drop 2 l) 
m a b=(a+b)&lt;code&gt;div&lt;/code&gt;2
foldl(++)&quot;&quot;.map(printf&quot;%x&quot;)$zipWith m(h&quot;ff00ff&quot;)(h&quot;00ff00&quot;)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>132 Zeichen im ersten Versuch. Einzeilig wäre etwas länger. Und Ruby ist es auch nicht. Aber mindestens so cryptisch.</p>

<p>h[]=[]::[Int]
h l=read(&#8220;0x&#8221;++(take 2 l)):h(drop 2 l) 
m a b=(a+b)<code>div</code>2
foldl(++)&#8221;".map(printf&#8221;%x&#8221;)$zipWith m(h&#8221;ff00ff&#8221;)(h&#8221;00ff00&#8243;)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: joe.sixpack</title>
		<link>http://www.sofasportler.de/dirk.blog/articles/interpolate-hex-color-vectors-in-one-line-of-ruby/comment-page-1#comment-27700</link>
		<dc:creator>joe.sixpack</dc:creator>
		<pubDate>Wed, 27 Jun 2007 11:31:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.sofasportler.de/dirk.blog/2007/06/27/interpolate-hex-color-vectors-in-one-#comment-27700</guid>
		<description>&lt;p&gt;@it would not work for HSV, i knew that, but found colorspace to complicated for one line.&lt;/p&gt;

&lt;p&gt;about active_support, that&#039;s also right, but would go against the &#039;fully self contained&#039; character of this oneliner.&lt;/p&gt;

&lt;p&gt;keep on going: &lt;del datetime=&quot;2007-06-27T15:11:09+00:00&quot;&gt;127&lt;/del&gt;121 == &#039;%w{ff00ff 00ff00}.map{&#124;a&#124;a.scan(/../).map{&#124;b&#124;b.hex}}.inject{&#124;c,d&#124;c.size.times{&#124;i&#124;c[i]+=d[i]};c}.map{&#124;e&#124;&quot;%0x&quot;%(e&gt;&gt;1)}.join&#039;.size&lt;/p&gt;

&lt;p&gt;are to beat!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@it would not work for HSV, i knew that, but found colorspace to complicated for one line.</p>

<p>about active_support, that&#8217;s also right, but would go against the &#8216;fully self contained&#8217; character of this oneliner.</p>

<p>keep on going: <del datetime="2007-06-27T15:11:09+00:00">127</del>121 == &#8216;%w{ff00ff 00ff00}.map{|a|a.scan(/../).map{|b|b.hex}}.inject{|c,d|c.size.times{|i|c[i]+=d[i]};c}.map{|e|&#8221;%0x&#8221;%(e&gt;&gt;1)}.join&#8217;.size</p>

<p>are to beat!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: schmidt</title>
		<link>http://www.sofasportler.de/dirk.blog/articles/interpolate-hex-color-vectors-in-one-line-of-ruby/comment-page-1#comment-27690</link>
		<dc:creator>schmidt</dc:creator>
		<pubDate>Wed, 27 Jun 2007 10:22:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.sofasportler.de/dirk.blog/2007/06/27/interpolate-hex-color-vectors-in-one-#comment-27690</guid>
		<description>&lt;p&gt;I could eliminate 5 chars by swapping &quot;(0...c.size).each&quot; with &quot;c.size.times&quot;. One is redundant: &quot;%02x&quot; and &quot;%0x&quot; should be the same in this context. (e&gt;&gt;1) should never be larger than 255.&lt;/p&gt;

&lt;p&gt;%w{ff00ff 00ff00}.map{&#124;a&#124;a.scan(/../).map{&#124;b&#124;b.hex}}.inject{&#124;c,d&#124;c.size.times{&#124;i&#124;c[i]+=d[i]};c}.map{&#124;e&#124;&quot;%0x&quot;%(e&gt;&gt;1)}.join&lt;/p&gt;

&lt;p&gt;With the help of active support you could substitute &quot;.map{&#124;b&#124;b.hex}&quot; with &quot;.map(&amp;:hex)&quot; and save again 3 characters.&lt;/p&gt;

&lt;p&gt;And the final question is, wheter this algorithm is sufficient to calculate the colour &quot;in the middle&quot;. I guess transforming it to HSV (the colour schema not the football club) and computing there would deliver better results. But this won&#039;t be shorter.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I could eliminate 5 chars by swapping &#8220;(0&#8230;c.size).each&#8221; with &#8220;c.size.times&#8221;. One is redundant: &#8220;%02x&#8221; and &#8220;%0x&#8221; should be the same in this context. (e&gt;&gt;1) should never be larger than 255.</p>

<p>%w{ff00ff 00ff00}.map{|a|a.scan(/../).map{|b|b.hex}}.inject{|c,d|c.size.times{|i|c[i]+=d[i]};c}.map{|e|&#8221;%0x&#8221;%(e&gt;&gt;1)}.join</p>

<p>With the help of active support you could substitute &#8220;.map{|b|b.hex}&#8221; with &#8220;.map(&amp;:hex)&#8221; and save again 3 characters.</p>

<p>And the final question is, wheter this algorithm is sufficient to calculate the colour &#8220;in the middle&#8221;. I guess transforming it to HSV (the colour schema not the football club) and computing there would deliver better results. But this won&#8217;t be shorter.</p>]]></content:encoded>
	</item>
</channel>
</rss>

