<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ramakrishnan&#039;s website</title>
	<atom:link href="http://www.zerobeat.in/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zerobeat.in</link>
	<description>Ramakrishnan&#039;s random thoughts on computer programming, amateur (ham) radio and Free Software.</description>
	<lastBuildDate>Sun, 02 May 2010 18:50:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
		<item>
		<title>Manual configuration of swank-clojure with the upstream slime</title>
		<link>http://www.zerobeat.in/2010/05/02/manual-configuration-of-swank-clojure-with-the-upstream-slime/</link>
		<comments>http://www.zerobeat.in/2010/05/02/manual-configuration-of-swank-clojure-with-the-upstream-slime/#comments</comments>
		<pubDate>Sun, 02 May 2010 14:08:22 +0000</pubDate>
		<dc:creator>Ramakrishnan Muthukrishnan</dc:creator>
				<category><![CDATA[clojure]]></category>

		<guid isPermaLink="false">http://www.zerobeat.in/?p=340</guid>
		<description><![CDATA[I now have a very nicely working swank-clojure, completely configurable by hand and no ELPA magic. And this plays very well with the upstream slime as well as swank-clojure, albeit some small changes in the emacs lisp of the swank side.. The problem Upstream swank-clojure supports only ELPA and those who want to configure swank [...]]]></description>
			<content:encoded><![CDATA[<p>I now have a very nicely working swank-clojure, completely configurable by hand and no ELPA magic. And this plays very well with the upstream slime as well as swank-clojure, albeit some small changes in the emacs lisp of the swank side..</p>
<h4>The problem</h4>
<p>Upstream swank-clojure supports only ELPA and those who want to configure swank manually are on their own. I, for one, do not like those &#8220;conventions over configurations&#8221; stuff, atleast for my programming environment. Heck, that&#8217;s why I use emacs in the first place.</p>
<p>In the past, I was using an older version of swank-clojure which fully supported manual configuration. I then switched to a newer version of swank-clojure but with a totally different emacs lisp code to make configuration for easy.</p>
<p>Also, I use the clojure and clojure-contrib from the debian packages, which installs into /usr/share/java. The same directory has all the other java jars as well. But upstream swank-clojure supported somewhat different directory structure. If invoked on a project, it picks up dependencies from a subdirectory called &#8220;lib&#8221; (configurable). lein puts all the dependencies (including clojure*.jar) into that directory. It built up a new classpath from these (assuming that the project is self-contained, including dependencies).</p>
<p>This unfortunately does not work in my case. I almost never use a build tool while fooling around doing random with slime. For example, to use Slime with my <a href="http://github.com/vu3rdd/sicp">SICP exercises</a> where I do not have a build mechanism put in, it becomes difficult. Running tests for a namespace from slime is another reason why having the project namespace in the classpath is a very useful thing. For many simple projects that I do, all I need is clojure and clojure-contrib which is already in my classpath. But this made things difficult as adding the project being worked on into the classpath was messy. Becausee of the above setup, <code>swank-clojure-project</code> was unsable for me..</p>
<p>I also don&#8217;t like multiple copies of jars lying around. It is not the question of wasting disk space, which is very cheap anyway. But it is just a matter of taste and cleanliness. Multiple jars on each project directory is a convenience, but it is plain ugly.</p>
<p>Today I decided to clean up the whole mess. The end result is a much cleaner swank/slime.</p>
<h4>Solution</h4>
<p>Turned out the solution was very simple. When swank is started on a project, instead of changing <code>swank-clojure-classpath</code>, I build up another list using a variable called <code>swank-clojure-extra-classpaths</code>. This is then appended to the <code>swank-clojure-classpath</code> before starting up the JVM.</p>
<p>I also disabled the code which checks the presence of clojure*.jar files in some predefined location when swank starts up. This can always be called manually, if one wants to.</p>
<h4>Code</h4>
<p>For those wanting to follow similar approach, here is my github fork of <a href="http://github.com/vu3rdd/swank-clojure">swank-clojure</a> with <a href="http://github.com/vu3rdd/swank-clojure/raw/master/config.txt">instructions</a> on setting it up. The emacs repl (via <code>ielm</code>) was invaluable for debugging.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zerobeat.in/2010/05/02/manual-configuration-of-swank-clojure-with-the-upstream-slime/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Embracing maven</title>
		<link>http://www.zerobeat.in/2010/04/21/embracing-maven/</link>
		<comments>http://www.zerobeat.in/2010/04/21/embracing-maven/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 17:39:13 +0000</pubDate>
		<dc:creator>Ramakrishnan Muthukrishnan</dc:creator>
				<category><![CDATA[clojure]]></category>

		<guid isPermaLink="false">http://www.zerobeat.in/?p=327</guid>
		<description><![CDATA[After several failed attempt to understand maven and going back and forth between lein and maven, I have finally decided to settle on maven. There are several reasons for this. One of the most important one is that Debian has a very well packaged maven and a local repository system. i.e. Debian java packages installed [...]]]></description>
			<content:encoded><![CDATA[<p>After several failed attempt to understand maven and going back and forth between lein and maven, I have finally decided to settle on maven. There are several reasons for this. One of the most important one is that Debian has a <a href="http://wiki.debian.org/Java/MavenRepoSpec">very well packaged</a> maven and a local repository system. i.e. Debian java packages installed on a machine is available as a local repo. With that, offline builds become quite easy (provided all the dependencies are available as Debian packages). Maven is also well supported by the Java ecosystem. Though XML turns me off as well, maven takes care of generating much of the boilerplate for us.</p>
<p>I will walk through creating a trivial clojure project using maven. I assume that maven is already installed on your machine.</p>
<p>First, run the following command:</p>
<p><code>$ mvn archetype:create -DgroupId=in.clj.hello -DartifactId=hello</code></p>
<p>This gives the following output on my machine:<br />
<code><br />
[INFO] Scanning for projects...<br />
[INFO] Searching repository for plugin with prefix: 'archetype'.<br />
[INFO] ------------------------------------------------------------------------<br />
[INFO] Building Maven Default Project<br />
[INFO]    task-segment: [archetype:create] (aggregator-style)<br />
[INFO] ------------------------------------------------------------------------<br />
[INFO] Setting property: classpath.resource.loader.class =&gt; 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.<br />
[INFO] Setting property: velocimacro.messages.on =&gt; 'false'.<br />
[INFO] Setting property: resource.loader =&gt; 'classpath'.<br />
[INFO] Setting property: resource.manager.logwhenfound =&gt; 'false'.<br />
[INFO] [archetype:create {execution: default-cli}]<br />
[WARNING] This goal is deprecated. Please use mvn archetype:generate instead<br />
[INFO] Defaulting package to group ID: in.clj.hello<br />
[INFO] ----------------------------------------------------------------------------<br />
[INFO] Using following parameters for creating OldArchetype: maven-archetype-quickstart:RELEASE<br />
[INFO] ----------------------------------------------------------------------------<br />
[INFO] Parameter: groupId, Value: in.clj.hello<br />
[INFO] Parameter: packageName, Value: in.clj.hello<br />
[INFO] Parameter: package, Value: in.clj.hello<br />
[INFO] Parameter: artifactId, Value: hello<br />
[INFO] Parameter: basedir, Value: /tmp/hello-mvn<br />
[INFO] Parameter: version, Value: 1.0-SNAPSHOT<br />
[INFO] ********************* End of debug info from resources from generated POM ***********************<br />
[INFO] OldArchetype created in dir: /tmp/hello-mvn/hello<br />
[INFO] ------------------------------------------------------------------------<br />
[INFO] BUILD SUCCESSFUL<br />
[INFO] ------------------------------------------------------------------------<br />
[INFO] Total time: 1 second<br />
[INFO] Finished at: Wed Apr 21 22:13:22 IST 2010<br />
[INFO] Final Memory: 15M/150M<br />
[INFO] ------------------------------------------------------------------------<br />
</code></p>
<p>A directory called hello is created. Let us look at the parameters to <code>archetype:create</code>. <code>groupId</code> is a unique way to identify the module. Think of it as the namespace. <code>artifactId</code> is the name of the project. <code>groupId:artifactId:version</code> uniquely identify an &#8216;artifact&#8217;. By default, maven will create a <code>version</code> number <code>1.0-SNAPSHOT</code> for the project, if it is omitted from commandline.</p>
<p>The directory tree at this point looks like this:</p>
<pre>$ tree
.
|-- pom.xml
`-- src
    |-- main
    |   `-- java
    |       `-- in
    |           `-- clj
    |               `-- hello
    |                   `-- App.java
    `-- test
        `-- java
            `-- in
                `-- clj
                    `-- hello
                        `-- AppTest.java
</pre>
<p>Let us get rid of the java files first.<br />
<code><br />
$ rm -rf src/main/java<br />
$ rm -rf src/test<br />
</code><br />
Create the following directory structure:<br />
<code><br />
$ mkdir -p src/main/clojure/in/clj<br />
</code><br />
Note that we have created the structure according to our groupId specification.<br />
Create a file called hello.clj at the leaf of this directory and put the following contents inside it:</p>
<pre>
(ns in.clj.hello)

(defn greet [ &#038; args]
  (apply str args))
</pre>
<p>Now, open the pom.xml file. Some changes needs to be done here so that maven knows that we are building a clojure project and the dependencies. The following things are done:</p>
<ol>
<li>The dependency on junit is removed.</li>
<li>A dependency on clojure is added.</li>
<li>A new plugin clojure-maven-plugin is added and configured.</li>
<li>Repositories from where, dependencies are fetched, are added.</li>
</ol>
<p>At the end of this process, the pom.xml looks like this:</p>
<pre>
<span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">project</span> <span class="nxml-namespace-attribute-xmlns">xmlns</span>=<span class="nxml-namespace-attribute-value-delimiter">"</span><span class="nxml-namespace-attribute-value">http://maven.apache.org/POM/4.0.0</span><span class="nxml-namespace-attribute-value-delimiter">"</span> <span class="nxml-namespace-attribute-xmlns">xmlns</span><span class="nxml-namespace-attribute-colon">:</span><span class="nxml-namespace-attribute-prefix">xsi</span>=<span class="nxml-namespace-attribute-value-delimiter">"</span><span class="nxml-namespace-attribute-value">http://www.w3.org/2001/XMLSchema-instance</span><span class="nxml-namespace-attribute-value-delimiter">"</span>
  <span class="nxml-attribute-prefix">xsi</span><span class="nxml-attribute-colon">:</span><span class="nxml-attribute-local-name">schemaLocation</span>=<span class="nxml-attribute-value-delimiter">"</span><span class="nxml-attribute-value">http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd</span><span class="nxml-attribute-value-delimiter">"</span><span class="nxml-tag-delimiter">&gt;</span>
  <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">modelVersion</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">4.0.0</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">modelVersion</span><span class="nxml-tag-delimiter">&gt;</span>
  <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">groupId</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">in.clj.hello</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">groupId</span><span class="nxml-tag-delimiter">&gt;</span>
  <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">artifactId</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">hello</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">artifactId</span><span class="nxml-tag-delimiter">&gt;</span>
  <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">packaging</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">jar</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">packaging</span><span class="nxml-tag-delimiter">&gt;</span>
  <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">version</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">1.0-SNAPSHOT</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">version</span><span class="nxml-tag-delimiter">&gt;</span>
  <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">name</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">hello</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">name</span><span class="nxml-tag-delimiter">&gt;</span>
  <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">url</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">http://maven.apache.org</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">url</span><span class="nxml-tag-delimiter">&gt;</span>
  <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">description</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">project to demonstrate maven</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">description</span><span class="nxml-tag-delimiter">&gt;</span>

  <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">build</span><span class="nxml-tag-delimiter">&gt;</span>
    <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">plugins</span><span class="nxml-tag-delimiter">&gt;</span>
      <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">plugin</span><span class="nxml-tag-delimiter">&gt;</span>
        <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">groupId</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">com.theoryinpractise</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">groupId</span><span class="nxml-tag-delimiter">&gt;</span>
        <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">artifactId</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">clojure-maven-plugin</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">artifactId</span><span class="nxml-tag-delimiter">&gt;</span>
        <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">version</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">1.3.2</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">version</span><span class="nxml-tag-delimiter">&gt;</span>
        <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">executions</span><span class="nxml-tag-delimiter">&gt;</span>
          <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">execution</span><span class="nxml-tag-delimiter">&gt;</span>
            <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">id</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">compile-clojure</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">id</span><span class="nxml-tag-delimiter">&gt;</span>
            <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">phase</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">compile</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">phase</span><span class="nxml-tag-delimiter">&gt;</span>
            <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">goals</span><span class="nxml-tag-delimiter">&gt;</span>
              <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">goal</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">compile</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">goal</span><span class="nxml-tag-delimiter">&gt;</span>
            <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">goals</span><span class="nxml-tag-delimiter">&gt;</span>
          <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">execution</span><span class="nxml-tag-delimiter">&gt;</span>
        <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">executions</span><span class="nxml-tag-delimiter">&gt;</span>
        <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">configuration</span><span class="nxml-tag-delimiter">&gt;</span>
          <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">sourceDirectories</span><span class="nxml-tag-delimiter">&gt;</span>
            <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">sourceDirectory</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">src/main/clojure</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">sourceDirectory</span><span class="nxml-tag-delimiter">&gt;</span>
          <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">sourceDirectories</span><span class="nxml-tag-delimiter">&gt;</span>
        <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">configuration</span><span class="nxml-tag-delimiter">&gt;</span>
      <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">plugin</span><span class="nxml-tag-delimiter">&gt;</span>
    <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">plugins</span><span class="nxml-tag-delimiter">&gt;</span>
  <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">build</span><span class="nxml-tag-delimiter">&gt;</span>

  <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">dependencies</span><span class="nxml-tag-delimiter">&gt;</span>
    <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">dependency</span><span class="nxml-tag-delimiter">&gt;</span>
      <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">groupId</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">org.clojure</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">groupId</span><span class="nxml-tag-delimiter">&gt;</span>
      <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">artifactId</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">clojure</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">artifactId</span><span class="nxml-tag-delimiter">&gt;</span>
      <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">version</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">1.1.0</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">version</span><span class="nxml-tag-delimiter">&gt;</span>
    <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">dependency</span><span class="nxml-tag-delimiter">&gt;</span>
  <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">dependencies</span><span class="nxml-tag-delimiter">&gt;</span>

  <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">repositories</span><span class="nxml-tag-delimiter">&gt;</span>
    <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">repository</span><span class="nxml-tag-delimiter">&gt;</span>
      <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">id</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">clojure-snapshots</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">id</span><span class="nxml-tag-delimiter">&gt;</span>
      <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">url</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">http://build.clojure.org/snapshots</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">url</span><span class="nxml-tag-delimiter">&gt;</span>
      <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">releases</span><span class="nxml-tag-delimiter">&gt;</span>
        <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">enabled</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">false</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">enabled</span><span class="nxml-tag-delimiter">&gt;</span>
      <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">releases</span><span class="nxml-tag-delimiter">&gt;</span>
      <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">snapshots</span><span class="nxml-tag-delimiter">&gt;</span>
        <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">enabled</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">true</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">enabled</span><span class="nxml-tag-delimiter">&gt;</span>
      <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">snapshots</span><span class="nxml-tag-delimiter">&gt;</span>
    <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">repository</span><span class="nxml-tag-delimiter">&gt;</span>
    <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">repository</span><span class="nxml-tag-delimiter">&gt;</span>
      <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">id</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">clojure-releases</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">id</span><span class="nxml-tag-delimiter">&gt;</span>
      <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">url</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">http://build.clojure.org/releases</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">url</span><span class="nxml-tag-delimiter">&gt;</span>
      <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">releases</span><span class="nxml-tag-delimiter">&gt;</span>
        <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">enabled</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">true</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">enabled</span><span class="nxml-tag-delimiter">&gt;</span>
      <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">releases</span><span class="nxml-tag-delimiter">&gt;</span>
      <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">snapshots</span><span class="nxml-tag-delimiter">&gt;</span>
        <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-element-local-name">enabled</span><span class="nxml-tag-delimiter">&gt;</span><span class="nxml-text">false</span><span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">enabled</span><span class="nxml-tag-delimiter">&gt;</span>
      <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">snapshots</span><span class="nxml-tag-delimiter">&gt;</span>
    <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">repository</span><span class="nxml-tag-delimiter">&gt;</span>
  <span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">repositories</span><span class="nxml-tag-delimiter">&gt;</span>

<span class="nxml-tag-delimiter">&lt;</span><span class="nxml-tag-slash">/</span><span class="nxml-element-local-name">project</span><span class="nxml-tag-delimiter">&gt;</span>
</pre>
</pre>
<p>Now do:<br />
<code>$ mvn package</code><br />
This produces the following output on my machine:</p>
<pre>[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building hello
[INFO]    task-segment: [package]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /tmp/hello-mvn/hello/src/main/resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] No sources to compile
[INFO] [clojure:compile {execution: compile-clojure}]
Compiling in.clj.hello to /tmp/hello-mvn/hello/target/classes
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /tmp/hello-mvn/hello/src/test/resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] No sources to compile
[INFO] [surefire:test {execution: default-test}]
[INFO] No tests to run.
[INFO] [jar:jar {execution: default-jar}]
[INFO] Building jar: /tmp/hello-mvn/hello/target/hello-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4 seconds
[INFO] Finished at: Wed Apr 21 22:57:11 IST 2010
[INFO] Final Memory: 23M/121M
[INFO] ------------------------------------------------------------------------
</pre>
<p>A jar file is created under the <code>target</code> directory.<br />
Now, we add the jar into our classpath and invoke the clojure repl:<br />
<code><br />
$ java -cp /usr/share/java/clojure.jar:target/hello-1.0-SNAPSHOT.jar clojure.main<br />
Clojure 1.1.0<br />
user=&gt; (use 'in.clj.hello)<br />
nil<br />
user=&gt; (greet "Hello World")<br />
"Hello World"<br />
user=&gt;<br />
</code><br />
You can also invoke the repl from maven:<br />
<code><br />
$ mvn clojure:repl<br />
</code><br />
That wasn't really too hard. With emerging tools around maven like the <a href="http://polyglot.sonatype.org/">Polyglot Maven</a> which supports Clojure and a S-expression syntax for writing the POM, we don't even have to do as much as we did now.<br />
I have put this example in this <a href="http://github.com/vu3rdd/hello-mvn">repository</a> for anyone to play with.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zerobeat.in/2010/04/21/embracing-maven/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The passionate programmer by Chad Fowler</title>
		<link>http://www.zerobeat.in/2010/04/19/the-passionate-programmer-by-chad-fowler/</link>
		<comments>http://www.zerobeat.in/2010/04/19/the-passionate-programmer-by-chad-fowler/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 19:08:51 +0000</pubDate>
		<dc:creator>Ramakrishnan Muthukrishnan</dc:creator>
				<category><![CDATA[books]]></category>

		<guid isPermaLink="false">http://www.zerobeat.in/?p=323</guid>
		<description><![CDATA[I just finished reading &#8220;The Passionate Programmer: Creating a Remarkable Career in Software Development&#8221; by Chad Fowler. The book is a rehash of the author&#8217;s earlier book with a mysterious title. This book is not strictly in the category of &#8220;self help&#8221; books meant to give a temporal high. It is a set of advice [...]]]></description>
			<content:encoded><![CDATA[<p>I just finished reading &#8220;<a href="http://pragprog.com/titles/cfcar2/the-passionate-programmer">The Passionate Programmer: Creating a Remarkable Career in Software Development</a>&#8221; by Chad Fowler. The book is a rehash of the author&#8217;s earlier book with a <a href="http://www.amazon.com/Job-Went-India-Pragmatic-Programmers/dp/0976694018">mysterious title</a>.</p>
<p>This book is not strictly in the category of &#8220;self help&#8221; books meant to give a temporal high. It is a set of advice (54 of them) for any programmer to improve himself. Each of the chapter is only 2 or 3 pages long, so it is quite easy to read and digest. I have put some of my notes on the book in this <a href="http://zerobeat.in/wiki/doku.php?id=books:passionate_programmer">wiki page</a>. The author had earlier lived in India, apparently managing an outsourced team here and makes some good and correct observations on the general attitudes of Indian software programmers.</p>
<p>The book is worth a read. If you have no time to read the entire book and just need a summary, read my <a href="http://zerobeat.in/wiki/doku.php?id=books:passionate_programmer">notes</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zerobeat.in/2010/04/19/the-passionate-programmer-by-chad-fowler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clojure&#8217;s function composition goodness</title>
		<link>http://www.zerobeat.in/2010/04/14/clojures-function-composition-goodness/</link>
		<comments>http://www.zerobeat.in/2010/04/14/clojures-function-composition-goodness/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 14:04:41 +0000</pubDate>
		<dc:creator>Ramakrishnan Muthukrishnan</dc:creator>
				<category><![CDATA[clojure]]></category>

		<guid isPermaLink="false">http://www.zerobeat.in/?p=320</guid>
		<description><![CDATA[Sean Devlin, in the Episode 16 of the Full Disclojure posted some really awesome ways to play with tables. One of the nice things he did is worth writing. Due credits go to Sean for posting the code. Suppose you have a map of people with their name and ages: (def from-xml [{:name "Sean" :age [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://fulldisclojure.blogspot.com/">Sean Devlin</a>, in the <a href="http://vimeo.com/10714859">Episode 16</a> of the <a href="http://vimeo.com/channels/fulldisclojure">Full Disclojure</a> posted some really awesome ways to play with tables. One of the nice things he did is worth writing. Due credits go to Sean for posting the code.</p>
<p>Suppose you have a map of people with their name and ages:<br />
<code><br />
(def from-xml [{:name "Sean" :age 27} {:name "Ross" :age 27} {:name "Brian" :age 22}])<br />
</code><br />
Now, you want to have the name and age of people in this list of those with the age 27. Clojure&#8217;s <code>comp</code> function comes to the rescue. <code>comp</code> takes some functions and applies them to the data from right to left. i.e., It takes the right most function, applies it to the input parameters, the result of which goes as input to the next right most function and so on.<br />
Let us take one single map and pass it to the comp:<br />
<code><br />
user&gt; ((comp #{33} :age) {:name "Ram" :age 33})<br />
33<br />
</code><br />
What this does is, it takes the input map, applies the <code>:age</code> function on the map (Clojure&#8217;s hashmap keys are functions themselves). The result of this is used to see if it falls in the given set (which just has 33).  Now, sets are functions of their members. Here is an example:<br />
<code><br />
user> (#{33 34} 34)<br />
34<br />
user> (#{33 34} 33)<br />
33<br />
user> (#{33 34} 32)<br />
nil<br />
user> (#{33} 33)<br />
33<br />
</code></p>
<p>We use this composition as a predicate to the filter function which results in the elegant solution that Sean posted.<br />
<code><br />
user&gt; (filter (comp #{27} :age) from-xml)<br />
({:name "Sean", :age 27} {:name "Ross", :age 27})<br />
</code><br />
Note that we get back maps in the same format, which is really nice in certain situations. Sean&#8217;s Episode 16 also has quite a lot of other goodness as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zerobeat.in/2010/04/14/clojures-function-composition-goodness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pragmatic Thinking and Learning</title>
		<link>http://www.zerobeat.in/2010/04/01/pragmatic-thinking-and-learning/</link>
		<comments>http://www.zerobeat.in/2010/04/01/pragmatic-thinking-and-learning/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 11:24:36 +0000</pubDate>
		<dc:creator>Ramakrishnan Muthukrishnan</dc:creator>
				<category><![CDATA[books]]></category>

		<guid isPermaLink="false">http://www.zerobeat.in/?p=300</guid>
		<description><![CDATA[I finished reading &#8220;Pragmatic thinking and learning&#8221; by Andy Hunt (who wrote Pragmatic Programmer and other books). If one is really interested in self-improvement, this is the book to grab. For me, most things described in the book were known things, but it got very reinforced because Andy has some magical power to convey ideas [...]]]></description>
			<content:encoded><![CDATA[<p>I finished reading &#8220;<a href="http://pragprog.com/titles/ahptl/pragmatic-thinking-and-learning">Pragmatic thinking and learning</a>&#8221; by Andy Hunt (who wrote Pragmatic Programmer and other books). If one is really interested in self-improvement, this is the book to grab. For me, most things described in the book were known things, but it got very reinforced because Andy has some magical power to convey ideas in a very convincing way.I highly recommend this book for anyone interested to know more about learning and apply those things into their own daily lives. The book explains the process of learning using the <a href="http://en.wikipedia.org/wiki/Dreyfus_model_of_skill_acquisition">Dreyfus model</a> and how one advances from a beginner to an expert. Ever wondered why you get new ideas while in the bathroom? Have you noticed why you suddenly perform better when you are in the middle of good performers? I have many times noticed that I speak better english when I am talking to a good english speaker and vice versa. This book explains why, using a simplified model of the human brain.</p>
<p>One noteworthy suggestion in the book for every reader is to keep a personal wiki, which I had experimented with, sometime last year, with great success. I especially liked the meditation technique described in the book and can say with some confidence that it works very well. The chapter on &#8220;focus&#8221; is also very well researched. The book says that each context switch costs about 20 minutes. Interestingly, the book does not talk about the concept of <a href="http://en.wikipedia.org/wiki/Flow_%28psychology%29">flow</a>.</p>
<p>I greatly enjoyed reading &#8220;Pragmatic Programmer: From Journeyman to Master&#8221; earlier (despite the extremely bad packing from <a href="http://flipkart.com">Flipkart</a>, which made the paper curly, sort of permanantly).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zerobeat.in/2010/04/01/pragmatic-thinking-and-learning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Power of find and xargs</title>
		<link>http://www.zerobeat.in/2010/03/17/power-of-find-and-xargs/</link>
		<comments>http://www.zerobeat.in/2010/03/17/power-of-find-and-xargs/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 06:00:11 +0000</pubDate>
		<dc:creator>Ramakrishnan Muthukrishnan</dc:creator>
				<category><![CDATA[computer]]></category>

		<guid isPermaLink="false">http://www.zerobeat.in/?p=291</guid>
		<description><![CDATA[Doesn&#8217;t, the unix commands find, xargs and grep look like map, apply and filter of the functional world? I was looking at the OCW website and downloaded some content from there as a zip file, which had a complicated directory structure. I wanted to flatten the directory structure, so that all the pdfs are in [...]]]></description>
			<content:encoded><![CDATA[<p>Doesn&#8217;t, the unix commands <em>find</em>, <em>xargs</em> and <em>grep</em> look like <em>map</em>, <em>apply</em> and <em>filter</em> of the functional world?<br />
I was looking at the OCW website and downloaded some content from there as a zip file, which had a complicated directory structure. I wanted to flatten the directory structure, so that all the pdfs are in one directory. With find and xargs it turned out to be extremely easy.</p>
<p><code>$ find ./ -name *.pdf -print | xargs -I xxx cp xxx /tmp</code></p>
<p>The key is the -I argument to xargs which replaces every occurance of the pattern in the command with the input from stdin.</p>
<p>Also don&#8217;t the pipes look like calling a function composition like in f(g(x) as mentioned by this <a href="http://groups.google.co.jp/group/comp.lang.functional/browse_thread/thread/1d3da70673d9816e/6e807b31fe440698">post</a>?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zerobeat.in/2010/03/17/power-of-find-and-xargs/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SICP Challenge</title>
		<link>http://www.zerobeat.in/2010/03/14/sicp-study/</link>
		<comments>http://www.zerobeat.in/2010/03/14/sicp-study/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 14:33:05 +0000</pubDate>
		<dc:creator>Ramakrishnan Muthukrishnan</dc:creator>
				<category><![CDATA[SICP]]></category>

		<guid isPermaLink="false">http://www.zerobeat.in/?p=287</guid>
		<description><![CDATA[The SICP study group met today. We agreed to do the following: read a section of the book. solve the exercises in the section. see the videos. come with doubts/insights etc for the next meetup. We agreed to meetup once in 2 weeks. So, here I am, (re)starting the SICP from today. Hopefully this time [...]]]></description>
			<content:encoded><![CDATA[<p>The SICP study group met today. We agreed to do the following:</p>
<ul>
<li> read a section of the book.</li>
<li>solve the exercises in the section.</li>
<li>see the videos.</li>
<li>come with doubts/insights etc for the next meetup.</li>
</ul>
<p>We agreed to meetup once in 2 weeks.</p>
<p>So, here I am, (re)starting the SICP from today. Hopefully this time I will complete the book. I am very tempted to do the exercises in clojure, so that I won&#8217;t copy the code as it is from the text. I am not sure whether future chapters can become difficult for me  because of this, but I think I will give it a try with clojure. Also I believe I will need only a subset of clojure so that use only the fundamentals and no advanced facilities.</p>
<p>Here are some of the available resources that I plan to use:</p>
<ul>
<li>The book itself, which is <a href="http://mitpress.mit.edu/sicp/full-text/book/book.html">available online</a> and the exercises.</li>
<li>The OCW <a href="http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-001Spring-2005/LectureNotes/index.htm">lecture notes</a>.</li>
<li>The Berkeley <a href="http://www.youtube.com/watch?v=zmYqShvVDh4">CS61A videos</a> (see the panel on the right for the following lectures, 44 of them).</li>
<li>The <a href="http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-001Spring-2005/Projects/index.htm">Problem sets (or projects)</a>.</li>
<li>The <a href="http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/">video lectures given by the authors at HP</a> (based on first edition).</li>
<li>Clojure/Emacs/Slime/Paredit.</li>
</ul>
<p>My solutions will be available in <a href="http://github.com/vu3rdd/sicp">this github repository</a>.</p>
<p>Of course, I/we are not the first to do this. Here are some of the other people who have attempted this and have documented it (much better than I could ever do) on the web.</p>
<ul>
<li><a href="http://eli.thegreenplace.net/category/programming/lisp/sicp/">Eli Bendersky&#8217;s SICP discussions</a>.</li>
<li><a href="http://wiki.drewhess.com/wiki/Category:SICP_solutions">Drew Hess&#8217;s SICP wiki</a>.</li>
<li><a href="http://www.kendyck.com/solutions-to-sicp/">Ken Dyck&#8217;s SICP solutions</a>.</li>
<li><a href="http://www.billthelizard.com/search/label/sicp">Bill the lizard&#8217;s solutions</a>.</li>
<li><a href="http://wqzhang.wordpress.com/sicp-solutions/">Weiqun Zhang&#8217;s solutions</a>.</li>
<li>&#8230; and many more.</li>
</ul>
<p>For those who are using Scheme, <a href="http://programmingpraxis.com/contents/standard-prelude/">this page</a> will be of great help.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zerobeat.in/2010/03/14/sicp-study/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>SICP Study group</title>
		<link>http://www.zerobeat.in/2010/03/10/sicp-study-group/</link>
		<comments>http://www.zerobeat.in/2010/03/10/sicp-study-group/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 18:21:06 +0000</pubDate>
		<dc:creator>Ramakrishnan Muthukrishnan</dc:creator>
				<category><![CDATA[SICP]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.zerobeat.in/?p=276</guid>
		<description><![CDATA[Some of us in the bangalore-fp group have decided to form a study group on SICP. The main reason behind study groups is that it is a great way to learn any new subject or a literary work. People share what they read, ask questions, have discussions around these questions they ask etc etc. Also [...]]]></description>
			<content:encoded><![CDATA[<p>Some of us in the bangalore-fp group have decided to form a study group on <a href="http://mitpress.mit.edu/sicp/">SICP</a>. The main reason behind study groups is that it is a great way to learn any new subject or a literary work. People share what they read, ask questions, have discussions around these questions they ask etc etc. Also regular meetups provide a time tick to the group and is very motivational.<br />
If anyone is interested, please <a href="http://www.zerobeat.in/contact-me/">contact me</a> or subscribe to <a href="http://groups.google.co.in/group/bangalore-fp">bangalore-fp</a>. We will most likely have a meetup this sunday. The venue and time is not yet decided. I will update this post once it is agreed upon.<br />
I am not sure whether this will be a &#8220;success&#8221;. I don&#8217;t even know how to measure success (in general, not just in this context). If one person manage to get inspired to complete the entire book, then I guess it can be considered as a success.<br />
<strong>Update</strong>: The meeting is at this place called <a href="http://jaaga.wikidot.com/contact">Jaaga</a> on sunday, 14th March 2010 from 3pm.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zerobeat.in/2010/03/10/sicp-study-group/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Laptop Power Supply</title>
		<link>http://www.zerobeat.in/2010/03/06/laptop-power-supply/</link>
		<comments>http://www.zerobeat.in/2010/03/06/laptop-power-supply/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 18:12:17 +0000</pubDate>
		<dc:creator>Ramakrishnan Muthukrishnan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.zerobeat.in/?p=273</guid>
		<description><![CDATA[Common folklore (confirmed by some Norwegian friends) is that heat is not a friend of laptop batteries. The life of a laptop battery tend to reduce in Indian weather. One of the Dell Laptops I bought in early 2008 can now work barely 30 minutes with a fully charged battery. Linux kernel provides a wealth [...]]]></description>
			<content:encoded><![CDATA[<p>Common folklore (confirmed by some Norwegian friends) is that heat is not a friend of laptop batteries. The life of a laptop battery tend to reduce in Indian weather. One of the Dell Laptops I bought in early 2008 can now work barely 30 minutes with a fully charged battery.</p>
<p>Linux kernel provides a wealth of information (through ACPI) about the Battery like the make, type, serial number etc. Look under<br />
<code>/sys/class/power_supply/BAT0/</code>. This is what I have:<br />
<code><br />
~$ cat /sys/class/power_supply/BAT0/status<br />
Unknown<br />
~$ cat /sys/class/power_supply/BAT0/technology<br />
Li-ion<br />
~$ cat /sys/class/power_supply/BAT0/type<br />
Battery<br />
~$ cat /sys/class/power_supply/BAT0/serial_number<br />
32511<br />
~$ cat /sys/class/power_supply/BAT0/manufacturer<br />
SANYO<br />
~$ cat /sys/class/power_supply/BAT0/model_name<br />
42T4511<br />
~$ cat /sys/class/power_supply/BAT0/energy_full_design<br />
84240000<br />
~$ cat /sys/class/power_supply/BAT0/energy_full<br />
64530000<br />
~$ cat /sys/class/power_supply/BAT0/energy_now<br />
63160000<br />
</code><br />
It looks like, my battery (this is a work laptop, Lenovo Thinkpad T61 running Debian x86-64 unstable) is functioning at a lesser capacity than it is designed. It will be nice to corelate these readings with the actual performance of the battery. I tend to run this machine mostly with AC, but I will try profiling it for battery performance and see how much time these numbers translate to.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zerobeat.in/2010/03/06/laptop-power-supply/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>git &#8211; renaming branches</title>
		<link>http://www.zerobeat.in/2010/01/24/git-renaming-branches/</link>
		<comments>http://www.zerobeat.in/2010/01/24/git-renaming-branches/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 18:47:41 +0000</pubDate>
		<dc:creator>Ramakrishnan Muthukrishnan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://www.zerobeat.in/?p=267</guid>
		<description><![CDATA[I was working on a project recently, which involved cloning another git repository and adding my own changes into it. After I cloned it, I forgot to create and switch to the new branch and do my changes there. So all my changes were in the &#8216;master&#8217; branch. I rather wanted to have my changes [...]]]></description>
			<content:encoded><![CDATA[<p>I was working on a project recently, which involved cloning another git repository and adding my own changes into it. After I cloned it, I forgot to create and switch to the new branch and do my changes there. So all my changes were in the &#8216;master&#8217; branch. I rather wanted to have my changes in my own branch. git makes these things trivial. All you have to do is rename your current master:</p>
<pre>$ git branch -m &lt;old-branch-name&gt; &lt;new-branch-name&gt;
$ git branch (should show the new name)
</pre>
<p>Now, do a git log and find out which is the commit before you started making the change and do:</p>
<pre>$ git checkout -b &lt;old-branch-name&gt; &lt;commit-sha1&gt;
</pre>
<p>That&#8217;s it and you have the whole thing as you wanted it to be.</p>
<p>Thanks to my friend Anand for the tip on the -m option to git branch. Most git gems seem to be deep embedded in those switches of the sub commands of git.</p>
<pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.zerobeat.in/2010/01/24/git-renaming-branches/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
