<?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>Walmik&#039;s weblog</title>
	<atom:link href="http://www.walmik.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.walmik.com</link>
	<description>Frontend Developer / UX Designer</description>
	<lastBuildDate>Sun, 13 May 2012 16:29:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Javascript/jQuery implementation of Game of Life</title>
		<link>http://www.walmik.com/2012/03/javascriptjquery-implementation-of-game-of-life/</link>
		<comments>http://www.walmik.com/2012/03/javascriptjquery-implementation-of-game-of-life/#comments</comments>
		<pubDate>Fri, 30 Mar 2012 11:10:44 +0000</pubDate>
		<dc:creator>Walmik</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.walmik.com/?p=343</guid>
		<description><![CDATA[To win you&#8217;ve got to stay in the game. -Claude M. Bristol Recently I watched a video on Coursera on Model Thinking where the instructor, Scott E Page explained the Game of Life (a zero player game) divised by mathematician John &#8230; <a href="http://www.walmik.com/2012/03/javascriptjquery-implementation-of-game-of-life/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<blockquote><p>To win you&#8217;ve got to stay in the game.<br />
<em>-Claude M. Bristol</em></p></blockquote>
<p><a href="http://www.walmik.com/wp-content/uploads/2012/03/game-of-life.png"><img class="alignleft size-full wp-image-354" title="game-of-life" src="http://www.walmik.com/wp-content/uploads/2012/03/game-of-life.png" alt="" width="200" height="135" /></a><br />
Recently I watched a video on <a title="Model Thinking" href="https://www.coursera.org/course/modelthinking" target="_blank">Coursera</a> on Model Thinking where the instructor, <a href="http://www.cscs.umich.edu/%7Espage/">Scott E Page</a> explained the <a title="Game of Life" href="http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life" target="_blank">Game of Life</a> (a zero player game) divised by mathematician <a title="John Horton Conway" href="http://en.wikipedia.org/wiki/John_Horton_Conway">John Horton Conway</a>. The game is basically a grid of cels and each cel has a &#8216;on&#8217; and a &#8216;off&#8217; state or in other words, an &#8216;alive&#8217; or &#8216;dead&#8217; state. It has simple rules that can create complex patterns over time. If a cel is alive, then it can continue to &#8216;live&#8217; only if it has exactly 2 or 3 neighboring cels alive, else it dies or goes &#8216;off&#8217;. A dead cel can come alive only if it has exactly 3 neighboring cels alive. Over time, this creates intricate patterns and even animations!</p>
<p>I decided to implement this in Javascript/jQuery for fun. This hardly took an hour and it happens to be my second project on Github. Though I need to implement some more customizations, its <a title="Javascript/jQuery implementation of Game of Life" href="http://walmik.info/demos/game-of-life/" target="_blank">here</a> for you to look at and <a href="https://github.com/walmik/game-of-life/fork" target="_blank">here</a> if you d like to fork it and make better <img src='http://www.walmik.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.walmik.com/2012/03/javascriptjquery-implementation-of-game-of-life/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Manage your custom WordPress theme using git instead of FTP</title>
		<link>http://www.walmik.com/2012/03/manage-your-custom-wordpress-theme-using-git-instead-of-ftp/</link>
		<comments>http://www.walmik.com/2012/03/manage-your-custom-wordpress-theme-using-git-instead-of-ftp/#comments</comments>
		<pubDate>Thu, 22 Mar 2012 05:21:32 +0000</pubDate>
		<dc:creator>Walmik</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.walmik.com/?p=336</guid>
		<description><![CDATA[Creating a WordPress theme is really fun, so is maintaining it using Git! If you ve been using FTP to push all your cool updates to your theme, then you may want to consider using version control instead. Git for &#8230; <a href="http://www.walmik.com/2012/03/manage-your-custom-wordpress-theme-using-git-instead-of-ftp/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.walmik.com/wp-content/uploads/2012/03/wp-theme-with-bit-bucket.png"><img class="alignleft size-thumbnail wp-image-350" title="wp-theme-with-bit-bucket" src="http://www.walmik.com/wp-content/uploads/2012/03/wp-theme-with-bit-bucket-150x150.png" alt="" width="150" height="150" /></a><br />
Creating a WordPress theme is really fun, so is maintaining it using Git! If you ve been using FTP to push all your cool updates to your theme, then you may want to consider using version control instead. Git for instance. Earlier there really wasnt any online service that would let you host unlimited private repositories for free. <a href="http://www.springloops.com">Springloops</a> (which is undoubtedly awesome!) gave out only 100MB for free. But with <a href="https://bitbucket.org/">BitBucket</a> the whole scenario changes. Of course, there is <a href="https://github.com/">Github</a>, but you may not want to make your WordPress theme public. At least not right away!</p>
<p>Pre-requisites:</p>
<ul>
<li>Git</li>
<li>A BitBucket account (free)</li>
<li>A Virtual Private Server (I use <a href="http://www.linode.com/?r=2eb31580e95098fbce16ac54d6091986af7ae60d">Linode</a>. If you dont have a VPS yet, then I highly recommend Linode and I d be delighted if you use this link as this has my referral code in it)</li>
</ul>
<p>Log in to your BitBucket account and create a Git repository. Leave the &#8216;private&#8217; checkbox selected. Once its created, use the link it will provide to clone the newly created repository. In a terminal, change directory to the wp-contents/theme folder in your WordPress installation and paste the git command which may look something like</p>
<pre>git clone https://yourname@bitbucket.org/yourname/my-wp-theme.git</pre>
<p>Enter the password and you are set to create your WordPress theme. Once you make some additions or changes to this theme folder, commit the changes and push them to BitBucket.</p>
<p><code>git add .<br />
git commit -a -m "some message to identify this commit"</code></p>
<p>The first time you push, you may run into an error due to the size of files being pushed. In that case set the http post buffer to a little higher number</p>
<p><code>git config http.postBuffer 524288000</code></p>
<p>Once you are ready to take your new WordPress theme live, login to your VPS and in your wp-content/themes folder clone the repository from BitBucket just the way you did when you cloned it on your local machine. Whenever you make changes to your theme, push them to BitBucket and then pull them inside your theme folder on your VPS by issuing the git command</p>
<p><code>git pull</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.walmik.com/2012/03/manage-your-custom-wordpress-theme-using-git-instead-of-ftp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Timer Plugin</title>
		<link>http://www.walmik.com/2012/02/jquery-timer-plugin/</link>
		<comments>http://www.walmik.com/2012/02/jquery-timer-plugin/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 10:00:13 +0000</pubDate>
		<dc:creator>Walmik</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Useful]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://www.walmik.com/?p=306</guid>
		<description><![CDATA[Time does not change us. It just unfolds us. -Max Frisch I m happy to post about my first ever jQuery plugin. This plugin will allow you to add a simple timer to a HTML element like DIV or SPAN &#8230; <a href="http://www.walmik.com/2012/02/jquery-timer-plugin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<blockquote><p>Time does not change us. It just unfolds us.</p>
<p>-Max Frisch</p></blockquote>
<p><a href="http://www.walmik.com/wp-content/uploads/2012/02/jquery-timer.png"><img class="alignleft size-thumbnail wp-image-319" title="jquery-timer" src="http://www.walmik.com/wp-content/uploads/2012/02/jquery-timer-150x150.png" alt="" width="150" height="150" /></a>I m happy to post about my first ever jQuery plugin. This plugin will allow you to add a simple timer to a HTML element like DIV or SPAN or any other valid display element. You can style this element to show the timer in a nice way <img src='http://www.walmik.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Currently this plugin has 3 self explainatory methods to interact with it:</p>
<ol>
<li>$(&#8220;#divId&#8221;).timer(&#8220;start&#8221;);  -&gt; this will initialize the timer inside the div with id = &#8220;divId&#8221;. You can even pass in the number of seconds you&#8217;d like to start the timer at, like this, $(&#8220;#divId&#8221;).timer(&#8220;start&#8221;, 2500);</li>
<li>$(&#8220;#divId&#8221;).timer(&#8220;pause&#8221;); -&gt; this will pause a started timer</li>
<li>$(&#8220;#divId&#8221;).timer(&#8220;resume&#8221;); -&gt; and this will obviously resume a paused timer.</li>
</ol>
<p>Make sure to include the latest jQuery file and this plugin file in your HEAD section. Click <a title="jQuery Timer Plugin" href="http://walmik.info/demos/timer.jquery/">here</a> for a demo of this plugin. <a href="https://github.com/walmik/timer.jquery/zipball/master">Download</a> the zipped folder (includes the plugin + demo HTML page) from GitHub. Here&#8217;s the <a href="http://walmik.info/demos/timer.jquery/timer.jquery.js">script</a> itself.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.walmik.com/2012/02/jquery-timer-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nav Highlighter</title>
		<link>http://www.walmik.com/2012/02/nav-highlighter/</link>
		<comments>http://www.walmik.com/2012/02/nav-highlighter/#comments</comments>
		<pubDate>Sat, 11 Feb 2012 09:04:38 +0000</pubDate>
		<dc:creator>Walmik</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Useful]]></category>

		<guid isPermaLink="false">http://www.walmik.com/?p=189</guid>
		<description><![CDATA[We were suddenly faced with the necessity of training a lot of young men in the art of navigation. -Clyde Tombaugh Navigation items built out of li elements or a common class name assigned to multiple divs or a set &#8230; <a href="http://www.walmik.com/2012/02/nav-highlighter/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<blockquote><p>We were suddenly faced with the necessity of training a lot of young men in the art of navigation.</p>
<p>-Clyde Tombaugh</p></blockquote>
<p><a href="http://www.walmik.com/wp-content/uploads/2012/02/navigation.png"><img class="alignleft size-full wp-image-282" title="navigation" src="http://www.walmik.com/wp-content/uploads/2012/02/navigation.png" alt="" width="300" height="225" /></a>Navigation items built out of li elements or a common class name assigned to multiple divs or a set of elements that act as a bunch of options to select one from&#8230; all of these need a selected or highlighted state visually for the option that was clicked on. Also these kinda items need to store the currently selected item. Instead of writing a few lines of code every time I needed to have an item highlighted or selected, I wrote this simple Javascript function to manage this task with the following goals<br />
* Highlight one item from a set<br />
* Unhighlight currently highlighted item (if any)<br />
* Store the currently highlighted element</p>
<p>You can either use the .js file for this in your project or simply copy the class from here and paste it in your common helpers file if you use one.</p>
<pre>function Highlighter(selClass)
{
    this.sC = selClass;
    this.currItem;
}
Highlighter.prototype.highlight = function(item)
{
    if(item != this.currItem)
    {
        if(this.currItem != undefined)
        {
            this.currItem.removeClass(this.sC);
        }
        item.addClass(this.sC);
        this.currItem = item;
    }
}</pre>
<h3>How to use this?</h3>
<p>In your HTML page, add a unordered list. For example,</p>
<pre>&lt;ul&gt;
    &lt;li&gt;Home&lt;/li&gt;
    &lt;li&gt;About&lt;/li&gt;
    &lt;li&gt;Bleh&lt;/li&gt;
    &lt;li&gt;Contact&lt;/li&gt;
&lt;/ul&gt;</pre>
<p>In the head tag of the HTML page, make sure you are pulling jQuery along with the Highlighter JavaScript function as well as a CSS class for the highlighted state of the list element. I m calling it &#8216;sel&#8217; for now. You can call it anything you like. Just make sure to pass that name to the JavaScript function.</p>
<p>Here s my simple CSS style for the unordered list and the sel class.</p>
<pre>ul
{
    padding: 0px;
}
li
{
    list-style:none;
    display: inline-block;
    padding: 5px;
    background-color: #f2f2f2;
    color: #666;
    cursor: pointer;
    font-size: 12px;
}</pre>
<h3>Document Ready</h3>
<pre>$(document).ready(function(){
    var navHighlighter = new Highlighter("sel");
    $("li").click(function(){
        navHighlighter.highlight($(this));
    });
});</pre>
<p>And that should enable the highlighter on the unordered list elements. Here&#8217;s a little <a href="http://walmik.info/demos/nav-highlighter/" target="_blank">demo</a> of this function in action.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.walmik.com/2012/02/nav-highlighter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable 2 finger scrolling on the trackpad in Ubuntu</title>
		<link>http://www.walmik.com/2012/02/enable-2-finger-scrolling-on-the-trackpad-in-ubuntu/</link>
		<comments>http://www.walmik.com/2012/02/enable-2-finger-scrolling-on-the-trackpad-in-ubuntu/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 16:05:08 +0000</pubDate>
		<dc:creator>Walmik</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Useful]]></category>

		<guid isPermaLink="false">http://www.walmik.com/?p=228</guid>
		<description><![CDATA[Just a reminder for me to enable 2 finger scrolling on the trackpad using Ubuntu. I had enabled this in the Mouse/Trackpad settings but it didnt work for me. Here goes, Create a text file with the following text in &#8230; <a href="http://www.walmik.com/2012/02/enable-2-finger-scrolling-on-the-trackpad-in-ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.walmik.com/wp-content/uploads/2012/02/2-finger-scrolling2.png"><img class="alignleft size-thumbnail wp-image-334" title="2-finger-scrolling" src="http://www.walmik.com/wp-content/uploads/2012/02/2-finger-scrolling2-150x150.png" alt="" width="150" height="150" /></a><br />
Just a reminder for me to enable 2 finger scrolling on the trackpad using Ubuntu. I had enabled this in the Mouse/Trackpad settings but it didnt work for me. Here goes,</p>
<p>Create a text file with the following text in it and name it something like 2finger-scroll.</p>
<p><code>#!/bin/sh<br />
synclient VertTwoFingerScroll=1<br />
synclient HorizTwoFingerScroll=1<br />
synclient EmulateTwoFingerMinW=5<br />
synclient EmulateTwoFingerMinZ=48</code></p>
<p>In the terminal go to the directory where this file resides and make it executable:<br />
<code>sudo chmod +x 2finger-scroll</code></p>
<p>Add this file to the Startup Applications list. Now it ll enable 2 finger scroll on the trackpad every time you boot into Ubuntu. For it to take effect right away, enter</p>
<p><code>./2finger-scroll</code></p>
<p><code><br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.walmik.com/2012/02/enable-2-finger-scrolling-on-the-trackpad-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to create sticky table headers using jQuery &#8211; jquery sticky plugin</title>
		<link>http://www.walmik.com/2011/12/sticky-table-headers-using-jquery-sticky-plugin/</link>
		<comments>http://www.walmik.com/2011/12/sticky-table-headers-using-jquery-sticky-plugin/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 18:08:27 +0000</pubDate>
		<dc:creator>Walmik</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.walmik.com/?p=215</guid>
		<description><![CDATA[Welcome those big, sticky, complicated problems. In them are your most powerful opportunities. -Ralph Marston &#160; Update: I ve converted this function into a jQuery plugin and put up a demo for it. If you d like to improve this &#8230; <a href="http://www.walmik.com/2011/12/sticky-table-headers-using-jquery-sticky-plugin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<blockquote><p>Welcome those big, sticky, complicated problems. In them are your most powerful opportunities.<br />
<em>-Ralph Marston</em></p></blockquote>
<p>&nbsp;</p>
<p><a href="http://www.walmik.com/wp-content/uploads/2011/12/jquery-sticky-headers.png"><img class="alignleft size-full wp-image-328" title="jquery-sticky-headers" src="http://www.walmik.com/wp-content/uploads/2011/12/jquery-sticky-headers.png" alt="" width="300" height="210" /></a><em><strong>Update</strong>: I ve converted this function into a jQuery plugin and put up a <a title="jQuery sticky table headers plugin" href="http://walmik.info/demos/sticky.jquery/" target="_blank">demo</a> for it. If you d like to improve this plugin then you can <a title="jQuery sticky table headers plugin on GitHub" href="https://github.com/walmik/sticky.jquery" target="_blank">clone it from github</a>.</em></p>
<p>Here s a nice way to use jQuery and make table headers sticky when a page is scrolled down and the table headers reach the top. This is a feature in the new look that Google is sporting, in Google documents, Gmail etc. Obviously Google is not using jQuery to accomplish this and they are probably using some fancy code to do it. This is just a quick way to get it working on table headers.. &lt;th&gt; elements. In this setup we calculate the distance of the table from the top, check if it reaches 0 while scrolling and apply the CSS property position:fixed to it. If it falls back under the distance it had, then we revert the position to normal.</p>
<p>Pass in the table&#8217;s id to the function that follows it. For example if you have a table that had an id = &#8220;my_table&#8221;, then pass this in the document.ready function:</p>
<pre>$(document).ready(function(){
    makeTableHeadersSticky("#my_table");
});

function makeTableHeadersSticky(tableId)
{
    //collect widths of all the th elements
    var thArr = $(tableId + " th");
    //create an array to hold the auto calculated widths of each element
    var thWidthsArr = [];
    $(tableId + " th").each(function(){
        thWidthsArr.push($(this).css("width"));
    });
    var pos = $(tableId).offset();
    //set the distance of the table from the top,
    //we ll need to make the headers sticky when this distance is 0  
    var thTop = pos.top + "px";
    //set the widths of the first and last tr's ths/tds...
    //this is done coz in some cases,
    //the widths will get messed up if the data was generated dynamically
    var count = 0;
    $(tableId + " tr:first-child&gt;th").each(function(){
        $(this).css("width", thWidthsArr[count]);
        count++;
    });
    count = 0;
    $(tableId + " tr:last-child&gt;td").each(function(){
        $(this).css("width", thWidthsArr[count]);
        count++;
    });
    $(window).scroll(function(){
        if($(window).scrollTop() &gt; pos.top)
        {
            $(tableId + " tr:first-child").css("position", "fixed");
            $(tableId + " tr:first-child").css("top", "0px");
        }
        else
        {
            $(tableId + " tr:first-child").css("position", "relative");
            $(tableId + " tr:first-child").css("top", thTop);
        }
    });
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.walmik.com/2011/12/sticky-table-headers-using-jquery-sticky-plugin/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to upgrade firefox in Ubuntu</title>
		<link>http://www.walmik.com/2011/11/how-to-upgrade-firefox-in-ubuntu/</link>
		<comments>http://www.walmik.com/2011/11/how-to-upgrade-firefox-in-ubuntu/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 07:20:24 +0000</pubDate>
		<dc:creator>Walmik</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.walmik.com/?p=212</guid>
		<description><![CDATA[A good fox does not eat his neighbor&#8217;s fowl! -French proverb This post is supposed to be just a reminder for me on how to upgrade the default Firefox on Ubuntu. 10.04 uses Firefox 3.6.23 when Firefox has released version &#8230; <a href="http://www.walmik.com/2011/11/how-to-upgrade-firefox-in-ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<blockquote><p>A good fox does not eat his neighbor&#8217;s fowl!<br />
<em>-French proverb</em></p></blockquote>
<p><a href="http://www.walmik.com/wp-content/uploads/2011/11/upgrade-firefox.png"><img class="alignleft  wp-image-324" title="upgrade-firefox" src="http://www.walmik.com/wp-content/uploads/2011/11/upgrade-firefox.png" alt="" width="161" height="203" style="max-width:161px" /></a>This post is supposed to be just a reminder for me on how to upgrade the default Firefox on Ubuntu. 10.04 uses Firefox 3.6.23 when Firefox has released version 5, 6, 7 and very recently 8 in 2011 itself. Mozilla had announced this development plan.</p>
<p>To upgrade the Firefox version to the most recent one, you ll need to run the usual update and upgrade commands on apt-get and then add the following ppa to the Ubuntu repository list:</p>
<p><code>sudo add-apt-repository ppa:mozillateam/firefox-next</code></p>
<p>After that again</p>
<p><code>sudo apt-get update<br />
sudo apt-get upgrade</code></p>
<p>And Firefox should be at its most recent offering which is 8 as of today.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.walmik.com/2011/11/how-to-upgrade-firefox-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solution: How to get a svn log by author name</title>
		<link>http://www.walmik.com/2011/11/solution-how-to-get-a-svn-log-by-author-name/</link>
		<comments>http://www.walmik.com/2011/11/solution-how-to-get-a-svn-log-by-author-name/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 07:04:21 +0000</pubDate>
		<dc:creator>Walmik</dc:creator>
				<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://www.walmik.com/?p=198</guid>
		<description><![CDATA[I am in the habit of maintaining a daily work log. I do this in a Google spreadsheet and maintain each month on an individual sheet. This not only lets me share with the team what I ve been up &#8230; <a href="http://www.walmik.com/2011/11/solution-how-to-get-a-svn-log-by-author-name/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.walmik.com/wp-content/uploads/2011/11/log.png"><img class="alignleft size-full wp-image-284" title="svn-log-by-author" src="http://www.walmik.com/wp-content/uploads/2011/11/log.png" alt="" width="300" height="184" /></a>I am in the habit of maintaining a daily work log. I do this in a Google spreadsheet and maintain each month on an individual sheet. This not only lets me share with the team what I ve been up but it also gives me a good idea about how a particular week or month was and then based on that I can make some changes to my daily schedule to improve my productivity. The only issue is, sometimes I forget to maintain the work log and then if that happens for a number of days, then the spreadsheet has this unbearable &#8216;void&#8217; suddenly. To deal with this, I want to naturally turn to my recent project&#8217;s git or svn log for filling up the missing days. But svn log will not give me a log by author. So here s a XML + <a href="http://www.w3schools.com/xsl/" target="_blank">XSL</a> based solution that I m using currently.</p>
<p>I export the svn log to a xml file</p>
<pre>svn log --xml -v &gt; mylog.xml</pre>
<p>And then I add a XSL stylesheet to the log file that got created on its second line (right after the XML version declaration)</p>
<pre>&lt;?xml-stylesheet type="text/xsl" href="myxsl.xsl"?&gt;</pre>
<p>And finally I use the following XSL to filter out other authors and only include my commits. If you are copying this from here, then make sure you substitute my name &#8216;walmik&#8217; with your name.</p>
<pre>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
&lt;xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
&lt;xsl:template match="/"&gt;
&lt;html&gt;
&lt;body&gt;
&lt;h2&gt;My SVN log&lt;/h2&gt;
&lt;table border="1"&gt;
&lt;xsl:for-each select="log/logentry"&gt;
&lt;xsl:if test="author='walmik'"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;xsl:value-of select="@revision"/&gt;&lt;/td&gt;
&lt;td&gt;&lt;xsl:value-of select="author"/&gt;&lt;/td&gt;
&lt;td&gt;&lt;xsl:value-of select="substring(date,1,10)"/&gt;&lt;/td&gt;
&lt;td&gt;&lt;xsl:value-of select="msg"/&gt;&lt;/td&gt;
&lt;td&gt;
&lt;xsl:for-each select="paths/path"&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;xsl:value-of select="@action"/&gt;&lt;/td&gt;
&lt;td&gt;&lt;xsl:value-of select="."/&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/xsl:for-each&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/xsl:if&gt;
&lt;/xsl:for-each&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;</pre>
<p>As you can notice I m using a substring to format the date to show just the year, month and day.</p>
<p>Now when I open the XML in a browser, I can copy the work log entries from missing dates and paste it inside the Google spreadsheet. Of course, this whole exercise would be pointless if you are not in the habit of adding a message to your commits!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.walmik.com/2011/11/solution-how-to-get-a-svn-log-by-author-name/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Renaming multiple files in a folder to a numbered format from the terminal</title>
		<link>http://www.walmik.com/2011/10/renaming-multiple-files-to-a-numbered-forma-from-the-terminal/</link>
		<comments>http://www.walmik.com/2011/10/renaming-multiple-files-to-a-numbered-forma-from-the-terminal/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 17:17:53 +0000</pubDate>
		<dc:creator>Walmik</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Useful]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.walmik.com/?p=193</guid>
		<description><![CDATA[This is just for my reference. I needed to rename a whole lot of png files in a folder from filename.png, some-other-filename.png to 0.png, 1.png etc. It took a little bit of experimenting and it lead me to: count=0; for &#8230; <a href="http://www.walmik.com/2011/10/renaming-multiple-files-to-a-numbered-forma-from-the-terminal/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.walmik.com/wp-content/uploads/2011/10/rename-multiple-files.png"><img src="http://www.walmik.com/wp-content/uploads/2011/10/rename-multiple-files.png" alt="" title="rename-multiple-files" width="300" height="218" class="alignleft size-full wp-image-296" /></a>This is just for my reference. I needed to rename a whole lot of png files in a folder from filename.png, some-other-filename.png to 0.png, 1.png etc. It took a little bit of experimenting and it lead me to:</p>
<pre>count=0; for file in *; do mv $file $count.png; let count=$count+1; done;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.walmik.com/2011/10/renaming-multiple-files-to-a-numbered-forma-from-the-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Toggle TinyMCE rich text editor effectively</title>
		<link>http://www.walmik.com/2011/09/toggle-tinymce-rich-text-editor-effectively/</link>
		<comments>http://www.walmik.com/2011/09/toggle-tinymce-rich-text-editor-effectively/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 03:17:38 +0000</pubDate>
		<dc:creator>Walmik</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.walmik.com/?p=183</guid>
		<description><![CDATA[Using TinyMCE effectively can take a bit of practice and time. Especially if you have multiple TinyMCE instances on the same page pulling dynamic data. Two common problems are to display the data itself and the other is to toggle &#8230; <a href="http://www.walmik.com/2011/09/toggle-tinymce-rich-text-editor-effectively/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Using <a href="http://www.tinymce.com/" target="_blank">TinyMCE</a> effectively can take a bit of practice and time. Especially if you have multiple TinyMCE instances on the same page pulling dynamic data. Two common problems are to display the data itself and the other is to toggle the rich text editor on a TinyMCE enabled textarea to display rich text or not on the click of a button.</p>
<p>The first case can be tackled by pulling data after a small <a href="http://www.w3schools.com/jsref/met_win_setinterval.asp" target="_blank">delay</a> so that TinyMCE assets are loaded. The second case can be handled as follows:</p>
<p>To remove rich text capability from a textarea with the id &#8216;tmce-id&#8217;:</p>
<pre>
tinymce.get("tmce-id").save();
tinymce.execCommand('mceRemoveControl', true, "tmce-id");
</pre>
<p>In the above code, we saved the contents before removing the control so that the most recent edited text is available in plain view. You may also want to strip the tags that the editor had added to the text. You can just use a regular expression to do so and put in a function so you can reuse it quickly:</p>
<pre>
function stripHtml(str){
return str.replace(/&lt;\S[^&gt;&lt;]*&gt;/gi, "");
}
</pre>
<p>So now the code would look like:</p>
<pre>
tinymce.get("tmce-id").save();
tinymce.execCommand('mceRemoveControl', true, "tmce-id");
var str = $("#tmce-id").val();
$("#tmce-id").val(stripHtml(str));
</pre>
<p>To add rich text again,</p>
<pre>tinymce.execCommand('mceAddControl', true, "tmce-id");</pre>
<p>In case of multiple TinyMCE textarea instances on the same page, you can pass a <a title="Making HTML tags more useful by custom attributes" href="http://www.walmik.com/2011/06/making-html-tags-more-useful/" target="_blank">custom HTML attribute</a> to the buttons that toggle TinyMCE. So if you are looping from 0 to 10 while adding textareas then the buttons that you are drawing for toggling can have a custom html attribute such as</p>
<pre>
&lt;a class='enable-rte-btn' <strong>ref</strong>='tmce-id-0'&gt;Enable Rich Text&lt;/a&gt;
&lt;a class='disable-rte-btn' <strong>ref</strong>='tmce-id-0'&gt;Remove Rich Text&lt;/a&gt;
&lt;textarea id='tmce-id-0' class='tinymce'&gt;&lt;/textarea&gt;
</pre>
<p>You can draw out multiple textareas like this incrementing 0 to 10 or whatever the number and then enable TinyMCE on textareas with the class &#8216;tinymce&#8217;. If there are too many textareas then pull the data after a small delay (based on the number of textareas you have) and load it in the textareas. After that add a click function to enable or disable rich text on all tags with the class &#8216;enable-rte-btn&#8217; and &#8216;disable-rte-btn&#8217; respectively.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.walmik.com/2011/09/toggle-tinymce-rich-text-editor-effectively/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

