<?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>CyrusBuilt dot Net</title>
	<atom:link href="http://cyrusbuilt.net/wordpress/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://cyrusbuilt.net/wordpress</link>
	<description>A place for geeks  ;-)</description>
	<lastBuildDate>Thu, 29 Jul 2010 15:51:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Sensibility FTW.  Awesome.</title>
		<link>http://cyrusbuilt.net/wordpress/?p=269</link>
		<comments>http://cyrusbuilt.net/wordpress/?p=269#comments</comments>
		<pubDate>Thu, 29 Jul 2010 15:48:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://cyrusbuilt.net/wordpress/?p=269</guid>
		<description><![CDATA[
		
		
		
		

function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&#038;t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}


html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}

Share
		
		
		
		As a U.S. citizen, I&#8217;m not the biggest fan of the U.S. government.  Having said that, every once in a while, they do something cool:

The U.S. Government [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 42px; padding-right: 90px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		reddit_url = "http://cyrusbuilt.net/wordpress/?p=269";
		reddit_title = "Sensibility FTW.  Awesome.";
		//-->
		</script>
		<script type="text/javascript" src="http://www.reddit.com/button.js?t=1"></script></div><div style="float: right; width: 70px; margin: 0 0 0 10px;">
<script type="text/javascript">
function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}
</script>
<style type="text/css">
html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}
</style>
<a href="http://www.facebook.com/share.php?u=http://cyrusbuilt.net/wordpress/?p=269" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://cyrusbuilt.net/wordpress/?p=269";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "Sensibility FTW.  Awesome.";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><!--S-ButtonZ 1.1.5 End--><div id="_mcePaste">As a U.S. citizen, I&#8217;m not the biggest fan of the U.S. government.  Having said that, every once in a while, they do something cool:</div>
<div id="_mcePaste"></div>
<div><a href="http://www.appleinsider.com/articles/10/07/26/us_government_legalizes_iphone_jailbreaking_for_unauthorized_apps.html" target="_blank">The U.S. Government legalizes jail-breaking the iPhone.</a></div>
<p>Take THAT Steve Jobs.  Your anti-competitive practices and AT&amp;T&#8217;s bullshit finally pissed off the right people.  HA!</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://cyrusbuilt.net/wordpress/?feed=rss2&amp;p=269</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You gotta be kidding me&#8230;.</title>
		<link>http://cyrusbuilt.net/wordpress/?p=268</link>
		<comments>http://cyrusbuilt.net/wordpress/?p=268#comments</comments>
		<pubDate>Thu, 29 Jul 2010 15:27:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://cyrusbuilt.net/wordpress/?p=268</guid>
		<description><![CDATA[
		
		
		
		

function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&#038;t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}


html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}

Share
		
		
		
		This resulted in a BSOD and a spontaneous reboot.  This is why I hit &#8220;save&#8221; after every line of code.  *sigh*
&#160;]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 42px; padding-right: 90px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		reddit_url = "http://cyrusbuilt.net/wordpress/?p=268";
		reddit_title = "You gotta be kidding me&#8230;.";
		//-->
		</script>
		<script type="text/javascript" src="http://www.reddit.com/button.js?t=1"></script></div><div style="float: right; width: 70px; margin: 0 0 0 10px;">
<script type="text/javascript">
function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}
</script>
<style type="text/css">
html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}
</style>
<a href="http://www.facebook.com/share.php?u=http://cyrusbuilt.net/wordpress/?p=268" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://cyrusbuilt.net/wordpress/?p=268";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "You gotta be kidding me&#8230;.";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><!--S-ButtonZ 1.1.5 End--><div id="attachment_267" class="wp-caption alignnone" style="width: 276px"><a href="http://cyrusbuilt.net/wordpress/wp-content/uploads/2010/07/LovelyError.jpg"><img src="http://cyrusbuilt.net/wordpress/wp-content/uploads/2010/07/LovelyError-266x300.jpg" alt="" title="LovelyError" width="266" height="300" class="size-medium wp-image-267" /></a><p class="wp-caption-text">WTF???  Naughty BIOS....</p></div>
<p>This resulted in a BSOD and a spontaneous reboot.  This is why I hit &#8220;save&#8221; after every line of code.  *sigh*</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://cyrusbuilt.net/wordpress/?feed=rss2&amp;p=268</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Busy Busy Busy</title>
		<link>http://cyrusbuilt.net/wordpress/?p=265</link>
		<comments>http://cyrusbuilt.net/wordpress/?p=265#comments</comments>
		<pubDate>Fri, 23 Jul 2010 21:02:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[CyrusBuilt Software]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://cyrusbuilt.net/wordpress/?p=265</guid>
		<description><![CDATA[
		
		
		
		

function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&#038;t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}


html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}

Share
		
		
		
		Busy at work doing cross-platform application development in Mono/.NET using Monodevelop and GTK#.  Mmmmmmm&#8230;&#8230;. We loves it.
&#160;]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 42px; padding-right: 90px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		reddit_url = "http://cyrusbuilt.net/wordpress/?p=265";
		reddit_title = "Busy Busy Busy";
		//-->
		</script>
		<script type="text/javascript" src="http://www.reddit.com/button.js?t=1"></script></div><div style="float: right; width: 70px; margin: 0 0 0 10px;">
<script type="text/javascript">
function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}
</script>
<style type="text/css">
html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}
</style>
<a href="http://www.facebook.com/share.php?u=http://cyrusbuilt.net/wordpress/?p=265" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://cyrusbuilt.net/wordpress/?p=265";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "Busy Busy Busy";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><!--S-ButtonZ 1.1.5 End--><div id="attachment_264" class="wp-caption alignnone" style="width: 310px"><a href="http://cyrusbuilt.net/wordpress/wp-content/uploads/2010/07/Screen.Capture.20100723163435.jpg"><img class="size-medium wp-image-264" title="Screen.Capture.20100723163435" src="http://cyrusbuilt.net/wordpress/wp-content/uploads/2010/07/Screen.Capture.20100723163435-300x93.jpg" alt="" width="300" height="93" /></a><p class="wp-caption-text">Hard at work!</p></div>
<p>Busy at work doing cross-platform application development in Mono/.NET using Monodevelop and GTK#.  Mmmmmmm&#8230;&#8230;. We loves it.</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://cyrusbuilt.net/wordpress/?feed=rss2&amp;p=265</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CyrusBuilt StopWatch Library for Mono/.NET</title>
		<link>http://cyrusbuilt.net/wordpress/?p=258</link>
		<comments>http://cyrusbuilt.net/wordpress/?p=258#comments</comments>
		<pubDate>Wed, 21 Jul 2010 22:00:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://cyrusbuilt.net/wordpress/?p=258</guid>
		<description><![CDATA[
		
		
		
		

function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&#038;t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}


html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}

Share
		
		
		
		I&#8217;ve worked on several projects where I desperately needed functionality of a StopWatch in code.  For example, I worked on a front-end for nmap.  When ever you [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 42px; padding-right: 90px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		reddit_url = "http://cyrusbuilt.net/wordpress/?p=258";
		reddit_title = "CyrusBuilt StopWatch Library for Mono/.NET";
		//-->
		</script>
		<script type="text/javascript" src="http://www.reddit.com/button.js?t=1"></script></div><div style="float: right; width: 70px; margin: 0 0 0 10px;">
<script type="text/javascript">
function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}
</script>
<style type="text/css">
html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}
</style>
<a href="http://www.facebook.com/share.php?u=http://cyrusbuilt.net/wordpress/?p=258" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://cyrusbuilt.net/wordpress/?p=258";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "CyrusBuilt StopWatch Library for Mono/.NET";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><!--S-ButtonZ 1.1.5 End--><p>I&#8217;ve worked on several projects where I desperately needed functionality of a StopWatch in code.  For example, I worked on a front-end for <a href="http://www.insecure.org" target="_blank">nmap</a>.  When ever you clicked the &#8220;start scan&#8221; button to initiate the nmap scan, the idea was to start a timer and then update a label with the elapsed time as the time passed, and then give a total scan duration (yes, nmap calculates scan duration itself, but I wanted the combined duration of the front-end&#8217;s operations *plus* nmap&#8217;s).</p>
<p>This really isn&#8217;t that complicated.  The System.Timers namespace provides most of what we need to do exactly that.  But I need MORE from the System.Timers class.  I needed methods that performed a number of calculations AND built a formatted elapsed time string for me, so I didn&#8217;t have to keep repeating this code in an event handler.  I have seen examples from people using the TimeSpan class where they would set a variable equal to DateTime.Now before they started an operation, then get the value of DateTime.Now when the operation was over and calculate then calculate the difference.  This is all well and good, but I needed something that acted more like a <em>real</em> stopwatch.  At a defined interval (or pulse, if you will), I wanted an event to get raised, which simulated the tick of the second hand on the stopwatch.  I could then have an event handler that got all the time information for the event and only have to update a label (or whatever) using the data passed from the event.</p>
<p>Yes, System.Timers.Timer <em>does</em> have an &#8220;Elapsed&#8221; event.  But the event doesn&#8217;t give me everything I want.  So basically, I decided to write my own reusable class library for both Mono and .NET that accomplished everything I needed, and then some.</p>
<p>The CyrusBuilt StopWatch class library has the following features:</p>
<ul>
<li>Calculate elapsed time between start time and current time (if running) or start time and stop time.</li>
<li>Calculate total elapsed time in days.</li>
<li>Calculate total elapsed time in hours.</li>
<li>Calculate total elapsed time in minutes.</li>
<li>Calculate total elapsed time in seconds.</li>
<li>Calculate total elapsed time in milliseconds.</li>
<li>Get a formatted elapsed time string.</li>
<li>Raise an event that passes the above information in the event arguments.</li>
<li>Start/Stop the stopwatch.</li>
<li>Allow user defined &#8220;pulse&#8221; or &#8220;tick&#8221; interval (defaults to 1 second).</li>
<li>Set a flag to indicate whether or not the stopwatch is running.</li>
</ul>
<p>The following is an example of how to use it:</p>
<p><strong>Without events:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">using</span> <span style="color: #008080;">CyrusBuilt.Utils</span><span style="color: #008000;">;</span>
&nbsp;
StopWatch sw <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> StopWatch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
sw.<span style="color: #0000FF;">Start</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">// Wait 3 seconds.</span>
<span style="color: #0600FF;">while</span> <span style="color: #000000;">&#40;</span>sw.<span style="color: #0000FF;">IsRunning</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
   <span style="color: #000000;">System.<span style="color: #0000FF;">Threading</span></span>.<span style="color: #0000FF;">Thread</span>.<span style="color: #0000FF;">Sleep</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">3000</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
