<?xml version="1.0" encoding="ISO-8859-1"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ref="http://purl.org/rss/1.0/modules/reference/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/">
	<channel rdf:about="http://blog.shuva.in/rss.rdf">
		<title>Shuva&#039;s blog</title>
		<link>http://blog.shuva.in/index.php</link>
		<description><![CDATA[(C) Shuva Brata Deb 2007-2008<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-2499707-1";
urchinTracker();
</script>]]></description>
		<items>
			<rdf:Seq>
				<rdf:li resource="http://blog.shuva.in/index.php?entry=entry091210-145416" />
				<rdf:li resource="http://blog.shuva.in/index.php?entry=entry091202-065713" />
				<rdf:li resource="http://blog.shuva.in/index.php?entry=entry090708-013943" />
				<rdf:li resource="http://blog.shuva.in/index.php?entry=entry090614-022913" />
				<rdf:li resource="http://blog.shuva.in/index.php?entry=entry090419-012507" />
				<rdf:li resource="http://blog.shuva.in/index.php?entry=entry090409-090647" />
				<rdf:li resource="http://blog.shuva.in/index.php?entry=entry090409-041844" />
				<rdf:li resource="http://blog.shuva.in/index.php?entry=entry090322-073532" />
				<rdf:li resource="http://blog.shuva.in/index.php?entry=entry090210-204935" />
				<rdf:li resource="http://blog.shuva.in/index.php?entry=entry090120-040828" />
			</rdf:Seq>
		</items>
	</channel>
	<item rdf:about="http://blog.shuva.in/index.php?entry=entry091210-145416">
		<title>Cyclomatic complexity</title>
		<link>http://blog.shuva.in/index.php?entry=entry091210-145416</link>
		<description><![CDATA[I came across this interesting metric called &quot;Cyclomatic complexity&quot; at work today. It is measurement of how complex a function is in terms of the logical branches it has.<br /><br />The <a href="http://en.wikipedia.org/wiki/Cyclomatic_complexity" target="_blank" >formal definition as in Wikipedia</a> is quite mathematical and not in tune with the thinking of the like minded people visiting my blog.<br /><br />A far less and simple definition can be found at <a href="http://www.codeproject.com/KB/architecture/Cyclomatic_Complexity.aspx" target="_blank" >this code project article </a>which says to calculate this metric:<br /><br />•	Start with 1 for a straight path through the routine. <br />•	Add 1 for each of the following keywords or their equivalent: if, while, repeat, for, and, or. <br />•	Add 1 for each case in a switch statement. <br /><br />There is another defintion as seen in Ncover&#039;s site which says <br /><br /><i>The cyclomatic complexity value is the maximum number of test cases needed to get 100% branch coverage, and the minimum number of test cases needed to exercise every path through a method, so it provides a good way to tell how well-tested a method is.</i><br /><br />Happy cyclomatting.//]]></description>
	</item>
	<item rdf:about="http://blog.shuva.in/index.php?entry=entry091202-065713">
		<title>So many software development  methods</title>
		<link>http://blog.shuva.in/index.php?entry=entry091202-065713</link>
		<description><![CDATA[I never knew that we have so many software development methods that exist until I read some stuff today. If you had asked me yesterday I would have said:<br /><br />1. Waterfall ---- thats what I learnt in my first few months at TCS.<br /><br />2. Spiral --- the diagram when I first saw looked confusing, but thats what I do mostly these days.<br /><br />3. Extreme programming --- I had spent some time with a start up. Definitely productive with so less management interference. You were almost always the boss but of an extremely small team and which is sometimes just you.<br /><br />The others which are interesting to know and are formal methods are:<br /><br />1. Structured Programming Development -- everything is structured, disciplined.<br /><br />2. Cleanroom -- strong focus towards defect prevention. Quality is though design+coding and not testing.<br /><br />3. Iterative development -- I dont know how this is different from the Spiral method.<br /><br />4. Prototyping --- do prototyping, go to user, re-prototype until acceptable. Sounds like RnD project to me.<br /><br />5. Modified Prototype Model --- Like web-page maintenance. Start simple, keep on modifying based on user needs.<br /><br />6. Rapid Application Development --- No time, just do it.<br /><br />7. Joint Analysis Development --- Developers work closely with end-users to develop the software.<br /><br />8. Exploratory model --- Requirements not known initially, but lets start the project and we will see what is needed.<br /><br />That makes eleven Software Development models. Woow!<br /><br />Happy Modelling.//]]></description>
	</item>
	<item rdf:about="http://blog.shuva.in/index.php?entry=entry090708-013943">
		<title>Cross platform XML library comparison</title>
		<link>http://blog.shuva.in/index.php?entry=entry090708-013943</link>
		<description><![CDATA[I fond this nice site comparing various cross-platform XML libraries. They have a very good benchmark data with lots of graphs. Very useful for making project decisions:<br /><br /><a href="http://iweb.dl.sourceforge.net/sourceforge/xmlbench/features.pdf" target="_blank" >Feature comparison</a><br /><br /><a href="http://iweb.dl.sourceforge.net/sourceforge/xmlbench/benchmark.pdf" target="_blank" >Benchmark sheet 1</a><br /><br /><a href="http://iweb.dl.sourceforge.net/sourceforge/xmlbench/benchmark200402.pdf" target="_blank" >Benchmark sheet 2</a><br /><br />Happy XXLing.//]]></description>
	</item>
	<item rdf:about="http://blog.shuva.in/index.php?entry=entry090614-022913">
		<title>Recession and Alibaba</title>
		<link>http://blog.shuva.in/index.php?entry=entry090614-022913</link>
		<description><![CDATA[One more effect of recession. Children at school now read &quot;Alibaba and the thirty thieves&quot;.<br /><br />Happy reading.//]]></description>
	</item>
	<item rdf:about="http://blog.shuva.in/index.php?entry=entry090419-012507">
		<title>Tips for speeding up your Windows XP box</title>
		<link>http://blog.shuva.in/index.php?entry=entry090419-012507</link>
		<description><![CDATA[If you also want to speed up your Windows XP box, the following link serves as a good article.<br /><br /><a href="http://www.overclock.net/windows/9836-xp-definitive-performance-tweaking-guide.html" target="_blank" >Windows XP Definitive Performance Tweaking guide</a><br /><br /><br /><b>Real life incident:</b><br /><b>Shuva</b>: (@ office, losing patience waiting for his laptop to shut down). I will take this question to my grave.<br /><b>Anadi </b>: What question?<br /><b>Shuva </b>: Why does Windows take a lifetime to shutdown?<br /><b>Anadi </b>: (brief pause, shakes his legs as usual, thinks)<br />...<br />...<br /><b>Anadi </b>: Everybody takes a lifetime to shutdown.<br /><br /><br />Happy Tweaking.//]]></description>
	</item>
	<item rdf:about="http://blog.shuva.in/index.php?entry=entry090409-090647">
		<title>The Computer Security Radar Page link</title>
		<link>http://blog.shuva.in/index.php?entry=entry090409-090647</link>
		<description><![CDATA[I liked this live page<br /><br /><a href="http://www.securitywizardry.com/radar.htm" target="_blank" >Computer Network Defence Operational Picture</a><br /><br />Hope you like(bookmark) it too.<br /><br />Happy Scanning.//]]></description>
	</item>
	<item rdf:about="http://blog.shuva.in/index.php?entry=entry090409-041844">
		<title>C++ : A lock with a timeout : Example code</title>
		<link>http://blog.shuva.in/index.php?entry=entry090409-041844</link>
		<description><![CDATA[When we use a mutex and wait on it, we basically ASSUME that somebody else is going to release the lock. Most of the time this assumption works. But there can be a situation when you dont want to wait forever on the lock. In such cases we want to have a GetLock() function that has a time out.<br /><br />One such lock exists in Boost and they are:<br /><a href="http://www.boost.org/doc/libs/1_32_0/doc/html/timed_mutex.html" target="_blank" >boost::timed_mutex</a> and<br /><a href="http://www.boost.org/doc/libs/1_32_0/doc/html/recursive_timed_mutex.html" target="_blank" >boost::recursive_timed_mutex</a><br /><br />Unfortunately there are too many good resources that explain boost locks with examples. Here is one crude example that I had to write for my own practice.<br /> <br /><pre><br />#include &lt;iostream&gt;<br />#include &lt;boost/thread/thread.hpp&gt;<br />#include &lt;boost/thread/locks.hpp&gt;<br />#include &lt;sys/types.h&gt;<br />#include &lt;linux/unistd.h&gt;<br /><br />_syscall0(pid_t,gettid)<br /><br />boost::timed_mutex m_mutex;<br /><br />void Thread1_CreateObjectAndWait() {<br />    //Get the lock <br />    boost::timed_mutex::scoped_lock guard(m_mutex);<br />    std::cout &lt;&lt; gettid()  &lt;&lt; &quot;: Thread  got the lock&quot; &lt;&lt; std::endl;<br /><br />    boost::system_time timeout = boost::get_system_time() +<br />                             boost::posix_time::milliseconds(10000);<br /><br />    std::cout &lt;&lt; gettid() <br />              &lt;&lt; &quot;: Waiting for thread 2 to unlock or else timeout&quot; <br />              &lt;&lt; std::endl;<br />    bool ret = m_mutex.timed_lock(timeout);<br /><br />    if (ret == true) { <br />        std::cout &lt;&lt; gettid() &lt;&lt; &quot;: Got the lock before timeout&quot; <br />                  &lt;&lt; std::endl;<br />    } else {<br />        std::cout &lt;&lt; gettid() &lt;&lt; &quot;: Got the lock after timeout&quot; <br />                  &lt;&lt; std::endl;<br />    }       <br />    <br />}<br /><br />void Thread2_Unlock() {<br />    std::cout &lt;&lt; gettid() &lt;&lt; &quot; : Unlocking the mutex &quot; &lt;&lt; std::endl;<br />    m_mutex.unlock() ;<br />}<br /><br /><br />int main() {<br /><br />    //Create thread 1, which will lock itself and wait for thread 2 <br />    //to unlock or timeout.<br />    boost::thread thread1(&amp;Thread1_CreateObjectAndWait);<br /><br />    //sleep some time to give time for thread 1 to start.<br />    sleep(2);<br />    <br />    //create thread 2 which will unlock before thread 1 gets a timeout.<br />    boost::thread thread2(&amp;Thread2_Unlock);<br /><br />    //Create thread 3,  which will lock itself and wait for thread 2 <br />    //to unlock or timeout.<br />    boost::thread thread3(&amp;Thread1_CreateObjectAndWait);<br /><br />    thread1.join();<br />    thread2.join();<br />    thread3.join();<br />    return 0;<br />}<br /><br /></pre><br />The above code compiled with g++ with the following command:<br /><br /><pre>g++ example.cpp -I&lt;path to boost include dir&gt;  &lt;path to boost lib dir&gt;/libboost_thread-gcc34-mt.a  -lpthread</pre><br /><br />The o/p should look something like:<br /><pre>28061: Thread  got the lock<br />28061: Waiting for thread 2 to unlock or else timeout<br />28062 : Unlocking the mutex <br />28061: Got the lock before timeout<br />28063: Thread  got the lock<br />28063: Waiting for thread 2 to unlock or else timeout<br />28063: Got the lock after timeout</pre><br /><br /><br />PS: To compile on Windows, replace gettid() with GetCurrentThreadId() and remove the linux specific header file.<br /><br />Happy Boosting.//<br />]]></description>
	</item>
	<item rdf:about="http://blog.shuva.in/index.php?entry=entry090322-073532">
		<title>Bash Arithmetic : Leading 0 (zero) errors : value too great for base</title>
		<link>http://blog.shuva.in/index.php?entry=entry090322-073532</link>
		<description><![CDATA[It can be quite frustrating at time when you cannot get a simple thing as doing a arithmetic expression where the number has a leading zero. I am talking of Bash arithmetic.<br /><br />Example: <br /><b>let x=7*5</b> is OK.<br /><br /><br /><b>let x=07*5 </b>is also OK<br /><br />But <br /><b>let x=08*5 </b>gives the following error:<br /><font color=red>bash: let: x=081: value too great for base (error token is "081")</font><br /><br />The reason is that numbers with leading 0 is treated as octal in Bash. So 01, 02, 03 ...07 would not have any problem. 08, 09 are not valid octal numbers and hence treated so.<br /><br />OK, OK. How to get rid of a leading zero. Unfortunately in Bash its not so straight forward. Here are some useful hints:<br /><br />1. Use a loop like this to get rid of leading zeros from the variable x<br /><pre>while [[ $a = 0* ]]<br />do <br />a=${a#0} <br />done</pre><br /><br />2. The second solution is to explicity mention that it is a base 10 number, which can be quite cumbersome.<br /><pre><br />y=081<br />let x=10#$y*7; #Treat 08 as a base 10 digit.</pre><br /><br /><br />Happy Bashing.//<br />]]></description>
	</item>
	<item rdf:about="http://blog.shuva.in/index.php?entry=entry090210-204935">
		<title>Online Grevience forum in India.</title>
		<link>http://blog.shuva.in/index.php?entry=entry090210-204935</link>
		<description><![CDATA[India as a country does not stand very well in the list of corrupt countries in the world. One of the most important things that happened in the last few years is the <a href="http://righttoinformation.gov.in/" target="_blank" >Right to Information Act</a>. <br /><br />I received this email from my colleague this morning and its one of the few emails that is actually worth forwarding and spreading the word. So here it is:<br /><br /><br />Hi all <br /><br />for your information <br /><br />Government of India has an on-line Grievance forum at <a href="http://pgportal.gov.in/" target="_blank" >http://pgportal.gov.in/ </a>Can you imagine this is happening in INDIA? <br /><br />The govt. wants people to use this tool to highlight the problems they faced while dealing with Government officials or departments like Passport Office, Electricity board, BSNL/MTNL, Railways etc.       <br />So use this grievance forum and educate others who don&#039;t know about this facility.  This way we can at least raise our concerns instead of just talking about the &#039; System &#039; in India. <br /><br />Invite your friends to contribute for many such happenings. <br /><br />PLEASE SPREAD THIS MESSAGE IF U WANTS OUR INDIA TO HAVE A BETTER TOMORROW &amp; FORWARD THIS MAIL TO AS MANY AS POSSIBLE.<br /><br />Thanks<br /><br />Taheer Mohd<br /><br /><br />Happy Grievancing.//]]></description>
	</item>
	<item rdf:about="http://blog.shuva.in/index.php?entry=entry090120-040828">
		<title>Free email server setup for your domain or small business through Google Apps</title>
		<link>http://blog.shuva.in/index.php?entry=entry090120-040828</link>
		<description><![CDATA[If you have a small business, running a non-profit org, or a school, you probably have a website with your own registered domain name. You might also have the requirement of setting up email accounts for your domain, like <a href="mailto:jonny@your-domain.com" target="_blank" >owner@your-domain.com</a>, etc. Normally, you would be looking for a service provider which supports email along with hosting your site. I would strongly recommend that you switch over to <a href="http://www.google.com/a" target="_blank" >Google Apps </a>to support your Email requirements. All you need is ability to update DNS settings for your domain which your service provider generally provides. Your existing website and other stuff just remains the way it is.<br /><br />Last week, I switched over the Email system of a website to Google Apps and it took just 20 minutes to do everything. The migration was a cake-walk. Once you register your domain with Google Apps, you would get detail instructions on how to do that, but in a nut shell, you just have to update your domains DNS settings. Technically you would be updating your DNS&#039;s CNAME and MX records. Click <a href="http://www.google.com/support/a/bin/answer.py?answer=33352&amp;topic=9196" target="_blank" >here </a>to know more about configuring MX records.<br /><br />The main reasons why we switched over were:<br />1. Our main server was handling around 1000 emails per day and the usage was continuously growing. Moving to Google Apps meant less usage of resources on the server.<br /><br />2. Google was much better in handling spam than we could do with open-source anti spam engines. Anti-spam engines take a lot of server resources too.<br /><br />3. You could login into either http://mail.mydomain.com to check emails or even pull it into your personal gmail address through POP access.<br /><br />4. You can create groups and specially a <a href="mailto:catchall@mydomain.com" target="_blank" >catchall@mydomain.com</a> email address that will catch emails addressed to users that you havent created manually. <br /><br />5. Sites like hotmail uses SPF technology and tend to flag emails coming from several servers as either SPAM or they just reject it. With Google Apps, you have a better chance that they will reach hotmail users. It can be quite embrassing for your business to send an email to a hotmail user which never reaches them or lands in their SPAM folder. You can read more about <a href="http://www.innovation-station.net/archives/2007/03/29/hotmail-and-my-spf-nightmare/" target="_blank" >Hotmail and SPF nightmare here</a>.<br /><br />There are basically two packages in Google Apps. A free Standard package which gives you only 7GB storage space and a $50/user Premium package. <br /><br />Check them out at <a href="http://www.google.com/apps/intl/en/business/editions.html" target="_blank" >Google Apps comparison page</a>.<br /><br />The best thing about Google Apps email is the hassle free migration process and their system simply works. Their self-help documentation is also properly laid out to answer all your questions.<br /><br /><a href="http://www.google.com/a" target="_blank" >Google Apps</a> is not just about Email, but a complete solution for small office setup. I am writing about Email only because I am a very satisfied user of the email system.<br /><br />Helpful links:<br /><a href="http://www.google.com/support/a/bin/answer.py?answer=107155" target="_blank" >Google Apps getting started guide.</a><br /><a href="http://www.google.com/support/a/bin/topic.py?topic=9202" target="_blank" >Google Apps Email FAQ page</a><br /><br />Happy Google Appsing.//]]></description>
	</item>
</rdf:RDF>

