<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>777</title>
	<atom:link href="http://amardeka.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://amardeka.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Sun, 16 Aug 2009 16:42:34 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='amardeka.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/8d9650216d5c6ba562daa5f7660a0c55?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>777</title>
		<link>http://amardeka.wordpress.com</link>
	</image>
			<item>
		<title>Viewing contents of an rpm package</title>
		<link>http://amardeka.wordpress.com/2009/08/16/viewing-contents-of-an-rpm-package/</link>
		<comments>http://amardeka.wordpress.com/2009/08/16/viewing-contents-of-an-rpm-package/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 16:42:34 +0000</pubDate>
		<dc:creator>amardeka</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://amardeka.wordpress.com/?p=90</guid>
		<description><![CDATA[rpm2cpio [package.rpm] &#124;cpio -dvim
it should extract the archive in the current directory
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amardeka.wordpress.com&blog=1558984&post=90&subd=amardeka&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>rpm2cpio [package.rpm] |cpio -dvim</p>
<p>it should extract the archive in the current directory</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amardeka.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amardeka.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amardeka.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amardeka.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amardeka.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amardeka.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amardeka.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amardeka.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amardeka.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amardeka.wordpress.com/90/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amardeka.wordpress.com&blog=1558984&post=90&subd=amardeka&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://amardeka.wordpress.com/2009/08/16/viewing-contents-of-an-rpm-package/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9b451e2201006ef08fb350c8d1ff52f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amardeka</media:title>
		</media:content>
	</item>
		<item>
		<title>Control LCD brightness in Fedora8</title>
		<link>http://amardeka.wordpress.com/2009/08/16/control-lcd-brightness-in-fedora8/</link>
		<comments>http://amardeka.wordpress.com/2009/08/16/control-lcd-brightness-in-fedora8/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 14:30:37 +0000</pubDate>
		<dc:creator>amardeka</dc:creator>
				<category><![CDATA[Fedora8]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://amardeka.wordpress.com/?p=87</guid>
		<description><![CDATA[xbacklight is an useful command to change the brightness of your monitor backlight provided you have a supported driver.
xbacklight -get
to retrieve to get present brightness level in %
xbacklight -set value
to set the brightness to desired value in %
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amardeka.wordpress.com&blog=1558984&post=87&subd=amardeka&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>xbacklight is an useful command to change the brightness of your monitor backlight provided you have a supported driver.</p>
<p>xbacklight -get<br />
to retrieve to get present brightness level in %</p>
<p>xbacklight -set value</p>
<p>to set the brightness to desired value in %</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amardeka.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amardeka.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amardeka.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amardeka.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amardeka.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amardeka.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amardeka.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amardeka.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amardeka.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amardeka.wordpress.com/87/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amardeka.wordpress.com&blog=1558984&post=87&subd=amardeka&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://amardeka.wordpress.com/2009/08/16/control-lcd-brightness-in-fedora8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9b451e2201006ef08fb350c8d1ff52f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amardeka</media:title>
		</media:content>
	</item>
		<item>
		<title>Working from home</title>
		<link>http://amardeka.wordpress.com/2008/10/01/working-from-home/</link>
		<comments>http://amardeka.wordpress.com/2008/10/01/working-from-home/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 14:34:24 +0000</pubDate>
		<dc:creator>amardeka</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://amardeka.wordpress.com/?p=78</guid>
		<description><![CDATA[Most of the time I need to login to my linux box in my office from home. The obvious choice is to ssh using putty or cygwin (in case i need some X windows). Normally in cygwin &#8211; you will run
ssh -l xyz@yourserver.com &#8230;&#8230;&#8230;(1)
to login to your account &#8220;xyz&#8221; in yourserver.com . This would ask [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amardeka.wordpress.com&blog=1558984&post=78&subd=amardeka&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Most of the time I need to login to my linux box in my office from home. The obvious choice is to ssh using putty or cygwin (in case i need some X windows). Normally in cygwin &#8211; you will run</p>
<blockquote><p>ssh -l xyz@yourserver.com &#8230;&#8230;&#8230;(1)</p></blockquote>
<p>to login to your account &#8220;xyz&#8221; in yourserver.com . This would ask for password and if you provide the correct password you would be able to login to the server.</p>
<p>SSH optionally uses public-key encryption &#8211; where a  public and private key pair can be used to automate the login process. If you are using cygwin( or in fact any other client running ssh) you can do the following to generate your public and private key pair</p>
<blockquote><p>ssh-keygen&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..(2)</p></blockquote>
<p>It will prompt for a few input &#8211; but you can just press &#8216;enter&#8217; in all the cases. The keys will be created in $HOME/.ssh/as id_rsa(private key) and id_rsa.pub(public key). Now you can copy the id_rsa.pub to the server -yourserver.com&#8217;s &#8216;xyz&#8217;s ~/.ssh/ as &#8216;authorized_keys&#8217; &#8211; and you are done. Try running (1) and you should be able to login without the prompt for password.</p>
<p>In case you are using putty &#8211; you can use puttygen to generate the public  &amp; private key pair. Then you will do the same step &#8211; copy the public key to the desired account&#8217;s .ssh/authorized_keys and use the private key to login. There are <a href="http://ask-leo.com/d-putty">tutorials</a> that explains this with nice diagrams .</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amardeka.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amardeka.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amardeka.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amardeka.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amardeka.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amardeka.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amardeka.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amardeka.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amardeka.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amardeka.wordpress.com/78/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amardeka.wordpress.com&blog=1558984&post=78&subd=amardeka&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://amardeka.wordpress.com/2008/10/01/working-from-home/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9b451e2201006ef08fb350c8d1ff52f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amardeka</media:title>
		</media:content>
	</item>
		<item>
		<title>Rescued by cscope</title>
		<link>http://amardeka.wordpress.com/2008/06/17/rescued-by-cscope/</link>
		<comments>http://amardeka.wordpress.com/2008/06/17/rescued-by-cscope/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 02:41:11 +0000</pubDate>
		<dc:creator>amardeka</dc:creator>
				<category><![CDATA[Free Software]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://amardeka.wordpress.com/?p=39</guid>
		<description><![CDATA[code searching using cscope. Its simple easy ...............<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amardeka.wordpress.com&blog=1558984&post=39&subd=amardeka&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I have been working on mozilla codebase quite sometime. Its a huge codebase with millions of lines of code. A simple counting on the numbers of lines in *.cpp files for 3.0b2 release accounts  1778818 lines of code[1]. Most of the time I need to search for function definitions &#8211; I used grep -r xyz * as that was the only option I know until recently I have started using <a title="cscope" href="http://cscope.sourceforge.net/">cscope</a> which came as a rescue. cscope maintains its own database of symbol definition of the code. You can find the symbol, find a symbol definition, a file , a text within source code. Configuration of the cscope database is simple.</p>
<blockquote><p><em>Step 1 .</em> Make a directory to store the cscope db say  $HOME/mycscope/mozilla</p>
<p><em>Step 2.</em> cd /</p>
<p><em>Step 3.</em> say $HOME/mozilla is the home directory of the project that contains the source files(*.c,*.cpp,*.h)</p>
<p>run      find $HOME/mozilla -name &#8220;*.cpp&#8221; &gt;&gt; $HOME/mycscope/mozilla/cscope.files</p>
<p>run      find $HOME/mozilla -name &#8220;*.h&#8221; &gt;&gt; $HOME/mycscope/mozilla/cscope.files etc.</p>
<p>It will simply populate the cscope.files used by cscope to create the data with the desired filenames.</p>
<p><em>Step 4.</em> run in $HOME/mycscope    cscope -b -q -k   which will create the database cscope.out</p>
<p><em>Step 5.</em> run cscope -d from $HOME/myscope and start searching and browsing code.</p></blockquote>
<p>In case you want to invoke it from vim add the following lines to your .vimrc</p>
<blockquote><p>set nocsverb   ; supress cscope logging messages<br />
cscope add $HOME/mycscope/cscope.out</p></blockquote>
<p>You should be able to invoke cscope from vim window now . eg try :cs find 1 XYZ</p>
<p>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</p>
<p>1. sum=0;for i in `find . -name &#8220;*.cpp&#8221; -exec wc -l {} \; |cut -d &#8216; &#8216; -f 1` ; do  sum=`expr $sum + $i`; done; echo $sum</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/amardeka.wordpress.com/39/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/amardeka.wordpress.com/39/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amardeka.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amardeka.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amardeka.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amardeka.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amardeka.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amardeka.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amardeka.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amardeka.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amardeka.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amardeka.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amardeka.wordpress.com&blog=1558984&post=39&subd=amardeka&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://amardeka.wordpress.com/2008/06/17/rescued-by-cscope/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9b451e2201006ef08fb350c8d1ff52f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amardeka</media:title>
		</media:content>
	</item>
		<item>
		<title>Copyright Vs Community w/ Richard Stallman</title>
		<link>http://amardeka.wordpress.com/2008/03/26/copyright-vs-community-w-richard-stallman/</link>
		<comments>http://amardeka.wordpress.com/2008/03/26/copyright-vs-community-w-richard-stallman/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 03:48:35 +0000</pubDate>
		<dc:creator>amardeka</dc:creator>
				<category><![CDATA[Free Software]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://amardeka.wordpress.com/?p=37</guid>
		<description><![CDATA[Just got a chance to attend a seminar on Copyright Vs Community by Richard Stallman 
I hope most of you are aware of this guy who pioneered the free software movement .
coined the term GNU is not UNIX , developed the most popular gcc compiler and emacs editors .

Free software movement started in early eighties [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amardeka.wordpress.com&blog=1558984&post=37&subd=amardeka&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">Just got a chance to attend a seminar on Copyright Vs Community by <a href="http://en.wikipedia.org/wiki/Richard_Stallman">Richard Stallman </a><br />
I hope most of you are aware of this guy who pioneered the free software movement .<br />
coined the term GNU is not UNIX , developed the most popular gcc compiler and emacs editors .</p>
<p align="left"><a title="Stallman" href="http://amardeka.files.wordpress.com/2008/03/stallman.png"><img class="alignleft" style="border:2px solid black;margin:4px;" src="http://amardeka.files.wordpress.com/2008/03/stallman.thumbnail.png?w=100&#038;h=100" alt="Stallman" width="100" height="100" /></a></p>
<p>Free software movement started in early eighties and by now its just as a dominant<br />
race as the non-free softwares . Freedom is our right and proprietary softwares just<br />
donot respect individual freedom . People are entitled to use only the way developer<br />
design that software &#8211; there is no freedom to customize it to their need because the<br />
source codes were not available. Stallman defined four degrees of freedom for a software<br />
to be called a free software -<br />
0 &#8211; they should be available freely for use \<br />
1 &#8211; source code should be available for customized by the user<br />
2 &#8211; user can distribute the custom software freely<br />
3 &#8211; user can make as many copy of the software as he wants freely .</p>
<p>After this brief introduction he moved to the constraints that hinders the freedom of the users<br />
Here comes the theme of the lecture . He mentioned how the copyright laws came into existence and how they<br />
are helping the corporates to make money and comprising on the freedom of individual in a democratic society.<br />
Example ranging from books to digital music got mention in his talk .<br />
One example that worth mentioning is the music CDs prepared by Sony . Sony hides a copyright management<br />
software in their music disks that runs automatically and  and modifies some of the system parameters permanently so that<br />
the software remains hidden from the user and prevent user from making copy of the music.<br />
This caused a permanent security loophole in the system and computers became vulnerable to attacks.<br />
<a href="http://www.computerworld.com/securitytopics/security/story/0,10801,108793,00.html">Sony was finally forced to recall million of its CDs . </a></p>
<p>I personally feel that copyright should be there &#8211; but I believe this should not be the same way as they<br />
are today . And when it comes to different category of copyright able subjects they<br />
should be treated differently.He mentioned some innovative way publishers are making money<br />
without sharing much of the revenue with the author or the composer. Stallman mentioned that books , musics<br />
etc are subjected to a limited  copyright. In case of softwares , he insisted that their non commercial use<br />
should be free and the above four freedom should exists in the software world to help maintaining a democratic society.</p>
<p>He finally urge everyone to stand against the wave and support the freedom of software .<br />
If you would like to participate in the movement <a href="http://defectivebydesign.org/%20sites%20has%20been">here</a> is a good point to start .</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/amardeka.wordpress.com/37/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/amardeka.wordpress.com/37/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amardeka.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amardeka.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amardeka.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amardeka.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amardeka.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amardeka.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amardeka.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amardeka.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amardeka.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amardeka.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amardeka.wordpress.com&blog=1558984&post=37&subd=amardeka&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://amardeka.wordpress.com/2008/03/26/copyright-vs-community-w-richard-stallman/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9b451e2201006ef08fb350c8d1ff52f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amardeka</media:title>
		</media:content>

		<media:content url="http://amardeka.files.wordpress.com/2008/03/stallman.thumbnail.png" medium="image">
			<media:title type="html">Stallman</media:title>
		</media:content>
	</item>
		<item>
		<title>My .vimrc</title>
		<link>http://amardeka.wordpress.com/2008/01/18/my-vimrc/</link>
		<comments>http://amardeka.wordpress.com/2008/01/18/my-vimrc/#comments</comments>
		<pubDate>Fri, 18 Jan 2008 04:58:38 +0000</pubDate>
		<dc:creator>amardeka</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://amardeka.wordpress.com/2008/01/18/my-vimrc/</guid>
		<description><![CDATA[For those who are writing codes in C/C++ using Vim should find this .vimrc configuration file useful .  The script should be self explanatory . If you have any question, I will try to answer. or  :help should help you out. Put the following lines to your  .vimrc and save .
set incsearch [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amardeka.wordpress.com&blog=1558984&post=36&subd=amardeka&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>For those who are writing codes in C/C++ using Vim should find this .vimrc configuration file useful .  The script should be self explanatory . If you have any question, I will try to answer. or  <i>:help </i>should help you out. Put the following lines to your  .vimrc and save .</p>
<blockquote><p><font color="#0000ff">set incsearch &#8220;when you start searching ESC /[string] it will start matching as soon as you type</font></p>
<p><font color="#0000ff">set scrolloff=3  &#8221; there would be atleast 3 lines from the top/bottom of the screen as you edit</font></p>
<p><font color="#0000ff">set wildmode=longest,list  &#8221; ESC :![filename] TAB should give you a list of matched files</font></p>
<p><font color="#0000ff">set ts=2    &#8221; TAB would be of two char length</font></p>
<p><font color="#0000ff">set expandtab  &#8220;expand TAB char to spaces<br />
</font></p>
<p><font color="#0000ff">set ai            &#8221; set auto indent</font></p>
<p><font color="#0000ff">set cindent shiftwidth=4  &#8220;enable C style indent</font></p>
<p><font color="#0000ff">set ignorecase</font></p>
<p><font color="#0000ff">set smartcase &#8221; together they help you search string ignoring case if you type in lower case</font></p>
<p><font color="#0000ff">colo evening   &#8221; if you like a colorful editing experience </font></p>
<p><font color="#0000ff"> </font></p></blockquote>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/amardeka.wordpress.com/36/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/amardeka.wordpress.com/36/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amardeka.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amardeka.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amardeka.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amardeka.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amardeka.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amardeka.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amardeka.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amardeka.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amardeka.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amardeka.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amardeka.wordpress.com&blog=1558984&post=36&subd=amardeka&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://amardeka.wordpress.com/2008/01/18/my-vimrc/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9b451e2201006ef08fb350c8d1ff52f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amardeka</media:title>
		</media:content>
	</item>
		<item>
		<title>Fade up of Vista ? Wait !!</title>
		<link>http://amardeka.wordpress.com/2008/01/08/fade-up-of-vista-wait/</link>
		<comments>http://amardeka.wordpress.com/2008/01/08/fade-up-of-vista-wait/#comments</comments>
		<pubDate>Tue, 08 Jan 2008 00:08:31 +0000</pubDate>
		<dc:creator>amardeka</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://amardeka.wordpress.com/2008/01/08/fade-up-of-vista-wait/</guid>
		<description><![CDATA[Many people do not like Vista for a lot of  reasons. I personally donot like it because I can no longer use my favorite softwares that runs in XP due to compatibility issues. Initially I thought I would just install Windows XP over Vista. But again I had some issues with the drivers for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amardeka.wordpress.com&blog=1558984&post=34&subd=amardeka&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Many people do not like Vista for a lot of  reasons. I personally donot like it because I can no longer use my favorite softwares that runs in XP due to compatibility issues. Initially I thought I would just install Windows XP over Vista. But again I had some issues with the drivers for my laptops &#8211; they are just made for Vista it seems. Finally I found a turnaround.</p>
<p>Microsoft thankfully provides a virtual desktop environment called <a href="http://www.microsoft.com/windows/products/winfamily/virtualpc/default.mspx">Virtual PC</a>. You can use it as a virtual machine in  most  of the Vista Versions and install Windows XP and other Windows OS on it.</p>
<p>Details on how to set up the Virtual PC on your machine can be found in this <a href="http://lifehacker.com/software/virtual-pc/download-of-the-day--microsoft-virtual-pc-2007-windows-238059.php">link. </a></p>
<p>I am currently  using  it and found it powerful and fast enough for my programming stuff.</p>
<p><a href="http://amardeka.files.wordpress.com/2008/01/vpc.jpg" title="Virtual PC on Vista"><img src="http://amardeka.files.wordpress.com/2008/01/vpc.jpg" alt="Virtual PC on Vista" /></a></p>
<p>It comes FREE of cost.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/amardeka.wordpress.com/34/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/amardeka.wordpress.com/34/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amardeka.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amardeka.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amardeka.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amardeka.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amardeka.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amardeka.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amardeka.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amardeka.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amardeka.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amardeka.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amardeka.wordpress.com&blog=1558984&post=34&subd=amardeka&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://amardeka.wordpress.com/2008/01/08/fade-up-of-vista-wait/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9b451e2201006ef08fb350c8d1ff52f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amardeka</media:title>
		</media:content>

		<media:content url="http://amardeka.files.wordpress.com/2008/01/vpc.jpg" medium="image">
			<media:title type="html">Virtual PC on Vista</media:title>
		</media:content>
	</item>
		<item>
		<title>One Laptop Per Child</title>
		<link>http://amardeka.wordpress.com/2007/10/09/one-laptop-per-child/</link>
		<comments>http://amardeka.wordpress.com/2007/10/09/one-laptop-per-child/#comments</comments>
		<pubDate>Tue, 09 Oct 2007 04:16:19 +0000</pubDate>
		<dc:creator>amardeka</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://amardeka.wordpress.com/2007/10/09/one-laptop-per-child/</guid>
		<description><![CDATA[
A $100 laptop – with a tablet screen, video camera, microphone, a graphics tablet, game-pad controllers, and a memory-card slot ? Yes, this is the dream of One Laptop Per Child    to develop a very low-cost, high-potential, extremely rugged computer for the two billion educationally underserved children in poor countries. And the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amardeka.wordpress.com&blog=1558984&post=30&subd=amardeka&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p class="MsoNormal"><a href="http://amardeka.files.wordpress.com/2007/10/xo11.jpg" title="xo11.jpg"><img src="http://amardeka.files.wordpress.com/2007/10/xo11.jpg" alt="xo11.jpg" /></a></p>
<p class="MsoNormal">A $100 laptop – with <span class="bodytext">a tablet screen, video camera, microphone, a graphics tablet, game-pad controllers, and a memory-card slot ? Yes, </span>this is the dream of <a href="http://www.laptop.org">One Laptop Per Child </a><span>   </span>to develop a very low-cost, high-potential, extremely rugged computer for the two billion educationally underserved children in poor countries. And the dream comes true OLPC unveiled their dream machine XO in October.</p>
<p class="MsoNormal">&nbsp;</p>
<p><a href="http://amardeka.files.wordpress.com/2007/10/xo2.jpg" title="xo2.jpg"><img src="http://amardeka.files.wordpress.com/2007/10/xo2.jpg" alt="xo2.jpg" /></a></p>
<p class="MsoNormal" align="left"><span class="bodytext">XO provides regular wireless Internet connectivity as well as mesh networking, and its system software takes up one-fifth of its 1 GB of flash memory storage. The majority of the laptop&#8217;s programs can be shared on the mesh network it supports. The XO comes close to the initiative&#8217;s original vision of a $100 laptop (it currently costs $200 ) and in November the computer will be offered for sale to the public in industrialized countries for two weeks through OLPC&#8217;s <a href="http://www.xogiving.org/">&#8220;Get 1, Give 1&#8243;</a> program. Under the program, a consumer pays $400, which covers the cost of one XO laptop&#8211;complete with tax deduction&#8211;for the consumer and one for a student in an impoverished country. One more reason to be happy &#8211; XO is built from free and open-source software.</span></p>
<p class="MsoNormal" align="left"> Configuration : (Details can be found <a href="http://www.laptop.org/laptop/hardware/specs.shtml">here</a> )</p>
<ul>
<li>Approximate dimensions: 242mm×228mm×32mm;</li>
<li>Approximate weight: 1.45KG with LiFeP battery; 1.58KG with NiMH battery;</li>
<li>Configuration: Convertible laptop with pivoting, reversible display; dirt- and moisture-resistant system enclosure; no fan.</li>
<li>CPU: 433 Mhz AMD Geode LX-700@0.8W CPU</li>
<li>Memory: 256 MiB DRAM</li>
<li>Storage: 1 GB SLC NAND flash ;MMC/SD Card slot available</li>
<li>Battery: : 2 or 4 cells LiFePO4; or 5 cells NiMH .</li>
<li>Average Power Consumption : 2 watts, compared with 60 or more on a typical business laptop. That’s one reason it gets such great battery life. A small yo-yo-like pull-cord charger is available (one minute of pulling provides 10 minutes of power); so is a $12 solar panel that, although only one foot square, provides enough power to recharge or power the machine.</li>
</ul>
<p class="MsoNormal">&nbsp;</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/amardeka.wordpress.com/30/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/amardeka.wordpress.com/30/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amardeka.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amardeka.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amardeka.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amardeka.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amardeka.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amardeka.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amardeka.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amardeka.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amardeka.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amardeka.wordpress.com/30/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amardeka.wordpress.com&blog=1558984&post=30&subd=amardeka&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://amardeka.wordpress.com/2007/10/09/one-laptop-per-child/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9b451e2201006ef08fb350c8d1ff52f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amardeka</media:title>
		</media:content>

		<media:content url="http://amardeka.files.wordpress.com/2007/10/xo11.jpg" medium="image">
			<media:title type="html">xo11.jpg</media:title>
		</media:content>

		<media:content url="http://amardeka.files.wordpress.com/2007/10/xo2.jpg" medium="image">
			<media:title type="html">xo2.jpg</media:title>
		</media:content>
	</item>
		<item>
		<title>Open Source North East &#8211; An Initiative</title>
		<link>http://amardeka.wordpress.com/2007/10/05/open-source-north-east-an-initiative/</link>
		<comments>http://amardeka.wordpress.com/2007/10/05/open-source-north-east-an-initiative/#comments</comments>
		<pubDate>Fri, 05 Oct 2007 03:05:18 +0000</pubDate>
		<dc:creator>amardeka</dc:creator>
				<category><![CDATA[Assam]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://amardeka.wordpress.com/2007/10/05/open-source-north-east-an-initiative/</guid>
		<description><![CDATA[&#8220;Open Source Northeast&#8221; is one more initiative from Prag Foundation. This is supposed to be the first magazine from NE india promoting Open Source for development of North Eastern States. The theme is very novel. The founders are very much motivated to share the benefits of Free and Open Source Software (FOSS) in building Information [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amardeka.wordpress.com&blog=1558984&post=28&subd=amardeka&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>&#8220;Open Source Northeast&#8221; is one more initiative from <a href="http://pragfoundation.net ">Prag Foundation</a>. This is supposed to be the first magazine from NE india promoting Open Source for development of North Eastern States. The theme is very novel. The founders are very much motivated to share the benefits of Free and Open Source Software (FOSS) in building Information Communication Technology (ICT) capability for development and success in today&#8217;s emerging Knowledge Society.</p>
<p><a href="http://www.myopensource.in/osne/Issue-1.pdf"><img src="http://amardeka.files.wordpress.com/2007/10/os.jpg" alt="Open Source NorthEast" /></a><br />
Volume-I of the magazine covers a few interesting topics such as  Open Access and Open Course Ware. You will find links to various organization, especially the universities,  that houses various courses online and free for all. In India ,a similar kind of initiative is taking place in IIT Bombay (http://www.dep.iitb.ac.in/). I think there will be much more information about open course ware in the coming issues of the magazine.</p>
<p>If you want to buy a PC for yourself here are the tips for you in the Know How section. A good review of OpenOffice is also in place as per the software reviewed in this issue.</p>
<p>I feel Open Source Northeast is a good start. Contents are good and well written except for some occasional typos. There are lot more scope to improve the current layout  to create better look and feel experience.</p>
<p>For all those interested to read out the mag should find a soft copy <a href="http://www.myopensource.in/osne/Issue-1.pdf">here</a>. And please dont forget to leave your comments to editor. !</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/amardeka.wordpress.com/28/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/amardeka.wordpress.com/28/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amardeka.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amardeka.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amardeka.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amardeka.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amardeka.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amardeka.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amardeka.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amardeka.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amardeka.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amardeka.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amardeka.wordpress.com&blog=1558984&post=28&subd=amardeka&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://amardeka.wordpress.com/2007/10/05/open-source-north-east-an-initiative/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9b451e2201006ef08fb350c8d1ff52f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amardeka</media:title>
		</media:content>

		<media:content url="http://amardeka.files.wordpress.com/2007/10/os.jpg" medium="image">
			<media:title type="html">Open Source NorthEast</media:title>
		</media:content>
	</item>
		<item>
		<title>Feature Oriented Programming -II</title>
		<link>http://amardeka.wordpress.com/2007/10/02/feature-oriented-programming-ii/</link>
		<comments>http://amardeka.wordpress.com/2007/10/02/feature-oriented-programming-ii/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 03:30:49 +0000</pubDate>
		<dc:creator>amardeka</dc:creator>
				<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://amardeka.wordpress.com/2007/10/02/feature-oriented-programming-ii/</guid>
		<description><![CDATA[    AHEAD, as discussed in the previous article defines the following tasks for generating complete software from features. .  
A. define numbers of features
B. semantics to create an algebraic equation from features (feature refinement)
C. define a composer to compose the final feature out of the equation and produce the final software [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amardeka.wordpress.com&blog=1558984&post=26&subd=amardeka&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p class="MsoNormal" style="text-align:justify;">    AHEAD, as discussed in the <a href="http://amardeka.wordpress.com/2007/09/16/feature-oriented-programming-i/" title="FOP-I">previous article</a> defines the following tasks for generating complete software from features. . <span> </span></p>
<p class="MsoNormal" style="text-align:justify;">A. define numbers of features</p>
<p class="MsoNormal" style="text-align:justify;">B. semantics to create an algebraic equation from features (feature refinement)</p>
<p class="MsoNormal" style="text-align:justify;">C. define a composer to compose the final feature out of the equation and produce the final software (assuming composer performs the final compilation)</p>
<p class="MsoNormal" style="text-align:justify;"> <span>         </span>This approach requires the selection of different features available to be specified in compile time. Every new refinement would require step B and C to be repeated.</p>
<p class="MsoNormal" style="text-align:justify;"> <span>          </span>The purpose of this <em>short</em> article is to show a different FOP approach where feature selection happens in runtime. In this approach – all the features are loaded at compile time and the selection of features is deferred till we run the application. The user is provided with a configuration that is read by the program to activate only those features specified in the configuration. By this we can complete the requirement of different feature selection by providing different configuration with the same executable. This ensures that we reduce the time spent in compilation for different combinations of features.</p>
<p class="MsoNormal" style="text-align:justify;"><strong><u>Sample Implementation </u></strong></p>
<p class="MsoNormal" style="text-align:justify;"> The implementation I am currently using is inspired by the “registry of singleton” mentioned in Design Patterns – Elements of Reusable Object-Oriented Software (GOF).</p>
<p class="MsoNormal" style="text-align:justify;"> All features are derived from a base class – Feature.<span>  </span>Every feature (Feature1, Feature2), in this example, assigns a different value to printStr. <span> </span>The features are registered with a FeatureManager that acts as a store house for features.<span>  </span>The user specifies the features he wants to use as a command line input to the test program.</p>
<p class="MsoNormal" style="text-align:justify;">You may download the source and makefile from <a href="http://www.mytanana.com/src/ros.tar.gz">this link.</a></p>
<p class="MsoNormal"><strong><em><u>Base class &#8211; Feature.h</u></em></strong></p>
<p class="MsoNormal">&nbsp;</p>
<p>#ifndef _F_H_</p>
<p class="MsoNormal">#define _F_H_</p>
<p class="MsoNormal">#include&lt;iostream&gt;</p>
<p class="MsoNormal"> class Feature</p>
<p class="MsoNormal">{</p>
<p class="MsoNormal"><span>  </span>public:</p>
<p class="MsoNormal"><span>    </span>virtual void print()</p>
<p class="MsoNormal"><span>    </span>{</p>
<p class="MsoNormal"><span>      </span>std::cout &lt;&lt; printStr &lt;&lt; std::endl;</p>
<p class="MsoNormal"><span>    </span>}</p>
<p class="MsoNormal"><span>  </span>protected:</p>
<p class="MsoNormal"><span>    </span>std::string printStr;</p>
<p class="MsoNormal">};</p>
<p class="MsoNormal">#endif</p>
<blockquote></blockquote>
<p class="MsoNormal"><strong><em><u>File: Feature1.h</u></em></strong></p>
<p class="MsoNormal">#ifndef _F1_H_</p>
<p class="MsoNormal"><em><u><span style="text-decoration:none;"> </span></u></em></p>
<blockquote></blockquote>
<blockquote></blockquote>
<p class="MsoNormal">#define _F1_H_</p>
<p class="MsoNormal">#include&lt;iostream&gt;</p>
<p class="MsoNormal">#include &#8220;FeatureManager.h&#8221;</p>
<p class="MsoNormal">#include &#8220;Feature.h&#8221;</p>
<p class="MsoNormal">class Feature1 : public Feature</p>
<p class="MsoNormal">{</p>
<p class="MsoNormal"><span>  </span>public:</p>
<p class="MsoNormal"><span>    </span>Feature1()</p>
<p class="MsoNormal"><span>    </span>{</p>
<p class="MsoNormal"><span>      </span>printStr = &#8220;1&#8243;;</p>
<p class="MsoNormal"><span>      </span>FeatureManager::Register(printStr ,this);</p>
<p class="MsoNormal"><span>    </span>}</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">};</p>
<p class="MsoNormal">#endif</p>
<blockquote></blockquote>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><strong><em><u>File:Feature1.cpp</u></em></strong></p>
<p class="MsoNormal">#include &#8220;Feature1.h&#8221;</p>
<p class="MsoNormal">static Feature1 f1;</p>
<p class="MsoNormal"><em><u><span style="text-decoration:none;"> </span></u></em></p>
<blockquote></blockquote>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><strong><em><u>File: Feature2.h</u></em></strong></p>
<p class="MsoNormal">#ifndef _F2_H_</p>
<p class="MsoNormal"><em><u><span style="text-decoration:none;"> </span></u></em></p>
<blockquote></blockquote>
<p class="MsoNormal">#define _F2_H_</p>
<p class="MsoNormal">#include&lt;iostream&gt;</p>
<p class="MsoNormal">#include &#8220;FeatureManager.h&#8221;</p>
<p class="MsoNormal">#include &#8220;Feature.h&#8221;</p>
<p class="MsoNormal">class Feature2 : public Feature</p>
<p class="MsoNormal">{</p>
<p class="MsoNormal"><span>  </span>public:</p>
<p class="MsoNormal"><span>    </span>Feature2()</p>
<p class="MsoNormal"><span>    </span>{</p>
<p class="MsoNormal"><span>      </span>printStr = &#8220;2&#8243;;</p>
<p class="MsoNormal"><span>      </span>FeatureManager::Register(printStr,this);</p>
<p class="MsoNormal"><span>    </span>}</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">};</p>
<p class="MsoNormal">#endif</p>
<blockquote></blockquote>
<p class="MsoNormal"><strong><em><u>File: Feature2.cpp</u></em></strong></p>
<p class="MsoNormal">&nbsp;</p>
<blockquote></blockquote>
<p class="MsoNormal">#include &#8220;Feature2.h&#8221;</p>
<p class="MsoNormal">static Feature2 f2;</p>
<blockquote></blockquote>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><strong><em><u>File: FeatureManager.h</u></em></strong></p>
<p class="MsoNormal">#ifndef _FM_H_</p>
<p class="MsoNormal">&nbsp;</p>
<blockquote></blockquote>
<p class="MsoNormal">#define _FM_H_</p>
<p class="MsoNormal">#include&lt;iostream&gt;</p>
<p class="MsoNormal">#include&lt;map&gt;</p>
<p class="MsoNormal">#include &#8220;Feature.h&#8221;</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">class FeatureManager</p>
<p class="MsoNormal">{</p>
<p class="MsoNormal"><span>  </span>public:</p>
<p class="MsoNormal"><span>    </span>static void Register(const std::string&amp; name, Feature* f);</p>
<p class="MsoNormal"><span>    </span>static FeatureManager*<span>  </span>GetInstance();</p>
<p class="MsoNormal"><span>    </span>static Feature* Lookup(const std::string&amp; name);</p>
<p class="MsoNormal"><span>  </span>private:</p>
<p class="MsoNormal"><span>    </span>static FeatureManager* _instance;</p>
<p class="MsoNormal"><span>    </span>static std::map&lt;std::string, Feature*&gt; _registry;</p>
<p class="MsoNormal">};</p>
<p class="MsoNormal">#endif</p>
<blockquote></blockquote>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><strong><em><u>File: FeatureManager.cpp</u></em></strong></p>
<p class="MsoNormal"><em><u><span style="text-decoration:none;"> </span></u></em></p>
<blockquote></blockquote>
<p class="MsoNormal">#include &#8220;FeatureManager.h&#8221;</p>
<p class="MsoNormal">FeatureManager* FeatureManager::_instance = NULL;</p>
<p class="MsoNormal">std::map&lt;std::string,Feature*&gt; FeatureManager::_registry;</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">FeatureManager*<span>  </span>FeatureManager::GetInstance()</p>
<p class="MsoNormal">{</p>
<p class="MsoNormal"><span>  </span>if(_instance == NULL)</p>
<p class="MsoNormal"><span>  </span>{</p>
<p class="MsoNormal"><span>    </span>return (_instance = new FeatureManager());</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><span>  </span>}</p>
<p class="MsoNormal"><span>  </span>else</p>
<p class="MsoNormal"><span>    </span>return _instance;</p>
<p class="MsoNormal">}</p>
<blockquote></blockquote>
<p class="MsoNormal">&nbsp;</p>
<blockquote></blockquote>
<p class="MsoNormal">void FeatureManager::Register(const std::string&amp; name, Feature* f)</p>
<p class="MsoNormal">{</p>
<p class="MsoNormal"><span>  </span>_registry[name] = f;</p>
<p class="MsoNormal">}</p>
<p class="MsoNormal">Feature* FeatureManager::Lookup(const std::string&amp; name)</p>
<p class="MsoNormal">{</p>
<p class="MsoNormal"><span>  </span>std::map&lt;std::string,Feature*&gt;::iterator it = _registry.find(name);</p>
<p class="MsoNormal"><span>  </span>if( it != _registry.end())</p>
<p class="MsoNormal"><span>  </span>{</p>
<p class="MsoNormal"><span>    </span>return (*it).second;</p>
<p class="MsoNormal"><span>  </span>}</p>
<p class="MsoNormal"><span>  </span>else</p>
<p class="MsoNormal"><span>  </span>{</p>
<p class="MsoNormal"><span>    </span>return NULL;</p>
<p class="MsoNormal"><span>  </span>}</p>
<p class="MsoNormal">}</p>
<blockquote></blockquote>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><strong><em><u>File: test.cpp</u></em></strong></p>
<p class="MsoNormal"><em><u><span style="text-decoration:none;"> </span></u></em></p>
<blockquote></blockquote>
<p class="MsoNormal">#include &lt;iostream&gt;</p>
<p class="MsoNormal">#include &#8220;FeatureManager.h&#8221;</p>
<p class="MsoNormal">#include &#8220;Feature.h&#8221;</p>
<p class="MsoNormal">int main(int argc, char **argv)</p>
<p class="MsoNormal">{</p>
<p class="MsoNormal"><span>  </span>FeatureManager * mgr = FeatureManager::GetInstance();</p>
<p class="MsoNormal"><span>  </span>//loop through the features provided</p>
<p class="MsoNormal"><span>  </span>for(int i = 1; i&lt;argc; i++) {</p>
<p class="MsoNormal"><span>    </span>Feature *f = mgr-&gt;Lookup(argv[i]);</p>
<p class="MsoNormal"><span>    </span>if(f)</p>
<p class="MsoNormal"><span>      </span>f-&gt;print();</p>
<p class="MsoNormal"><span>  </span>}</p>
<p class="MsoNormal">}</p>
<blockquote></blockquote>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><strong><em><u>Test run</u></em></strong></p>
<p class="MsoNormal"><em><u><span style="text-decoration:none;"> </span></u></em></p>
<p class="MsoNormal">$ ./test 1 2<span>      </span></p>
<p class="MsoNormal">1</p>
<p class="MsoNormal">2</p>
<p class="MsoNormal">$ ./test 2</p>
<p class="MsoNormal">2</p>
<p class="MsoNormal">&nbsp;</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/amardeka.wordpress.com/26/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/amardeka.wordpress.com/26/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amardeka.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amardeka.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amardeka.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amardeka.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amardeka.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amardeka.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amardeka.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amardeka.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amardeka.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amardeka.wordpress.com/26/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amardeka.wordpress.com&blog=1558984&post=26&subd=amardeka&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://amardeka.wordpress.com/2007/10/02/feature-oriented-programming-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9b451e2201006ef08fb350c8d1ff52f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amardeka</media:title>
		</media:content>
	</item>
	</channel>
</rss>