sw.<span style="color: #0000FF;">Stop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
Console.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Time elapsed: &quot;</span> <span style="color: #008000;">+</span> sw.<span style="color: #0000FF;">GetElapsedTimeString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
sw.<span style="color: #0000FF;">Dispose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p><strong>With Events</strong></p>
<p>This is a lil bit trickier, but still quite manageable and probably the most common way it would be implemented in a Form.  First, let&#8217;s create an event handler for the <strong>Elapsed</strong> event.  Assume we have a label control called MyLabel:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">using</span> <span style="color: #008080;">CyrusBuilt.Utils</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">// put this somewhere inside a class declaration or FormLoad event handler (for example).</span>
StopWatch sw <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> StopWatch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">// ........ shortened for brevity ..... //</span>
<span style="color: #0600FF;">private</span> <span style="color: #0600FF;">void</span> StopWatchElapsed<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> sender, StopWatchElapsedEventArgs e<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
   MyLabel.<span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> e.<span style="color: #0000FF;">ElapsedTimeString</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Now we just need to register the event, then when the event fires after we start the stopwatch the label will be automatically updated with the elapsed time.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">private</span> <span style="color: #0600FF;">void</span> Go<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
   sw.<span style="color: #0000FF;">Elapsed</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">new</span> StopWatchElapsedEventHandler<span style="color: #000000;">&#40;</span>StopWatchElapsed<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
   sw.<span style="color: #0000FF;">Start</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
   <span style="color: #0600FF;">while</span> <span style="color: #000000;">&#40;</span>sw.<span style="color: #0000FF;">IsRunning</span><span style="color: #000000;">&#41;</span>
   <span style="color: #000000;">&#123;</span>
      <span style="color: #000000;">System.<span style="color: #0000FF;">Threading</span></span>.<span style="color: #0000FF;">Thread</span>.<span style="color: #0000FF;">Sleep</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">3000</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
   <span style="color: #000000;">&#125;</span>
