<?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>Madan Revoor</title>
	<atom:link href="http://www.madanrevoor.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.madanrevoor.com</link>
	<description>Life, IT and everything else</description>
	<lastBuildDate>Sun, 20 Dec 2009 07:08:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Emacs &#8211; Playing music in your text editor</title>
		<link>http://www.madanrevoor.com/emacs-playing-music-in-your-text-editor</link>
		<comments>http://www.madanrevoor.com/emacs-playing-music-in-your-text-editor#comments</comments>
		<pubDate>Sun, 20 Dec 2009 07:05:58 +0000</pubDate>
		<dc:creator>Madan Revoor</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/madanrev/public_html/wp-content/plugins/autometa/autometa.php</b> on line <b>300</b><br />
		<category><![CDATA[Linux]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.madanrevoor.com/?p=240</guid>
		<description><![CDATA[I have always felt it was cool to play music while working on my files. If you are someone like me, I guess you would enjoy this post. I was simply awed when I was introduced to this feature of Emacs for the first time and blown away by the fact that it allows you [...]]]></description>
			<content:encoded><![CDATA[<p>I have always felt it was cool to play music while working on my files. If you are someone like me, I guess you would enjoy this post. I was simply awed when I was introduced to this feature of Emacs for the first time and blown away by the fact that it allows you to play music while working on your files without having to open one of those GUI based players! Imagine it. I felt determined to make it work on my laptop running openSUSE. In this post, we will look at how Emacs can be customized for playing your favorite music without having to switch windows or losing your focus from work! <img src='http://www.madanrevoor.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>STEP 1: All you need for Emacs to play music is to download the emms (Emacs Multimedia System) package for Emacs. You can download it from http://www.gnu.org/software/emms/download/emms-3.0.tar.gz</p>
<p>STEP2: Uncompress or extract the archive using the command &#8216;tar -xvzf emms-3.0.tar.gz&#8217; or you can do it in two steps using &#8216;gunzip emms-3.0.tar.gz&#8217; and &#8216;tar -xvf emms-3.0.tar&#8217;. After either case, you shall be left with a folder &#8216;emms-3.0&#8242;.</p>
<p>STEP 3: copy the &#8216;.el&#8217; files to a convenient location like &#8216;~/elisp/emms&#8217;, if you prefer. Or else, you can leave your &#8216;emms-3.0&#8242; folder under the downloads directory itself if you don&#8217;t mind to bother yourself with a bit of organizing data.</p>
<p>STEP 4: We need to add a line to the &#8216;~/.emacs&#8217; config file to enable it to find the Emms package. Add the following line to it.<br />
(add-to-list &#8216;load-path &#8220;~/elisp/emms/&#8221;)</p>
<p>STEP 5: The following lines to be added to the emacs config file to setup emms.<br />
        (require &#8216;emms-setup)<br />
        (emms-standard)<br />
        (emms-default-players)</p>
<p>STEP 6: The following lines are optional and if added to the config file shall show the currently playing track as a message (like this &#8220;Now Playing: /media/music/song/fav.mp3&#8243;) in the mini buffer at the bottom of the Emacs editor.</p>
<p>   ;; Show the current track each time EMMS<br />
   ;; starts to play a track with &#8220;NP : &#8221;<br />
(add-hook &#8216;emms-player-started-hook &#8216;emms-show)<br />
(setq emms-show-format &#8220;Now Playing : %s&#8221;)</p>
<p>STEP 7: This is also an optional step. You can omit it if you do not wish to be shown your own default music directory when prompting emms to play music. Please note that &#8216;;;&#8217; are comments which need to be removed before replacing your default music directory in the below options. I do not use this option in my setup though.<br />
;; When asked for emms-play-directory,<br />
;; always start from this one<br />
;;(setq emms-source-file-default-directory &#8220;/media/sda5/songs/&#8221;)<br />
;;(setq emms-source-playlist-default-directory &#8220;~/Music/&#8221;)</p>
<p>STEP 8: You need to make sure if you have installed the mpg123 audio player. Emms uses mpg123 to play music from within the editor interface and without it, we cannot play music files in our editor. In OpenSUSE 11.2, I installed it using the Yast program. For Ubuntu, you can use the apt-get program.</p>
<p>STEP 9: You are all set to play music in Emacs now! Open up emacs and type &#8216;M-x emms-add-file&#8217;. You shall be asked to type the path of your music directory.<br />
/media/music/songs/fav.mp3</p>
<p>STEP 10: You can start playing the fav.mp3 file by typing &#8216;M-x emms-start&#8217;</p>
<p>STEP 11: You can also enter the interactive emms mode by typing the path of your music directory in STEP 9 instead of pointing it to a single music file. For example, you can type /media/music/songs and then go into interactive mode by typing &#8216;M-x emms-playlist-mode-go&#8217; and then using the arrow keys to select a track or file to play.</p>
<p>Some of the short cut keys in the interactive playlist mode are listed below:</p>
<p>`n&#8217;&#8230;.Start playing the next track in the playlist.</p>
<p>`p&#8217;&#8230;.Start playing the previous track in the playlist.</p>
<p>`s&#8217;&#8230;.Stop playing.</p>
<p>`f&#8217;&#8230;.Describe the currently playing track in the minibuffer.</p>
<p>`c&#8217;&#8230;.Display the current track in the center of the screen.</p>
<p>`RET&#8217;..Start playing the track under point. Note that this is also<br />
       available with `<mouse-2>&#8216;.</p>
<p>`q&#8217;&#8230;.Put the interactive playlist buffer at the end of the list of all<br />
       buffers (ie. bury it).</p>
<p>A few more commands for your emms player:</p>
<p>emms-play-file &#8230;&#8230;&#8230;&#8230;. Play a single file<br />
emms-play-directory &#8230;&#8230;.. Play a whole directory<br />
emms-play-directory-tree &#8230; Play a directory tree</p>
]]></content:encoded>
			<wfw:commentRss>http://www.madanrevoor.com/emacs-playing-music-in-your-text-editor/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shell script to count number of lines of all files within a directory</title>
		<link>http://www.madanrevoor.com/shell-script-to-count-number-of-lines-of-all-files-within-a-directory</link>
		<comments>http://www.madanrevoor.com/shell-script-to-count-number-of-lines-of-all-files-within-a-directory#comments</comments>
		<pubDate>Sat, 17 Oct 2009 18:02:04 +0000</pubDate>
		<dc:creator>Madan Revoor</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/madanrev/public_html/wp-content/plugins/autometa/autometa.php</b> on line <b>300</b><br />
		<category><![CDATA[Linux]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.madanrevoor.com/?p=154</guid>
		<description><![CDATA[In this post, I&#8217;m going to showcase a small shell script that can count the number of lines in a file and will recursively move through all sub directories and list the count of lines in all files within them. This script helped me during the analysis phase of a project where I had to [...]]]></description>
			<content:encoded><![CDATA[<p>In this post, I&#8217;m going to showcase a small shell script that can count the number of lines in a file and will recursively move through all sub directories and list the count of lines in all files within them. This script helped me during the analysis phase of a project where I had to provide estimates for development based on complexity metrics which was indirectly tied up to the count of lines, the number of files and number of database tables used by each program. This script shall only count the number of lines in a file recursively and display them.</p>
<pre name="code" class="c">
#!/bin/bash

DIR="."	#assigns the current path to this variable

# This function does the work of checking every input
# parameter to test if its a directory or file. If it is a directory
# it recursively calls itself to count the lines of all files within it.
# Else, if it is a file, it invokes 'wc' to print the number of lines in
# that file and stops.

count_lines()
{

if [ ! -d "$1" ]
then
echo "$1"
return
fi
cd "$1"
for file in *
do
if [ -d "$file" ]
then
count_lines "$file"
cd ..
else
count=`wc -l "$file" | cut -d ' ' -f1`
echo "$PWD/$file: $count lines"
fi
done
}

# Main Processing starts here. If no inputs
# offered, run the script on the files in the
# current directory.

if [ $# -eq 0 ]
then
count_lines $DIR	# if no input offered, count_lines of files in current directory
exit 0
fi

# For every input parameter passed to this script,
# count lines of all files within each of them.

for i in $*
do
DIR="$1"
count_lines "$DIR"
shift 1	#Consider the next input parameter
done                              
</pre>
<p>Hope you find this script useful. If you have any suggestions, please feel free to offer them. Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.madanrevoor.com/shell-script-to-count-number-of-lines-of-all-files-within-a-directory/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Emacs vs Vi &#8211; A single page reference to commands</title>
		<link>http://www.madanrevoor.com/emacs-vs-vi-a-single-page-reference-to-commands</link>
		<comments>http://www.madanrevoor.com/emacs-vs-vi-a-single-page-reference-to-commands#comments</comments>
		<pubDate>Fri, 11 Sep 2009 18:36:10 +0000</pubDate>
		<dc:creator>Madan Revoor</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/madanrev/public_html/wp-content/plugins/autometa/autometa.php</b> on line <b>300</b><br />
		<category><![CDATA[Linux]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.madanrevoor.com/?p=127</guid>
		<description><![CDATA[There is nothing new about this post. Emacs and Vi are two of the most powerful editors in the Linux family and I&#8217;m no exception in not loving them! I thought it would be a good idea to group both of their commands and keep them on a single page (side-by-side) for a handy reference. [...]]]></description>
			<content:encoded><![CDATA[<p>There is nothing new about this post. Emacs and Vi are two of the most powerful editors in the Linux family and I&#8217;m no exception in not loving them! I thought it would be a good idea to group both of their commands and keep them on a single page (side-by-side) for a handy reference. I like emacs a little more than Vi as it allows me to listen to music while working on the text (I meant emacs plays music files within the editor interface!). But Vi was the first editor that I learnt to use. I&#8217;m equally loyal to both of them. They are both excellent editors and suitable for all of your needs from editing simple text to programming in different languages, whatever they may be. They are my favorites and must be yours too! So, let&#8217;s enjoy using them and have some fun!&#8230;..</p>
<p>
Note: The following list is not exhaustive and only contains those commands which could be identified under both emacs and vi editors. The command descriptions are taken from the emacs reference card and the vi commands were mapped to them. You can download the emacs reference card from <a href="http://home.uchicago.edu/~gan/file/emacs.pdf">here</a>.
</p>
<table cellspacing="15">
<tr>
<th>Command Description</th>
<th>Emacs</th>
<th>Vi</th>
</tr>
<tr>
<td>Read a file</td>
<td>C-x C-f</td>
<td>:r &lt;file&gt; </td>
</tr>
<tr>
<td>Save a file to disk</td>
<td>C-x C-s</td>
<td>:w &lt;file&gt;</td>
</tr>
<tr>
<td>Insert contents of another file into this buffer</td>
<td>C-x i</td>
<td>:r &lt;file&gt;</td>
</tr>
<tr>
<td>Replace this file with the file you really want</td>
<td>C-x C-v</td>
<td>:e &lt;file&gt;</td>
</tr>
<tr>
<td>Write buffer to a specified file</td>
<td>C-x C-w</td>
<td>:w &lt;file&gt;</td>
</tr>
<tr>
<td>Redraw garbaged screen</td>
<td>C-l</td>
<td>C-l</td>
</tr>
<tr>
<td>Regular expression search</td>
<td>C-M-s</td>
<td>/regexp</td>
</tr>
<tr>
<td>Reverse regular expression search</td>
<td>C-M-r</td>
<td>?regexp</td>
</tr>
<tr>
<td>Move one character backwards</td>
<td>C-b</td>
<td>h</td>
</tr>
<tr>
<td>Move one character forwards</td>
<td>C-f</td>
<td>l</td>
</tr>
<tr>
<td>Move one word backwards</td>
<td>M-b</td>
<td>b</td>
</tr>
<tr>
<td>Move one word forwards</td>
<td>M-f</td>
<td>w</td>
</tr>
<tr>
<td>Move cursor up by one line</td>
<td>C-p</td>
<td>j</td>
</tr>
<tr>
<td>Move cursor down by one line</td>
<td>C-n</td>
<td>k</td>
</tr>
<tr>
<td>Go to line beginning</td>
<td>C-a</td>
<td>^ or 0</td>
</tr>
<tr>
<td>Go to line end</td>
<td>C-e</td>
<td>$</td>
</tr>
<tr>
<td>Scroll display backward a screen</td>
<td>M-v</td>
<td>C-b</td>
</tr>
<tr>
<td>Scroll display forward a screen</td>
<td>C-v</td>
<td>C-f</td>
</tr>
<tr>
<td>Scroll current line to center of screen</td>
<td>C-u C-l</td>
<td>C-d or C-u</td>
</tr>
<tr>
<td>Delete a character backwards</td>
<td>DEL</td>
<td>x</td>
</tr>
<tr>
<td>Delete a character forwards</td>
<td>C-d</td>
<td>x</td>
</tr>
<tr>
<td>Delete a word backwards</td>
<td>M-DEL</td>
<td>dw</td>
</tr>
<tr>
<td>Delete a word forwards</td>
<td>M-d</td>
<td>dw</td>
</tr>
<tr>
<td>Yank back last thing killed</td>
<td>C-y</td>
<td>p</td>
</tr>
<tr>
<td>Set mark here</td>
<td>C-@ or C-SPC</td>
<td>ml</td>
</tr>
<tr>
<td>Exchange point and mark</td>
<td>C-x C-x</td>
<td>&#8216;l(Goto line with label l)</td>
</tr>
<tr>
<td>Interactively replace a text string</td>
<td>M-%</td>
<td>s/a/b/gc</td>
</tr>
<tr>
<td>Split window horizontally</td>
<td>C-x 2</td>
<td>C-ws</td>
</tr>
<tr>
<td>Delete this window</td>
<td>C-x 0</td>
<td>C-wc</td>
</tr>
<tr>
<td>Split window vertically</td>
<td>C-x 3</td>
<td>:vsplit</td>
</tr>
<tr>
<td>Indent current line</td>
<td>TAB</td>
<td>&lt;&lt; or &gt;&gt;</td>
</tr>
<tr>
<td>Insert newline after point</td>
<td>C-o</td>
<td>O</td>
</tr>
<tr>
<td>Join with previous line</td>
<td>M-^</td>
<td>J</td>
</tr>
<tr>
<td>Change word to uppercase</td>
<td>M-U</td>
<td>U</td>
</tr>
<tr>
<td>Change word to lowercase</td>
<td>M-u</td>
<td>u</td>
</tr>
<tr>
<td>Capitalize word</td>
<td>M-c</td>
<td>~ (swap case)</td>
</tr>
</table>
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.
]]></content:encoded>
			<wfw:commentRss>http://www.madanrevoor.com/emacs-vs-vi-a-single-page-reference-to-commands/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mixing JQuery Lightbox with Innerfade &#8211; Your own JQuery Slideshow album</title>
		<link>http://www.madanrevoor.com/mixing-jquery-lightbox-with-innerfade-your-own-jquery-slideshow-album</link>
		<comments>http://www.madanrevoor.com/mixing-jquery-lightbox-with-innerfade-your-own-jquery-slideshow-album#comments</comments>
		<pubDate>Fri, 27 Feb 2009 09:38:28 +0000</pubDate>
		<dc:creator>Madan Revoor</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/madanrev/public_html/wp-content/plugins/autometa/autometa.php</b> on line <b>300</b><br />
		<category><![CDATA[Web Designing]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.madanrevoor.com/?p=87</guid>
		<description><![CDATA[Did you ever know how simple is it to make a slideshow photo album of your own with JQuery? I tried one by mixing JQuery Lightbox plugin with Innerfade. Some of the best things in life are free and this one&#8217;s simple too!
Here goes the code:
Step 1: Download lightbox and innerfade. Place the &#8220;jquery.lightbox-0.5.js&#8221; and [...]]]></description>
			<content:encoded><![CDATA[<p>Did you ever know how simple is it to make a slideshow photo album of your own with JQuery? I tried one by mixing JQuery Lightbox plugin with Innerfade. Some of the best things in life are free and this one&#8217;s simple too!</p>
<p>Here goes the code:</p>
<p>Step 1: Download lightbox and innerfade. Place the &#8220;jquery.lightbox-0.5.js&#8221; and &#8220;jquery.innerfade.js&#8221; script files into your &#8220;js&#8221; folder along with other files like &#8220;jquery-1.3.1.js&#8221;.</p>
<p>Step 2: Copy the CSS stylesheet for lightbox into your &#8216;css&#8217; folder or in the default theme directory, if you are using WordPress. In WordPress, you shall find the default theme stylesheet, &#8217;style.css&#8217; file at this location.</p>
<p>Step 3: Create the html file for your album. Name it like &#8216;album.html&#8217;. Include the JQuery, lightbox and innerfade script files and any other required stylesheet files as shown below:</p>
<pre name="code" class="c">
&lt;html&gt;
&lt;head&gt;

&lt;link rel="stylesheet" type="text/css" href="css/jquery.lightbox-0.5.css" media="screen" /&gt;

&lt;script type="text/javascript" src="js/jquery.js"&gt;&lt;/script&gt;
 &lt;script type="text/javascript" src="js/jquery.innerfade.js"&gt;&lt;/script&gt;
 &lt;script type="text/javascript" src="js/jquery.lightbox-0.5.js"&gt;&lt;/script&gt;
</pre>
<p>Step 4:  Create your own script file for the album as &#8216;album.js&#8217;. You must include it in your &#8216;album.html&#8217; file as shown below:</p>
<pre name="code" class="js">
&lt;html&gt;
&lt;head&gt;

&lt;link rel="stylesheet" type="text/css" href="css/jquery.lightbox-0.5.css" media="screen" /&gt;

&lt;script type="text/javascript" src="js/jquery.js"&gt;&lt;/script&gt;
 &lt;script type="text/javascript" src="js/jquery.innerfade.js"&gt;&lt;/script&gt;
 &lt;script type="text/javascript" src="js/jquery.lightbox-0.5.js"&gt;&lt;/script&gt;
<b>&lt;script type="text/javascript" src="js/album.js"&gt;&lt;/script&gt;</b>
</pre>
<p>Step 5: Place the following code into your &#8216;album.js&#8217; file to set up the JQuery calls that need to be invoked on page load.</p>
<pre name="code" class="js">
$(document).ready(
	function(){
		$('#images').innerfade({
		animationtype: 'slide',  //You can change it to 'fade' to
//create a fade animation in your slideshow
		speed: 750,
		timeout: 2000,
		type: 'sequence',
		containerheight: '75px'
	});

	$('#gallery a').lightBox();
});
</pre>
<p>The above code defines the options for innerfade like the speed of image swap and animation type. It is important to note that there are two div layers with id=&#8221;gallery&#8221; and &#8220;images&#8221;. We apply the lightbox effect to the gallery while invoking the innerfade effect on the images. Don&#8217;t worry if its confusing. You will understand it better after we see the next step.</p>
<p>Step 6: Add the following stylesheet code into your default &#8217;style.css&#8217; file. Or you can create your custom &#8216;gallery.css&#8217; file and link it in the header section of your &#8216;album.html&#8217; file as follows:</p>
<pre name="code" class="css">
&lt;html&gt;
&lt;head&gt;

&lt;link rel="stylesheet" type="text/css" href="css/jquery.lightbox-0.5.css" media="screen" /&gt;
<b>&lt;link rel="stylesheet" type="text/css" href="css/gallery.css" media="screen" /&gt;</b>
&lt;script type="text/javascript" src="js/jquery.js"&gt;&lt;/script&gt;
 &lt;script type="text/javascript" src="js/jquery.innerfade.js"&gt;&lt;/script&gt;
 &lt;script type="text/javascript" src="js/jquery.lightbox-0.5.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="js/album.js"&gt;&lt;/script&gt;
</pre>
<p>The following code goes into the &#8216;gallery.css&#8217; file:</p>
<pre name="code" class="css">
#gallery {	}
#gallery ul { list-style: none; }
#gallery ul li { display: inline; }
#gallery ul img {
	border: 0px;
}
#gallery ul a:hover img {
		color: #fff;
}
#gallery ul a:hover { color: #fff; }
</pre>
<p>Step 7: Add the following final piece of code to the body of your html file (album.html):</p>
<pre name="code" class="c">
&lt;div id="gallery"&gt;
    &lt;ul id="images"&gt;
      &lt;li&gt;&lt;a href="Winter.jpg" title="Winter"&gt;
     &lt;img src="Winter.jpg" width="150" height="150" alt="" /&gt;&lt;/a&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;a href="Sunset.jpg" title="Sunset"&gt;
      &lt;img src="Sunset.jpg" width="150" height="150" alt="" /&gt;&lt;/a&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;a href="Water lilies.jpg" title="Water Lilies"&gt;
    &lt;img src="Water lilies.jpg" width="150" height="150" alt="" /&gt;&lt;/a&gt;
    &lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;
</pre>
<p>The above piece of code creates two div layers. The gallery layer to which the lightbox effect shall be added and the images layer (in fact a ul element) to which the innerfade effect shall be applied to create an impression of a slideshow.</p>
<p>Take care to note where the images are stored. You must refer to the images correctly in the anchor elements.</p>
<p>Thats it! Your own album with slideshow effect is ready! If you click on the slideshow, you can view the images in full size with lightbox effect. Have fun!</p>
<p><b>Demo:  You can try a demo of the slideshow described <a href="wp-content/themes/madan/album.html">here</a>.</b></p>
]]></content:encoded>
			<wfw:commentRss>http://www.madanrevoor.com/mixing-jquery-lightbox-with-innerfade-your-own-jquery-slideshow-album/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Adding JQuery to WordPress &#8211; For your customized WordPress theme</title>
		<link>http://www.madanrevoor.com/adding-jquery-to-wordpress-for-your-customized-wordpress-theme</link>
		<comments>http://www.madanrevoor.com/adding-jquery-to-wordpress-for-your-customized-wordpress-theme#comments</comments>
		<pubDate>Thu, 26 Feb 2009 14:02:27 +0000</pubDate>
		<dc:creator>Madan Revoor</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/madanrev/public_html/wp-content/plugins/autometa/autometa.php</b> on line <b>300</b><br />
		<category><![CDATA[Web Designing]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.madanrevoor.com/?p=75</guid>
		<description><![CDATA[JQuery can be easily added to your WordPress theme. Irrespective of whether you use the default themes from WordPress or if you have customized an unique theme for your website, JQuery will help your website to stand out from the crowd.
I do not prefer to use the integrated WordPress JQuery plugins. In fact, I have [...]]]></description>
			<content:encoded><![CDATA[<p>JQuery can be easily added to your WordPress theme. Irrespective of whether you use the default themes from WordPress or if you have customized an unique theme for your website, JQuery will help your website to stand out from the crowd.</p>
<p>I do not prefer to use the integrated WordPress JQuery plugins. In fact, I have not tried them. I always love to add JQuery manually to my WordPress application.</p>
<p>Lets get our hands dirty by straight away jumping into the integration.</p>
<p>Step 1: Create a &#8216;js&#8217; folder under your WordPress theme directory.</p>
<p>Step 2: Save any of your JQuery stylesheets directly under the theme directory with your other theme stylesheets. One example would be the lightbox stylesheet file.</p>
<p>Step 3: Create a &#8216;images&#8217; folder under your WordPress theme directory. You may normally already have this directory. Place your JQuery related images under it. For example, the NEXT, PREV and CLOSE buttons of the lightbox plugin can be stored here.</p>
<p>Step 4: create a &#8216;your_theme_name.js&#8217; file which can be placed under the &#8216;js&#8217; folder created in step 1.</p>
<p>Sample contents of the js folder:</p>
<pre name="code" class="js">
jquery-1.3.1.js
jquery-lightbox-0.5.js
</pre>
<p>Step 5: Edit your header.php file in your theme directory to include the &#8216;your_theme_name.js&#8217; script file and all of your JQuery style sheets (for example the lightbox plugin css file). In this file, you can define the ready() function where JQuery calls can be added.</p>
<p>First, include the script file and stylesheet in your header.php</p>
<pre name="code" class="js">
.....
&lt;link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/jquery.lightbox-0.5.css" type="text/css" media="screen" /&gt;
&lt;script src="&lt;?php bloginfo('stylesheet_directory'); ?&gt;&lt;!-- /js/jquery-1.3.1.js" type="text/javascript"&gt;
.....
</pre>
<p>Next, modify the &#8216;your_theme_name.js&#8217; under the &#8216;js&#8217; folder to include your JQuery calls</p>
<pre name="code" class="js">
$(document).ready(function() {
.....
/* Sample code to show/hide a layer by clicking on a second layer */
$("#layer1").click(function () {
$("#layer2").show("slide", {}, 1000);
});
.....
}
</pre>
<p>Thats it! Now, can it be more easier than that?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.madanrevoor.com/adding-jquery-to-wordpress-for-your-customized-wordpress-theme/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>WordPress Plugins &#8211; Five most useful wordpress plugins for your website</title>
		<link>http://www.madanrevoor.com/wordpress-plugins-five-most-useful-wordpress-plugins-for-your-website</link>
		<comments>http://www.madanrevoor.com/wordpress-plugins-five-most-useful-wordpress-plugins-for-your-website#comments</comments>
		<pubDate>Fri, 20 Feb 2009 12:46:17 +0000</pubDate>
		<dc:creator>Madan Revoor</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/madanrev/public_html/wp-content/plugins/autometa/autometa.php</b> on line <b>300</b><br />
		<category><![CDATA[Web Designing]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.madanrevoor.com/?p=50</guid>
		<description><![CDATA[The best thing about wordpress is the ease of installing plugins to it. Plugins provide additional capability and features to your wordpress installation. There are so many plugins available freely that one may get confused as to what may be required immediately after a fresh installation of wordpress. Here, I list the five best plugins [...]]]></description>
			<content:encoded><![CDATA[<p>The best thing about wordpress is the ease of installing plugins to it. Plugins provide additional capability and features to your wordpress installation. There are so many plugins available freely that one may get confused as to what may be required immediately after a fresh installation of wordpress. Here, I list the five best plugins which I use on my website and find them to be quite handy.</p>
<ol>
<li><strong>WordPress Popular Posts</strong><br />
Did you notice the popular posts section on the left sidebar of my website? No wonder, almost every other blog site has it too. How do we end up to get the popular posts displayed on our sidebar? Simple, just install the <a href="http://rauru.com/wordpress-popular-posts/">wordpress popular posts</a> plugin. It is one of the most useful and simplest of all plugins that I have come across. It is sufficient to paste</p>
<blockquote><p>&lt; ?php get_mostpopular(); ? &gt;</p></blockquote>
<p>into your pages wherever you may wish to display the popular posts of your blog. Blog posts are rated based on both comments and views which can be controlled from the settings tab of your wordpress dashboard. You can also set the maximum number of entries to be displayed under it.</li>
<li><strong>Recent Posts</strong><br />
The second most useful plugin without doubt is the <a href="http://wordpress.org/extend/plugins/recent-posts/">recent posts plugin</a> which helps to display the most recent posts of your blog. This is important because when you make a fresh post, there may not be sufficient views or comments to list your latest post under the popular posts section. To handle such scenarios the recent posts plugin is necessary. It is quite simple to use and requires the following</p>
<blockquote><p>&lt; ?php php mdv_recent_comments();  ? &gt;</p></blockquote>
<p>to be pasted into your pages wherever you may wish to display the list of recent posts in your blog. You can pass arguments to it to restrict the entries under recent posts.</li>
<li><strong>WP-reCAPTCHA</strong><br />
This plugin helps to prevent spam in your comments by stopping spambots from messing around with your website. This plugin adds a neat box to your comment form with two different words in a distorted manner that the user shall need to fill in before submitting his comment. It requires an unique public and private key for each domain that you may control. The other advantages of using it can be read from <a href="http://www.blaenkdenum.com/wp-recaptcha/"> http://www.blaenkdenum.com/wp-recaptcha/</a></li>
<li><strong>Contact Form</strong><br />
The <a href="http://ideasilo.wordpress.com/2007/04/30/contact-form-7/">contact form plugin </a> supports creating multiple contact forms for your website in a simple manner. The contact forms can be created under the settings tab of your wordpress dashboard and included in your &#8216;Contact&#8217; pages. This is quite a useful plugin that I shall recommend to everyone.</li>
<li><strong>User Photo</strong><br />
The user photo plugin provides capability to wordpress to associate a photo with every user profile. All registered users can upload pictures and it can be customized easily to be displayed beside posts and comments. The plugin allows users to upload a picture and also creates a thumbnail for it. You can use it&#8217;s simple API to display the picture wherever you may wish to on your posts and beside comments.</li>
</ol>
<p>These are the five plugins that I setup immediately after installing wordpress for my website. Hope you will find this post helpful. What were you looking for immediately after installing wordpress? Don&#8217;t tell me you wanted an auto-bot plugin to write your first post! <img src='http://www.madanrevoor.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.madanrevoor.com/wordpress-plugins-five-most-useful-wordpress-plugins-for-your-website/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>How to swap two variables without a temp variable?</title>
		<link>http://www.madanrevoor.com/how-to-swap-two-variables-without-a-temp-variable</link>
		<comments>http://www.madanrevoor.com/how-to-swap-two-variables-without-a-temp-variable#comments</comments>
		<pubDate>Tue, 10 Feb 2009 07:59:44 +0000</pubDate>
		<dc:creator>Madan Revoor</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/madanrev/public_html/wp-content/plugins/autometa/autometa.php</b> on line <b>300</b><br />
		<category><![CDATA[C Programming]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.madanrevoor.com/?p=14</guid>
		<description><![CDATA[This was one of those weird questions that got popped at me during a recent recruitment process. I tried to attempt it using XOR logic which I had read at a c programming tutorial page. The XOR truth table is unique in the sense that when both inputs are opposite (i.e a=true/ON and b=false/OFF), then [...]]]></description>
			<content:encoded><![CDATA[<p>This was one of those weird questions that got popped at me during a recent recruitment process. I tried to attempt it using XOR logic which I had read at a c programming tutorial page. The XOR truth table is unique in the sense that when both inputs are opposite (i.e a=true/ON and b=false/OFF), then the output is true or ON. Otherwise, the output is false or OFF. </p>
<p>The truth table for XOR (Exclusive OR) is shown below:</p>
<div id="code">
<table border="1" cellpadding="5" cellspacing="15">
<tr>
<th>A</th>
<th>B</th>
<th>O/P</th>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>0</td>
</tr>
</table>
</div>
<p>The solution is as follows.</p>
<div id="code">
<code>Assume int a = 5; and int b = 3;</code>
</div>
<p>Now to swap them using XOR, one has to do the following</p>
<div id="code">
<code>a = a xor b;  // 5 ^ 3 = 6<br />
b = a xor b; // 6 ^ 3 = 5<br />
a = a xor b; //6 ^ 5 = 3</code>
</div>
<p>That&#8217;s it! we have swapped the two variables without using a temp variable. We saved resources when we could have easily wasted a few more bytes!  Now, there&#8217;s an other way to do it. Why would you need a XOR when you could do it with the common &#8216;+&#8217;? Well, I needed some assistance to figure out it was the same logic to do a swap with the common and more preferred additive &#8216;+&#8217; operator. Here is the solution.</p>
<div id="code">
<code>a = a + b;  //a = 8 (sum of the two variables)<br />
b = a - b; // b = 8 - 3 = 5<br />
a = a - b; //a = 8 - 5 = 3</code>
</div>
<p>Phew! At the end of it, I could not but wonder what weird questions get popped at you during an interview. Hope you enjoy your next one!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.madanrevoor.com/how-to-swap-two-variables-without-a-temp-variable/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install wordpress for your website?</title>
		<link>http://www.madanrevoor.com/how-to-install-wordpress-for-your-website</link>
		<comments>http://www.madanrevoor.com/how-to-install-wordpress-for-your-website#comments</comments>
		<pubDate>Fri, 06 Feb 2009 07:19:25 +0000</pubDate>
		<dc:creator>Madan Revoor</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/madanrev/public_html/wp-content/plugins/autometa/autometa.php</b> on line <b>300</b><br />
		<category><![CDATA[Web Designing]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.madanrevoor.com/?p=9</guid>
		<description><![CDATA[Installing wordpress on your website can be an easy thing if you understand how to setup the environment required for it correctly. Wordpress is dependent on MySQL, PHP and Apache. Assuming that you are working on Windows platform (WAMP &#8211; Windows, Apache, MySQL and PHP), this blog post shall help you to install Wordpress and [...]]]></description>
			<content:encoded><![CDATA[<p>Installing wordpress on your website can be an easy thing if you understand how to setup the environment required for it correctly. Wordpress is dependent on MySQL, PHP and Apache. Assuming that you are working on Windows platform (WAMP &#8211; Windows, Apache, MySQL and PHP), this blog post shall help you to install Wordpress and write your very own blog entry for the first time in a few minutes.</p>
<p>Step 1: Install Apache. Download Apache HTTP server application from <a href="http://httpd.apache.org/download.cgi">http://httpd.apache.org/download.cgi</a>. I always prefer to download the windows installer (MSI) and follow the step by step installation wizard. Just follow the default options and install it.</p>
<p>Step 2: Install MySQL. Download the MySQL community database server which is available for free download from <a href="http://www.mysql.com">http://www.mysql.com</a>. The exact link to follow is <a href="http://dev.mysql.com/downloads/mysql/5.1.html#win32">http://dev.mysql.com/downloads/mysql/5.1.html#win32</a>. Select the EXE download and follow the installation wizard by keeping to default options. It is alright to configure the MySQL database as a service that shall start automatically on every reboot. Otherwise, we may need to start it manually. You can test the MySQL installation by opening a command prompt and typing cd \Program Files\MySQL\MySQL Server 5.0\bin and executing &#8220;mysqld-nt.exe &#8211;console&#8221;. This shall start the MySQL server manually. We can open a client connection to test whether we installed the server correctly. we can do this by opning a command prompt and typing &#8220;mysql.exe -u root -p&#8221; and supplying it with the root password which was created during installation. If the client connects successfully, you can see the MySQL welcome message and then prompt. Go ahead and create a separate database for your blog. I create mine as &#8220;blog&#8221;. MySQL&gt; create database blog; use blog;</p>
<p>Step 3: Install PHP. PHP can be downloaded from <a href="http://www.php.net/downloads.php">http://www.php.net/downloads.php</a>. I always prefer to download the installer from the website. Follow the step by step PHP installation wizard. Be careful to select the MySQL extensions when installing. Wordpress will not work without the MySQL PHP extensions and it shall be a headache to do it again after you miss it for the first time.</p>
<p>Step 4: Follow the five minute guide &#8220;readme.html&#8221; from wordpress to set it up. Wordpress can be downloaded from <a href="http://wordpress.org">http://wordpress.org</a>. Extract the zip into your web server directory. For example into the /htdocs directory if you are using Apache HTTP server. Rename the wp-config-sample.php file as wp-config.php and fill it up with your correct connection details. My wp-config.php looks like the following:</p>
<p>// ** MySQL settings &#8211; You can get this info from your web host ** //<br />
/** The name of the database for WordPress */<br />
define(&#8217;DB_NAME&#8217;, &#8216;blog&#8217;);</p>
<p>/** MySQL database username */<br />
define(&#8217;DB_USER&#8217;, &#8216;root&#8217;);</p>
<p>/** MySQL database password */<br />
define(&#8217;DB_PASSWORD&#8217;, &#8216;password&#8217;);</p>
<p>/** MySQL hostname */<br />
define(&#8217;DB_HOST&#8217;, &#8216;localhost&#8217;);</p>
<p>Step 5: Open the /wp-admin/install.php file in your web browser typing the entire path as <a href="http://localhost:8080/wordpress/wp-admin/install.php">http://localhost:8080/wordpress/wp-admin/install.php</a>. This shall setup wordpress for you and generate a unique password for you. You can then open the wordpress dashboard page following the URL <a href="http://localhost:8080/wordpress/wp-admin/index.php">http://localhost:8080/wordpress/wp-admin/index.php</a>. The dashboard shall present a really simple UI for you to create your first blog post. Just type the content and click post it or update post. You can view your blog page from the URL <a href="http://localhost:8080/wordpress/">http://localhost:8080/wordpress/</a>.</p>
<p>In my next post, I plan to write about how wordpress can be customized to match the look and feel of your own website. For now, have fun downloading the default themes and playing around with them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.madanrevoor.com/how-to-install-wordpress-for-your-website/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Configuring Linksys WAG200G (Wireless ADSL Router) with BSNL broadband</title>
		<link>http://www.madanrevoor.com/configuring-linksys-wag200g-wireless-adsl-router-with-bsnl-broadband</link>
		<comments>http://www.madanrevoor.com/configuring-linksys-wag200g-wireless-adsl-router-with-bsnl-broadband#comments</comments>
		<pubDate>Fri, 06 Feb 2009 07:16:45 +0000</pubDate>
		<dc:creator>Madan Revoor</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/madanrev/public_html/wp-content/plugins/autometa/autometa.php</b> on line <b>300</b><br />
		<category><![CDATA[Router Configuration]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.madanrevoor.com/?p=3</guid>
		<description><![CDATA[Linksys WAG200G is a wireless ADSL gateway for home networks. This wireless router also boasts of an inbuilt ADSL modem and can directly connect to the telephone line. This tutorial shows how to configure your WAG200G modem with a BSNL dataone broadband connection.
This tutorial is split into two parts. One, to configure the router to [...]]]></description>
			<content:encoded><![CDATA[<p>Linksys WAG200G is a wireless ADSL gateway for home networks. This wireless router also boasts of an inbuilt ADSL modem and can directly connect to the telephone line. This tutorial shows how to configure your WAG200G modem with a BSNL dataone broadband connection.</p>
<p>This tutorial is split into two parts. One, to configure the router to connect with a BSNL dataone connection. Two, to configure an ubuntu client to connect with the router through a Netgear wireless USB adapter.</p>
<p>Part One &#8211; connecting with BSNL dataone</p>
<p>The first step would be to open a browser window and type &#8220;http://192.168.1.1&#8243; to access the web configuration page of the wireless router. The default username and password is admin/admin.</p>
<p><a class="lightbox" href="http://www.madanrevoor.com/wp-content/themes/madan/images/auth.jpg"><img src="http://www.madanrevoor.com/wp-content/themes/madan/images/auth.jpg" alt="authentication" width="450" height="350"/></a></p>
<p>The screenshot below depicts the basic settings that work for BSNL connections.</p>
<p><a class="lightbox" href="http://www.madanrevoor.com/wp-content/themes/madan/images/basic_setup.jpg"><img src="http://www.madanrevoor.com/wp-content/themes/madan/images/basic_setup.jpg" alt="Basic Setup for BSNL" width="450" height="350" /></a></p>
<p>The encapsulation needs to be set to PPP over Ethernet (PPPoE) and the Qos to unspecified bit rate (UBR). UBR is normally intended for non real-time applications that do not expect a maximum bound on the transfer delay. BSNL also expects a virtual circuit (channel) connection with VPI/VCI values of 0/35. The DSL Modulation can be set to Multimode.</p>
<p>The next step would be to configure the DNS settings. BSNL primary and secondary DNS IP addresses are 61.1.96.69 and 61.1.96.71. The new set of DNS on my connection appears to be  DNS1: 218.248.240.181 and DNS2: 218.248.240.180. You can try with any of them and use the one which works.</p>
<p><a class="lightbox" href="http://www.madanrevoor.com/wp-content/themes/madan/images/basic_setup2.jpg"/><img src="http://www.madanrevoor.com/wp-content/themes/madan/images/basic_setup2.jpg" alt="Basic Setup 2" width="450" height="350"/></a></p>
<p>The following screenshot shows the wireless configurations to enable wireless clients to connect with the router. Please note that the SSID can be an alphanumeric of any value that you prefer to name your home wireless network.</p>
<p><a class="lightbox" href="http://www.madanrevoor.com/wp-content/themes/madan/images/basic_wireless.jpg"><img id="config_img" src="http://www.madanrevoor.com/wp-content/themes/madan/images/basic_wireless.jpg" alt="Basic wireless setup" width="450" height="350"/></a></p>
<p>It is important to secure your wireless network and the preferred security mode is WPA-Personal (Wi-Fi Protected Access) standard that was created to overcome several shortcomings of the earlier WEP (wired equivalent privacy) standard. The WPA standard is based on TKIP (Temporal Key Integrity Protocol) algorithm that secures the wireless network with a passphrase. Please enter an alphanumeric that you prefer the TKIP to make use of, in securing the wireless network. This passphrase shall be required for authentication purposes when accessing your home wireless network.</p>
<p><a class="lightbox" href="http://www.madanrevoor.com/wp-content/themes/madan/images/wireless_security.jpg"><img id="config_img" src="http://www.madanrevoor.com/wp-content/themes/madan/images/wireless_security.jpg" alt="Wireless Security Settings" width="450" height="350"/></a></p>
<p>The following four screenshots depict the ADSL connection status after the above the configurations are made. If the configurations are successful, the DSL connection status screenshot shows the DSL status as &#8220;connected&#8221;. Please note that these setting shall vary with your ISP and the above configurations are recommended only for BSNL ADSL connections.</p>
<p><a class="lightbox" href="http://www.madanrevoor.com/wp-content/themes/madan/images/gateway_status.jpg"><img id="config_img" src="http://www.madanrevoor.com/wp-content/themes/madan/images/gateway_status.jpg" alt="Gateway status" width="450" height="350"/></a></p>
<p><a class="lightbox" href="http://www.madanrevoor.com/wp-content/themes/madan/images/localnetwork_status.jpg"><img id="config_img" src="http://www.madanrevoor.com/wp-content/themes/madan/images/localnetwork_status.jpg" alt="Local Network Status" width="450" height="350"/></a></p>
<p><a class="lightbox" href="http://www.madanrevoor.com/wp-content/themes/madan/images/wireless_status.jpg"><img id="config_img" src="http://www.madanrevoor.com/wp-content/themes/madan/images/wireless_status.jpg" alt="Wireless Network Status" width="450" height="350"/></a></p>
<p><<a class="lightbox" href="http://www.madanrevoor.com/wp-content/themes/madan/images/dslconn_status.jpg"><img id="config_img" src="http://www.madanrevoor.com/wp-content/themes/madan/images/dslconn_status.jpg" alt="DSL Connection Status" width="450" height="350"/></a></p>
<p>Hope you enjoyed configuring your BSNL connection for wireless access!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.madanrevoor.com/configuring-linksys-wag200g-wireless-adsl-router-with-bsnl-broadband/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>
