<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.3" -->
<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/"
	>

<channel>
	<title>Bill's Dev Blog</title>
	<link>http://devblog.billism.com</link>
	<description>My software development scratch pad.</description>
	<pubDate>Mon, 12 Oct 2009 20:24:32 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
	<language>en</language>
			<item>
		<title>Hofstadter&#8217;s Law</title>
		<link>http://devblog.billism.com/?p=23</link>
		<comments>http://devblog.billism.com/?p=23#comments</comments>
		<pubDate>Mon, 12 Oct 2009 20:24:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[People]]></category>

		<guid isPermaLink="false">http://devblog.billism.com/?p=23</guid>
		<description><![CDATA[Hofstadter&#8217;s Law: It always takes longer than you expect, even when you take into account Hofstadter&#8217;s Law.
]]></description>
			<content:encoded><![CDATA[<p>Hofstadter&#8217;s Law: It always takes longer than you expect, even when you take into account Hofstadter&#8217;s Law.</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.billism.com/?feed=rss2&amp;p=23</wfw:commentRss>
		</item>
		<item>
		<title>John Carmack (on software patents)</title>
		<link>http://devblog.billism.com/?p=22</link>
		<comments>http://devblog.billism.com/?p=22#comments</comments>
		<pubDate>Sat, 10 Oct 2009 13:12:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[People]]></category>

		<guid isPermaLink="false">http://devblog.billism.com/?p=22</guid>
		<description><![CDATA[&#8220;The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.&#8221;
-John Carmack 
]]></description>
			<content:encoded><![CDATA[<p>&#8220;The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.&#8221;</p>
<p>-<a href="http://en.wikipedia.org/wiki/John_Carmack" title="John Carmack">John Carmack </a></p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.billism.com/?feed=rss2&amp;p=22</wfw:commentRss>
		</item>
		<item>
		<title>Excel has detected that &#8217;somefile.csv&#8217; is a SYLK file, but cannot load it.</title>
		<link>http://devblog.billism.com/?p=20</link>
		<comments>http://devblog.billism.com/?p=20#comments</comments>
		<pubDate>Wed, 09 Sep 2009 14:35:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://devblog.billism.com/?p=20</guid>
		<description><![CDATA[I am writing some software that generates CSV files to be opened by the default CSV application on the system. I just spent about 30 minutes troubleshooting this MS Excel 2007 error when opening one of my CSV files:
&#8220;Excel has detected that &#8217;somefile.csv&#8217; is a SYLK file, but cannot load it. Either the file has [...]]]></description>
			<content:encoded><![CDATA[<p>I am writing some software that generates CSV files to be opened by the default CSV application on the system. I just spent about 30 minutes troubleshooting this MS Excel 2007 error when opening one of my CSV files:</p>
<p>&#8220;Excel has detected that &#8217;somefile.csv&#8217; is a SYLK file, but cannot load it. Either the file has errors or it is not a SYLK file format. Click OK to try to open the file in a different format.&#8221;</p>
<p>As it turns out, this error occurs when the first 2 characters of the first column name in a CSV file are &#8220;ID&#8221; (All upper-case).</p>
<p>The solution: Change &#8220;ID&#8221; to anything else. One or both characters can even be lower-case and that will solve this error.</p>
<p>I hope this saves some time for someone else out there.</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.billism.com/?feed=rss2&amp;p=20</wfw:commentRss>
		</item>
		<item>
		<title>VSS 2005 vs Subversion</title>
		<link>http://devblog.billism.com/?p=19</link>
		<comments>http://devblog.billism.com/?p=19#comments</comments>
		<pubDate>Fri, 27 Feb 2009 16:08:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Source Control]]></category>

		<guid isPermaLink="false">http://devblog.billism.com/?p=19</guid>
		<description><![CDATA[



 

I recently was asked to form an argument for switching my company&#8217;s source control from VSS 2005 to Subversion. This is what I came up with&#8230;
&#160;
Subversion is obviously not the only alternative to Visual Source Safe, but it is a very solid one, one which I have personally used over the past several years [...]]]></description>
			<content:encoded><![CDATA[<p><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="ProgId" content="Word.Document" /><meta name="Generator" content="Microsoft Word 12" /><meta name="Originator" content="Microsoft Word 12" /></p>
<link href="file:///C:%5CDOCUME%7E1%5Ckrahmerb%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" rel="File-List" />
<link href="file:///C:%5CDOCUME%7E1%5Ckrahmerb%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx" rel="themeData" />
<link href="file:///C:%5CDOCUME%7E1%5Ckrahmerb%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml" rel="colorSchemeMapping" /><!--[if gte mso 9]><xml>  <w:WordDocument>   <w:View>Normal</w:View>   <w:Zoom>0</w:Zoom>   <w:TrackMoves/>   <w:TrackFormatting/>   <w:PunctuationKerning/>   <w:ValidateAgainstSchemas/>   <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>   <w:IgnoreMixedContent>false</w:IgnoreMixedContent>   <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>   <w:DoNotPromoteQF/>   <w:LidThemeOther>EN-US</w:LidThemeOther>   <w:LidThemeAsian>X-NONE</w:LidThemeAsian>   <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>   <w:Compatibility>    <w:BreakWrappedTables/>    <w:SnapToGridInCell/>    <w:WrapTextWithPunct/>    <w:UseAsianBreakRules/>    <w:DontGrowAutofit/>    <w:SplitPgBreakAndParaMark/>    <w:DontVertAlignCellWithSp/>    <w:DontBreakConstrainedForcedTables/>    <w:DontVertAlignInTxbx/>    <w:Word11KerningPairs/>    <w:CachedColBalance/>   </w:Compatibility>   <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>   <m:mathPr>    <m:mathFont m:val="Cambria Math"/>    <m:brkBin m:val="before"/>    <m:brkBinSub m:val="&#45;-"/>    <m:smallFrac m:val="off"/>    <m:dispDef/>    <m:lMargin m:val="0"/>    <m:rMargin m:val="0"/>    <m:defJc m:val="centerGroup"/>    <m:wrapIndent m:val="1440"/>    <m:intLim m:val="subSup"/>    <m:naryLim m:val="undOvr"/>   </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml>  <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"   DefSemiHidden="true" DefQFormat="false" DefPriority="99"   LatentStyleCount="267">   <w:LsdException Locked="false" Priority="0" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Normal"/>   <w:LsdException Locked="false" Priority="9" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>   <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>   <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>   <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>   <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>   <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>   <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>   <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>   <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>   <w:LsdException Locked="false" Priority="39" Name="toc 1"/>   <w:LsdException Locked="false" Priority="39" Name="toc 2"/>   <w:LsdException Locked="false" Priority="39" Name="toc 3"/>   <w:LsdException Locked="false" Priority="39" Name="toc 4"/>   <w:LsdException Locked="false" Priority="39" Name="toc 5"/>   <w:LsdException Locked="false" Priority="39" Name="toc 6"/>   <w:LsdException Locked="false" Priority="39" Name="toc 7"/>   <w:LsdException Locked="false" Priority="39" Name="toc 8"/>   <w:LsdException Locked="false" Priority="39" Name="toc 9"/>   <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>   <w:LsdException Locked="false" Priority="10" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Title"/>   <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>   <w:LsdException Locked="false" Priority="11" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>   <w:LsdException Locked="false" Priority="22" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Strong"/>   <w:LsdException Locked="false" Priority="20" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>   <w:LsdException Locked="false" Priority="59" SemiHidden="false"    UnhideWhenUsed="false" Name="Table Grid"/>   <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>   <w:LsdException Locked="false" Priority="1" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>   <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading"/>   <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List"/>   <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid"/>   <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1"/>   <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2"/>   <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1"/>   <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2"/>   <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1"/>   <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2"/>   <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3"/>   <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List"/>   <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading"/>   <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List"/>   <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid"/>   <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 1"/>   <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 1"/>   <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 1"/>   <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>   <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>   <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>   <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>   <w:LsdException Locked="false" Priority="34" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>   <w:LsdException Locked="false" Priority="29" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Quote"/>   <w:LsdException Locked="false" Priority="30" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>   <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>   <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>   <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>   <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>   <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 1"/>   <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>   <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 1"/>   <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>   <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 2"/>   <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 2"/>   <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 2"/>   <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>   <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>   <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>   <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>   <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>   <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>   <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>   <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 2"/>   <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>   <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 2"/>   <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>   <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 3"/>   <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 3"/>   <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 3"/>   <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>   <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>   <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>   <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>   <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>   <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>   <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>   <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 3"/>   <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>   <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 3"/>   <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>   <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 4"/>   <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 4"/>   <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 4"/>   <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>   <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>   <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>   <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>   <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>   <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>   <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>   <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 4"/>   <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>   <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 4"/>   <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>   <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 5"/>   <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 5"/>   <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 5"/>   <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>   <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>   <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>   <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>   <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>   <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>   <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>   <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 5"/>   <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>   <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 5"/>   <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>   <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 6"/>   <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 6"/>   <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 6"/>   <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>   <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>   <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>   <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>   <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>   <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>   <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>   <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 6"/>   <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>   <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 6"/>   <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>   <w:LsdException Locked="false" Priority="19" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>   <w:LsdException Locked="false" Priority="21" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>   <w:LsdException Locked="false" Priority="31" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>   <w:LsdException Locked="false" Priority="32" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>   <w:LsdException Locked="false" Priority="33" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>   <w:LsdException Locked="false" Priority="37" Name="Bibliography"/>   <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>  </w:LatentStyles> </xml><![endif]--><br />
<style><!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman";} span.postbody 	{mso-style-name:postbody; 	mso-style-unhide:no;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	font-size:10.0pt; 	mso-ansi-font-size:10.0pt; 	mso-bidi-font-size:10.0pt;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --> </style>
<p><!--[if gte mso 10]></p>
<style>  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} </style>
<p> <![endif]--></p>
<p class="MsoNormal">I recently was asked to form an argument for switching my company&#8217;s source control from VSS 2005 to Subversion. This is what I came up with&#8230;</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">Subversion is obviously not the only alternative to Visual Source Safe, but it is a very solid one, one which I have personally used over the past several years with ease. Other source control options for us would be to use Perforce or MS TFS, both of which are pricey, especially TFS. However, Subversion is free and largely recommended by a vast number of people, especially when compared to VSS. Subversion is also supported by a large volunteer online community.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have chosen Subversion over VSS <em>mainly</em> for the following reasons:</p>
<p class="MsoNormal"><strong><o:p> </o:p></strong></p>
<p class="MsoNormal"><strong>True Atomic Commits<o:p></o:p></strong></p>
<p class="MsoNormal">A commit containing multiple files is treated as a single transaction, and a new revision all in one. Much like a database transaction, if one file fails to commit, they all fail – which is desirable to assure that project-wide changes being made which depend on each other are all done at once.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><strong>Copy-Modify-Merge<o:p></o:p></strong></p>
<p class="MsoNormal">VSS’s lock-modify-unlock model makes it difficult to collaborate on rapidly changing files/projects. Subversion uses the copy-modify-merge model (aka <span class="postbody">optimistic merge</span>), which better allows for multiple developers to work on the same project. More often than not, optimistic merge is a time saver over the lock-modify-unlock model. It is possible to lock a file from being committed by others in Subversion as well.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><strong>Easy Branching/Merging<o:p></o:p></strong></p>
<p class="MsoNormal">Subversion allows for easy branching and merging of projects. This allows for easier development of new features or new versions of the product.</p>
<p class="MsoNormal"><strong><o:p> </o:p></strong></p>
<p class="MsoNormal"><strong>True Client-Server Model<o:p></o:p></strong></p>
<p class="MsoNormal">VSS uses a network share for the repository database that relies on the developers having, basically, full control of the files therein. Subversion uses a true client-server model via http(s) or the proprietary svn protocol. I recommend the https protocol for compatibility and encryption.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><strong>Data Corruption with VSS<o:p></o:p></strong></p>
<p class="MsoNormal">With VSS, it’s not a question of if the repository database will become corrupt and lose data, it is WHEN this will happen. Your source repository is supposed to be a rock - if a developer&#8217;s workstation crashes, you should only have lost HIS changes. You shouldn&#8217;t lose random files and data from the repository.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span class="postbody">If you have developers spread across multiple time zones, the very act of both of them checking in can corrupt the database if they check in too close together, in the wrong order.</span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><strong>API<o:p></o:p></strong></p>
<p class="MsoNormal"><span class="postbody">There is no good, usable, easily available published API for VSS and 3rd-party tools are weak for the most part. Subversion is open-source and inherently widely supported via API and many third-party plug-ins and additions.</span></p>
<p class="MsoNormal"><strong><o:p> </o:p></strong></p>
<p class="MsoNormal"><strong>Other notes:<o:p></o:p></strong></p>
<p class="MsoNormal">Microsoft recommends that VSS is not suited well for large projects, but rather small projects with small teams. <span class="postbody">Microsoft themselves haven&#8217;t used VSS (in any widespread capacity) in over 10 years. If MS doesn&#8217;t believe in their own software, why should we?<o:p></o:p></span></p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.billism.com/?feed=rss2&amp;p=19</wfw:commentRss>
		</item>
		<item>
		<title>Find Lost MS Office Product Keys</title>
		<link>http://devblog.billism.com/?p=18</link>
		<comments>http://devblog.billism.com/?p=18#comments</comments>
		<pubDate>Tue, 27 Jan 2009 01:24:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://devblog.billism.com/?p=18</guid>
		<description><![CDATA[After searching a few minutes for a Microsoft Office product key viewer, I found a free program that does what I was looking for. But not until after several crippled demo programs found their way onto my screen, which require payment to work. I just wanted to help promote the free one that I found.
ProduKey [...]]]></description>
			<content:encoded><![CDATA[<p>After searching a few minutes for a <a href="http://www.nirsoft.net/utils/product_cd_key_viewer.html">Microsoft Office product key viewer</a>, I found a free program that does what I was looking for. But not until after several crippled demo programs found their way onto my screen, which require payment to work. I just wanted to help promote the free one that I found.</p>
<p><a href="http://www.nirsoft.net/utils/product_cd_key_viewer.html">ProduKey</a> is a small utility that displays the ProductID and the CD-Key of MS-Office, Windows, Exchange Server, and SQL Server installed on your computer. You can view this information for your current running operating system, or for another operating system/computer - by using command-line options. This utility can be useful if you lost the product key of your Windows/Office, and you want to reinstall it on your computer.</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.billism.com/?feed=rss2&amp;p=18</wfw:commentRss>
		</item>
		<item>
		<title>Build a Really Useful ASP.NET Exception Engine</title>
		<link>http://devblog.billism.com/?p=17</link>
		<comments>http://devblog.billism.com/?p=17#comments</comments>
		<pubDate>Sun, 08 Jul 2007 15:00:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[ASP .Net]]></category>

		<guid isPermaLink="false">http://devblog.billism.com/?p=17</guid>
		<description><![CDATA[http://www.eggheadcafe.com/articles/20030816.asp
Excerpt:
&#8220;The GetLastError() method of the Server         object returns a reference to a generic HttpException wrapping the original         exception          that was passed from your ASP.NET page to the Application_Error event.  [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.eggheadcafe.com/articles/20030816.asp" title=" Build a Really Useful ASP.NET Exception Engine" target="_blank">http://www.eggheadcafe.com/articles/20030816.asp</a></p>
<p>Excerpt:</p>
<p>&#8220;The <strong>GetLastError()</strong> method of the Server         object returns a reference to a generic HttpException wrapping the original         exception          that was passed from your ASP.NET page to the Application_Error event.         Gain access to the original exception by calling its<strong> GetBaseException()</strong>        method.         This will provide the original exception instance, regardless of how         many layers have been added           to the exception stack. Once <strong>Application_Error</strong> has           completed, it automatically performs a redirect to your custom error           page that you can set up in web.config. See the MSDN documentation           on how to set this up if you want it.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.billism.com/?feed=rss2&amp;p=17</wfw:commentRss>
		</item>
		<item>
		<title>A Few .Net (2.0) Notes</title>
		<link>http://devblog.billism.com/?p=16</link>
		<comments>http://devblog.billism.com/?p=16#comments</comments>
		<pubDate>Sun, 24 Jun 2007 17:54:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[.Net Performance]]></category>

		<guid isPermaLink="false">http://devblog.billism.com/?p=16</guid>
		<description><![CDATA[I am currently brushing up on my .Net skills so I will be taking notes on topics that are worth taking the extra time to remember.
Classes and structs
A class is allocated on the managed heap rather than on the stack and assignment between two variables results in both  variables pointing to the same instance.
While [...]]]></description>
			<content:encoded><![CDATA[<p>I am currently brushing up on my .Net skills so I will be taking notes on topics that are worth taking the extra time to remember.</p>
<p><strong>Classes and structs</strong></p>
<p class="para"><em>A</em> class is allocated on the managed heap rather than on the stack and assignment between two variables results in both  variables pointing to the same instance.</p>
<p class="para">While the functionality is similar, structures are usually more  efficient than classes. A struct takes up the amount of space (on the stack) that the value types defined in the struct take up together. You should define a structure, rather than a class, if  the type will perform better as a value type than a reference type.  Specifically, structure types should meet all of these criteria: Logically represents a single value; Has an instance size less than 16 bytes; Will not be changed after creation; Will not be cast to a reference type.</p>
<hr />
<strong> The runtime optimizes the performance of 32-bit integer  types</strong> (<em class="emphasis">Int32</em> and <em class="emphasis">UInt32</em>), so use  those types for counters and other frequently accessed integral variables. For  floating-point operations, <em class="emphasis">Double</em> is the most efficient  type because those operations are optimized by hardware.</p>
<hr />
<p class="para"><strong>Immutable types in .Net</strong>, such as <em>string</em>s: Any change to this type causes the runtime to create a new  object and abandon the old one. That happens invisibly, and many programmers  might be surprised to learn that the following code allocates four new strings  in memory:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="csharp"><span style="color: #008080; font-style: italic;">// C#</span>
<span style="color: #FF0000;">string</span> s;
s = <span style="color: #808080;">&quot;wombat&quot;</span>;          <span style="color: #008080; font-style: italic;">// &quot;wombat&quot;</span>
s += <span style="color: #808080;">&quot; kangaroo&quot;</span>;      <span style="color: #008080; font-style: italic;">// &quot;wombat kangaroo&quot;</span>
s += <span style="color: #808080;">&quot; wallaby&quot;</span>;       <span style="color: #008080; font-style: italic;">// &quot;wombat kangaroo wallaby&quot;</span>
s += <span style="color: #808080;">&quot; koala&quot;</span>;         <span style="color: #008080; font-style: italic;">// &quot;wombat kangaroo wallaby koala&quot;</span>
Console.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>s<span style="color: #000000;">&#41;</span>;</pre></td></tr></table></div>

<p>Only the last string has a reference; the other three will be disposed of during  garbage collection. Avoiding these types of temporary strings helps avoid  unnecessary garbage collection, which improves performance.</p>
<hr /><font size="1">These notes have been &#8220;borrowed&#8221; and modified from the book: <em>MCTS Self-Paced Training Kit (Exam 70-536): Microsoft .NET Framework 2.0 Application Development Foundation</em></font></p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.billism.com/?feed=rss2&amp;p=16</wfw:commentRss>
		</item>
		<item>
		<title>Howto: Enable Concurrent Remote Desktop Sessions in Windows XP SP2</title>
		<link>http://devblog.billism.com/?p=14</link>
		<comments>http://devblog.billism.com/?p=14#comments</comments>
		<pubDate>Thu, 14 Jun 2007 01:36:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Tweaks]]></category>

		<guid isPermaLink="false">http://www.billism.com/devblog/2007/06/13/howto-enable-concurrent-remote-desktop-sessions-in-windows-xp-sp2/</guid>
		<description><![CDATA[Windows XP, unlike the Server editions of Windows, does not allow multiple simultaneous remote user sessions. This can be a pain. For instance, my wife has a user account on my computer at home which she often uses when I am not at the computer. When I am at work (or where ever) and want [...]]]></description>
			<content:encoded><![CDATA[<p>Windows XP, unlike the Server editions of Windows, does not allow multiple simultaneous remote user sessions. This can be a pain. For instance, my wife has a user account on my computer at home which she often uses when I am not at the computer. When I am at work (or where ever) and want to remote into my computer at home, I think I should be able to, even if Vanessa is using the computer. I mean, it is totally possible and built into any good OS worth a damn. I do run Windows XP <strong>Pro</strong> after-all, the more expensive version of XP for <strong>profession</strong> users. However Windows XP forces you to boot (log off) the other user before you can log in.  This is most likely because Micro$oft wants you to shell out more money for the server OS. Even if you use the server edition of Windows, there are licensing issues with it that prevent you from running certain programs that you are only allowed to run on non-server editions of Windows. Oh for crying out loud! What a stupid pointless catch 22. I guess Micro$oft doesn&#8217;t see it that way because it forces you to buy more of their software.</p>
<p>This article outlines how to get around this annoying, draconian limitation imposed by Micro$oft.</p>
<p> <a href="http://devblog.billism.com/?p=14#more-14" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.billism.com/?feed=rss2&amp;p=14</wfw:commentRss>
		</item>
		<item>
		<title>INSERT … ON DUPLICATE KEY UPDATE</title>
		<link>http://devblog.billism.com/?p=12</link>
		<comments>http://devblog.billism.com/?p=12#comments</comments>
		<pubDate>Wed, 06 Jun 2007 18:52:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[MySQL]]></category>

		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://www.billism.com/devblog/2007/06/06/on-duplicate-key-update/</guid>
		<description><![CDATA[MySQL has some nifty extensions to ANSI SQL. Two of which are &#8220;INSERT &#8230; ON DUPLICATE KEY UPDATE&#8221; and &#8220;REPLACE&#8221; (As of MySQL 4.1). These statements are used when inserting data into a table where the unique key of the row you are inserting may already exist, and if it does, you want this row [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL has some nifty extensions to ANSI SQL. Two of which are &#8220;<a href="http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html" title="INSERT ... ON DUPLICATE KEY UPDATE Syntax" target="_blank">INSERT &#8230; ON DUPLICATE KEY UPDATE</a>&#8221; and &#8220;<a href="http://dev.mysql.com/doc/refman/5.0/en/replace.html" title="REPLACE Syntax." target="_blank">REPLACE</a>&#8221; (As of MySQL 4.1). These statements are used when inserting data into a table where the unique key of the row you are inserting may already exist, and if it does, you want this row to be updated with new data. Instead of doing a select/insert/update routine, this gives a significant performance increase for frequently updated schemas; and what is even more important, the application code becomes simpler, less error prone, and easy to read.</p>
<p>&#8220;INSERT &#8230; ON DUPLICATE KEY UPDATE&#8221; will actually perform either an UPDATE or an INSERT, whichever one is necessary. The &#8220;REPLACE&#8221; statement will actually delete the row if it exists and insert the new row.</p>
<p>Example of &#8220;INSERT &#8230; ON DUPLICATE KEY UPDATE&#8221; (assuming column &#8216;a&#8217; is the unique key):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="sql"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #66cc66;">&#40;</span>a,b,c<span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">2</span>,<span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">ON</span> DUPLICATE <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #993333; font-weight: bold;">UPDATE</span> b=<span style="color: #cc66cc;">2</span>, c=<span style="color: #cc66cc;">3</span>;</pre></td></tr></table></div>

<p>Example of &#8220;REPLACE&#8221;:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="sql"><span style="color: #993333; font-weight: bold;">REPLACE</span> <span style="color: #993333; font-weight: bold;">INTO</span> table_a <span style="color: #66cc66;">&#40;</span>a,b,c<span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">VALUES</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">2</span>,<span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>Oracle 9i+ also has an extension that can somewhat similarly handle this conditional INSERT-or-UPDATE task: the <a href="http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_915a.htm#2080942" title="MERGE Syntax." target="_blank">MERGE</a> statement, though not as intuitive and the code is not as easy to read. Here is an example of how one might implement MERGE for this situation:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="sql">MERGE <span style="color: #993333; font-weight: bold;">INTO</span> SCHEMA.table_a TA
<span style="color: #993333; font-weight: bold;">USING</span> <span style="color: #66cc66;">&#40;</span>
 <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #ff0000;">'1'</span> a, <span style="color: #ff0000;">'2'</span> b, <span style="color: #ff0000;">'3'</span> c
 <span style="color: #993333; font-weight: bold;">FROM</span> DUAL
 <span style="color: #66cc66;">&#41;</span> E
<span style="color: #993333; font-weight: bold;">ON</span> <span style="color: #66cc66;">&#40;</span>TA.a = E.a<span style="color: #66cc66;">&#41;</span>
WHEN MATCHED THEN
 <span style="color: #993333; font-weight: bold;">UPDATE</span> <span style="color: #993333; font-weight: bold;">SET</span> TA.b = E.b, TA.c = E.c
WHEN <span style="color: #993333; font-weight: bold;">NOT</span> MATCHED THEN
 <span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #66cc66;">&#40;</span>TA.a, TA.b, TA.c<span style="color: #66cc66;">&#41;</span>
 <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span>E.a, E.b, E.c<span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>Comparing Oracle&#8217;s 11 line method to MySQL&#8217;s 3 line method, I must hand it to MySQL for its simpler and superior method.</p>
<p>References:<br />
<a href="http://forums.devshed.com/oracle-development-96/if-exist-271432.html?&amp;highlight=merge" target="_blank">forums.devshed.com</a>, <a href="http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html" target="_blank">dev.mysql.com</a>, <a href="http://dev.mysql.com/doc/refman/5.0/en/replace.html" target="_blank">dev.mysql.com</a>, <a href="http://www.mysqlperformanceblog.com/2006/05/29/insert-on-duplicate-key-update-and-summary-counters/" target="_blank">www.mysqlperformanceblog.com</a>, <a href="http://www.oracle.com/technology/products/oracle9i/daily/Aug24.html" target="_blank">www.oracle.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.billism.com/?feed=rss2&amp;p=12</wfw:commentRss>
		</item>
		<item>
		<title>More C++ Preprocessor Directives</title>
		<link>http://devblog.billism.com/?p=11</link>
		<comments>http://devblog.billism.com/?p=11#comments</comments>
		<pubDate>Tue, 05 Jun 2007 20:01:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://www.billism.com/devblog/2007/06/05/more-c-preprocessor-directives/</guid>
		<description><![CDATA[The #pragma directive is a compiler specific directive which compiler vendors may use for their own purposes. For instance, a #pragma is often used to allow suppression of specific error messages, manage heap and stack debugging, etc.
You can see the C# .Net equivalent here.
In Microsoft Visual C++ 8 (Visual Studio 2005), one useful use for [...]]]></description>
			<content:encoded><![CDATA[<p>The <code>#pragma</code> directive is a <a href="http://en.wikipedia.org/wiki/Compiler_directive" title="Compiler directive">compiler specific directive</a> which compiler vendors may use for their own purposes. For instance, a <code>#pragma</code> is often used to allow suppression of specific error messages, manage heap and stack debugging, etc.</p>
<p>You can see the <a href="http://msdn2.microsoft.com/en-us/library/441722ys(VS.80).aspx" title="C# Preocessor #pragma" target="_blank">C# .Net equivalent here</a>.</p>
<p>In Microsoft Visual C++ 8 (Visual Studio 2005), one useful use for the <code>#pragma</code> directive is to modify compiler warnings. This is from <a href="http://msdn2.microsoft.com/en-us/library/2c8f766e(VS.80).aspx" title="C/C++ Preprocessor Reference" target="_blank">Microsoft</a>:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp"><span style="color: #339900;">#pragma warning( warning-specifier : warning-number-list [; warning-specifier : warning-number-list...] )</span>
<span style="color: #339900;">#pragma warning( push[ ,n ] )</span>
<span style="color: #339900;">#pragma warning( pop )</span></pre></div></div>

<p>The <em>warning-specifier</em> can be one of the following.</p>
<p class="tableSection">
<table border="1" width="100%">
<tr>
<th><em>Warning-specifier</em></th>
<th>Meaning</th>
</tr>
<tr>
<td><strong>1</strong>, <strong>2</strong>, <strong>3</strong>, <strong>4</strong></td>
<td>Apply the given level to the specified warning(s). This also has the effect of turning a specified warning on that is off by default.</td>
</tr>
<tr>
<td><strong>default</strong></td>
<td>Reset warning behavior to its default value. This also has the effect of turning a specified warning on that is off by default. The warning will be generated at its default, documented, level.See <a href="http://msdn2.microsoft.com/en-us/library/23k5d385%28VS.80%29.aspx" onclick="javascript:Track('ctl00_LibFrame_ctl09|ctl00_LibFrame_ctl10',this);">Compiler Warnings That Are Off by Default</a> for more information.</td>
</tr>
<tr>
<td><strong>disable</strong></td>
<td>Do not issue the specified warning message(s).</td>
</tr>
<tr>
<td><strong>error</strong></td>
<td>Report the specified warnings as errors.</td>
</tr>
<tr>
<td><strong>once</strong></td>
<td>Display the specified message(s) only once.</td>
</tr>
<tr>
<td><strong>suppress</strong></td>
<td>Pushes the current state of the pragma on the stack, disables the specified warning for the next line, and then pops the warning stack, resetting the pragma state. You can only specify one warning for each <strong>suppress</strong> specifier, but multiple <strong>warning</strong> pragmas can operate on one line of code.<strong>suppress</strong> is only supported for C6000 warnings (code analysis warnings), which are enabled with the <span class="linkTerms"><a href="http://msdn2.microsoft.com/en-us/library/ms173498%28VS.80%29.aspx" onclick="javascript:Track('ctl00_LibFrame_ctl09|ctl00_LibFrame_ctl11',this);">/analyze (Enterprise Code Analysis)</a></span> compiler option.</td>
</tr>
</table>
<p>The <em>warning-number-list</em> can contain any warning numbers. Multiple options can be specified in the same pragma directive as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp"><span style="color: #339900;">#pragma warning( disable : 4507 34; once : 4385; error : 164 )</span></pre></div></div>

<p>This is functionally equivalent to:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp"><span style="color: #ff0000;">// Disable warning messages 4507 and 4034.</span>
<span style="color: #339900;">#pragma warning( disable : 4507 34 )</span>
&nbsp;
<span style="color: #ff0000;">// Issue warning 4385 only once.</span>
<span style="color: #339900;">#pragma warning( once : 4385 )</span>
&nbsp;
<span style="color: #ff0000;">// Report warning 4164 as an error.</span>
<span style="color: #339900;">#pragma warning( error : 164 )</span></pre></div></div>

<p>The compiler will add 4000 to any warning number that is between 0 and 999.</p>
<p>The compiler only supports up to 56 <tt>#pragma warning</tt> statements in a compiland.</p>
<p>For warning numbers in the range of 4700-4999, those associated with code generation, the state of the warning in effect when the compiler encounters the open curly brace of a function will be in effect for the rest of the function. Using the <strong>warning</strong> pragma inside the function to change the state of a warning greater than 4699 will only take effect after the end of the function. The following example shows the correct placement of <strong>warning</strong> pragmas to disable, and then restore, a code-generation warning message:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp"><span style="color: #ff0000;">// pragma_warning.cpp</span>
<span style="color: #ff0000;">// compile with: /W1</span>
<span style="color: #339900;">#pragma warning(disable:4700)</span>
<span style="color: #0000ff;">void</span> Test<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
   <span style="color: #0000ff;">int</span> x;
   <span style="color: #0000ff;">int</span> y = x;   <span style="color: #ff0000;">// no C4700 here</span>
   <span style="color: #339900;">#pragma warning(default:4700)   // C4700 enabled after Test ends</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">int</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
   <span style="color: #0000ff;">int</span> x;
   <span style="color: #0000ff;">int</span> y = x;   <span style="color: #ff0000;">// C4700</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Note that within a function body, the last setting of the <strong>warning</strong> pragma will be in effect for the entire function.</p>
<p>The <strong>warning</strong> pragma also supports the following syntax:</p>
<p><strong>#pragma warning(</strong> <strong>push</strong> [ <strong>,</strong><em>n</em> ] <strong>)</strong></p>
<p><strong>#pragma warning(</strong> <strong>pop )</strong></p>
<p>Where <em>n</em> represents a warning level (1 through 4).</p>
<p>The pragma <strong>warning( push ) </strong>stores the current warning state for all warnings. The pragma <strong>warning( push, </strong><em>n</em><strong>) </strong>stores the current state for all warnings and sets the global warning level to <em>n</em>.</p>
<p>The pragma <strong>warning( pop ) </strong>pops the last warning state pushed onto the stack. Any changes made to the warning state between <strong>push</strong> and <strong>pop</strong> are undone. Consider this example:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp"><span style="color: #339900;">#pragma warning( push )</span>
<span style="color: #339900;">#pragma warning( disable : 4705 )</span>
<span style="color: #339900;">#pragma warning( disable : 4706 )</span>
<span style="color: #339900;">#pragma warning( disable : 4707 )</span>
<span style="color: #ff0000;">// Some code</span>
<span style="color: #339900;">#pragma warning( pop )</span></pre></div></div>

<p>At the end of this code, <strong>pop</strong> restores the state of all warnings (including 4705, 4706, and 4707) to what it was at the beginning of the code.</p>
<p>When you write header files, you can use <strong>push</strong> and <strong>pop</strong> to ensure that changes to warning states made by the user do not prevent your headers from compiling properly. Use <strong>push</strong> at the beginning of the header and <strong>pop</strong> at the end. Suppose, for example, you have a header that does not compile cleanly at warning level 4. The following code changes the warning level to 3 then restores the original warning level at the end of the header:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp"><span style="color: #339900;">#pragma warning( push, 3 )</span>
<span style="color: #ff0000;">// Declarations/ definitions</span>
<span style="color: #339900;">#pragma warning( pop )</span></pre></div></div>

<p>See <a href="http://msdn2.microsoft.com/en-us/library/8c5ztk84%28VS.80%29.aspx" onclick="javascript:Track('ctl00_LibFrame_ctl09|ctl00_LibFrame_ctl17',this);">/FI</a> and <a href="http://msdn2.microsoft.com/en-us/library/thxezb7y%28VS.80%29.aspx" onclick="javascript:Track('ctl00_LibFrame_ctl09|ctl00_LibFrame_ctl18',this);">/w</a> for compiler options that help you suppress warnings.</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.billism.com/?feed=rss2&amp;p=11</wfw:commentRss>
		</item>
	</channel>
</rss>