&nbsp;
   sw.<span style="color: #0000FF;">Stop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>In the above example, the label text should be &#8220;03:00&#8243; (3 seconds, 0 milliseconds).  Since we know only a matter of seconds will pass for our operation, we could have also written our event handler like this:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">private</span> <span style="color: #0600FF;">void</span> StopWatchElapsed<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> sender, StopWatchElapsedEventArgs e<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
   MyLabel.<span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Format</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Elapsed: {0} seconds&quot;</span>, e.<span style="color: #0000FF;">ElapsedSeconds</span>.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>The StopWatch library is released under <a href="http://www.gnu.org/licenses/gpl-2.0.html" target="_blank">GPLv2</a> and the source code and binaries are available from the <a href="http://cyrusbuilt.net/wordpress/?page_id=55" target="_self">downloads</a> page in the &#8220;Mono/.NET&#8221; section.</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://cyrusbuilt.net/wordpress/?feed=rss2&amp;p=258</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checking for Java in VBScript (Existence and Path)</title>
		<link>http://cyrusbuilt.net/wordpress/?p=247</link>
		<comments>http://cyrusbuilt.net/wordpress/?p=247#comments</comments>
		<pubDate>Wed, 07 Jul 2010 16:07:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://cyrusbuilt.net/wordpress/?p=247</guid>
		<description><![CDATA[
		
		
		
		

function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&#038;t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}


html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}

Share
		
		
		
		I was working on another login script for one of our clients a while back and ran into a situation where I needed to programmatically check if Java &#8482; [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 42px; padding-right: 90px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		reddit_url = "http://cyrusbuilt.net/wordpress/?p=247";
		reddit_title = "Checking for Java in VBScript (Existence and Path)";
		//-->
		</script>
		<script type="text/javascript" src="http://www.reddit.com/button.js?t=1"></script></div><div style="float: right; width: 70px; margin: 0 0 0 10px;">
<script type="text/javascript">
function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}
</script>
<style type="text/css">
html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}
</style>
<a href="http://www.facebook.com/share.php?u=http://cyrusbuilt.net/wordpress/?p=247" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://cyrusbuilt.net/wordpress/?p=247";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "Checking for Java in VBScript (Existence and Path)";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><!--S-ButtonZ 1.1.5 End--><p>I was working on another login script for one of our clients a while back and ran into a situation where I needed to programmatically check if Java &#8482; was installed.  I then had another scenario where I needed to get the path to the JRE.  Unfortunately, I didn&#8217;t know any good way to do that at the time so I put together a couple of helper functions.  I&#8217;m not entirely sure if this is the <em>best</em> way to do this, but its the best method I&#8217;ve come up with so far, and has served me well for a few weeks now.</p>
<p><strong>Some background:</strong></p>
<p>The client is a school with a large number of student and staff workstations (whole labs, classrooms, etc).  They have a (rather poorly written IMHO) educational software package written in Java deployed all over the place.  As such, the primary requirement for this software is the Java Runtime Environment (JRE).  Unfortunately, not <em>all</em> the workstations have the JRE (intentionally in some cases).  The client requested that the script logic <em>conditionally</em> create shortcuts on the desktop for various URLs and applications, with the Java application being one of them.  Naturally, a condition for creating the shortcut to the Java application needed to be that Java actually be installed in the first place (the second being that the application itself is installed, and the other being that the user belonged to a particular security group).</p>
<p>But, the shortcut can&#8217;t just point to the .JAR file.  It has to launch the runtime with the .JAR as an argument (also could&#8217;ve created a batch file or other script to do the same thing, but why bother) which means I needed to know the path to the JRE so I could build the path to the javaw.exe binary.</p>
<p><strong>The code:</strong></p>
<p>The method I chose involves looking in the local machine&#8217;s registry.  So before I go too deep into the Java stuff, we&#8217;re going to need the following function.  The purpose of this function is to check for the existence of a named value within a specified key in a specified hive in the local registry:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Function</span> RegValueExists(<span style="color: #000080;">ByVal</span> Hive, <span style="color: #000080;">ByVal</span> Key, <span style="color: #000080;">ByVal</span> Value)
   <span style="color: #000080;">Const</span> sComputer = <span style="color: #800000;">&quot;.&quot;</span>
   <span style="color: #000080;">Dim</span> arrValNames
   <span style="color: #000080;">Dim</span> arrValTypes
   <span style="color: #000080;">Dim</span> idx
   <span style="color: #000080;">Dim</span> iRet
   <span style="color: #000080;">Dim</span> objReg
   iRet = <span style="color: #000080;">False</span>
