<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;CkIMSH0_fip7ImA9WhRaFEw.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348</id><updated>2012-02-16T08:43:09.346-08:00</updated><category term="Clojure" /><category term="editor" /><category term="scala" /><category term="tips and tricks" /><title>Keep IT Simply Simple</title><subtitle type="html">My thoughts on tackling IT complexity by breaking it into atomic components. and I term it lego oriented solution, LOS for short.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://ktuman.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>27</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/KeepItSimplySimple" /><feedburner:info uri="keepitsimplysimple" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;AkcHQ30-eip7ImA9WhdQF04.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-6883386349488279818</id><published>2011-08-19T00:13:00.000-07:00</published><updated>2011-08-19T00:13:52.352-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-19T00:13:52.352-07:00</app:edited><title>Visualize Google search results with Clojure</title><content type="html">One question that I always get asked when I introduce Clojure to my programmer friends is about its strength. While there are so much about Clojure that a programmer can benefit from, I always tend to single out one thing about it - powerful sequence processing.  It shines when you are faced with solving any problem related to data processing. Rather than just talking how great it is to manipulate and analyze data, I actually created a project that I called gcount that shows Google search results in a bar chart. Here is the source:
&lt;script src="https://gist.github.com/1156214.js?file=gcount.clj"&gt;&lt;/script&gt;

You can just clone it like this:
git clone https://oneness@github.com/oneness/gcount.git
Then you can run lein deps in gcount directory to pull all dependencies. When it is done, just evaluate core.clj file from the REPL and run:
gcount.core&gt; (search-view-terms ["Functional programming" "Object oriented programming" "Functional Object oriented programming"])
You will see following chart:
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-CTDEMQfm6KI/Tk4LMda2lkI/AAAAAAAAAB4/0FxwBPhQngU/s1600/gcount-FOOP.png" imageanchor="1" style="clear:left; float:left;margin-right:1em; margin-bottom:1em"&gt;&lt;img border="0" height="300" width="600" src="http://4.bp.blogspot.com/-CTDEMQfm6KI/Tk4LMda2lkI/AAAAAAAAAB4/0FxwBPhQngU/s400/gcount-FOOP.png" /&gt;&lt;/a&gt;&lt;/div&gt;

