<?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 for The Free Geek</title>
	<atom:link href="http://freegeek.in/blog/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://freegeek.in/blog</link>
	<description>The Chronicles of Nerd-nia</description>
	<lastBuildDate>Tue, 27 Dec 2011 04:20:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>Comment on 10 Clojure One Liners to Impress Your Friends by mchampine</title>
		<link>http://freegeek.in/blog/2011/06/10-clojure-one-liners/comment-page-1/#comment-494</link>
		<dc:creator>mchampine</dc:creator>
		<pubDate>Tue, 27 Dec 2011 04:20:15 +0000</pubDate>
		<guid isPermaLink="false">http://freegeek.in/blog/?p=111#comment-494</guid>
		<description>A favorite &quot;impress your friends&quot; one-liner of mine is: 

(time (nth (map first (iterate (fn [[a b]] [b (+ a b)]) [0 1])) 100000))

Which outputs the gigantic 20899 digit number which is the 100000th value of the fibonacci  sequence.  The timer shows how fast it ran. On my nothing-special core i5 I got &quot;Elapsed time: 792.022986 msecs&quot;.</description>
		<content:encoded><![CDATA[<p>A favorite &#8220;impress your friends&#8221; one-liner of mine is: </p>
<p>(time (nth (map first (iterate (fn [[a b]] [b (+ a b)]) [0 1])) 100000))</p>
<p>Which outputs the gigantic 20899 digit number which is the 100000th value of the fibonacci  sequence.  The timer shows how fast it ran. On my nothing-special core i5 I got &#8220;Elapsed time: 792.022986 msecs&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Clojure Protocols &amp; Datatypes &#8212; A sneak peek by Pankaj Doharey</title>
		<link>http://freegeek.in/blog/2010/05/clojure-protocols-datatypes-a-sneak-peek/comment-page-1/#comment-492</link>
		<dc:creator>Pankaj Doharey</dc:creator>
		<pubDate>Thu, 24 Nov 2011 13:34:08 +0000</pubDate>
		<guid isPermaLink="false">http://freegeek.in/blog/?p=91#comment-492</guid>
		<description>In ruby a statistical mode could be something as small as this :

p ARGV.collect {&#124;i&#124; [ARGV.count(i) , i]}.sort.last.last , 

which includes taking a input from command line ... can something similar be done in clojure. the above could could handle everything but floats. for floats we can use this.

p ARGV.uniq.map {&#124;i&#124; [ARGV.count(i) , (i.to_f == i.to_f.floor) ? i.to_i : i.to_f]}.sort.last.last

this new line can handle everything mixed strings floats , negatives and return a statistical mode.</description>
		<content:encoded><![CDATA[<p>In ruby a statistical mode could be something as small as this :</p>
<p>p ARGV.collect {|i| [ARGV.count(i) , i]}.sort.last.last , </p>
<p>which includes taking a input from command line &#8230; can something similar be done in clojure. the above could could handle everything but floats. for floats we can use this.</p>
<p>p ARGV.uniq.map {|i| [ARGV.count(i) , (i.to_f == i.to_f.floor) ? i.to_i : i.to_f]}.sort.last.last</p>
<p>this new line can handle everything mixed strings floats , negatives and return a statistical mode.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Clojure Protocols &amp; Datatypes &#8212; A sneak peek by Pankaj Doharey</title>
		<link>http://freegeek.in/blog/2010/05/clojure-protocols-datatypes-a-sneak-peek/comment-page-1/#comment-491</link>
		<dc:creator>Pankaj Doharey</dc:creator>
		<pubDate>Thu, 24 Nov 2011 13:30:25 +0000</pubDate>
		<guid isPermaLink="false">http://freegeek.in/blog/?p=91#comment-491</guid>
		<description>How to write a smallest statistical mode in clojure ? like for a series like :

# 1 2 3 4 5 2 4 8 9 0 1 5 3 6 6 7 0 -- normal series.
# 1 2.0 3 4.1 5 2.3 4 8 9 0 1 5 3.2 6 6 7 0 -1 -3 -5 -2 -1 -- mixed series with floats and negatives. What could be the shortest one liner for this ?</description>
		<content:encoded><![CDATA[<p>How to write a smallest statistical mode in clojure ? like for a series like :</p>
<p># 1 2 3 4 5 2 4 8 9 0 1 5 3 6 6 7 0 &#8212; normal series.<br />
# 1 2.0 3 4.1 5 2.3 4 8 9 0 1 5 3.2 6 6 7 0 -1 -3 -5 -2 -1 &#8212; mixed series with floats and negatives. What could be the shortest one liner for this ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Clojure Protocols &amp; Datatypes &#8212; A sneak peek by David</title>
		<link>http://freegeek.in/blog/2010/05/clojure-protocols-datatypes-a-sneak-peek/comment-page-1/#comment-490</link>
		<dc:creator>David</dc:creator>
		<pubDate>Fri, 21 Oct 2011 19:43:59 +0000</pubDate>
		<guid isPermaLink="false">http://freegeek.in/blog/?p=91#comment-490</guid>
		<description>Thanks for the nice explanation of protocols! I wasn&#039;t getting it before. I think I got it now. Keep the posts coming! :)</description>
		<content:encoded><![CDATA[<p>Thanks for the nice explanation of protocols! I wasn&#8217;t getting it before. I think I got it now. Keep the posts coming! <img src='http://freegeek.in/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Clojure Protocols &amp; Datatypes &#8212; A sneak peek by Sidharth</title>
		<link>http://freegeek.in/blog/2010/05/clojure-protocols-datatypes-a-sneak-peek/comment-page-1/#comment-487</link>
		<dc:creator>Sidharth</dc:creator>
		<pubDate>Wed, 28 Sep 2011 10:04:08 +0000</pubDate>
		<guid isPermaLink="false">http://freegeek.in/blog/?p=91#comment-487</guid>
		<description>Best explanation of reify, defrecord and defprotocols!

It might be a good idea to show explictly that you can call (fly crow) if you simply used extend-type

Thanks!</description>
		<content:encoded><![CDATA[<p>Best explanation of reify, defrecord and defprotocols!</p>
<p>It might be a good idea to show explictly that you can call (fly crow) if you simply used extend-type</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on 10 Clojure One Liners to Impress Your Friends by mnicky</title>
		<link>http://freegeek.in/blog/2011/06/10-clojure-one-liners/comment-page-1/#comment-485</link>
		<dc:creator>mnicky</dc:creator>
		<pubDate>Thu, 15 Sep 2011 14:04:39 +0000</pubDate>
		<guid isPermaLink="false">http://freegeek.in/blog/?p=111#comment-485</guid>
		<description>@mx: a little shorter, but more dumb and memory-consuming:

((fn[n](reduce(fn[c x](filter #(or(&lt; 0(mod % x))(= % x))c))n n))(range 2 100))

and uncompressed:

((fn [numbers]
   (reduce (fn [coll number]
             (filter #(or (&lt; 0 (mod % number)) (= % number))
                     coll))
           numbers
           numbers))
  (range 2 100))</description>
		<content:encoded><![CDATA[<p>@mx: a little shorter, but more dumb and memory-consuming:</p>
<p>((fn[n](reduce(fn[c x](filter #(or(&lt; 0(mod % x))(= % x))c))n n))(range 2 100))</p>
<p>and uncompressed:</p>
<p>((fn [numbers]<br />
   (reduce (fn [coll number]<br />
             (filter #(or (&lt; 0 (mod % number)) (= % number))<br />
                     coll))<br />
           numbers<br />
           numbers))<br />
  (range 2 100))</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on 10 Clojure One Liners to Impress Your Friends by mx</title>
		<link>http://freegeek.in/blog/2011/06/10-clojure-one-liners/comment-page-1/#comment-484</link>
		<dc:creator>mx</dc:creator>
		<pubDate>Mon, 29 Aug 2011 15:15:07 +0000</pubDate>
		<guid isPermaLink="false">http://freegeek.in/blog/?p=111#comment-484</guid>
		<description>10.
((fn sieve [numbers primes]
    (if (empty? numbers) (reverse primes)
        (sieve (filter #(&gt; (mod % (first numbers)) 0) numbers) (cons (first numbers) primes)))
) (range 2 100) ())

?</description>
		<content:encoded><![CDATA[<p>10.<br />
((fn sieve [numbers primes]<br />
    (if (empty? numbers) (reverse primes)<br />
        (sieve (filter #(&gt; (mod % (first numbers)) 0) numbers) (cons (first numbers) primes)))<br />
) (range 2 100) ())</p>
<p>?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on 10 Clojure One Liners to Impress Your Friends by Manoj Waikar</title>
		<link>http://freegeek.in/blog/2011/06/10-clojure-one-liners/comment-page-1/#comment-483</link>
		<dc:creator>Manoj Waikar</dc:creator>
		<pubDate>Mon, 08 Aug 2011 18:33:15 +0000</pubDate>
		<guid isPermaLink="false">http://freegeek.in/blog/?p=111#comment-483</guid>
		<description>Hi BG,

I am a little confused by Aaron&#039;s comments on clojure.contrib being deprecated. If it is deprecated, what is the equivalent of clojure.contrib.java-utils? I specifically want to use read-properties function.

Also why is this (http://clojure.github.com/clojure-contrib/branch-master/java-utils-api.html) still available under v 1.3?

Thanks,
Manoj.</description>
		<content:encoded><![CDATA[<p>Hi BG,</p>
<p>I am a little confused by Aaron&#8217;s comments on clojure.contrib being deprecated. If it is deprecated, what is the equivalent of clojure.contrib.java-utils? I specifically want to use read-properties function.</p>
<p>Also why is this (<a href="http://clojure.github.com/clojure-contrib/branch-master/java-utils-api.html" rel="nofollow">http://clojure.github.com/clojure-contrib/branch-master/java-utils-api.html</a>) still available under v 1.3?</p>
<p>Thanks,<br />
Manoj.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on 10 Clojure One Liners to Impress Your Friends by Baishampayan Ghose</title>
		<link>http://freegeek.in/blog/2011/06/10-clojure-one-liners/comment-page-1/#comment-468</link>
		<dc:creator>Baishampayan Ghose</dc:creator>
		<pubDate>Tue, 14 Jun 2011 09:46:54 +0000</pubDate>
		<guid isPermaLink="false">http://freegeek.in/blog/?p=111#comment-468</guid>
		<description>Jaskirat: I try to avoid using `apply` when the operation is inherently binary in nature (eg. +,-,max, etc.).

If you look at the definition of `max` you will see that it uses `reduce` when the arity is more than 2 :)</description>
		<content:encoded><![CDATA[<p>Jaskirat: I try to avoid using `apply` when the operation is inherently binary in nature (eg. +,-,max, etc.).</p>
<p>If you look at the definition of `max` you will see that it uses `reduce` when the arity is more than 2 <img src='http://freegeek.in/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on 10 Clojure One Liners to Impress Your Friends by Jaskirat</title>
		<link>http://freegeek.in/blog/2011/06/10-clojure-one-liners/comment-page-1/#comment-467</link>
		<dc:creator>Jaskirat</dc:creator>
		<pubDate>Tue, 14 Jun 2011 09:34:59 +0000</pubDate>
		<guid isPermaLink="false">http://freegeek.in/blog/?p=111#comment-467</guid>
		<description>Nice! I just had one little question, do you have any particular reason for not using apply instead of reduce for question 8 ? 
(apply max [1 2 3]) 

@Chris
That&#039;s a neat way to transpose a matrix!</description>
		<content:encoded><![CDATA[<p>Nice! I just had one little question, do you have any particular reason for not using apply instead of reduce for question 8 ?<br />
(apply max [1 2 3]) </p>
<p>@Chris<br />
That&#8217;s a neat way to transpose a matrix!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic page generated in 1.857 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-01-10 00:26:34 -->