&nbsp;
   <span style="color: #000080;">Set</span> objReg = GetObject(<span style="color: #800000;">&quot;winmgmts:{impersonationLevel=impersonate}!\\&quot;</span> &amp; sComputer &amp; <span style="color: #800000;">&quot;\root\default:StdRegProv&quot;</span>)
   <span style="color: #000080;">If</span> (IsObject(objReg)) <span style="color: #000080;">Then</span>
      <span style="color: #000080;">If</span> (objReg.EnumValues(Hive, Key, arrValNames, arrValTypes) = 0) <span style="color: #000080;">Then</span>
         <span style="color: #000080;">If</span> (IsArray(arrValNames)) <span style="color: #000080;">Then</span>
            <span style="color: #000080;">For</span> idx = 1 <span style="color: #000080;">To</span> <span style="color: #000080;">UBound</span>(arrValNames)
               <span style="color: #000080;">If</span> (LCase(arrValNames(idx)) = LCase(Value)) <span style="color: #000080;">Then</span>
                  iRet = <span style="color: #000080;">True</span>
                  <span style="color: #000080;">Exit</span> <span style="color: #000080;">For</span>
               <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
            <span style="color: #000080;">Next</span>
         <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
      <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
   <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
&nbsp;
   <span style="color: #000080;">Set</span> objReg = <span style="color: #000080;">Nothing</span>
   <span style="color: #000080;">Erase</span> arrValNames
   <span style="color: #000080;">Erase</span> arrValTypes
   RegValueExists = iRet
<span style="color: #000080;">End</span> <span style="color: #000080;">Function</span></pre></div></div>

<p>Now on to the good stuff.  The following function will get the path to the newest version of installed JRE on the local machine:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Function</span> GetJavaPath()
   <span style="color: #000080;">On</span> <span style="color: #000080;">Error</span> <span style="color: #000080;">Resume</span> <span style="color: #000080;">Next</span>
   <span style="color: #000080;">Const</span> HKLM = &amp;H80000002
   <span style="color: #000080;">Const</span> sComputer = <span style="color: #800000;">&quot;.&quot;</span>
   <span style="color: #000080;">Dim</span> sRet
   <span style="color: #000080;">Dim</span> sKeyPath
   <span style="color: #000080;">Dim</span> sValueName
   <span style="color: #000080;">Dim</span> sValue
   <span style="color: #000080;">Dim</span> objReg
   sRet = <span style="color: #800000;">&quot;&quot;</span>
