<?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>bobpeers -&#62; blog &#187; c++</title>
	<atom:link href="http://blog.bobpeers.com/tag/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bobpeers.com</link>
	<description>Better late than never</description>
	<lastBuildDate>Fri, 24 Jun 2011 12:34:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>C# Replace New Lines</title>
		<link>http://blog.bobpeers.com/2009/10/29/c-replace-new-lines/</link>
		<comments>http://blog.bobpeers.com/2009/10/29/c-replace-new-lines/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 08:17:27 +0000</pubDate>
		<dc:creator>Bob Peers</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[newline]]></category>
		<category><![CDATA[replace]]></category>

		<guid isPermaLink="false">http://blog.bobpeers.com/2009/10/29/c-replace-new-lines/</guid>
		<description><![CDATA[If you know you&#8217;re working on the Windows platform and all data will come from Windows then to replace newlines using C#.NET we just use. myString=myString.Replace(Environment.NewLine,""); In all other cases it&#8217;s much safer to string together the Replace function to cover all possibilities. myString=myString.Replace("\r", "").Replace("\n", "");]]></description>
			<content:encoded><![CDATA[<p>If you know you&#8217;re working on the Windows platform and all data will come from Windows then to replace newlines using C#.NET we just use.</p>
<pre>myString=myString.Replace(Environment.NewLine,"");</pre>
<p>In all other cases it&#8217;s much safer to string together the Replace function to cover all possibilities.</p>
<pre>myString=myString.Replace("\r", "").Replace("\n", "");</pre>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F29%2Fc-replace-new-lines%2F&amp;counturl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F29%2Fc-replace-new-lines%2F&amp;count=none&amp;text=C%23%20Replace%20New%20Lines" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F29%2Fc-replace-new-lines%2F&amp;counturl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F29%2Fc-replace-new-lines%2F&amp;count=none&amp;text=C%23%20Replace%20New%20Lines" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F29%2Fc-replace-new-lines%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F29%2Fc-replace-new-lines%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F29%2Fc-replace-new-lines%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F29%2Fc-replace-new-lines%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F29%2Fc-replace-new-lines%2F&amp;linkname=C%23%20Replace%20New%20Lines" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F29%2Fc-replace-new-lines%2F&amp;linkname=C%23%20Replace%20New%20Lines" title="Evernote" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_button_google_gmail" href="http://www.addtoany.com/add_to/google_gmail?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F29%2Fc-replace-new-lines%2F&amp;linkname=C%23%20Replace%20New%20Lines" title="Google Gmail" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/gmail.png" width="16" height="16" alt="Google Gmail"/></a><a class="a2a_button_hotmail" href="http://www.addtoany.com/add_to/hotmail?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F29%2Fc-replace-new-lines%2F&amp;linkname=C%23%20Replace%20New%20Lines" title="Hotmail" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/live.png" width="16" height="16" alt="Hotmail"/></a><a class="a2a_button_wordpress" href="http://www.addtoany.com/add_to/wordpress?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F29%2Fc-replace-new-lines%2F&amp;linkname=C%23%20Replace%20New%20Lines" title="WordPress" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/wordpress.png" width="16" height="16" alt="WordPress"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F29%2Fc-replace-new-lines%2F&amp;linkname=C%23%20Replace%20New%20Lines" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F29%2Fc-replace-new-lines%2F&amp;linkname=C%23%20Replace%20New%20Lines" title="Facebook" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F29%2Fc-replace-new-lines%2F&amp;linkname=C%23%20Replace%20New%20Lines" title="Delicious" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F29%2Fc-replace-new-lines%2F&amp;title=C%23%20Replace%20New%20Lines" id="wpa2a_2"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.bobpeers.com/2009/10/29/c-replace-new-lines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# IsNumeric</title>
		<link>http://blog.bobpeers.com/2009/10/28/c-isnumeric/</link>
		<comments>http://blog.bobpeers.com/2009/10/28/c-isnumeric/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 19:10:00 +0000</pubDate>
		<dc:creator>Bob Peers</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[IsNumeric]]></category>

		<guid isPermaLink="false">http://blog.bobpeers.com/2009/10/28/c-isnumeric/</guid>
		<description><![CDATA[If you do a search for &#8216;C# IsNumeric&#8217; you&#8217;ll find a lot of hits talking about why this function is available in VB.NET but not in C#.NET. It&#8217;s used to test if a given string can be converted to a number. I agree it&#8217;s a very useful function and there&#8217;s lots of possible solutions, the [...]]]></description>
			<content:encoded><![CDATA[<p>If you do a search for &#8216;C# IsNumeric&#8217; you&#8217;ll find a lot of hits talking about why this function is available in VB.NET but not in C#.NET. It&#8217;s used to test if a given string can be converted to a number.</p>
<p>I agree it&#8217;s a very useful function and there&#8217;s lots of possible solutions, the main ones being</p>
<ol>
<li>Loop through the string and check each Char is a number</li>
<li>Use Double.TryParse is a very popular one since it doesn&#8217;t throw an exception on failure</li>
<li>Use Convert.ToInt32 inside a try/catch block</li>
<li>Using a Regex expression</li>
</ol>
<p>I really wanted to use Double.TryParse but unfortunately this will return true for numbers that are decimals. Therefore if you want to test a string for whole numbers you also have to check the string for periods or commas (using string.contains) depending on your locale.</p>
<p>For this reason I tend to use the Regex solution, mainly because it&#8217;s very short and simple to implement.</p>
<pre>public static bool IsNumeric(string str)
       {
            return Regex.IsMatch(str, "^[0-9]+$");
       }
</pre>
<p>It also requires the using directive System.Text.RegularExpressions</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F28%2Fc-isnumeric%2F&amp;counturl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F28%2Fc-isnumeric%2F&amp;count=none&amp;text=C%23%20IsNumeric" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F28%2Fc-isnumeric%2F&amp;counturl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F28%2Fc-isnumeric%2F&amp;count=none&amp;text=C%23%20IsNumeric" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F28%2Fc-isnumeric%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F28%2Fc-isnumeric%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F28%2Fc-isnumeric%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F28%2Fc-isnumeric%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F28%2Fc-isnumeric%2F&amp;linkname=C%23%20IsNumeric" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F28%2Fc-isnumeric%2F&amp;linkname=C%23%20IsNumeric" title="Evernote" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_button_google_gmail" href="http://www.addtoany.com/add_to/google_gmail?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F28%2Fc-isnumeric%2F&amp;linkname=C%23%20IsNumeric" title="Google Gmail" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/gmail.png" width="16" height="16" alt="Google Gmail"/></a><a class="a2a_button_hotmail" href="http://www.addtoany.com/add_to/hotmail?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F28%2Fc-isnumeric%2F&amp;linkname=C%23%20IsNumeric" title="Hotmail" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/live.png" width="16" height="16" alt="Hotmail"/></a><a class="a2a_button_wordpress" href="http://www.addtoany.com/add_to/wordpress?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F28%2Fc-isnumeric%2F&amp;linkname=C%23%20IsNumeric" title="WordPress" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/wordpress.png" width="16" height="16" alt="WordPress"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F28%2Fc-isnumeric%2F&amp;linkname=C%23%20IsNumeric" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F28%2Fc-isnumeric%2F&amp;linkname=C%23%20IsNumeric" title="Facebook" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F28%2Fc-isnumeric%2F&amp;linkname=C%23%20IsNumeric" title="Delicious" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.bobpeers.com%2F2009%2F10%2F28%2Fc-isnumeric%2F&amp;title=C%23%20IsNumeric" id="wpa2a_4"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.bobpeers.com/2009/10/28/c-isnumeric/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Display Server Time Using Javascript and ASP.NET in C#</title>
		<link>http://blog.bobpeers.com/2008/11/20/display-server-time-using-javascript-and-aspnet-in-c/</link>
		<comments>http://blog.bobpeers.com/2008/11/20/display-server-time-using-javascript-and-aspnet-in-c/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 21:05:01 +0000</pubDate>
		<dc:creator>Bob Peers</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://blog.bobpeers.com/2008/11/20/display-server-time-using-javascript-and-aspnet-in-c/</guid>
		<description><![CDATA[I&#8217;ve recently written an ASP.NET page using C# that required displaying the server time on the webpage using Javascript. To do this you need to output the Javascript code using C# and initialise the Javascript Date() object with the server time, after playing around I found this code does the job. "server_time = new Date('" [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently written an ASP.NET page using C# that required displaying the server time on the webpage using Javascript. To do this you need to output the Javascript code using C# and initialise the Javascript Date() object with the server time, after playing around I found this code does the job.</p>
<pre>"server_time = new Date('" + DateTime.Now.ToString("MMMM d, yyyy HH:mm:ss") + "');"</pre>
<p>The entire code looks like this assuming you have a label with id=&#8217;clock&#8217; on the page. Just output the string js to the page to add the clock.</p>
<pre>const string crlf = "\r\n";
string js = "&lt;script type='text/javascript'>" + crlf +
"window.onload=startclock;" + crlf +
"var clock;" + crlf +
"var time_diff;" + crlf +
"function startclock(){" + crlf +
   "clock=document.getElementById('clock');" + crlf +
   "server_time = new Date('" + DateTime.Now.ToString("MMMM d, yyyy HH:mm:ss") + "');" + crlf +
   "time_diff=new Date()-server_time;" + crlf +
   "setInterval('runclock()',1000);" + crlf +
"}" + crlf +
"function runclock(){" + crlf +
   "var cDate=new Date();" + crlf +
   "cDate.setTime(cDate.getTime()-time_diff);" + crlf +
   "var curr_hours = cDate.getHours();" + crlf +
   "var curr_mins = cDate.getMinutes();" + crlf +
   "var curr_secs = cDate.getSeconds();" + crlf +
   "curr_hours=(curr_hours &lt; 10)?'0' + curr_hours:curr_hours;" + crlf +
   "curr_mins=(curr_mins &lt; 10)?'0' + curr_mins:curr_mins;" + crlf +
   "curr_secs=(curr_secs &lt; 10)?'0' + curr_secs:curr_secs;" + crlf +
   "clock.innerHTML=curr_hours+':'+curr_mins+':'+curr_secs;" + crlf +
   "}" + crlf +
"&lt;/script>";
</pre>
<p>I should mention that if you&#8217;re using classic ASP and VBScript then the line becomes.</p>
<pre>"server_time = new Date(" &#038; DatePart("yyyy",Date) &#038; "," &#038; DatePart("m",Date)-1 &#038; "," &#038; DatePart("d",Date) &#038; "," &#038; DatePart("h",Now) &#038; "," &#038; DatePart("n",Now) &#038; "," &#038; DatePart("s",Now) &#038; ");"
</pre>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F20%2Fdisplay-server-time-using-javascript-and-aspnet-in-c%2F&amp;counturl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F20%2Fdisplay-server-time-using-javascript-and-aspnet-in-c%2F&amp;count=none&amp;text=Display%20Server%20Time%20Using%20Javascript%20and%20ASP.NET%20in%20C%23" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F20%2Fdisplay-server-time-using-javascript-and-aspnet-in-c%2F&amp;counturl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F20%2Fdisplay-server-time-using-javascript-and-aspnet-in-c%2F&amp;count=none&amp;text=Display%20Server%20Time%20Using%20Javascript%20and%20ASP.NET%20in%20C%23" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F20%2Fdisplay-server-time-using-javascript-and-aspnet-in-c%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F20%2Fdisplay-server-time-using-javascript-and-aspnet-in-c%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F20%2Fdisplay-server-time-using-javascript-and-aspnet-in-c%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F20%2Fdisplay-server-time-using-javascript-and-aspnet-in-c%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F20%2Fdisplay-server-time-using-javascript-and-aspnet-in-c%2F&amp;linkname=Display%20Server%20Time%20Using%20Javascript%20and%20ASP.NET%20in%20C%23" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F20%2Fdisplay-server-time-using-javascript-and-aspnet-in-c%2F&amp;linkname=Display%20Server%20Time%20Using%20Javascript%20and%20ASP.NET%20in%20C%23" title="Evernote" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_button_google_gmail" href="http://www.addtoany.com/add_to/google_gmail?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F20%2Fdisplay-server-time-using-javascript-and-aspnet-in-c%2F&amp;linkname=Display%20Server%20Time%20Using%20Javascript%20and%20ASP.NET%20in%20C%23" title="Google Gmail" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/gmail.png" width="16" height="16" alt="Google Gmail"/></a><a class="a2a_button_hotmail" href="http://www.addtoany.com/add_to/hotmail?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F20%2Fdisplay-server-time-using-javascript-and-aspnet-in-c%2F&amp;linkname=Display%20Server%20Time%20Using%20Javascript%20and%20ASP.NET%20in%20C%23" title="Hotmail" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/live.png" width="16" height="16" alt="Hotmail"/></a><a class="a2a_button_wordpress" href="http://www.addtoany.com/add_to/wordpress?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F20%2Fdisplay-server-time-using-javascript-and-aspnet-in-c%2F&amp;linkname=Display%20Server%20Time%20Using%20Javascript%20and%20ASP.NET%20in%20C%23" title="WordPress" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/wordpress.png" width="16" height="16" alt="WordPress"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F20%2Fdisplay-server-time-using-javascript-and-aspnet-in-c%2F&amp;linkname=Display%20Server%20Time%20Using%20Javascript%20and%20ASP.NET%20in%20C%23" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F20%2Fdisplay-server-time-using-javascript-and-aspnet-in-c%2F&amp;linkname=Display%20Server%20Time%20Using%20Javascript%20and%20ASP.NET%20in%20C%23" title="Facebook" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F20%2Fdisplay-server-time-using-javascript-and-aspnet-in-c%2F&amp;linkname=Display%20Server%20Time%20Using%20Javascript%20and%20ASP.NET%20in%20C%23" title="Delicious" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F20%2Fdisplay-server-time-using-javascript-and-aspnet-in-c%2F&amp;title=Display%20Server%20Time%20Using%20Javascript%20and%20ASP.NET%20in%20C%23" id="wpa2a_6"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.bobpeers.com/2008/11/20/display-server-time-using-javascript-and-aspnet-in-c/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Too Busy to Blog</title>
		<link>http://blog.bobpeers.com/2008/11/13/too-busy-to-blog/</link>
		<comments>http://blog.bobpeers.com/2008/11/13/too-busy-to-blog/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 20:07:49 +0000</pubDate>
		<dc:creator>Bob Peers</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[fedora 10]]></category>
		<category><![CDATA[hp]]></category>

		<guid isPermaLink="false">http://blog.bobpeers.com/2008/11/13/too-busy-to-blog/</guid>
		<description><![CDATA[I hope to add some more posts very soon, it&#8217;s not that there&#8217;s nothing happening but rather a bit too much going on. At work I&#8217;m involved with a project in SAP that takes all my time, I&#8217;ve also written some webpages in ASP.NET using C#, something I&#8217;ve never done before. I&#8217;ve also got a [...]]]></description>
			<content:encoded><![CDATA[<p>I hope to add some more posts very soon, it&#8217;s not that there&#8217;s nothing happening but rather a bit too much going on.</p>
<p>At work I&#8217;m involved with a project in SAP that takes all my time, I&#8217;ve also written some webpages in ASP.NET using C#, something I&#8217;ve never done before. I&#8217;ve also got a new work laptop, a <a href="http://h10010.www1.hp.com/wwpc/us/en/sm/WF06b/321957-321957-64295-3740645-89315-3688868-3688870-3750774.html?jumpid=oc_R1002_USENC-001_HP%20EliteBook%206930p%20Notebook%20PC&#038;lang=en&#038;cc=us">HP 6930p</a> so I&#8217;ll write my impressions on that soon.</p>
<p>Personally I&#8217;ve had an old schoolfriend visit who now lives in Melbourne, Australia plus I&#8217;ve just come back from a week visiting family in England so spare time is in short supply right now.</p>
<p>On top of all that Fedora 10 comes out in 12 days!</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F13%2Ftoo-busy-to-blog%2F&amp;counturl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F13%2Ftoo-busy-to-blog%2F&amp;count=none&amp;text=Too%20Busy%20to%20Blog" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F13%2Ftoo-busy-to-blog%2F&amp;counturl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F13%2Ftoo-busy-to-blog%2F&amp;count=none&amp;text=Too%20Busy%20to%20Blog" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F13%2Ftoo-busy-to-blog%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F13%2Ftoo-busy-to-blog%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F13%2Ftoo-busy-to-blog%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F13%2Ftoo-busy-to-blog%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F13%2Ftoo-busy-to-blog%2F&amp;linkname=Too%20Busy%20to%20Blog" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F13%2Ftoo-busy-to-blog%2F&amp;linkname=Too%20Busy%20to%20Blog" title="Evernote" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_button_google_gmail" href="http://www.addtoany.com/add_to/google_gmail?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F13%2Ftoo-busy-to-blog%2F&amp;linkname=Too%20Busy%20to%20Blog" title="Google Gmail" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/gmail.png" width="16" height="16" alt="Google Gmail"/></a><a class="a2a_button_hotmail" href="http://www.addtoany.com/add_to/hotmail?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F13%2Ftoo-busy-to-blog%2F&amp;linkname=Too%20Busy%20to%20Blog" title="Hotmail" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/live.png" width="16" height="16" alt="Hotmail"/></a><a class="a2a_button_wordpress" href="http://www.addtoany.com/add_to/wordpress?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F13%2Ftoo-busy-to-blog%2F&amp;linkname=Too%20Busy%20to%20Blog" title="WordPress" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/wordpress.png" width="16" height="16" alt="WordPress"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F13%2Ftoo-busy-to-blog%2F&amp;linkname=Too%20Busy%20to%20Blog" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F13%2Ftoo-busy-to-blog%2F&amp;linkname=Too%20Busy%20to%20Blog" title="Facebook" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F13%2Ftoo-busy-to-blog%2F&amp;linkname=Too%20Busy%20to%20Blog" title="Delicious" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F11%2F13%2Ftoo-busy-to-blog%2F&amp;title=Too%20Busy%20to%20Blog" id="wpa2a_8"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.bobpeers.com/2008/11/13/too-busy-to-blog/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Development tools on Windows vs Linux</title>
		<link>http://blog.bobpeers.com/2008/03/12/development-tools-on-windows-vs-linux/</link>
		<comments>http://blog.bobpeers.com/2008/03/12/development-tools-on-windows-vs-linux/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 21:33:30 +0000</pubDate>
		<dc:creator>Bob Peers</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.bobpeers.com/2008/03/12/development-tools-on-windows-vs-linux/</guid>
		<description><![CDATA[As far as desktop systems go, for email, internet and basic office functionality, there&#8217;s no denying that Windows rules the roost. I would argue that Linux is actually not difficult to set up and use, it&#8217;s just different and probably has a perception problem, but therein lies the problem. But from a developers point of [...]]]></description>
			<content:encoded><![CDATA[<p>As far as desktop systems go, for email, internet and basic office functionality, there&#8217;s no denying that Windows rules the roost. I would argue that Linux is actually not difficult to set up and use, it&#8217;s just different and probably has a perception problem, but therein lies the problem.</p>
<p>But from a developers point of view using Linux as the platform has many advantages over Windows. Try writing a simple &#8220;Hello world&#8221; program in C or C++ on a fresh Windows install an then compile and run it. You can&#8217;t.</p>
<p>Simply put, most Linux distributions come with compilers (<a href="http://gcc.gnu.org/" title="GCC, the GNU Compiler Collection">gcc</a> in this case) installed out of the box and many more are available with an &#8216;apt-get&#8217; or &#8216;yum install&#8217; command. You don&#8217;t even have to do this from the command line these days as most distributions have friendly graphical install programs that put anything Windows has to shame.</p>
<p>Want Python or <a href="http://www.perl.com/" title=" Perl.com ">Perl</a>, <a href="http://www.apache.org/" title="Apache Software Foundation Site">Apache</a> or <a href="http://www.mysql.com/" title="MySQL site">MySQL</a> again it&#8217;s a few clicks away along with hundreds (thousands?) of other tools. Plus once they&#8217;re installed the OS takes care of notifying you (and optionally installing) any updates so you&#8217;ll never be left with 3 year old, unpatched software on your computer.</p>
<p>The last time I checked my Windows install I had many applications that were way out of date but the effort required to check up and manually update each one individually was just too much effort.</p>
<p>On a related note I have been using <a href="http://www.eclipse.org/" title="Eclipse.org homepage">Eclipse</a> as my <a href="http://en.wikipedia.org/wiki/Integrated_development_environment" title="Wikipedia page on IDE">IDE</a> of choice, mainly because of it&#8217;s support of both Python and C++ using the <a href="http://pydev.sourceforge.net/" title="Python Development Environment">Pydev</a> and <a href="http://www.eclipse.org/cdt/" title="Eclipse C/C++ Development Tooling - CDT">CDT</a> modules. So I thought I&#8217;d give it a try on Windows.</p>
<p>After downloading and installing Python then <a href="http://www.rose-hulman.edu/Class/csse/resources/Eclipse/eclipse-python-configuration.htm" title="Pydev install instructions">installing the Pydev module</a>, getting Python to work was not too difficult. Next came C++ support, it involves installing MinGW following the <a href="http://www.mingw.org/download.shtml" title="MinGW download page">instructions on download page</a>, then configuring Eclipse using <a href="http://www.codeproject.com/KB/tips/CPP_Dev_eclipse_CDT.aspx" title="C++ Development using eclipse IDE– Starters guide">these instructions</a>.</p>
<p>If you&#8217;re very lucky it will all work first time, but don&#8217;t count on it. And god help you if you decide to update any packages at a later date.</p>
<p>Compared to all this the development tools on Linux are a breeze. Linux may or may not be ready for the desktop for the average user (if there is such a person) but when it comes to the power user or developer it&#8217;s already ahead in my books.</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F12%2Fdevelopment-tools-on-windows-vs-linux%2F&amp;counturl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F12%2Fdevelopment-tools-on-windows-vs-linux%2F&amp;count=none&amp;text=Development%20tools%20on%20Windows%20vs%20Linux" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F12%2Fdevelopment-tools-on-windows-vs-linux%2F&amp;counturl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F12%2Fdevelopment-tools-on-windows-vs-linux%2F&amp;count=none&amp;text=Development%20tools%20on%20Windows%20vs%20Linux" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F12%2Fdevelopment-tools-on-windows-vs-linux%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F12%2Fdevelopment-tools-on-windows-vs-linux%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F12%2Fdevelopment-tools-on-windows-vs-linux%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F12%2Fdevelopment-tools-on-windows-vs-linux%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F12%2Fdevelopment-tools-on-windows-vs-linux%2F&amp;linkname=Development%20tools%20on%20Windows%20vs%20Linux" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F12%2Fdevelopment-tools-on-windows-vs-linux%2F&amp;linkname=Development%20tools%20on%20Windows%20vs%20Linux" title="Evernote" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_button_google_gmail" href="http://www.addtoany.com/add_to/google_gmail?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F12%2Fdevelopment-tools-on-windows-vs-linux%2F&amp;linkname=Development%20tools%20on%20Windows%20vs%20Linux" title="Google Gmail" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/gmail.png" width="16" height="16" alt="Google Gmail"/></a><a class="a2a_button_hotmail" href="http://www.addtoany.com/add_to/hotmail?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F12%2Fdevelopment-tools-on-windows-vs-linux%2F&amp;linkname=Development%20tools%20on%20Windows%20vs%20Linux" title="Hotmail" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/live.png" width="16" height="16" alt="Hotmail"/></a><a class="a2a_button_wordpress" href="http://www.addtoany.com/add_to/wordpress?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F12%2Fdevelopment-tools-on-windows-vs-linux%2F&amp;linkname=Development%20tools%20on%20Windows%20vs%20Linux" title="WordPress" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/wordpress.png" width="16" height="16" alt="WordPress"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F12%2Fdevelopment-tools-on-windows-vs-linux%2F&amp;linkname=Development%20tools%20on%20Windows%20vs%20Linux" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F12%2Fdevelopment-tools-on-windows-vs-linux%2F&amp;linkname=Development%20tools%20on%20Windows%20vs%20Linux" title="Facebook" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F12%2Fdevelopment-tools-on-windows-vs-linux%2F&amp;linkname=Development%20tools%20on%20Windows%20vs%20Linux" title="Delicious" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F12%2Fdevelopment-tools-on-windows-vs-linux%2F&amp;title=Development%20tools%20on%20Windows%20vs%20Linux" id="wpa2a_10"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.bobpeers.com/2008/03/12/development-tools-on-windows-vs-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programming for Performance or Simplicity</title>
		<link>http://blog.bobpeers.com/2008/03/11/programming-for-performance-or-simplicity/</link>
		<comments>http://blog.bobpeers.com/2008/03/11/programming-for-performance-or-simplicity/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 21:34:20 +0000</pubDate>
		<dc:creator>Bob Peers</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[vbscript]]></category>

		<guid isPermaLink="false">http://blog.bobpeers.com/2008/03/11/programming-for-performance-or-simplicity/</guid>
		<description><![CDATA[I was recently writing some code to be run from a command line that recursively walks through a network folder and all sub folders compiling a list of all the files, their last modified date and their size. Since writing VBScript is quick and dirty I tend to start with that and in most cases [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently writing some code to be run from a command line that recursively walks through a network folder and all sub folders compiling a list of all the files, their last modified date and their size.</p>
<p>Since writing <a href="http://msdn2.microsoft.com/en-us/library/t0aew7h6.aspx" title="Microsoft Developer Network - VBScript">VBScript</a> is quick and dirty I tend to start with that and in most cases it works just fine. However when speed really matter it&#8217;s just not up to the job.</p>
<p>The network directory contains about 35,000 files in 3,200 folders consuming 45.4GB of disk space. The script should simply gather the data required and write it to a flat text file (delimited with semi-colons). When I ran the VBScript it took 306 seconds (5 minutes and 6 seconds) to gather the data.</p>
<p>Not too bad but not fast enough. So I decided to write the same script both in <a href="http://www.python.org/" title="Python Programming Language -- Official Website">Python</a> and <a href="http://en.wikipedia.org/wiki/C%2B%2B" title="Wikipedia C++ entry">C++</a>. Python is a very high level scripting language, so nowhere near as fast as a complied language like C++, but I wanted to see how it compared to VBScript. Here&#8217;s the results for the 3 programs.</p>
<table>
<tr>
<th>Language</th>
<th>Files indexed</th>
<th>Time taken (seconds)</th>
<th>Files per Second</th>
</tr>
<tr>
<td>VBScript</td>
<td>34999</td>
<td>306</td>
<td>114.4</td>
</tr>
<tr>
<td>Python</td>
<td>35018</td>
<td>68.5</td>
<td>511.2</td>
</tr>
<tr>
<td>C++</td>
<td>35017</td>
<td>13.9</td>
<td>2519.2</td>
</tr>
</table>
<p>Of course, as expected, for real performance C++ outstrips the scripting languages by a mile but Python also fairs pretty well.</p>
<p>When I also consider how simple the code is and how long it took to develop I think Python is the clear winner unless every ounce of performance is vital. Developing real world programs in Python is extremely easy and the code is fast.</p>
<p>I use another short script in Python to parse <a href="http://www.apache.org/" title="Apache Software Foundation">Apache</a> log files and it amazes me how fast it runs. The current log is over 122,000 lines (27.1MB of data) long but the script parses the file and outputs the results to a text file in just over a second! Very impressive for an interpreted language.</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F11%2Fprogramming-for-performance-or-simplicity%2F&amp;counturl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F11%2Fprogramming-for-performance-or-simplicity%2F&amp;count=none&amp;text=Programming%20for%20Performance%20or%20Simplicity" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F11%2Fprogramming-for-performance-or-simplicity%2F&amp;counturl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F11%2Fprogramming-for-performance-or-simplicity%2F&amp;count=none&amp;text=Programming%20for%20Performance%20or%20Simplicity" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F11%2Fprogramming-for-performance-or-simplicity%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F11%2Fprogramming-for-performance-or-simplicity%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F11%2Fprogramming-for-performance-or-simplicity%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F11%2Fprogramming-for-performance-or-simplicity%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F11%2Fprogramming-for-performance-or-simplicity%2F&amp;linkname=Programming%20for%20Performance%20or%20Simplicity" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F11%2Fprogramming-for-performance-or-simplicity%2F&amp;linkname=Programming%20for%20Performance%20or%20Simplicity" title="Evernote" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_button_google_gmail" href="http://www.addtoany.com/add_to/google_gmail?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F11%2Fprogramming-for-performance-or-simplicity%2F&amp;linkname=Programming%20for%20Performance%20or%20Simplicity" title="Google Gmail" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/gmail.png" width="16" height="16" alt="Google Gmail"/></a><a class="a2a_button_hotmail" href="http://www.addtoany.com/add_to/hotmail?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F11%2Fprogramming-for-performance-or-simplicity%2F&amp;linkname=Programming%20for%20Performance%20or%20Simplicity" title="Hotmail" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/live.png" width="16" height="16" alt="Hotmail"/></a><a class="a2a_button_wordpress" href="http://www.addtoany.com/add_to/wordpress?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F11%2Fprogramming-for-performance-or-simplicity%2F&amp;linkname=Programming%20for%20Performance%20or%20Simplicity" title="WordPress" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/wordpress.png" width="16" height="16" alt="WordPress"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F11%2Fprogramming-for-performance-or-simplicity%2F&amp;linkname=Programming%20for%20Performance%20or%20Simplicity" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F11%2Fprogramming-for-performance-or-simplicity%2F&amp;linkname=Programming%20for%20Performance%20or%20Simplicity" title="Facebook" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F11%2Fprogramming-for-performance-or-simplicity%2F&amp;linkname=Programming%20for%20Performance%20or%20Simplicity" title="Delicious" rel="nofollow" target="_blank"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.bobpeers.com%2F2008%2F03%2F11%2Fprogramming-for-performance-or-simplicity%2F&amp;title=Programming%20for%20Performance%20or%20Simplicity" id="wpa2a_12"><img src="http://blog.bobpeers.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.bobpeers.com/2008/03/11/programming-for-performance-or-simplicity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

