<?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>CH Gowri Kumar's blog</title>
	<atom:link href="http://www.gowrikumar.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gowrikumar.com/blog</link>
	<description>C, programming interviews, careers, tips and tricks</description>
	<lastBuildDate>Thu, 08 Jan 2009 17:29:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Enjoy your coffee</title>
		<link>http://www.gowrikumar.com/blog/2009/01/08/enjoy-your-coffee/</link>
		<comments>http://www.gowrikumar.com/blog/2009/01/08/enjoy-your-coffee/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 17:29:48 +0000</pubDate>
		<dc:creator>CH Gowri Kumar</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[inspirational]]></category>

		<guid isPermaLink="false">http://www.gowrikumar.com/blog/?p=39</guid>
		<description><![CDATA[The following is a very interesting e-mail forward recently and sharing the same with you all.
A group of alumni, highly established in their careers got together to visit old university professor. Conversation soon turned into complaints about stress in work and life.
Offering his guest coffee, professor went to the kitchen and brought a large pot [...]]]></description>
			<content:encoded><![CDATA[<p>The following is a very interesting e-mail forward recently and sharing the same with you all.</p>
<blockquote><p>A group of alumni, highly established in their careers got together to visit old university professor. Conversation soon turned into complaints about stress in work and life.</p>
<p>Offering his guest coffee, professor went to the kitchen and brought a large pot of coffee and assortment of cups- porcelain, plastic, glass, crystal. Some plain looking, some expensive and some exquisite, telling them to help themselves to hot coffee.</p>
<p>When all the student had a cup of coffee in hand professor said-<br />
If you noticed, all the nice looking expensive cups were taken up leaving behind the plain and cheap ones.  It is normal for you to want only the best for yourself But that is the source of your problem and stress.</p>
<p>What all of you wanted was coffee, not the cup, but you consciously want for the best cup and were eyeing each other&#8217;s cup.</p>
<p>Now if life is coffee, than jobs, money and position in society are the cups. They are just tools to hold Life, but the quality of Life doesn&#8217;t change. Sometimes by concentrating only on the cup we fail to enjoy the coffee in it.</p>
<p><strong><em>So don&#8217;t let the cups drive you&#8230;. </em></strong></p>
<p><strong><em>Enjoy the coffee instead.</em></strong></p>
<p><strong><em></em></strong></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.gowrikumar.com/blog/2009/01/08/enjoy-your-coffee/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>AT&amp;T &#8220;break&#8221; bug</title>
		<link>http://www.gowrikumar.com/blog/2009/01/06/att-break-bug/</link>
		<comments>http://www.gowrikumar.com/blog/2009/01/06/att-break-bug/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 18:21:34 +0000</pubDate>
		<dc:creator>CH Gowri Kumar</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.gowrikumar.com/blog/?p=29</guid>
		<description><![CDATA[The zune bug mentioned in the previous post was caused by a missing break statement. There was an interesting incident which had happened on January 15th, 1990, caused by the insertion of a break statement at the wrong place in the, C code. I have read about this bug in the book &#8220;Expert C Programming &#8211; Deep C [...]]]></description>
			<content:encoded><![CDATA[<p>The zune bug mentioned in the <a href="http://www.gowrikumar.com/blog/2009/01/05/the-practice-of-programming-advice-zune-bug/" target="_blank">previous post </a>was caused by a missing <em>break</em> statement. There was an interesting incident which had happened on January 15th, 1990, caused by the insertion of a <em>break</em> statement at the wrong place in the, C code. I have read about this bug in the book &#8220;<a title="Expert C programming book link" href="http://www.amazon.com/exec/obidos/ASIN/0131774298" target="_blank">Expert C Programming &#8211; Deep C secrets &#8211; Peter Vander Linden</a>&#8220;. The following is the excerpt from the book which explains it.</p>
<blockquote><p> This is a replica of the code that caused a major disruption of AT&amp;T phone service throughout the U.S. AT&amp;T&#8217;s network was in large part unusable for about nine hours starting on the afternoon of January 15, 1990. Telephone exchanges (or &#8220;switching systems&#8221; in phone jargon) are all computer systems these days, and this code was running on a model 4ESS Central Office Switching System. It demonstrates that it is too easy in C to overlook exactly which control constructs are affected by a <em>&#8220;break&#8221; </em>statement.</p></blockquote>
<pre class="syntax-highlight:c++">
network code()
{
switch (line) {
    case THING1:
        doit1();
        break;
 case THING2:
         if (x == STUFF) {
            do_first_stuff();
            if (y == OTHER_STUFF)
                 break;
            do_later_stuff();
          } /* coder meant to break to here... */
          initialize_modes_pointer();
          break;
    default:
         processing();
    } /* ...but actually broke to here! */
   use_modes_pointer();/* leaving the modes_pointer
    uninitialized */
}
</pre>
<blockquote>
<p align="left"><span style="font-size: small; font-family: TimesNewRoman;"><span style="font-size: small; font-family: TimesNewRoman;"> This is a simplified version of the code, but the bug was real enough. The programmer wanted to break out of the <em>&#8220;if&#8221;</em> statement, forgetting that <em>&#8220;<strong>break&#8221;</strong></em><strong> actually gets you out of the nearest enclosing iteration or switch statement</strong>. Here, it broke out of the switch, and executed the call to </span></span><span style="font-size: small; color: #354279; font-family: CourierNewPSMT;">use_modes_pointer() </span><span style="font-size: small; font-family: TimesNewRoman;">—but the necessary initialization had not been done, causing a failure further on. </span><span style="font-size: small; font-family: TimesNewRoman;"><span style="font-size: small; font-family: TimesNewRoman;">This code eventually caused the first major network problem in AT&amp;T&#8217;s 114-year history. The saga is described in greater detail on page 11 of the January 22, 1990 issue of </span></span><em><span style="font-size: small; font-family: TimesNewRoman,Italic;">Telephony </span></em><span style="font-size: small; font-family: TimesNewRoman;">magazine. The supposedly fail-safe design of the network signaling system actually spread the fault in a chain reaction, bringing down the entire long distance network. </span></p>
<p align="left"><span style="font-size: small; font-family: TimesNewRoman;"><span style="font-size: small; font-family: TimesNewRoman;">And it all rested on a C </span></span><span style="font-size: small; color: #354279; font-family: CourierNewPSMT;">switch </span><span style="font-size: small; font-family: TimesNewRoman;">statement!!!!.</span></p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.gowrikumar.com/blog/2009/01/06/att-break-bug/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Practice of Programming advice &#8211; Zune bug</title>
		<link>http://www.gowrikumar.com/blog/2009/01/05/the-practice-of-programming-advice-zune-bug/</link>
		<comments>http://www.gowrikumar.com/blog/2009/01/05/the-practice-of-programming-advice-zune-bug/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 17:13:16 +0000</pubDate>
		<dc:creator>CH Gowri Kumar</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.gowrikumar.com/blog/?p=18</guid>
		<description><![CDATA[The book &#8220;The Practice of Programming &#8211; Brian .W.Kernighan and Robert Pike&#8220;  is one the books, which has a profound influence on the way I  program/debug. One of the advice it provides is :
Know yourself, and the kind of errors you make.Once you have found and fixed a bug, make sure that you eliminate other [...]]]></description>
			<content:encoded><![CDATA[<p>The book &#8220;<a title="The Practice of Programming" href="http://cm.bell-labs.com/cm/cs/tpop/" target="_self">The Practice of Programming &#8211; Brian .W.Kernighan and Robert Pike</a>&#8220;  is one the books, which has a profound influence on the way I  program/debug. One of the advice it provides is :</p>
<blockquote><p>Know yourself, and the kind of errors you make.<span style="font-size: small; font-family: Times New Roman;">Once you have found and fixed a bug, make sure that you eliminate other bugs that might </span><span style="font-size: x-small; font-family: Times New Roman;">be </span><span style="font-size: small; font-family: Times New Roman;">similar. Think about what happened so you can avoid making that kind of mistake again.</span></p></blockquote>
<p>The book provides the above advice in the context of an implementation of a very useful UNIX utility, <em><a title="unix strings" href="http://en.wikipedia.org/wiki/Strings_(Unix)" target="_blank">strings</a>.</em> One of the  functions in that implementation had 3 erroneous calls to <strong><em>printf</em> </strong>. Later, it was fixed in one place, but the other two calls were not fixed.</p>
<p>Now you might be wondering how is this related to the Zune bug. The <a title="file containing the zune bug" href="http://pastie.org/349916" target="_blank">original file</a> containing the bug is available for public viewing.  The root cause for the bug is also explained in detail in  <a title="zune bug isolated" href="http://www.zuneboards.com/forums/zune-news/38143-cause-zune-30-leapyear-problem-isolated.html" target="_blank">zuneboards.com forum</a>. Upon a close observation of the <a href="http://pastie.org/349916" target="_blank">file containing the bug</a>, we can  notice that  there is a function<em> MX31GetRealTime, </em>which contains the similar code as in the buggy function, <em>ConvertDays. </em>But <em>MX31GetRealTime </em>has the correct version  with an extra <em>break</em> statement. </p>
<pre class="syntax-highlight:c++">

year = ORIGINYEAR;
while (day &gt; 365)
{
if (IsLeapYear(year))
{
numOfLeap++;
if (day &gt; 366)
{
OALMSG(OAL_RTC&amp;amp;amp;&amp;amp;amp;OAL_INFO, (TEXT(&quot;Leap Year: %u&quot;),year));
day -= 366;
year += 1;
OALMSG(OAL_RTC&amp;amp;amp;&amp;amp;amp;OAL_INFO, (TEXT(&quot;, Days left: %u\r\n&quot;),day));
}
else
{
OALMSG(OAL_ERROR, (TEXT(&quot;ERROR calculate day\r\n&quot;)));
break;
}
}
else
{
OALMSG(OAL_RTC&amp;amp;amp;&amp;amp;amp;OAL_INFO, (TEXT(&quot;Not Leap Year: %u&quot;),year));
day -= 365;
year += 1;
OALMSG(OAL_RTC&amp;amp;amp;&amp;amp;amp;OAL_INFO, (TEXT(&quot;, Days left: %u\r\n&quot;),day));
}
}
</pre>
<p>Probably this bug wouldn&#8217;t have been there, if the above advice from the book had been followed!!!</p>
<p>In the <a title="AT&amp;T break bug" href="http://www.gowrikumar.com/blog/2009/01/06/att-break-bug/" target="_blank">next post</a>, I will discuss about an (in)famous AT&amp;T bug, which was caused by the inclusion of break statement (quite the opposite of this case <img src='http://www.gowrikumar.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gowrikumar.com/blog/2009/01/05/the-practice-of-programming-advice-zune-bug/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Syntaxhighlighter Hello World!</title>
		<link>http://www.gowrikumar.com/blog/2009/01/02/syntaxhighlighter-hello-world/</link>
		<comments>http://www.gowrikumar.com/blog/2009/01/02/syntaxhighlighter-hello-world/#comments</comments>
		<pubDate>Thu, 01 Jan 2009 19:17:48 +0000</pubDate>
		<dc:creator>CH Gowri Kumar</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.gowrikumar.com/blog/?p=10</guid>
		<description><![CDATA[Testing how to use the syntax highlighter works.


#include &#60;stdio.h&#62;

int main()

{

printf(”Hello World!\n”);

return 0;

}

]]></description>
			<content:encoded><![CDATA[<p>Testing how to use the syntax highlighter works.</p>
<pre class="syntax-highlight:c">

#include &lt;stdio.h&gt;

int main()

{

printf(”Hello World!\n”);

return 0;

}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.gowrikumar.com/blog/2009/01/02/syntaxhighlighter-hello-world/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>To blog or not to blog and how/what to blog?</title>
		<link>http://www.gowrikumar.com/blog/2009/01/01/to-blog-or-not-to-blog/</link>
		<comments>http://www.gowrikumar.com/blog/2009/01/01/to-blog-or-not-to-blog/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 18:57:38 +0000</pubDate>
		<dc:creator>CH Gowri Kumar</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.gowrikumar.com/blog/?p=3</guid>
		<description><![CDATA[And finally I have started blogging on my website www.gowrikumar.com. For a long time, I was pondering whether I should blog or not. If so, how should I do it? I have made a few attempts earlier to blog, but those were mostly on blogspot or wordpress domains. Though I have been thinking about setting [...]]]></description>
			<content:encoded><![CDATA[<p>And finally I have started blogging on my website <a href="http://www.gowrikumar.com">www.gowrikumar.com</a>. For a long time, I was pondering whether I should blog or not. If so, how should I do it? I have made a few attempts earlier to blog, but those were mostly on blogspot or wordpress domains. Though I have been thinking about setting up a blog in my website, a few things hold me back. The questions I have had in my mind were:</p>
<ul>
<li>What would I blog on?</li>
<li>How do I change the look and feel for the blog?</li>
<li>Is it possible to depict the C code in a beautiful manner with all syntax highlighting?</li>
<li>How to add adsense to the wordpress blog?</li>
<li>&#8230;.</li>
<li>&#8230;.</li>
</ul>
<p>And a lot more questions like these. Thanks to Internet and the great user community for wordpress, I have been able to find the answers for most of them.</p>
<p>What to expect in this blog? Well, the least you can expect are answers to the <a title="http://www.gowrikumar.com/c/index.html" href="http://www.gowrikumar.com/c/index.html" target="_blank">C puzzles </a>and the <a title="http://www.gowrikumar.com/programming/index.html" href="http://www.gowrikumar.com/programming/index.html" target="_blank">programming interview questions </a>which are posted on <a title="http://www.gowrikumar.com" href="http://www.gowrikumar.com" target="_blank">my website </a> <img src='http://www.gowrikumar.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   And then nostalgic stuff of how I started my programming, how I learnt it, what am I doing currently etc&#8230;</p>
<p>Happy new year 2009 to all of you.</p>
<p>Have a terrific day!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gowrikumar.com/blog/2009/01/01/to-blog-or-not-to-blog/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://www.gowrikumar.com/blog/2008/12/31/hello-world/</link>
		<comments>http://www.gowrikumar.com/blog/2008/12/31/hello-world/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 18:05:55 +0000</pubDate>
		<dc:creator>CH Gowri Kumar</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.gowrikumar.com/blog/?p=1</guid>
		<description><![CDATA[Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!
]]></description>
			<content:encoded><![CDATA[<p>Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gowrikumar.com/blog/2008/12/31/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