&nbsp;
   <span style="color: #000080;">Set</span> objReg = GetObject(<span style="color: #800000;">&quot;winmgmts:{impersonationLevel=impersonate}!\\&quot;</span> &amp; sComputer &amp; <span style="color: #800000;">&quot;\root\default:StdRegProv&quot;</span>)
   <span style="color: #000080;">If</span> (IsObject(objReg)) <span style="color: #000080;">Then</span>
      sKeyPath = <span style="color: #800000;">&quot;SOFTWARE\JavaSoft\Java Runtime Environment&quot;</span>
      sValueName = <span style="color: #800000;">&quot;CurrentVersion&quot;</span>
      <span style="color: #000080;">If</span> (RegValueExists(HKLM, sKeyPath, sValueName)) <span style="color: #000080;">Then</span>
         <span style="color: #000080;">If</span> (objReg.GetStringValue(HKLM, sKeyPath, sValueName, sValue) = 0) <span style="color: #000080;">Then</span>
            <span style="color: #000080;">If</span> (Len(sValue) &gt; 0) <span style="color: #000080;">Then</span>
               sKeyPath = sKeyPath &amp; <span style="color: #800000;">&quot;\&quot;</span> &amp; sValue
               sValueName = <span style="color: #800000;">&quot;JavaHome&quot;</span>
&nbsp;
               <span style="color: #000080;">If</span> (RegValueExists(HKLM, sKeyPath, sValueName)) <span style="color: #000080;">Then</span>
                  <span style="color: #000080;">If</span> (objReg.GetStringValue(HKLM, sKeyPath, sValueName, sValue) = 0) <span style="color: #000080;">Then</span>
                     <span style="color: #000080;">If</span> (Len(sValue) &gt; 0) <span style="color: #000080;">Then</span>
                        sRet = sValue
                     <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
                  <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
               <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
            <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
         <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
      <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
   <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
&nbsp;
   <span style="color: #000080;">Set</span> objReg = <span style="color: #000080;">Nothing</span>
   GetJavaPath = sRet
<span style="color: #000080;">End</span> <span style="color: #000080;">Function</span></pre></div></div>

<p>And there you have it!  If no JRE is installed, the returned path will be a blank string.  Otherwise, the path to the latest JRE will be returned (Example: C:\program files\Java\jre6).  Please, note that the <em>installation path</em> is what is returned, not the full path to any executable.  Now with this logic, we can also do an existence check by simply checking the output of GetJavaPath() for a blank string, then check if non-empty string contains a valid path:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Function</span> IsJavaInstalled()
   <span style="color: #000080;">Dim</span> objFSO
   <span style="color: #000080;">Dim</span> sPath
&nbsp;
   sPath = GetJavaPath()
   <span style="color: #000080;">If</span> (Len(sPath) &gt; 0) <span style="color: #000080;">Then</span>
      <span style="color: #000080;">Set</span> objFSO = WScript.CreateObject(<span style="color: #800000;">&quot;Scripting.FileSystemObject&quot;</span>)
      <span style="color: #000080;">If</span> (IsObject(objFSO)) <span style="color: #000080;">Then</span>
         <span style="color: #000080;">If</span> (objFSO.FolderExists(sPath)) <span style="color: #000080;">Then</span>
            IsJavaInstalled = <span style="color: #000080;">True</span>
         <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
      <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
      <span style="color: #000080;">Set</span> objFSO = <span style="color: #000080;">Nothing</span>
   <span style="color: #000080;">Else</span>
      IsJavaInstalled = <span style="color: #000080;">False</span>
   <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
<span style="color: #000080;">End</span> <span style="color: #000080;">Function</span></pre></div></div>