Next time when you need to show your friend how popular a particular term is, just show him/her this chart. Then you will have curious questions about how it is done and more about Clojure. Enjoy!
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-6883386349488279818?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/eiGHSb7JWYF9CKHVZ6ZRj_NnNS4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eiGHSb7JWYF9CKHVZ6ZRj_NnNS4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/eiGHSb7JWYF9CKHVZ6ZRj_NnNS4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eiGHSb7JWYF9CKHVZ6ZRj_NnNS4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/7jDbOTca6PQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/6883386349488279818/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2011/08/visualize-google-search-results-with.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/6883386349488279818?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/6883386349488279818?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/7jDbOTca6PQ/visualize-google-search-results-with.html" title="Visualize Google search results with Clojure" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-CTDEMQfm6KI/Tk4LMda2lkI/AAAAAAAAAB4/0FxwBPhQngU/s72-c/gcount-FOOP.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2011/08/visualize-google-search-results-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkUHQn44fyp7ImA9WhZbE0o.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-1587778332844527436</id><published>2011-06-17T22:02:00.000-07:00</published><updated>2011-06-17T22:17:13.037-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-17T22:17:13.037-07:00</app:edited><title>Simply the best* way to learn and hack Clojure</title><content type="html">My previous blog created little bit controversy about the term "serious Programmers" that I have used in the title. So I am putting * after the term "best" to indicate that it is my personal opinion and readers can define their best way of doing the same.&lt;br /&gt;
Most of Clojure hackers agree that starting with Clojure can be frustrating. This has been discussed in google groups and elsewhere. Almost all hackers agree that&lt;br /&gt;
Clojure programmers spend most of their time in the REPL. &lt;br /&gt;
I find many different opinion about how to simplify this process. There are people&lt;br /&gt;
just complain about how hard it is while there are people outright defy and&lt;br /&gt;
provide all sorts of differing approaches, which adds to a newbie's confusion. &lt;br /&gt;
I actually created a project called ClojureW to help newbie get started easily and&lt;br /&gt;
quickly just to get a taste of Clojure (I blogged about where and how to get it in&lt;br /&gt;
my earlier blogs). This post is about a nice trick that I found to help with Clojure&lt;br /&gt;
hacking. In your .emacs file just put following:&lt;br /&gt;
&lt;pre style='color:#000020;background:#f6f8ff;'&gt;&lt;span style='color:#308080; '&gt;(&lt;/span&gt;defun eshell&lt;span style='color:#308080; '&gt;-&lt;/span&gt;execute&lt;span style='color:#308080; '&gt;-&lt;/span&gt;selection &lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
  &lt;span style='color:#800000; '&gt;"&lt;/span&gt;&lt;span style='color:#1060b6; '&gt;Insert text of current selection or clipboard in eshell and execute.&lt;/span&gt;&lt;span style='color:#800000; '&gt;"&lt;/span&gt;
  &lt;span style='color:#308080; '&gt;(&lt;/span&gt;interactive&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
  &lt;span style='color:#308080; '&gt;(&lt;/span&gt;require 'eshell&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
  &lt;span style='color:#308080; '&gt;(&lt;/span&gt;let &lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;(&lt;/span&gt;command &lt;span style='color:#308080; '&gt;(&lt;/span&gt;or &lt;span style='color:#308080; '&gt;(&lt;/span&gt;buffer&lt;span style='color:#308080; '&gt;-&lt;/span&gt;substring &lt;span style='color:#308080; '&gt;(&lt;/span&gt;mark&lt;span style='color:#308080; '&gt;)&lt;/span&gt; &lt;span style='color:#308080; '&gt;(&lt;/span&gt;point&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
         x&lt;span style='color:#308080; '&gt;-&lt;/span&gt;last&lt;span style='color:#308080; '&gt;-&lt;/span&gt;selected&lt;span style='color:#308080; '&gt;-&lt;/span&gt;text&lt;span style='color:#308080; '&gt;-&lt;/span&gt;clipboard&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
    &lt;span style='color:#308080; '&gt;(&lt;/span&gt;let &lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;(&lt;/span&gt;buf &lt;span style='color:#308080; '&gt;(&lt;/span&gt;current&lt;span style='color:#308080; '&gt;-&lt;/span&gt;buffer&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
      &lt;span style='color:#308080; '&gt;(&lt;/span&gt;unless &lt;span style='color:#308080; '&gt;(&lt;/span&gt;get&lt;span style='color:#308080; '&gt;-&lt;/span&gt;buffer eshell&lt;span style='color:#308080; '&gt;-&lt;/span&gt;buffer&lt;span style='color:#308080; '&gt;-&lt;/span&gt;name&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
        &lt;span style='color:#308080; '&gt;(&lt;/span&gt;eshell&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
      &lt;span style='color:#308080; '&gt;(&lt;/span&gt;display&lt;span style='color:#308080; '&gt;-&lt;/span&gt;buffer eshell&lt;span style='color:#308080; '&gt;-&lt;/span&gt;buffer&lt;span style='color:#308080; '&gt;-&lt;/span&gt;name t&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
      &lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#200080; font-weight:bold; '&gt;switch&lt;/span&gt;&lt;span style='color:#308080; '&gt;-&lt;/span&gt;to&lt;span style='color:#308080; '&gt;-&lt;/span&gt;buffer&lt;span style='color:#308080; '&gt;-&lt;/span&gt;other&lt;span style='color:#308080; '&gt;-&lt;/span&gt;window eshell&lt;span style='color:#308080; '&gt;-&lt;/span&gt;buffer&lt;span style='color:#308080; '&gt;-&lt;/span&gt;name&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
      &lt;span style='color:#308080; '&gt;(&lt;/span&gt;end&lt;span style='color:#308080; '&gt;-&lt;/span&gt;of&lt;span style='color:#308080; '&gt;-&lt;/span&gt;buffer&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
      &lt;span style='color:#308080; '&gt;(&lt;/span&gt;eshell&lt;span style='color:#308080; '&gt;-&lt;/span&gt;kill&lt;span style='color:#308080; '&gt;-&lt;/span&gt;input&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
      &lt;span style='color:#308080; '&gt;(&lt;/span&gt;insert command&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
      &lt;span style='color:#308080; '&gt;(&lt;/span&gt;eshell&lt;span style='color:#308080; '&gt;-&lt;/span&gt;&lt;span style='color:#400000; '&gt;send&lt;/span&gt;&lt;span style='color:#308080; '&gt;-&lt;/span&gt;input&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
      &lt;span style='color:#308080; '&gt;(&lt;/span&gt;end&lt;span style='color:#308080; '&gt;-&lt;/span&gt;of&lt;span style='color:#308080; '&gt;-&lt;/span&gt;buffer&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
      &lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#200080; font-weight:bold; '&gt;switch&lt;/span&gt;&lt;span style='color:#308080; '&gt;-&lt;/span&gt;to&lt;span style='color:#308080; '&gt;-&lt;/span&gt;buffer&lt;span style='color:#308080; '&gt;-&lt;/span&gt;other&lt;span style='color:#308080; '&gt;-&lt;/span&gt;window buf&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
and map it to a shortcut key of your choice like this:&lt;br /&gt;
(global-set-key [f10] 'eshell-execute-selection)&lt;br /&gt;
&lt;br /&gt;
Then start a Clojure REPL in eshell and type anything in a scratch buffer. You can&lt;br /&gt;
select any text and hit F10 to evaluate. One excellent side effect of this hack is&lt;br /&gt;
that you do not need to mess with SLIME or any other language specific set up. It &lt;br /&gt;
works with any command line tools you already familiar with. You can execute shell&lt;br /&gt;
scripts, Ruby scripts, and GNU Smalltalk scripts. If you have any frequently used&lt;br /&gt;
commands, it will be perfect to keep them in a file and just select and hit F10.&lt;br /&gt;
&lt;br /&gt;
I found this approach very helpful when I need to experiment with Clojure or Java&lt;br /&gt;
libs or platforms such as Java Packages and Incanter(In case, if you are not heard&lt;br /&gt;
it is a R like statistical charting platform written in Clojure). &lt;br /&gt;
&lt;br /&gt;
I hope someone finds this useful and Please share if you have handy hacks that ease the pain of hacking. Enjoy!&lt;br /&gt;
&lt;br /&gt;
Disclaimer: I did not write the whole elisp code. I just modified it to work with any selection or clipboard content. I believe I found this elisp snippet somewhere in Emacswiki, a fantastic place to "steal" snippets to hack with.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-1587778332844527436?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/GY0tObgnUt1SOv1Ao12-OxTAC5Q/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GY0tObgnUt1SOv1Ao12-OxTAC5Q/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/GY0tObgnUt1SOv1Ao12-OxTAC5Q/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GY0tObgnUt1SOv1Ao12-OxTAC5Q/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/St_lO7LgY80" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/1587778332844527436/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2011/06/simply-best-way-to-learn-and-hack.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/1587778332844527436?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/1587778332844527436?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/St_lO7LgY80/simply-best-way-to-learn-and-hack.html" title="Simply the best* way to learn and hack Clojure" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2011/06/simply-best-way-to-learn-and-hack.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEIARno8fCp7ImA9WhZUFkU.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-2987998398940249768</id><published>2011-06-09T23:15:00.000-07:00</published><updated>2011-06-09T23:15:47.474-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-09T23:15:47.474-07:00</app:edited><title>Two best programming languages for serious programmers</title><content type="html">After working with Java for five years, I thought I knew about OO until I started learning about Smalltalk. Reading "Smalltalk by Example" - a free book that you can download from &lt;a href="http://stephane.ducasse.free.fr/FreeBooks.html"&gt;here&lt;/a&gt; - had profound impact on how I think about Object Oriented Programming. Java's procedural and OO mix left me in a half-way schizophrenic state. Despite having read and practice "Clean Code" by Uncle Bob, I still found many if/else, check result and poorly designed classes. The idea that everything I mean literally everything is an Object teaches you the foundation of OO: Message Passing. The only way of getting things done in Smalltalk is via message passing, which supports "Don't ask, tell" and "Put off as much as you can" golden rule. This way of thinking results in very elegant design and code. &lt;br /&gt;
&lt;br /&gt;
Now you might wonder what are the two best programming languages I am talking about? You should know by now that the first one is Smalltalk. The second one is Clojure. Clojure cures the disease of writing hundreds of classes to deal with hundreds of different composite data structures. Why? Because you can't. The power of Clojure's sequence abstraction and provided core functions that operates on them gives you superman powers to manipulate data. For example, following simple function will condense strings by removing extra white spaces:&lt;br /&gt;
&lt;pre style='color:#000020;background:#f6f8ff;'&gt;&lt;span style='color:#308080; '&gt;(&lt;/span&gt;ns compact
  &lt;span style='color:#800000; '&gt;"&lt;/span&gt;&lt;span style='color:#1060b6; '&gt;compact a string by removing extra white spaces&lt;/span&gt;&lt;span style='color:#800000; '&gt;"&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;

&lt;span style='color:#308080; '&gt;(&lt;/span&gt;defn compact &lt;span style='color:#308080; '&gt;[&lt;/span&gt;s&lt;span style='color:#308080; '&gt;]&lt;/span&gt;
  &lt;span style='color:#308080; '&gt;(&lt;/span&gt;reduce &lt;span style='color:#308080; '&gt;#&lt;/span&gt;&lt;span style='color:#308080; '&gt;(&lt;/span&gt;str &lt;span style='color:#308080; '&gt;%&lt;/span&gt;&lt;span style='color:#008c00; '&gt;1&lt;/span&gt; &lt;span style='color:#800000; '&gt;"&lt;/span&gt;&lt;span style='color:#1060b6; '&gt; &lt;/span&gt;&lt;span style='color:#800000; '&gt;"&lt;/span&gt; &lt;span style='color:#308080; '&gt;%&lt;/span&gt;&lt;span style='color:#008c00; '&gt;2&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
   &lt;span style='color:#308080; '&gt;(&lt;/span&gt;filter &lt;span style='color:#308080; '&gt;#&lt;/span&gt;&lt;span style='color:#308080; '&gt;(&lt;/span&gt;seq &lt;span style='color:#308080; '&gt;%&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt; &lt;span style='color:#308080; '&gt;(&lt;/span&gt;seq &lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;.&lt;/span&gt;split s &lt;span style='color:#800000; '&gt;"&lt;/span&gt;&lt;span style='color:#1060b6; '&gt; &lt;/span&gt;&lt;span style='color:#800000; '&gt;"&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
Usage:&lt;br /&gt;
&lt;pre style='color:#000020;background:#f6f8ff;'&gt;&lt;span style='color:#308080; '&gt;(&lt;/span&gt;compact &lt;span style='color:#800000; '&gt;"&lt;/span&gt;&lt;span style='color:#1060b6; '&gt;  Your     uncompact    String  &lt;/span&gt;&lt;span style='color:#800000; '&gt;"&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
&lt;/pre&gt;-&gt; "Your uncompact String"&lt;br /&gt;
&lt;br /&gt;
I am not even contemplating the Java implementation of this simple function. This is all good. Why do I mention Smalltalk as the first one, you wonder. Here is why:&lt;br /&gt;
You do not need to implement the compact function. You just tell the String Object to compact itself. Here you go:&lt;br /&gt;
&lt;pre style='color:#000020;background:#f6f8ff;'&gt;&lt;span style='color:#ffffff; background:#dd9999; font-weight:bold; font-style:italic; '&gt;'  Your     uncompact    String  '&lt;/span&gt; withBlanksCondensed
&lt;/pre&gt;-&gt; 'Your uncompact String'&lt;br /&gt;
&lt;br /&gt;
You just send the "withBlanksCondensed" message and you are done. Clojure gives you the option of being practically lazy, but Smalltalk makes you one. So learn yourself a little Smalltalk and Clojure if you are really serious about programming with elegance and laziness.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-2987998398940249768?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cJuTilUvaSEUKB4FwMte9d9yFKI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cJuTilUvaSEUKB4FwMte9d9yFKI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cJuTilUvaSEUKB4FwMte9d9yFKI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cJuTilUvaSEUKB4FwMte9d9yFKI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/B4h8iVir74U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/2987998398940249768/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2011/06/two-best-programming-languages-for.html#comment-form" title="20 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/2987998398940249768?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/2987998398940249768?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/B4h8iVir74U/two-best-programming-languages-for.html" title="Two best programming languages for serious programmers" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>20</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2011/06/two-best-programming-languages-for.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EGQng7cCp7ImA9Wx9WFU0.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-4102958112927713447</id><published>2011-01-19T23:35:00.000-08:00</published><updated>2011-01-19T23:47:03.608-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-19T23:47:03.608-08:00</app:edited><title>Detect your host IP with Clojure</title><content type="html">Recently I was faced with trivial task of detecting a host's IP address where the host could have multiple network interfaces. Based on how the local network was configured, you might have a luck with just a one liner in Clojure:&lt;br /&gt;
&lt;br /&gt;
(import (java.net InetAddress))&lt;br /&gt;
(println (InetAddress/getLocalHost))&lt;br /&gt;
&lt;br /&gt;
This will produce following:&lt;br /&gt;
;;user=&gt; (import (java.net InetAddress))&lt;br /&gt;
;;(println (InetAddress/getLocalHost))&lt;br /&gt;
;;user=&gt; &lt;br /&gt;
;;inet4address kpad/127.0.0.1&lt;br /&gt;
;;nil&lt;br /&gt;
&lt;br /&gt;
Obviosly, that is not what you might be looking for since it is just a loopback address.&lt;br /&gt;
To find the your host LAN IP address, you need to find the not loopback interface and obtain the IP that is bound to it. It turns out it is pretty easy in Clojure. Here is whole thing: &lt;br /&gt;
===================================================================&lt;br /&gt;
&lt;pre class="lisp" style="font-family:monospace;"&gt;import &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;java&lt;span style="color: #66cc66;"&gt;.&lt;/span&gt;net NetworkInterface&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;def ip
     &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #b1b100;"&gt;let&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#91;&lt;/span&gt;ifc &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;NetworkInterface/getNetworkInterfaces&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
    ifsq &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;enumeration-seq ifc&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
    ifmp &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;map #&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;bean &lt;span style="color: #66cc66;"&gt;%&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; ifsq&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
    ipsq &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;filter #&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;false? &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;%&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;:&lt;/span&gt;&lt;span style="color: #555;"&gt;loopback&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; ifmp&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
    ipa &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;map &lt;span style="color: #66cc66;"&gt;:&lt;/span&gt;&lt;span style="color: #555;"&gt;interfaceAddresses&lt;/span&gt; ipsq&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
    ipaf &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #b1b100;"&gt;nth&lt;/span&gt; ipa &lt;span style="color: #cc66cc;"&gt;0&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
    ipafs &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;.&lt;/span&gt;split &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;str ipaf&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;&amp;quot; &amp;quot;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
    ips &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;first &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;nnext ipafs&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#93;&lt;/span&gt;
       &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;str &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;second &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;.&lt;/span&gt;split ips &lt;span style="color: #ff0000;"&gt;&amp;quot;/&amp;quot;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;&lt;/pre&gt;&lt;br /&gt;
========================================================================&lt;br /&gt;
&lt;br /&gt;
This will produce following:&lt;br /&gt;
;;user=&gt; (println ip)&lt;br /&gt;
;;192.168.1.70&lt;br /&gt;
;;nil&lt;br /&gt;
&lt;br /&gt;
Note: I am still learning Clojure and surely there will be better way of doing this. If you happen to know, please share. Thanks for reading.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-4102958112927713447?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/kWKb_AdDVWL4kk5EnjttYt8VHIs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/kWKb_AdDVWL4kk5EnjttYt8VHIs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/kWKb_AdDVWL4kk5EnjttYt8VHIs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/kWKb_AdDVWL4kk5EnjttYt8VHIs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/fgwfYI3K71I" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/4102958112927713447/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2011/01/detect-your-host-ip-with-clojure.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/4102958112927713447?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/4102958112927713447?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/fgwfYI3K71I/detect-your-host-ip-with-clojure.html" title="Detect your host IP with Clojure" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>3</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2011/01/detect-your-host-ip-with-clojure.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck4HRnY_fCp7ImA9WxFbF0k.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-5295858490629262874</id><published>2010-07-09T22:48:00.000-07:00</published><updated>2010-07-09T22:48:57.844-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-09T22:48:57.844-07:00</app:edited><title>Flatten a directory with a filter in Clojure</title><content type="html">I always wanted cross platform and stand-alone script to flatten a directory with an optional filter. I have relied on Ant builder from Groovy but it is slow and one needs to have Groovy installed along with Ant. So, I wrote a small script in Clojure that I can use and share with friends easily. Without further ado, here is the entire script: &lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_Sq31yq09j6U/TDe8ktJkdgI/AAAAAAAAAA4/vajuROMMqcg/s1600/dir-flatten.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" src="http://3.bp.blogspot.com/_Sq31yq09j6U/TDe8ktJkdgI/AAAAAAAAAA4/vajuROMMqcg/s640/dir-flatten.bmp" width="585" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Here is the &lt;a href="http://dl.dropbox.com/u/444011/dir-flatten.clj"&gt;source file&lt;/a&gt; for you to use, experiment or do whatever you want to have fun with Clojure.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-5295858490629262874?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/hp0cgXy2O9gKCzJQHyazOKCNqKw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hp0cgXy2O9gKCzJQHyazOKCNqKw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/hp0cgXy2O9gKCzJQHyazOKCNqKw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hp0cgXy2O9gKCzJQHyazOKCNqKw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/EYGGN0IRBdo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/5295858490629262874/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2010/07/flatten-directory-with-filter-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/5295858490629262874?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/5295858490629262874?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/EYGGN0IRBdo/flatten-directory-with-filter-in.html" title="Flatten a directory with a filter in Clojure" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_Sq31yq09j6U/TDe8ktJkdgI/AAAAAAAAAA4/vajuROMMqcg/s72-c/dir-flatten.bmp" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2010/07/flatten-directory-with-filter-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcMSH87cCp7ImA9WxFUEE0.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-609907979798034650</id><published>2010-06-19T19:48:00.000-07:00</published><updated>2010-06-19T19:48:09.108-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-19T19:48:09.108-07:00</app:edited><title>Ubiquitous note taking with Vim and Dropbox</title><content type="html">Finally I found the combination of a best data sync tool called Dropbox and my favorite text editor Vim for ubiquitous note taking. To make it even seamless, I added following to my .vimrc and sharing it with you guys:&lt;br /&gt;
&lt;span style="background-color: black; color: lime;"&gt;map &lt;leader&gt; &amp;lt;leader&amp;gt;nn :tabedit ~/Dropbox/YourName/notes/&lt;/leader&gt;&lt;/span&gt;&lt;br /&gt;
&amp;lt;leader&amp;gt; here is a mapleader, which is a special variable in vim that you can bind to a key in your vimrc. I use following to map it to ","&lt;br /&gt;
&lt;span style="background-color: black; color: lime;"&gt;let mapleader = ","&lt;/span&gt;&amp;nbsp; &lt;br /&gt;
After that you can use comma with the combination of any characters for mapping things that you end up doing a lot. In this case, I mapped it to creating a new file in a new tab within ~/Dropbox/YourName/notes/ folder with whatever name that I will type before hitting the enter key.&amp;nbsp; Above setting will allow following work flow:&lt;br /&gt;
1. Open vim&lt;br /&gt;
2. Just type ,nn and enter the file name you want&lt;br /&gt;
3. Hit enter and start typing&lt;br /&gt;
Creating a new notes could not be more easier and pleasant than this knowing that your notes will be automatically synchronized across multiple computers even on mobile phones. Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-609907979798034650?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/INdilbL6PPcsksUaj5Dq7spyaU0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/INdilbL6PPcsksUaj5Dq7spyaU0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/INdilbL6PPcsksUaj5Dq7spyaU0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/INdilbL6PPcsksUaj5Dq7spyaU0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/igDs5jQrV3s" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/609907979798034650/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2010/06/ubiquitous-note-taking-with-vim-and.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/609907979798034650?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/609907979798034650?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/igDs5jQrV3s/ubiquitous-note-taking-with-vim-and.html" title="Ubiquitous note taking with Vim and Dropbox" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2010/06/ubiquitous-note-taking-with-vim-and.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EBQXszeSp7ImA9WxFVEk4.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-6514606976102333585</id><published>2010-06-10T23:54:00.000-07:00</published><updated>2010-06-11T00:00:50.581-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-11T00:00:50.581-07:00</app:edited><title>On learning idiomatic Clojure</title><content type="html">If you hang around in Clojure google groups and Clojure user groups, one topic that keep popping up is this: How one go about learning idiomatic way of writing Clojure code? After reading almost every source that I could get my hands on, I finally settled for this:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Study Clojure.core daily&lt;/li&gt;
&lt;li&gt;Read "Joy of Clojure" &lt;a href="http://www.amazon.com/Joy-Clojure-Michael-Fogus/dp/1935182641?ie=UTF8&amp;amp;tag=kepe-20&amp;amp;link_code=btl&amp;amp;camp=213689&amp;amp;creative=392969" target="_blank"&gt;The Joy of Clojure&lt;/a&gt;&lt;img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=kepe-20&amp;amp;l=btl&amp;amp;camp=213689&amp;amp;creative=392969&amp;amp;o=1&amp;amp;a=1935182641" style="border: medium none ! important; margin: 0px ! important; padding: 0px ! important;" width="1" /&gt;&lt;/li&gt;
&lt;li&gt;Code, Code, and Code in Clojure as much as you can&lt;/li&gt;
&lt;/ol&gt;If you are really serious about Clojure, grab a MEAP edition of "Joy of Clojure" and the book bundle. Here is how I follow above steps: I find interesting functions from Clojure.core and will implement it by adding my- in front of standard functions. Then I search for the forms used within the function in the "Joy of Clojure".&amp;nbsp; It is quite an enlightening experience to see how the creator of the language structure his code. On top of that, you have an idiomatic Clojure reference book's help within your reach. Boy, it feels like a happy kid with a cotton candy in your hand.&amp;nbsp; Let me show you by an example:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;span style="background-color: black; color: lime;"&gt;(def&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: black; color: lime;"&gt;&amp;nbsp;my-assoc&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: black; color: lime;"&gt;&amp;nbsp;(fn my-assoc&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: black; color: lime;"&gt;&amp;nbsp;&amp;nbsp; ([map key val] (assoc map key val))&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: black; color: lime;"&gt;&amp;nbsp;&amp;nbsp; ([map key val &amp;amp; kvs]&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: black; color: lime;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (let [ret (my-assoc map key val)]&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: black; color: lime;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (if kvs&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: black; color: lime;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (recur ret (first kvs) (second kvs) (nnext kvs))&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: black; color: lime;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ret)))))&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: black; color: lime;"&gt;(println (my-assoc {} :symbol "assoc")) =&amp;gt; {:symbo assoc}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
my-assoc here is a Var that holds a reference to a function that named my-assoc, which takes a map and one or more key-val pairs, and returns a map that contains the mapping.&amp;nbsp; This actually is a classic Clojure style of tail recursive function. Namely, it is an idiomatic way to use function signatures for base and recursive cases. It is also very elegant to use let binding to hold accumulative value that will be referred in multiple places in a block. The use of recur in the tail position is just what it is intended for. It recursively invokes my-assoc function with the correct number of arguments, which in this case&lt;br /&gt;
&lt;span style="background-color: black; color: lime;"&gt;  (my-assoc [map key val &amp;amp; kvs])&lt;/span&gt;&amp;nbsp; until kvs are nil, which is one of only two false (nil and false) in idiomatic Clojure.&amp;nbsp; &lt;span style="background-color: black; color: lime;"&gt;(first  kvs) (second kvs) (nnext kvs)&lt;/span&gt; is also idiomatic way of traversing a seq that will save you from unexpected nil punning. (Again, read "Joy of Clojure" for detailed explanation for this).&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
My way of learning idiomatic Clojure is very opinionated and might not work for everyone. What is your way of learning idiomatic Clojure? Please share it if you can so a Clojure noob will have a good start.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-6514606976102333585?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/v-hg6EcNfysOOWOJVe4U-BtCC4M/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/v-hg6EcNfysOOWOJVe4U-BtCC4M/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/v-hg6EcNfysOOWOJVe4U-BtCC4M/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/v-hg6EcNfysOOWOJVe4U-BtCC4M/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/bum3lMbHJKI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/6514606976102333585/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2010/06/on-learning-idiomatic-clojure.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/6514606976102333585?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/6514606976102333585?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/bum3lMbHJKI/on-learning-idiomatic-clojure.html" title="On learning idiomatic Clojure" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2010/06/on-learning-idiomatic-clojure.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkUFSXg4fCp7ImA9WxFXFkg.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-5239417028438650989</id><published>2010-05-23T15:36:00.000-07:00</published><updated>2010-05-23T15:36:58.634-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-23T15:36:58.634-07:00</app:edited><title>Stat 101 and little more in 25 lines of Clojure</title><content type="html">If you like numbers or statistics to be exact, Clojure is your best friend. There is this wonderful statistical graphing library called Incanter, which is an R like environment for all of your data crunching and visualization needs. And there is such an expressive power of Clojure at your fingertips that you can pretty much express your stat 101 (probability, permutation, combination, number of trial and degree of certainty) with a mere 25 (blank lines are not counted) lines of Clojure code. OK, without further ado, here is the whole thing:&lt;br /&gt;
&lt;span style="background-color: black; color: lime;"&gt;Note: DC stands for degree of certainty that an event will appear, P stands  for probability of the event and N stands for number of trials  (events). from the auther of&lt;/span&gt; &lt;a href="http://www.amazon.com/Probability-Theory-Live-Ion-Saliu/dp/1450037348?ie=UTF8&amp;amp;tag=kepe-20&amp;amp;link_code=btl&amp;amp;camp=213689&amp;amp;creative=392969" target="_blank"&gt;Probability Theory, Live!&lt;/a&gt;&lt;img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=kepe-20&amp;amp;l=btl&amp;amp;camp=213689&amp;amp;creative=392969&amp;amp;o=1&amp;amp;a=1450037348" style="border: medium none ! important; margin: 0px ! important; padding: 0px ! important;" width="1" /&gt;&lt;br /&gt;
&lt;pre&amp;nbsp; style="background: url(&amp;quot;http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif&amp;quot;) repeat scroll 0% 0% rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;/pre&amp;nbsp;&gt;&lt;code style="color: black; word-wrap: normal;"&gt;1:&amp;nbsp; (defn N [p dc]&amp;nbsp; &lt;br /&gt;
2:&amp;nbsp;&amp;nbsp; (/ (Math/log (- 1 dc))&amp;nbsp; &lt;br /&gt;
3:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Math/log (- 1 p))))&amp;nbsp; &lt;br /&gt;
4:&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
5:&amp;nbsp; (defn DC [p n]&amp;nbsp; &lt;br /&gt;
6:&amp;nbsp;&amp;nbsp; (let [np (- 1 p)&amp;nbsp; &lt;br /&gt;
7:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pp (Math/pow np n)]&amp;nbsp; &lt;br /&gt;
8:&amp;nbsp;&amp;nbsp;&amp;nbsp; (- 1 pp)))&amp;nbsp; &lt;br /&gt;
9:&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
10:&amp;nbsp; (defn k-factorial [n]&amp;nbsp; &lt;br /&gt;
11:&amp;nbsp;&amp;nbsp; (reduce * (range 1 (inc n))))&amp;nbsp; &lt;br /&gt;
12:&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
13:&amp;nbsp; (defn permutation [n k]&amp;nbsp; &lt;br /&gt;
14:&amp;nbsp;&amp;nbsp; (/ (k-factorial n)&amp;nbsp; &lt;br /&gt;
15:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (k-factorial (- n k))))&amp;nbsp; &lt;br /&gt;
16:&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
17:&amp;nbsp; (defn combination [n k]&amp;nbsp; &lt;br /&gt;
18:&amp;nbsp;&amp;nbsp; (/ (k-factorial n)&amp;nbsp; &lt;br /&gt;
19:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (* (k-factorial k)&amp;nbsp; &lt;br /&gt;
20:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (k-factorial (- n k)))))&amp;nbsp; &lt;br /&gt;
21:&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
22:&amp;nbsp; (defn- k-filter [el coll]&amp;nbsp; &lt;br /&gt;
23:&amp;nbsp;&amp;nbsp; (filter #(not (= el %)) coll))&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
24:&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
25:&amp;nbsp; (defn permutations [n coll]&amp;nbsp; &lt;br /&gt;
26:&amp;nbsp;&amp;nbsp;&amp;nbsp; (if (= n 1)&amp;nbsp; &lt;br /&gt;
27:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (map #(vector %) coll)&amp;nbsp; &lt;br /&gt;
28:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (for [el coll nlis (permutations (- n 1) (k-filter el coll))]&amp;nbsp; &lt;br /&gt;
29:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (conj nlis el))))&amp;nbsp;&amp;nbsp; &lt;br /&gt;
30:&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
31:&amp;nbsp; (defn combinations [n coll]&amp;nbsp; &lt;br /&gt;
32:&amp;nbsp;&amp;nbsp; (set (map set (permutations n coll))))&amp;nbsp; &lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The combinations and permutations implementation is recursive and will result in stack over flow for large data. For non recursive implementation, you can check clojure-contrib's combinatorics library. It is fast and makes use of lazy-seq, meaning you can virtually generate combinations for arbitrary large amount of data. However, the point of this post is to show you that it is very easy to implement statistical formulas in Clojure. You might wander what you can do with the above code. Here is one interesting statistical riddle you can solve with it: Let us say you have a bag with 100 coins. There are 7 gold coins and 93 silver coins. If you are to pick up a coin without looking inside the bag, what is minimum number of coins that you had to pick up to be able to say with 50% confidence that this bag has 7 gold coins? Now, we can put the code above into action:&lt;br /&gt;
First we need to clarify the riddle is asking us to find the number of trials, which is N as defined above.&lt;br /&gt;
Second, we know that the possibility P of picking up a gold coin is 7/100.&amp;nbsp; The degree of certainty, which is denoted as DC above, is given as .5 or 1/2. So let us just plug in those numbers to the function N:&lt;br /&gt;
&lt;div style="background-color: black; color: lime;"&gt;=&amp;gt;(println (N (/ 7 100) 0.5))&lt;/div&gt;This will produce 9.551337509447352, which roughly around 10 trials.&amp;nbsp; So we can say that after picking about 10 coins, you can say with 50% percent confidence that the bag has 7 gold coins.&lt;br /&gt;
&lt;br /&gt;
Again, if you are math inclined person, you will have a lot more fun with Clojure than you might have imagined.&amp;nbsp; Note that the DC and N formula is directly from following website:&lt;br /&gt;
http://saliu.com/Saliu2.htm. I also got help and feedback to my permutations function from nice folks hang around in Google Clojure groups, which I highly recommend you sign up immediately if you want to learn from a master or masters.&amp;nbsp; I might do another post with the non recursive version of the function in my next post when time permits. Until then, enjoy your Clojure journey. &lt;br /&gt;
&amp;nbsp;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-5239417028438650989?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/6uDuuuyePnjQBWMwT6fz80CTuxI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6uDuuuyePnjQBWMwT6fz80CTuxI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/6uDuuuyePnjQBWMwT6fz80CTuxI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6uDuuuyePnjQBWMwT6fz80CTuxI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/y6XHGIVmDH4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/5239417028438650989/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2010/05/stat-101-and-little-more-in-25-lines-of.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/5239417028438650989?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/5239417028438650989?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/y6XHGIVmDH4/stat-101-and-little-more-in-25-lines-of.html" title="Stat 101 and little more in 25 lines of Clojure" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2010/05/stat-101-and-little-more-in-25-lines-of.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUIERn0_fCp7ImA9WxFQGUQ.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-9187289746568789951</id><published>2010-05-16T00:02:00.000-07:00</published><updated>2010-05-16T00:05:07.344-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-16T00:05:07.344-07:00</app:edited><title>The most portable Clojure REPL box - Eee PC 701</title><content type="html">I have been trying to put my Eee PC 701 into a good use. This weekend I realized that turning it into a portable Clojure Box could not be more useful considering I can have REPL access whenever I want. As it turned out, it is quite easy, and here is how I got it done:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Download the Arch Linux ISO (here: http://www.archlinux.org/download/) and burn it onto a CD.&lt;/li&gt;
&lt;li&gt;Use an external CD drive to boot your Eee PC with Arch Linux Image and follow the instructions to install the base system.&amp;nbsp; You will find very detailed step by step instruction from here: http://wiki.archlinux.org/index.php/Asus_Eee_PC_701. Even though the installation process is pretty straight forward, here are few things you need to pay attention:&lt;/li&gt;

&lt;ul style="background-color: black; color: lime;"&gt;&lt;li&gt;Make sure you select ext2 file system&lt;/li&gt;
&lt;li&gt;Run "pacman -Syu" to do system upgrade before installing any extra programs &lt;/li&gt;
&lt;li&gt;Make sure to add hal and fam to the deamon list by adding "DAEMONS=(syslog-ng network netfs crond @hal @fam)" to your /etc/rc.conf if you are planning to add a graphical desktop environment&lt;/li&gt;
&lt;li&gt;Now you can install Mercurial, Git, Java and Clojure. (You can install all from Arch repo except Clojure. You can easily install Clojure by: hg clone http://bitbucket.org/kasim/clojurew/, which is a project I created to make setting up Clojure less painful.)&amp;nbsp; &amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;&lt;/ol&gt;You can also install Xorg and a lightweight desktop called lxde very easily if you want. However, All I needed is a shell log in so I can play with Clojure REPL. The Clojurew project include latest versions of Clojure-contrib and JLine so you pretty much have all Clojure API doc and source code browsing at your fingertips with command line history. After installing Mercurial, Git, Java and Clojure with clojure-contrib, you will still have close to 3 Gig empty space left on your hard drive(It has only 4 Gig hard drive). That means you can still install Incanter, which I have been playing with a lot recently. (Note: you can just copy Incanter app jar from the binary download to Clojurew's lib directory to have Incanter available at the REPL).&amp;nbsp; It took me around an hour to set everything up and the joy of being able to carry a little Clojure box around is well worth the effort and amazing. Go ahead and try it out if you own Eee PC 701.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-9187289746568789951?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/T7uJfnAFjRFPFPcsHVCZlwXp3YI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/T7uJfnAFjRFPFPcsHVCZlwXp3YI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/T7uJfnAFjRFPFPcsHVCZlwXp3YI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/T7uJfnAFjRFPFPcsHVCZlwXp3YI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/tVP02SjTF4o" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/9187289746568789951/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2010/05/most-portable-clojure-repl-box-eee-pc.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/9187289746568789951?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/9187289746568789951?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/tVP02SjTF4o/most-portable-clojure-repl-box-eee-pc.html" title="The most portable Clojure REPL box - Eee PC 701" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2010/05/most-portable-clojure-repl-box-eee-pc.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkUDQH08fCp7ImA9WxFQGUU.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-3445517460878811007</id><published>2010-05-07T17:29:00.001-07:00</published><updated>2010-05-15T22:37:51.374-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-15T22:37:51.374-07:00</app:edited><title>Easy Clojure developement with Vim</title><content type="html">&lt;div class="Section1"&gt;&lt;div class="MsoNormal"&gt;Starting with Vim or Clojure can be difficult. Starting with both at the same time is not recommended. But it can get difficult for someone who knows both. Following is a simple way how I do my development:&lt;/div&gt;&lt;div class="MsoNormal"&gt;I edit clojure scripts in Vim. I found putting following lines in .vimrc very helpful:&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="background-color: black; color: lime;"&gt;set showmatch&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="background-color: black; color: lime;"&gt;map &amp;lt;F5&amp;gt; &amp;lt;Esc&amp;gt;:!clj '%:p'&amp;lt;CR&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;The first one is for highlighting matching (,{ and [. The second one is for executing the currently edited file.&amp;nbsp; Please note that !clj '%:p' just invokes shell command clj with the fully qualified path of the current buffer you are editing and it is mapped to the F5 function key.&amp;nbsp; If you are using MacVim, make sure that you put following lines in your .vimrc file:&lt;br /&gt;
&lt;span style="background-color: black; color: lime;"&gt;let $PATH="path/to/clojure/home/bin:".$PATH&lt;/span&gt;&lt;br /&gt;
I also use a vim plug in called “AutoClose” (here: &lt;a href="http://www.vim.org/scripts/script.php?script_id=1849"&gt;http://www.vim.org/scripts/script.php?script_id=1849&lt;/a&gt;) that will automatically close parenthesis, brackets and curly braces. You can also do yourself a favor by installing a plug in called “VimClojure” (here: &lt;a href="http://www.vim.org/scripts/script.php?script_id=2501"&gt;http://www.vim.org/scripts/script.php?script_id=2501&lt;/a&gt;). I only use syntax highlighting feature and do not run interactive REPL with it(I do not recommended using nailgun server). The above is just enough to do small scale development. However, for involved development, there is dependency and class path hurdles to overcome. It is even worse for someone who is new to Java World from other dialects of LISP. &amp;nbsp;To ease the pain, I created a project called Clojurew (here: &lt;a href="http://bitbucket.org/kasim/clojurew/src"&gt;http://bitbucket.org/kasim/clojurew/src&lt;/a&gt;) that will do automatic class path resolution. Any jar dependency will be resolved by just coping the jar to the lib folder of Clojurew. If you want to include your own script to the class path, &amp;nbsp;you can even create a soft link to your script within the lib directory and it will be included in the class path as well. Here is how you can do this:&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&lt;span style="background-color: black; color: lime;"&gt;ln &amp;nbsp;-s path/to/your/script linkname &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;After this, you can use any function in your script that is defined in other files. &amp;nbsp;Happy Vimming and Clojuring!&lt;/div&gt;&lt;div class="MsoNormal"&gt;I hope someone find this helpful.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-3445517460878811007?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/mIsoKvJjoi0TW3hoMFb4-0lOFt8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mIsoKvJjoi0TW3hoMFb4-0lOFt8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/mIsoKvJjoi0TW3hoMFb4-0lOFt8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mIsoKvJjoi0TW3hoMFb4-0lOFt8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/20lhZ05T-nw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/3445517460878811007/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2010/05/easy-clojure-developement-with-vim.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/3445517460878811007?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/3445517460878811007?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/20lhZ05T-nw/easy-clojure-developement-with-vim.html" title="Easy Clojure developement with Vim" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2010/05/easy-clojure-developement-with-vim.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08FR34_fip7ImA9WxFRE0k.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-720033151777666931</id><published>2010-04-26T19:00:00.001-07:00</published><updated>2010-04-26T21:16:56.046-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-26T21:16:56.046-07:00</app:edited><title>let and binding macros in Clojure</title><content type="html">&lt;div class="gmail_quote"&gt;&lt;blockquote class="gmail_quote" style="border-left: 1px #ccc solid; margin: 0 0 0 .8ex; padding-left: 1ex;"&gt;&lt;div lang="EN-US" link="blue" vlink="purple"&gt;&lt;div&gt;&lt;div class="MsoNormal"&gt;Clojure has a special form called "let" and "binding", which are actually implemented as macros. It can get confusing sometimes.&amp;nbsp; If you have read "Programming Clojure" book, you might be thinking that it is easy to use them correctly considering following straightforward example:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_Sq31yq09j6U/S9ZF4KCOquI/AAAAAAAAAAQ/hnldef5s8mw/s1600/image001.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="105" src="http://3.bp.blogspot.com/_Sq31yq09j6U/S9ZF4KCOquI/AAAAAAAAAAQ/hnldef5s8mw/s320/image001.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Basically, "let" creates a lexical scoped Vars, which is local to the code block or a procedure where it is initially defined. Therefore, in the example above, "let" just created a new "x" with the value of "new value". But it is not local to the function "print-x".&amp;nbsp; That is to say, "print-x" have no knowledge of the local scoped binding that is created by "let". "binding" macro instead creates a new binding for the already existed var, "x" with the "new value". Since "print-x" is evaluated within the "binding" form, the newly bound value is visible to any chained calls within the form. &amp;nbsp;All nice and easy. However, it is not that obvious to understand and use them correctly. Look at following example:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_Sq31yq09j6U/S9ZGG3YqWjI/AAAAAAAAAAY/UiH38NxvHlI/s1600/image002.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="108" src="http://2.bp.blogspot.com/_Sq31yq09j6U/S9ZGG3YqWjI/AAAAAAAAAAY/UiH38NxvHlI/s320/image002.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;"let" example is just fine. It created a new var "y" with the value of 5 bound to it.&amp;nbsp; But what is going on with the "binding" example? If we dig little deeper to Clojure API doc, we learn that the new bindings in "binding" are made in parallel, not sequential as it is in "let". Therefore, existing var "y" gets bound to the root binding of "x" not the overshadowed value of "x", which is the case in the "let example".&lt;/div&gt;&lt;div class="MsoNormal"&gt;OK, so far so good. Let us look at another example:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_Sq31yq09j6U/S9ZGSgbQmRI/AAAAAAAAAAg/55CVEihkkRQ/s1600/image003.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="125" src="http://3.bp.blogspot.com/_Sq31yq09j6U/S9ZGSgbQmRI/AAAAAAAAAAg/55CVEihkkRQ/s400/image003.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Line 20-29 is pretty straight forward. But how about line 30? Shouldn't &amp;nbsp;it call "print-y" function? Not really. It is because the anonymous function is evaluated outside of the "binding" form. &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see this in action let us try following:&lt;br /&gt;
&lt;blockquote class="gmail_quote" style="border-left: 1px #ccc solid; margin: 0 0 0 .8ex; padding-left: 1ex;"&gt;&lt;div lang="EN-US" link="blue" vlink="purple"&gt;&lt;div&gt;&lt;div class="MsoNormal"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_Sq31yq09j6U/S9ZGeENTVRI/AAAAAAAAAAo/hWj8qYzEYI4/s1600/image004.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="30" src="http://4.bp.blogspot.com/_Sq31yq09j6U/S9ZGeENTVRI/AAAAAAAAAAo/hWj8qYzEYI4/s400/image004.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The "#&amp;lt;user$eval__28$fn__30 user$eval__28$fn__30@bdb503&amp;gt;" is an indication that anonymous function did not get evaluated within the "binding" form. &amp;nbsp;Ok, now, how do you make sure it evaluates within the "binding" form? Here is what you do:&lt;br /&gt;
&lt;blockquote class="gmail_quote" style="border-left: 1px #ccc solid; margin: 0 0 0 .8ex; padding-left: 1ex;"&gt;&lt;div lang="EN-US" link="blue" vlink="purple"&gt;&lt;div&gt;&lt;div class="MsoNormal"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_Sq31yq09j6U/S9ZGgIL7J0I/AAAAAAAAAAw/-UNfwrQ0G1k/s1600/image005.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="36" src="http://4.bp.blogspot.com/_Sq31yq09j6U/S9ZGgIL7J0I/AAAAAAAAAAw/-UNfwrQ0G1k/s400/image005.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class="gmail_quote" style="border-left: 1px #ccc solid; margin: 0 0 0 .8ex; padding-left: 1ex;"&gt;&lt;div lang="EN-US" link="blue" vlink="purple"&gt;&lt;div&gt;&lt;div class="MsoNormal"&gt;Just enclose the anonymous function within parenthesis. &amp;nbsp;What do we learn from all of the above? Here are the summary that helps one use "let" and "binding" correctly:&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Use "binding" only if you are trying to alter a behavior dynamically for special-vars that is already defined. Enclose your special vars within * as recommended by idiomatic clojure&amp;nbsp;to make your intent clear.&lt;/li&gt;
&lt;li&gt;Use "let" for locally scoped vars and avoid shadowing already defined vars.&lt;/li&gt;
&lt;li&gt;Remember "let" binding is sequential and "binding" binding is done in parallel.&lt;/li&gt;
&lt;li&gt;Pay close attention to the scope of the "binding" form. Any expression that is not evaluated inside the form, will not see the binding. That is to say, binding in "binding" form is thread local starting from the "binding" form until it ends including any expression that is chained within the form, which is what the thread-local are all about.&lt;/li&gt;
&lt;/ul&gt;&lt;div class="MsoNormal"&gt;I posted this so that it helps someone trying to find his or her way in the wonderful world of Clojure. &amp;nbsp;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-720033151777666931?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/DKNhWS9w6u_0IpSklBhNfPWWgKM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DKNhWS9w6u_0IpSklBhNfPWWgKM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/DKNhWS9w6u_0IpSklBhNfPWWgKM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DKNhWS9w6u_0IpSklBhNfPWWgKM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/1hfa99y7H38" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/720033151777666931/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2010/04/re-clojures-let-and-binding-macros.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/720033151777666931?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/720033151777666931?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/1hfa99y7H38/re-clojures-let-and-binding-macros.html" title="let and binding macros in Clojure" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_Sq31yq09j6U/S9ZF4KCOquI/AAAAAAAAAAQ/hnldef5s8mw/s72-c/image001.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2010/04/re-clojures-let-and-binding-macros.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4FR3g5cCp7ImA9WxFREEU.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-4910067041571996242</id><published>2010-04-22T17:19:00.001-07:00</published><updated>2010-04-23T21:38:36.628-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-23T21:38:36.628-07:00</app:edited><title>Easy way to start with Clojure developement</title><content type="html">&lt;div class="Section1"&gt;&lt;div class="MsoNormal"&gt;&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=kepe-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=0596809484&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=kepe-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=1934356336&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;For any software developer, I recommend learning functional programming, which is especially true for anyone who spent quite a bit of time on doing Object Oriented Programming.&amp;nbsp; As far as my experience from Ruby -&amp;gt; Groovy -&amp;gt; Scala -&amp;gt; Clojure journey concerned, I strongly recommend learning Clojure to get into functional way of thinking in practical way.&amp;nbsp; One of the hurdles that I encountered in getting started with Clojure is lack of a simple way of setting the environment. Yes, there are many ways one can get started such as Lein, Maven+Clojure Plugin, Emacs+Swank+Slime, Vim+VimClojure, Eclipse+CounterClockWise, NetBeans+Enclojure, IDEA+LaClojure, you name it. But it all makes a newbie to spend days if not hours to get his or her environment right.&amp;nbsp; After playing the hard way( Emac+Swank+Slime, Vim+VimClojure), which I do not recommend for a new comer,&amp;nbsp; I ended up creating a project called ClojureW. &amp;nbsp;It is the easiest way to start with Clojure as far as I know for all three major OSes such as Windows, OS X and Linux.&amp;nbsp; Here is all you need to get going:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;"&gt;&lt;span class="apple-style-span"&gt;1.&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Download Clojurew from: &lt;span class="apple-style-span"&gt;&lt;span style="color: #444444; font-family: Verdana, sans-serif; font-size: 11.5pt;"&gt;&lt;a href="http://bitbucket.org/kasim/clojurew/get/tip.zip"&gt;&lt;span style="color: #2b547d;"&gt;http://bitbucket.org/kasim/clojurew/get/tip.zip&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;"&gt;2.&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Unzip it to a folder and change to bin directory of this folder&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;"&gt;3.&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Just run clj to get a REPL or run clj cljscript.clj to execute your script. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;For beginners, I recommend just using a text editor that highlights matching parenthesis. &amp;nbsp;Believe me, trying to set up an “IDE” for Clojure is painful if not disappointing at best.&amp;nbsp; The main thing that you learn from Clojure is to think bottom-up when solving problems.&amp;nbsp; You can practice this approach with any language but Clojure will force you to think this way. &amp;nbsp;Again, setting up IDE is a hindrance to what Clojure is really about at the beginning. You can play with IDEs once you get into idiomatic Clojure way of thinking.&amp;nbsp; As stated by a book titled, “97 Things Every Programmer Should Know”, being able to quickly type up a simple “Hello World” program and run it via command line can prove extremely valuable after all.# &amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-4910067041571996242?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/bac_AH93G0FkLu7uSm_3NXT-QY8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bac_AH93G0FkLu7uSm_3NXT-QY8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/bac_AH93G0FkLu7uSm_3NXT-QY8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bac_AH93G0FkLu7uSm_3NXT-QY8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/egqSbRAeW7A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/4910067041571996242/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2010/04/easy-way-to-start-with-clojure.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/4910067041571996242?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/4910067041571996242?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/egqSbRAeW7A/easy-way-to-start-with-clojure.html" title="Easy way to start with Clojure developement" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2010/04/easy-way-to-start-with-clojure.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAFSXk6fSp7ImA9WxFREEU.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-4130479831512819832</id><published>2010-02-26T21:32:00.000-08:00</published><updated>2010-04-23T21:35:18.715-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-23T21:35:18.715-07:00</app:edited><title>Books everyone should read not just geeks or hackers</title><content type="html">&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=kepe-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=1934356506&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=kepe-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=0596006624&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;It has been a while since I did not write anything on my blog.  I have been busy with work and reading among other things. But two books I read recently made me to want to blog about them. One is Paul Graham's Hackers and Painters, the other is Pomodoro Technique Illustrated by Staffan Noteberg.  &lt;br /&gt;
&lt;div&gt;On Hackers and Painters:&lt;/div&gt;&lt;div&gt;It is a great book especially for programmers.  The breadth of common sense and not so common sense knowledge is breathtaking. It offers unique perspective on programming languages. It is pretty much biased towards Lisp, which is understandable considering his success and expertise on it. However, his advice of not learning Lisp for people over the age of 25 does not do justice to such a great language that every programmer should learn even if they do not use it. I am recent Lisp convert and I can already see its benefit to my daily work.  I think earlier Lisp Dialects did not catch on because of its "strange" syntax, which made it more implementer friendly but not user friendly. But a recent dialect called Clojure is poised to make Lisp very very popular.  Because the creator of Clojure is making very very nice middle road approach between user and implementer of the language.  Anyway, Paul Graham's collection of essays in his book is really eye opening.  There is chapter on how America's public school system works, why it is works the way it is and how adults should help kids between the age of 11 and 17. There is also a chapter about how to create wealth. His take on start ups are really thoughtful. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;On Pomodoro Technique Illustrated:&lt;/div&gt;&lt;div&gt;Pomodoro means tomato in Italian.  It is a focus training method that helps every goal oriented person by allowing them to get things done. What is unique about it is:&lt;/div&gt;&lt;div&gt;1. It is simple&lt;/div&gt;&lt;div&gt;2. It is easy&lt;/div&gt;&lt;div&gt;3. It is effective&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Here is what you need to do:&lt;/div&gt;&lt;div&gt;1. Pick a to do item now&lt;/div&gt;&lt;div&gt;2. Set 25 minutes timer and start doing it now&lt;/div&gt;&lt;div&gt;3. Repeat above with new to do item if you finish or continue working after a short break. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;All you need is a Timer, a sheet of paper, and your attention.  In this memory overflow day and age, everyone needs to stay focused to get anything done. Countless interruption and stimulus is making people not even be able to concentrate for 25 minutes. Try it and you will be more productive. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-4130479831512819832?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/iB1NOpvazF5JBKRFCulPIlc_tfM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iB1NOpvazF5JBKRFCulPIlc_tfM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/iB1NOpvazF5JBKRFCulPIlc_tfM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iB1NOpvazF5JBKRFCulPIlc_tfM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/EWaCtq1kJfg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/4130479831512819832/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2010/02/books-everyone-should-read-not-just.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/4130479831512819832?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/4130479831512819832?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/EWaCtq1kJfg/books-everyone-should-read-not-just.html" title="Books everyone should read not just geeks or hackers" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2010/02/books-everyone-should-read-not-just.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEMGR3c6cCp7ImA9WxBQEk4.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-6273110917943212736</id><published>2010-01-08T10:10:00.000-08:00</published><updated>2010-01-11T11:00:26.918-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-11T11:00:26.918-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Clojure" /><title>To roman implementation in Clojure</title><content type="html">Here is my take of to roman implementation in Clojure:&lt;br /&gt;I posted this in &lt;a href="http://rosettacode.org/wiki/Roman_Numerals#Clojure"&gt;http://rosettacode.org/wiki/Roman_Numerals#Clojure&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(204, 204, 204); padding: 0px; background: rgb(240, 240, 240) url(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif) repeat scroll 0% 0%; overflow: auto; font-family: arial; font-size: 12px; width: 99%; height: auto; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; color: rgb(0, 0, 0); text-align: left; line-height: 20px;"&gt;&lt;code style="color: rgb(0, 0, 0); word-wrap: normal;"&gt;1:  (def arabic-roman-map&lt;br /&gt;2:     {1 "I", 5 "V", &lt;br /&gt;3:     10 "X", 50 "L", &lt;br /&gt;4:     100 "C", 500 "D", &lt;br /&gt;5:     1000 "M", &lt;br /&gt;6:     4 "IV", 9 "IX", &lt;br /&gt;7:     40 "XL", 90 "XC", &lt;br /&gt;8:     400 "CD", 900 "CM" })&lt;br /&gt;9:  (def arabic-roman-map-sorted-keys&lt;br /&gt;10:     (sort (keys arabic-roman-map)))&lt;br /&gt;11:  (defn find-value-in-coll&lt;br /&gt;12:   [coll k]&lt;br /&gt;13:   (let [aval (find coll k)]&lt;br /&gt;14:   (if (nil? aval) "" (val aval))))&lt;br /&gt;15:  (defn to-roman&lt;br /&gt;16:   [result n]&lt;br /&gt;17:   (let&lt;br /&gt;18:     [closest-key-for-n (last (filter #(&amp;gt; n %) arabic-roman-map-sorted-keys))&lt;br /&gt;19:      roman-value-for-n (find-value-in-coll arabic-roman-map n)&lt;br /&gt;20:      roman-value-for-closet-to-n (find-value-in-coll arabic-roman-map&lt;br /&gt;21:                                   closest-key-for-n)]&lt;br /&gt;22:      (if (or (&lt;= n 0) (contains? arabic-roman-map n))&lt;br /&gt;23:        (conj result roman-value-for-n)&lt;br /&gt;24:        (recur (conj result roman-value-for-closet-to-n)&lt;br /&gt;25:            (- n closest-key-for-n)))))&lt;br /&gt;26:  Usage: &amp;gt;(to-roman [] 1999)&lt;br /&gt;27:  result: ["M" "CM" "XC" "IX"]&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-6273110917943212736?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/-kaT4XYjHj4aSx9vYBkdqONIQ98/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-kaT4XYjHj4aSx9vYBkdqONIQ98/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/-kaT4XYjHj4aSx9vYBkdqONIQ98/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-kaT4XYjHj4aSx9vYBkdqONIQ98/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/vTJZ5F_67dQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/6273110917943212736/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2010/01/to-roman-implementation-in-clojure.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/6273110917943212736?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/6273110917943212736?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/vTJZ5F_67dQ/to-roman-implementation-in-clojure.html" title="To roman implementation in Clojure" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2010/01/to-roman-implementation-in-clojure.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkECQ3k_cSp7ImA9WxNWFk4.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-4425764896590181880</id><published>2009-10-15T11:09:00.000-07:00</published><updated>2009-10-15T11:17:42.749-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-15T11:17:42.749-07:00</app:edited><title>P12: Decode run-length encoding</title><content type="html">Following is the direct solution:&lt;br /&gt;&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt;1:  def decode(list:List[(Int,Any)]):List[Any] = {  &lt;br /&gt;2:     val b = new ListBuffer[Any]()  &lt;br /&gt;3:     var temp = list  &lt;br /&gt;4:     while(!temp.isEmpty){  &lt;br /&gt;5:     for(i&amp;lt;- 1 to temp.head._1){  &lt;br /&gt;6:      b+=temp.head._2 }  &lt;br /&gt;7:     temp = temp.tail  &lt;br /&gt;8:     }  &lt;br /&gt;9:     b.toList  &lt;br /&gt;10:     }  &lt;br /&gt;11:  println("input List = "+dlist)  &lt;br /&gt;12:  println(decode(dlist))  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;The input: &lt;br /&gt;List((6,'a), (2,'c), (4,'e))&lt;br /&gt;The output:&lt;br /&gt;List('a, 'a, 'a, 'a, 'a, 'a, 'c, 'c, 'e, 'e, 'e, 'e)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-4425764896590181880?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/WOXXhofTUWFtdeEUoOjfo-xLvB4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WOXXhofTUWFtdeEUoOjfo-xLvB4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/WOXXhofTUWFtdeEUoOjfo-xLvB4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WOXXhofTUWFtdeEUoOjfo-xLvB4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/Ai_fqRgRpRg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/4425764896590181880/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2009/10/p12-decode-run-length-encoding.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/4425764896590181880?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/4425764896590181880?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/Ai_fqRgRpRg/p12-decode-run-length-encoding.html" title="P12: Decode run-length encoding" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2009/10/p12-decode-run-length-encoding.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0cFQn44fip7ImA9WxNWFk8.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-5143663547106947680</id><published>2009-10-15T09:37:00.000-07:00</published><updated>2009-10-15T09:43:33.036-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-15T09:43:33.036-07:00</app:edited><title>P11: Modified run-length encoding that includes only repeated elements</title><content type="html">Use unflatten method from P9 and filter it before mapping the sublist as a tuple:&lt;br /&gt;println(ulist.filter(_.length &gt; 1).map(e=&gt;(e.length,e.head)))&lt;br /&gt;&lt;br /&gt;Output: &lt;br /&gt;List((6,'a), (2,'c), (4,'e))&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-5143663547106947680?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/DOsWOTx13QSRMzBKmmNb2X01ENc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DOsWOTx13QSRMzBKmmNb2X01ENc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/DOsWOTx13QSRMzBKmmNb2X01ENc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DOsWOTx13QSRMzBKmmNb2X01ENc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/qSXTwva75nY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/5143663547106947680/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2009/10/p11-modified-run-length-encoding-that.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/5143663547106947680?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/5143663547106947680?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/qSXTwva75nY/p11-modified-run-length-encoding-that.html" title="P11: Modified run-length encoding that includes only repeated elements" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2009/10/p11-modified-run-length-encoding-that.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEUNRXw_eip7ImA9WxNWFUs.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-4918882759594453234</id><published>2009-10-14T15:52:00.000-07:00</published><updated>2009-10-14T16:18:14.242-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-14T16:18:14.242-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="tips and tricks" /><title>Installing Eclipse, Scala and Groovy in Windows 7</title><content type="html">There are many ways to install them on Windows 7. I am just listing following simple ways that worked for me:&lt;br /&gt;1. Installing Eclipse 3.5&lt;br /&gt;The latest 3.5 version works just fine on Windows 7. download it then unzip it to a location of your choice.&lt;br /&gt;2. Installing Scala&lt;br /&gt;Download IzPack installer, Just follow the wizard and you are done.&lt;br /&gt;3. Installing Groovy&lt;br /&gt;Download the Windows-Installer package. After installation, you need to do following:&lt;br /&gt;1. Open Control Panel-&gt;System and Security-&gt;System and click on Advanced system settings.(Shortcut: Win+Pause/Break combination is your friend)&lt;br /&gt;2. Click on Environment Variables&lt;br /&gt;3. Make sure to create User variables such as GROOVY_HOME as name, installation location as value. (Note: Creating System variables did not work for me)&lt;br /&gt;That is all there is to it. I hope someone find this post helpful.&lt;/win+pause&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-4918882759594453234?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Q7ZrN5Tdza4xA9dFl4n1tv1gXN4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Q7ZrN5Tdza4xA9dFl4n1tv1gXN4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Q7ZrN5Tdza4xA9dFl4n1tv1gXN4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Q7ZrN5Tdza4xA9dFl4n1tv1gXN4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/pVys5A2JU94" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/4918882759594453234/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2009/10/installing-eclipse-scala-and-groovy-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/4918882759594453234?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/4918882759594453234?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/pVys5A2JU94/installing-eclipse-scala-and-groovy-in.html" title="Installing Eclipse, Scala and Groovy in Windows 7" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2009/10/installing-eclipse-scala-and-groovy-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUYARng6fip7ImA9WxNWFUk.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-178397801547329705</id><published>2009-10-14T10:54:00.000-07:00</published><updated>2009-10-14T10:59:07.616-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-14T10:59:07.616-07:00</app:edited><title>P10: Run-length encoding of a list.</title><content type="html">The idea is to use above unflatten function to group consecutive duplicates into a list and them map it to length, head pair. Here is the example:&lt;br /&gt;val x = List('a, 'a, 'a, 'a, 'b, 'c, 'c, 'a, 'a, 'd, 'e, 'e, 'e, 'e)&lt;br /&gt;val ulist = unflatten(x)&lt;br /&gt;println(ulist)&lt;br /&gt;println(ulist.map(e=&gt;(e.length,e.head)))&lt;br /&gt;&lt;br /&gt;Output: &lt;br /&gt;List(List('a, 'a, 'a, 'a, 'a, 'a), List('b), List('c, 'c), List('d), List('e, 'e, 'e,'e))&lt;br /&gt;List((6,'a), (1,'b), (2,'c), (1,'d), (4,'e))&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-178397801547329705?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/NjnNzevb_RaWykkl-k3fvEkMRto/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NjnNzevb_RaWykkl-k3fvEkMRto/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/NjnNzevb_RaWykkl-k3fvEkMRto/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NjnNzevb_RaWykkl-k3fvEkMRto/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/CTdFiNQTUbA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/178397801547329705/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2009/10/p10-run-length-encoding-of-list.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/178397801547329705?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/178397801547329705?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/CTdFiNQTUbA/p10-run-length-encoding-of-list.html" title="P10: Run-length encoding of a list." /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2009/10/p10-run-length-encoding-of-list.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUQFQX06cSp7ImA9WxNWFEo.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-3970349778609859835</id><published>2009-10-13T16:34:00.000-07:00</published><updated>2009-10-13T16:41:50.319-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-13T16:41:50.319-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="scala" /><title>P09:  Pack consecutive duplicates of list elements into sublists.</title><content type="html">This might be a good candidate for recursive solution. But much faster iterative solution is shown below:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;import scala.collection.mutable.ListBuffer&lt;br /&gt;def unflatten[T](list:List[T]):List[List[T]]={&lt;br /&gt;  val uniq = list.removeDuplicates&lt;br /&gt;  val c = new ListBuffer[List[T]]()&lt;br /&gt;  var uniqv = uniq&lt;br /&gt;  while(!uniqv.isEmpty){&lt;br /&gt;    c.append(list.filter(_==uniqv.head))&lt;br /&gt;    uniqv=uniqv.tail&lt;br /&gt;  }&lt;br /&gt;  c.toList&lt;br /&gt;}&lt;br /&gt;val x = List(1,2,3,1,2,3,1,2,3,1,2,3)&lt;br /&gt;println(unflatten(x))&lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;List(List(1, 1, 1, 1), List(2, 2, 2, 2), List(3, 3, 3, 3))&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-3970349778609859835?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/WOFMuKgTuupvRMxAQXI1L6ZCFjI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WOFMuKgTuupvRMxAQXI1L6ZCFjI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/WOFMuKgTuupvRMxAQXI1L6ZCFjI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WOFMuKgTuupvRMxAQXI1L6ZCFjI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/N7NL6OVY-KQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/3970349778609859835/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2009/10/p09-pack-consecutive-duplicates-of-list.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/3970349778609859835?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/3970349778609859835?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/N7NL6OVY-KQ/p09-pack-consecutive-duplicates-of-list.html" title="P09:  Pack consecutive duplicates of list elements into sublists." /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2009/10/p09-pack-consecutive-duplicates-of-list.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcCRXY5fip7ImA9WxNWEE8.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-5424202785162156119</id><published>2009-10-08T09:07:00.000-07:00</published><updated>2009-10-08T09:41:04.826-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-08T09:41:04.826-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="scala" /><title>P08: Eliminate consecutive duplicates of list elements.</title><content type="html">The simple solution:&lt;br /&gt;scala&gt; val x = List(1,2,2,3,4,4,5,5)&lt;br /&gt;x: List[Int] = List(1, 2, 2, 3, 4, 4, 5, 5)&lt;br /&gt;&lt;br /&gt;scala&gt; x.removeDuplicates&lt;br /&gt;res0: List[Int] = List(1, 2, 3, 4, 5)&lt;br /&gt;&lt;br /&gt;For the curious under the hood:&lt;br /&gt;&lt;br /&gt;scala&gt; import scala.collection.mutable.ListBuffer&lt;br /&gt;import scala.collection.mutable.ListBuffer&lt;br /&gt;&lt;br /&gt;scala&gt; def myRemoveDuplicates[T](in:List[T]):List[T] = {&lt;br /&gt;    |     val b = new ListBuffer[T]&lt;br /&gt;    |     var temp = in&lt;br /&gt;    |     while(!temp.isEmpty){&lt;br /&gt;    |          if(!temp.tail.contains(temp.head)) b+=temp.head&lt;br /&gt;    |          temp = temp.tail&lt;br /&gt;    |     }&lt;br /&gt;    |     b.toList&lt;br /&gt;    | }&lt;br /&gt;myRemoveDuplicates: [T](in: List[T])List[T]&lt;br /&gt;&lt;br /&gt;scala&gt; myRemoveDuplicates(x)&lt;br /&gt;res2: List[Int] = List(1, 2, 3, 4, 5)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-5424202785162156119?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/OBsnMjF8lgIH_oMWIT2KLvfZY5c/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OBsnMjF8lgIH_oMWIT2KLvfZY5c/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/OBsnMjF8lgIH_oMWIT2KLvfZY5c/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OBsnMjF8lgIH_oMWIT2KLvfZY5c/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/MWVUx3fnpEE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/5424202785162156119/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2009/10/p08-eliminate-consecutive-duplicates-of.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/5424202785162156119?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/5424202785162156119?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/MWVUx3fnpEE/p08-eliminate-consecutive-duplicates-of.html" title="P08: Eliminate consecutive duplicates of list elements." /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2009/10/p08-eliminate-consecutive-duplicates-of.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcNQ3g5fyp7ImA9WxNXGU4.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-8848498805407030303</id><published>2009-10-07T09:53:00.000-07:00</published><updated>2009-10-07T10:21:32.627-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-07T10:21:32.627-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="scala" /><title>P07: Flatten a list</title><content type="html">Just use flatten method:&lt;br /&gt;scala&gt; val m  = List(List(1, 2), List(3, 4)) &lt;br /&gt;res2: List[List[Int]] = List(List(1, 2), List(3, 4))&lt;br /&gt;&lt;br /&gt;scala&gt; m.flatten&lt;br /&gt;res3: List[Int] = List(1, 2, 3, 4)&lt;br /&gt;&lt;br /&gt;Just out of sheer curiosity, here another implementation with much better performace:&lt;br /&gt;&lt;br /&gt;scala&gt; import scala.collection.mutable.ListBuffer&lt;br /&gt;import scala.collection.mutable.ListBuffer&lt;br /&gt;&lt;br /&gt;scala&gt; def myFlatten[T](nl:List[List[T]]):List[T] = {&lt;br /&gt;     |     val b = new ListBuffer[T]&lt;br /&gt;     |     for(list&lt;-nl){&lt;br /&gt;     |        var tlist = list&lt;br /&gt;     |        while(!tlist.isEmpty){&lt;br /&gt;     |             b+=tlist.head&lt;br /&gt;     |             tlist = tlist.tail&lt;br /&gt;     |        }&lt;br /&gt;     |     }&lt;br /&gt;     |     b.toList&lt;br /&gt;     | }&lt;br /&gt;myFlatten: [T](nl: List[List[T]])List[T]&lt;br /&gt;&lt;br /&gt;scala&gt; myFlatten(m)&lt;br /&gt;res1: List[Int] = List(1, 2, 3, 4)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-8848498805407030303?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/hG9JpaFlq9xJ0vx09B0pHxz7ju8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hG9JpaFlq9xJ0vx09B0pHxz7ju8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/hG9JpaFlq9xJ0vx09B0pHxz7ju8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hG9JpaFlq9xJ0vx09B0pHxz7ju8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/qp4CEQIjkXs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/8848498805407030303/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2009/10/p07-flatten-list.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/8848498805407030303?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/8848498805407030303?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/qp4CEQIjkXs/p07-flatten-list.html" title="P07: Flatten a list" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2009/10/p07-flatten-list.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkcDRncyfSp7ImA9WxNXGEk.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-4180287495640297116</id><published>2009-10-06T09:52:00.000-07:00</published><updated>2009-10-06T09:54:37.995-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-06T09:54:37.995-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="scala" /><title>P06: Is a list palindrome</title><content type="html">scala&gt; val plist = List(1, 2, 3, 2, 1)&lt;br /&gt;res19: List[Int] = List(1, 2, 3, 2, 1)&lt;br /&gt;&lt;br /&gt;scala&gt; plist == plist.reverse&lt;br /&gt;res20: Boolean = true&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-4180287495640297116?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8RsR1Ks5wWE_YKTM23eC6i6ZEGQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8RsR1Ks5wWE_YKTM23eC6i6ZEGQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8RsR1Ks5wWE_YKTM23eC6i6ZEGQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8RsR1Ks5wWE_YKTM23eC6i6ZEGQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/e5JUeMY9pJA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/4180287495640297116/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2009/10/p06-is-list-palindrome.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/4180287495640297116?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/4180287495640297116?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/e5JUeMY9pJA/p06-is-list-palindrome.html" title="P06: Is a list palindrome" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2009/10/p06-is-list-palindrome.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEIEQXg_cSp7ImA9WxNXGEk.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-6426272906429514309</id><published>2009-10-06T09:22:00.000-07:00</published><updated>2009-10-06T09:28:20.649-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-06T09:28:20.649-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="scala" /><title>P03 - P05: Find nth element, length, reverse a list</title><content type="html">scala&gt; val list = List(1,2,3,4,5)&lt;br /&gt;list: List[Int] = List(1, 2, 3, 4, 5)&lt;br /&gt;&lt;br /&gt;scala&gt; list(4)&lt;br /&gt;res0: Int = 5&lt;br /&gt;&lt;br /&gt;scala&gt; list.length&lt;br /&gt;res1: Int = 5&lt;br /&gt;&lt;br /&gt;scala&gt; list.reverse&lt;br /&gt;&lt;br /&gt;scala&gt; list.reverse&lt;br /&gt;res2: List[Int] = List(5, 4, 3, 2, 1)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-6426272906429514309?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5SO5mec5VRnK1GG4V04LqvkNgQc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5SO5mec5VRnK1GG4V04LqvkNgQc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5SO5mec5VRnK1GG4V04LqvkNgQc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5SO5mec5VRnK1GG4V04LqvkNgQc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/rlQa0rvWdao" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/6426272906429514309/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2009/10/p03-p05-find-nth-element-length-reverse.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/6426272906429514309?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/6426272906429514309?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/rlQa0rvWdao/p03-p05-find-nth-element-length-reverse.html" title="P03 - P05: Find nth element, length, reverse a list" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2009/10/p03-p05-find-nth-element-length-reverse.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0AERHo_fCp7ImA9WxNXF0U.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-2279068844665393626</id><published>2009-10-05T15:12:00.000-07:00</published><updated>2009-10-05T15:28:25.444-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-05T15:28:25.444-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="scala" /><title>How to simply sum values in a Map in Scala</title><content type="html">Here is a code snippet that sums up the values in a map in Scala:&lt;br /&gt; m.foldLeft(0)(_+_._2)&lt;br /&gt;&lt;br /&gt;It may look cryptic at first but once you get the Scala feel, you will appreciate its conciseness and elegance. Here below is the explanation:&lt;br /&gt;m stands for a Map, foldLeft is a method that takes an initial value (0 here since sum is 0 at the beginning) and feeds it to its next iteration on this map entry. Note that the first _ stands for the result of previous iteration result. And _+_._2 means:&lt;br /&gt;take previous result and add it to the next map entry's value, which _._2 stands for. In Scala, Map values can be accessed as Tuples. _1 is the key and _2 is the value. Here is a working example:&lt;br /&gt;&lt;br /&gt;scala&gt; val m = Map("one"-&gt;1,"two"-&gt;2,"three"-&gt;3)&lt;br /&gt;m: scala.collection.immutable.Map[java.lang.String,Int] = Map(one -&gt; 1, two -&gt; 2, three -&gt; 3)&lt;br /&gt;scala&gt; m.foldLeft(0)(_+_._2)&lt;br /&gt;res0: Int = 6&lt;br /&gt;&lt;br /&gt;Note: You can change + to * and use 1 for the initial value to get the product of values.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-2279068844665393626?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/dLejLNaDQE5B-CSIPtPnVAUrFyE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dLejLNaDQE5B-CSIPtPnVAUrFyE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/dLejLNaDQE5B-CSIPtPnVAUrFyE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dLejLNaDQE5B-CSIPtPnVAUrFyE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/epRMdTJmtFM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/2279068844665393626/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2009/10/how-to-simply-sum-values-in-map-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/2279068844665393626?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/2279068844665393626?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/epRMdTJmtFM/how-to-simply-sum-values-in-map-in.html" title="How to simply sum values in a Map in Scala" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2009/10/how-to-simply-sum-values-in-map-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0MBRXw7eip7ImA9WxNXF0s.&quot;"><id>tag:blogger.com,1999:blog-1362569846310556348.post-4681902779399295335</id><published>2009-10-05T10:27:00.000-07:00</published><updated>2009-10-05T10:57:34.202-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-05T10:57:34.202-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="editor" /><title>Best Note Taking Tools</title><content type="html">In line with the spirit of why I started this blog, I would like to provide my take on following note taking tools and provide my biased verdict at the end.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Google Note : This is your friend to collect any text clips from the web.  You select a text and click on Google Note Bookmarklet and magically it will be saved on you Google note. If you use iPhone or iPod touch, you can sync view it offline with apps like Byline. &lt;/li&gt;&lt;li&gt;Ever Note: You would like this one if you have take notes from web and offline and sync across multiple computers. It has a free iPhone app that does much more than text notes. &lt;/li&gt;&lt;li&gt;My Writing Nook: It is a very simple writing tool works on any browser and it uses Google account. All you need is a browser to start writing. It also has an iPhone app that syncs your notes.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;My verdict is My Writing Nook. Because it follows KISS principle and let you focus on what you want - Writing, without being a mind boggling tool. Here is the link: &lt;a href="http://www.mywritingnook.com/"&gt;http://www.mywritingnook.com/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1362569846310556348-4681902779399295335?l=ktuman.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/g8iHU-y4EhlTc0f1Jjs3M3IbGoY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/g8iHU-y4EhlTc0f1Jjs3M3IbGoY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/g8iHU-y4EhlTc0f1Jjs3M3IbGoY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/g8iHU-y4EhlTc0f1Jjs3M3IbGoY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeepItSimplySimple/~4/WTtYxnvHRDs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ktuman.blogspot.com/feeds/4681902779399295335/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://ktuman.blogspot.com/2009/10/best-note-taking-tools.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/4681902779399295335?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1362569846310556348/posts/default/4681902779399295335?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeepItSimplySimple/~3/WTtYxnvHRDs/best-note-taking-tools.html" title="Best Note Taking Tools" /><author><name>Kasim</name><uri>http://www.blogger.com/profile/01891775826727002881</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ktuman.blogspot.com/2009/10/best-note-taking-tools.html</feedburner:origLink></entry></feed>