<p>Hope this helps someone out there!  If anyone knows a better or more accurate/efficient way to do this, feel free to share!</p>
<p>Happy coding.</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://cyrusbuilt.net/wordpress/?feed=rss2&amp;p=247</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Analysis Paralysis</title>
		<link>http://cyrusbuilt.net/wordpress/?p=242</link>
		<comments>http://cyrusbuilt.net/wordpress/?p=242#comments</comments>
		<pubDate>Thu, 27 May 2010 03:48:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://cyrusbuilt.net/wordpress/?p=242</guid>
		<description><![CDATA[
		
		
		
		

function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&#038;t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}


html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}

Share
		
		
		
		Currently, I am my employer&#8217;s sole software engineer.  We used to have another, but he resigned.  Even then, we never worked together on anything.  At my last [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 42px; padding-right: 90px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		reddit_url = "http://cyrusbuilt.net/wordpress/?p=242";
		reddit_title = "Analysis Paralysis";
		//-->
		</script>
		<script type="text/javascript" src="http://www.reddit.com/button.js?t=1"></script></div><div style="float: right; width: 70px; margin: 0 0 0 10px;">
<script type="text/javascript">
function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}
</script>
<style type="text/css">
html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}
</style>
<a href="http://www.facebook.com/share.php?u=http://cyrusbuilt.net/wordpress/?p=242" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://cyrusbuilt.net/wordpress/?p=242";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "Analysis Paralysis";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><!--S-ButtonZ 1.1.5 End--><p>Currently, I am my employer&#8217;s sole software engineer.  We used to have another, but he resigned.  Even then, we never worked together on anything.  At my last job, I was one of two developers.  To be fair, neither employer is actually <em>in</em> the software business&#8230;. but the both had a very real need for an in-house developer.</p>
<p>My current employer relies on my abilities to streamline it&#8217;s operations and the operations of our clients via automation and tools.  I spend a LOT of my time developing one-off tools and scripts, as well as entire frameworks of reusable code to make things more efficient and save our staff and the our clients&#8217; staff time.  I also build full-blown enterprise applications with SQL databases on the back-end.  Management tools, deployment tools, migration tools&#8230;. you name it.</p>
<p>But there is only one problem&#8230;.. I do this <em>alone.</em> Now there is some advantages to this:  For starters, I maintain <strong>absolute</strong> control over the codebase.  I have final say in how it gets written, what language it gets written in, etc, etc.  I also have the flexibility of working from home from time-to-time and I get the resources I need to get things done (without much argument and without much questioning) because there isn&#8217;t anyone else there to refute my needs or compete for said resources.  Plus, I can work at my own pace (except if some crazy short migration or deployment schedule gets dropped into my lap at the last minute) for the most part.</p>
<p>But there is also a dark side to coding alone: basically&#8230;. you&#8217;re working in a vacuum.  You don&#8217;t have anyone to collaborate with.  If you get stuck, Google is your only friend.  There is no one to check your work, make sure you stick to best practices or proper development guidelines, test your code, help look for bugs, etc.  You&#8217;re one your own.  I do have people I can collaborate with from a <em>design</em> perspective though.  These guys are Systems Engineers, Network Engineers, Support Managers, and technicians.  Their input is quite valuable, because they are technical people and they know how software <em>should </em>work.  They also understand usability and can usually point out things that will probably drive a user nuts or leave them totally confused.</p>
<p>But I don&#8217;t have anyone else who actually understands code&#8230;.. especially OOP.  Sure, we got a couple guys who can write some quick-and-VERY-dirty VBScripts or batch files, but thats about it.  Don&#8217;t misunderstand though&#8230; these guys are very talented individuals, but they simply aren&#8217;t <em>Programmers</em>.  There is a big difference.  A REAL programmer lives and breathes code&#8230; and understands multiple languages, knows when to use the right tool for the job and has a thorough grasp of OOP.  So while I still love what I do, and want to continue doing it, I often find myself with a sort-of &#8220;writers block&#8221; because I just can&#8217;t see a way forward.</p>
<p>This can be for a multitude of reasons:  didn&#8217;t get enough sleep, caffeine wore off, medical issues, totally stumped on a piece of code I can&#8217;t fix, too many distractions&#8230;.. whatever.  I&#8217;ve had days where I&#8217;ve stared at my computer screen drawing a complete blank and barely capable of writing even a few lines of code.  Usually when this happens, I&#8217;ll try to divert my energy to documenting existing methods in a library, compiling API documentation, or what-have-you just so I can keep moving and making <em>forward</em> progress.  But even that can be a chore sometimes.  When you are totally responsible for the design, testing, development, documentation, and implementation, and all other aspects of a project,<strong>you WILL make mistakes.</strong> It is unavoidable.  Bugs are going to be present no matter how hard you try.</p>
<p>So I sit and stare at the code.  Read and re-read books, articles, class diagrams, etc in an attempt to figure out the best approach to solve a problem or analyze my code to determine if what I have is the best approach and if the direction I want to go in is correct and efficient.  This leads to a condition commonly referred to as &#8220;analysis paralysis&#8221;.  You keep analyzing over and over, trying to figure out what to do next or how to fix a bug and how its going to affect the &#8220;big picture&#8221; and not actually getting anything significant accomplished.</p>
<p>Coding without collaborating is not ideal.  I understand why some people would be drawn to it, since programming was traditionally solo task in the days of yore, but in today&#8217;s world, large projects simply cannot be accomplished alone.  Its a dead-end.  In my case, it just isn&#8217;t feasible to have multiple programmers at our organization.  For the most part, this hasn&#8217;t been too much of a problem so far because I&#8217;ve really only had a couple large-scale projects, and I&#8217;m pretty good about beating my head on something until I figure it out, and all the days where I&#8217;m &#8220;in the zone&#8221; more than make up for the days where I&#8217;m stuck.  But for those of you who are aspiring to be a professional software developer&#8230;. choose a path that allows for collaboration.  Google can only take you so far.  Plus&#8230;.. Google isn&#8217;t going to check your code, perform extensive unit tests, or assist in debugging for you.</p>
<p>I read a <a href="http://www.codinghorror.com/blog/2007/06/in-programming-one-is-the-loneliest-number.html" target="_blank">very good post</a> about this that I felt hit the nail on the head.  It&#8217;s ok to ask questions.  It&#8217;s ok to challenge others as well as yourself.  This doesn&#8217;t have to mean &#8220;face time&#8221;.  I personally, am a fairly social person; although I didn&#8217;t used to be.  So I fully understand that many programmers are introverts.  That being said, there are many tools for communication that allow you to collaborate without being face-to-face.  Web-meetings, instant messaging, e-mail, etc.  They all can be used for collaboration and many open-source projects accomplish exactly that on a global scale.</p>
<p>Collective knowledge is far better than trying to roll solo.</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://cyrusbuilt.net/wordpress/?feed=rss2&amp;p=242</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FAIL.</title>
		<link>http://cyrusbuilt.net/wordpress/?p=238</link>
		<comments>http://cyrusbuilt.net/wordpress/?p=238#comments</comments>
		<pubDate>Thu, 06 May 2010 17:26:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://cyrusbuilt.net/wordpress/?p=238</guid>
		<description><![CDATA[
		
		
		
		

function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&#038;t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}


html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}

Share
		
		
		
		

So heres the thing&#8230;. I have a couple friends who do this kind of work, so I don&#8217;t like saying things like &#8220;construction workers are retards&#8221;.  But [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 42px; padding-right: 90px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		reddit_url = "http://cyrusbuilt.net/wordpress/?p=238";
		reddit_title = "FAIL.";
		//-->
		</script>
		<script type="text/javascript" src="http://www.reddit.com/button.js?t=1"></script></div><div style="float: right; width: 70px; margin: 0 0 0 10px;">
<script type="text/javascript">
function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}
</script>
<style type="text/css">
html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}
</style>
<a href="http://www.facebook.com/share.php?u=http://cyrusbuilt.net/wordpress/?p=238" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://cyrusbuilt.net/wordpress/?p=238";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "FAIL.";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><!--S-ButtonZ 1.1.5 End--><p><a href="http://cyrusbuilt.net/wordpress/wp-content/uploads/2010/05/Truck-Fail-2.jpg"><img class="alignnone size-medium wp-image-240" title="Truck Fail 2" src="http://cyrusbuilt.net/wordpress/wp-content/uploads/2010/05/Truck-Fail-2-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p><a href="http://cyrusbuilt.net/wordpress/wp-content/uploads/2010/05/Truck-Fail-1.jpg"><img class="alignnone size-medium wp-image-239" title="Truck Fail 1" src="http://cyrusbuilt.net/wordpress/wp-content/uploads/2010/05/Truck-Fail-1-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>So heres the thing&#8230;. I have a couple friends who do this kind of work, so I don&#8217;t like saying things like &#8220;construction workers are retards&#8221;.  But damnit&#8230;. they just keep giving me reasons!</p>
<p>Pssssssst&#8230;.. hey buddy&#8230;.. If you drive your truck with the boom up&#8230;. yer prolly gonna hit a power line or 2.  Just sayin&#8230;..</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://cyrusbuilt.net/wordpress/?feed=rss2&amp;p=238</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Palm, Suck it.</title>
		<link>http://cyrusbuilt.net/wordpress/?p=236</link>
		<comments>http://cyrusbuilt.net/wordpress/?p=236#comments</comments>
		<pubDate>Fri, 30 Apr 2010 21:10:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://cyrusbuilt.net/wordpress/?p=236</guid>
		<description><![CDATA[
		
		
		
		

function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&#038;t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}


html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}

Share
		
		
		
		So I noticed HP bought Palm&#8230;. and this makes me happy.  Every since they bought, then subsequently buried, BeOS I have been hoping for the day they [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 42px; padding-right: 90px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		reddit_url = "http://cyrusbuilt.net/wordpress/?p=236";
		reddit_title = "Palm, Suck it.";
		//-->
		</script>
		<script type="text/javascript" src="http://www.reddit.com/button.js?t=1"></script></div><div style="float: right; width: 70px; margin: 0 0 0 10px;">
<script type="text/javascript">
function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}
</script>
<style type="text/css">
html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}
</style>
<a href="http://www.facebook.com/share.php?u=http://cyrusbuilt.net/wordpress/?p=236" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://cyrusbuilt.net/wordpress/?p=236";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "Palm, Suck it.";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><!--S-ButtonZ 1.1.5 End--><p>So I noticed <a href="http://www.osnews.com/story/23221/HP_Buys_Palm" target="_blank">HP bought Palm</a>&#8230;. and this makes me happy.  Every since they bought, then subsequently <em>buried</em>, BeOS I have been hoping for the day they would have the same fate.  With any luck&#8230;. HP will strip them down, extract the technology for their patent portfolio and then discard the rest.</p>
<p>*spit*</p>
<p>And BTW Palm&#8230;. your phones are atrocious.  I don&#8217;t know how you&#8217;ve managed to stay in business this long, but luckily it is no longer relevant.</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://cyrusbuilt.net/wordpress/?feed=rss2&amp;p=236</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2008 &#8220;Themes&#8221;</title>
		<link>http://cyrusbuilt.net/wordpress/?p=233</link>
		<comments>http://cyrusbuilt.net/wordpress/?p=233#comments</comments>
		<pubDate>Mon, 12 Apr 2010 22:46:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://cyrusbuilt.net/wordpress/?p=233</guid>
		<description><![CDATA[
		
		
		
		

function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&#038;t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}


html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}

Share
		
		
		
		For the record, I&#8217;m not like some big Microsoft fanboy&#8230;. However, I work in the I.T. field, and thus dealing with Microsoft products is simply inescapable.  They [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 42px; padding-right: 90px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		reddit_url = "http://cyrusbuilt.net/wordpress/?p=233";
		reddit_title = "Visual Studio 2008 &#8220;Themes&#8221;";
		//-->
		</script>
		<script type="text/javascript" src="http://www.reddit.com/button.js?t=1"></script></div><div style="float: right; width: 70px; margin: 0 0 0 10px;">
<script type="text/javascript">
function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}
</script>
<style type="text/css">
html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}
</style>
<a href="http://www.facebook.com/share.php?u=http://cyrusbuilt.net/wordpress/?p=233" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://cyrusbuilt.net/wordpress/?p=233";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "Visual Studio 2008 &#8220;Themes&#8221;";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><!--S-ButtonZ 1.1.5 End--><p>For the record, I&#8217;m not like some big Microsoft fanboy&#8230;. However, I work in the I.T. field, and thus dealing with Microsoft products is simply inescapable.  They simply have the largest market share, and as such, most of our clients use Microsoft Windows and Office and their networks are usually an implementation of Active Directory.</p>
<p>That being said, this also means most of my software development is done on Windows using Microsoft Visual Studio (C#).  One thing I got VERY used to in Linux was all my IDEs and code editors were configured using a much nicer color scheme.  I personally prefer darker color schemes.  This bright white background that is the default in Visual Studio, for starters, makes my eyes burn after 8 &#8211; 10 hours a day of coding.  So I finally got sick of it and took a look at the VS2008 settings and found that I <em>could </em>make changes to the 4 bajillion possible color settings available and decided that it would take too damn long to tweak each one and play with it until I find the right combination that I like.</p>
<p>Soooo&#8230;. and did a quick Google search and stumbled across <a href="http://www.hanselman.com/blog/VisualStudioProgrammerThemesGallery.aspx" target="_blank">this site</a> that linked several VS2005 and VS2008 settings files that essentially act as themes.  They are just an export of all the color settings from the author&#8217;s Visual Studio configuration.  So just unpack the settings file, then click <strong>Tools &#8211;&gt; Import and Export Settings&#8230;</strong> then select <strong>Import selected environment settings</strong> then save your current settings (just to be safe), then click the <strong>Browse&#8230; </strong>button at the bottom of the import screen and browse to wherever you unpacked the .vssettings file and select to import.  That settings file will contain only IDE color settings, and should not modify anything else, but the import wizard will give you a sort of preview of the changes before you make them, so check them out before pulling the trigger.</p>
<p>I&#8217;m currently using <a href="http://www.agileprogrammer.com/dotnetguy/archive/2006/09/07/19030.aspx" target="_blank">BradsDarkMonaco2008</a> scheme</p>
<p><a href="http://cyrusbuilt.net/wordpress/wp-content/uploads/2010/04/vs2008screenie.png"><img class="alignnone size-medium wp-image-234" title="vs2008screenie" src="http://cyrusbuilt.net/wordpress/wp-content/uploads/2010/04/vs2008screenie-300x180.png" alt="" width="300" height="180" /></a></p>
<p>My eyes couldn&#8217;t be happier!!  Not too mention, it gave VS2008 a much-needed facelift.</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://cyrusbuilt.net/wordpress/?feed=rss2&amp;p=233</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finally&#8230;. Linux is free!!!</title>
		<link>http://cyrusbuilt.net/wordpress/?p=230</link>
		<comments>http://cyrusbuilt.net/wordpress/?p=230#comments</comments>
		<pubDate>Fri, 02 Apr 2010 22:30:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Operating Systems]]></category>

		<guid isPermaLink="false">http://cyrusbuilt.net/wordpress/?p=230</guid>
		<description><![CDATA[
		
		
		
		

function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&#038;t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}


html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}

Share
		
		
		
		Sloooooooooow down tex&#8230;.. I know Linux is &#8216;free&#8217;.  But when I say &#8216;free&#8217;, I mean in the sense that it is finally free of SCO.  In case [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 42px; padding-right: 90px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		reddit_url = "http://cyrusbuilt.net/wordpress/?p=230";
		reddit_title = "Finally&#8230;. Linux is free!!!";
		//-->
		</script>
		<script type="text/javascript" src="http://www.reddit.com/button.js?t=1"></script></div><div style="float: right; width: 70px; margin: 0 0 0 10px;">
<script type="text/javascript">
function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}
</script>
<style type="text/css">
html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}
</style>
<a href="http://www.facebook.com/share.php?u=http://cyrusbuilt.net/wordpress/?p=230" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://cyrusbuilt.net/wordpress/?p=230";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "Finally&#8230;. Linux is free!!!";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><!--S-ButtonZ 1.1.5 End--><p>Sloooooooooow down tex&#8230;.. I know Linux is &#8216;free&#8217;.  But when I say &#8216;free&#8217;, I mean in the sense that it is <a href="http://www.osnews.com/story/23086/Jury_Rules_UNIX_Copyrights_Didn_t_Go_to_SCO" target="_blank">finally free of SCO</a>.  In case you&#8217;ve been living under a rock for several years, there has been a long and drawn-out legal battle over who owns the rights to UNIX (of which Linux has some base).  Well its finally over&#8230;. a unanimous jury verdict stated that Novell truly owns the rights to UNIX, and Novell seems to be interested in promoting it, not suing everyone for it.</p>
<p>It is with great pleasure that I say:  F@#K you SCO.  Go home.</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://cyrusbuilt.net/wordpress/?feed=rss2&amp;p=230</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
