<?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>WorldofCode.com &#187; Coding</title>
	<atom:link href="http://www.worldofcode.com/category/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.worldofcode.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 05 Jan 2011 01:32:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>SQL Server Database stuck in Restoring state</title>
		<link>http://www.worldofcode.com/sql-server-database-stuck-in-restoring-state/</link>
		<comments>http://www.worldofcode.com/sql-server-database-stuck-in-restoring-state/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 12:00:00 +0000</pubDate>
		<dc:creator>WorldofCode</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Restore]]></category>

		<guid isPermaLink="false">http://www.worldofcode.com/sql-server-database-stuck-in-restoring-state/</guid>
		<description><![CDATA[From time to time your sql database will get stuck&#160;in Restoring state.&#160; Here are two different ways to get your database out of restoring state.&#160; RESTORE DATABASE MyDatabase&#160; &#160; &#160;FROM DISK = &#8216;MyDatabase.bak&#8217;&#160; &#160; &#160;WITH REPLACE,RECOVERY or Stop the service (MSSQLSERVER); Rename or delete the Database and Log files (C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data&#8230;) or wherever [...]]]></description>
			<content:encoded><![CDATA[<p></p>
<p>From time to time your sql database will get stuck&nbsp;in Restoring state.&nbsp; Here are two different ways to get your database out of restoring state.&nbsp;</p>
<blockquote>
<p><span class="pln">RESTORE DATABASE </span><span class="typ"><font color="#2b91af">MyDatabase</font></span><span class="pln">&nbsp;<br />
&nbsp; &nbsp;FROM DISK </span><span class="pun">=</span><span class="pln"> </span><span class="str"><font color="#800000">&#8216;MyDatabase.bak&#8217;</font></span><span class="pln">&nbsp;<br />
&nbsp; &nbsp;WITH REPLACE</span><span class="pun">,</span><span class="pln">RECOVERY</span></p>
</blockquote>
<div>or</div>
<ol>
<li>Stop the service (MSSQLSERVER);</li>
<li>Rename or delete the Database and Log files (C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data&#8230;) or wherever you have the files;</li>
<li>Start the service (MSSQLSERVER);</li>
<li>Delete the database with problem;</li>
<li>Restore the database again.</li>
</ol>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldofcode.com/sql-server-database-stuck-in-restoring-state/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert VB to C# or C# to VB</title>
		<link>http://www.worldofcode.com/convert-vb-to-c-or-c-to-vb/</link>
		<comments>http://www.worldofcode.com/convert-vb-to-c-or-c-to-vb/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 15:10:00 +0000</pubDate>
		<dc:creator>WorldofCode</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[VB.Net]]></category>

		<guid isPermaLink="false">http://www.worldofcode.com/convert-vb-to-c-or-c-to-vb/</guid>
		<description><![CDATA[Handy tool for conveting code inbetween VB and C# or vice versa. http://converter.telerik.com/ &#160;]]></description>
			<content:encoded><![CDATA[<p></p>
<p>Handy tool for conveting code inbetween VB and C# or vice versa.</p>
<p><a href="http://converter.telerik.com/">http://converter.telerik.com/</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldofcode.com/convert-vb-to-c-or-c-to-vb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get MP3 file duration/length</title>
		<link>http://www.worldofcode.com/get-mp3-file-durationlength/</link>
		<comments>http://www.worldofcode.com/get-mp3-file-durationlength/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 04:08:07 +0000</pubDate>
		<dc:creator>WorldofCode</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Windows Media Player]]></category>

		<guid isPermaLink="false">http://www.worldofcode.com/get-mp3-file-durationlength/</guid>
		<description><![CDATA[C# code for if you are trying to get the&#160;mp3 length or duration&#160;of a media&#160;file.&#160;&#160;You will need to reference Windows Media Player.&#160; Go to Com Add-ins to add the wmp.dll to your project.&#160; string Duration = null; WMPLib.WindowsMediaPlayer w = new WMPLib.WindowsMediaPlayer(); WMPLib.IWMPMedia m = w.newMedia(Filename); if (m != null) { &#160;Duration = m.durationString; } [...]]]></description>
			<content:encoded><![CDATA[<p></p>
<p>C# code for if you are trying to get the&nbsp;mp3 length or duration&nbsp;of a media&nbsp;file.&nbsp;&nbsp;You will need to reference Windows Media Player.&nbsp; Go to Com Add-ins to add the wmp.dll to your project.&nbsp;</p>
<blockquote>
<p>string Duration = null;<br />
WMPLib.WindowsMediaPlayer w = new WMPLib.WindowsMediaPlayer();<br />
WMPLib.IWMPMedia m = w.newMedia(Filename);<br />
if (m != null) {<br />
&nbsp;Duration = m.durationString;<br />
}<br />
w.close();</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.worldofcode.com/get-mp3-file-durationlength/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Replace line breaks with BR tags</title>
		<link>http://www.worldofcode.com/replace-line-breaks-with-60br62-tags/</link>
		<comments>http://www.worldofcode.com/replace-line-breaks-with-60br62-tags/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 03:22:01 +0000</pubDate>
		<dc:creator>WorldofCode</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[br]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[vb]]></category>

		<guid isPermaLink="false">http://www.worldofcode.com/replace-line-breaks-with-60br62-tags/</guid>
		<description><![CDATA[&#160;&#160;In Classic ASP we used to replace line breaks or vbCrLf tags in the following way. strValue = Replace(strValue, vbCrLf, &#34;&#60;br&#62;&#34;) In ASP.NET it is a bit different.&#160; Now we have the Environment.NewLine command that will determine the coding environment you are running&#160;in either VB or C#.&#160; So you can replace the line break command [...]]]></description>
			<content:encoded><![CDATA[<p></p>
<p>&nbsp;&nbsp;In Classic ASP we used to replace line breaks or vbCrLf tags in the following way.</p>
<blockquote>
<p>strValue = Replace(strValue, vbCrLf, &quot;&lt;br&gt;&quot;)</p>
</blockquote>
<p>In ASP.NET it is a bit different.&nbsp; Now we have the Environment.NewLine command that will determine the coding environment you are running&nbsp;in either VB or C#.&nbsp; So you can replace the line break command wether it is vbCrLf or /n.</p>
<blockquote>
<p>string strValue = strValue;</p>
<p>strValue.Text = strValue.Replace(Environment.NewLine, &quot;&lt;br/&gt;&quot;);</p>
</blockquote>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldofcode.com/replace-line-breaks-with-60br62-tags/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use the Union statement with a dynamic order by</title>
		<link>http://www.worldofcode.com/how-to-use-the-union-statement-with-a-dynamic-order-by/</link>
		<comments>http://www.worldofcode.com/how-to-use-the-union-statement-with-a-dynamic-order-by/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 01:28:22 +0000</pubDate>
		<dc:creator>WorldofCode</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[derived table]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[union]]></category>

		<guid isPermaLink="false">http://www.worldofcode.com/how-to-use-the-union-statement-with-a-dynamic-order-by/</guid>
		<description><![CDATA[I don&#8217;t use the Union statement to much in my SQL coding but today I needed to use it to combine results from two separate tables.  But I ran into an error when I wanted to add in my usual code for doing a dynamic order by.  SQL wouldn&#8217;t run my query and output this [...]]]></description>
			<content:encoded><![CDATA[<p><br />
I don&#8217;t use the Union statement to much in my SQL coding but today I needed to use it to combine results from two separate tables.  But I ran into an error when I wanted to add in my usual code for doing a dynamic order by.  SQL wouldn&#8217;t run my query and output this error message.</p>
<p><span style="color: #ff0000;">ORDER BY items must appear in the select list if the statement contains a UNION, INTERSECT or EXCEPT operator.</span></p>
<p> To fix this problem I put my Union statement into a derived table by doing the following.</p>
<blockquote><p>SELECT * FROM (</p>
<p>SELECT Column1, Column2 FROM Table_A</p>
<p>UNION ALL</p>
<p>SELECT Column1, Column2 FROM Table_B</p>
<p>) DerivedTableName (Column1, Column2)</p></blockquote>
<p>Next I added in my dynamic Order By code as such.</p>
<blockquote><p>SELECT * FROM (</p>
<p>SELECT Column1, Column2 FROM Table_A</p>
<p>UNION ALL</p>
<p>SELECT Column1, Column2 FROM Table_B</p>
<p>) DerivedTableName (Column1, Column2)</p>
<p>ORDER BY</p>
<p>CASE @OrderBy WHEN &#8216;Column1ASC&#8217; THEN Column1 END ASC,</p>
<p>CASE @OrderBy WHEN &#8216;Column1DESC&#8217; THEN Column1 END DESC</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.worldofcode.com/how-to-use-the-union-statement-with-a-dynamic-order-by/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>reCAPTCHA Classic ASP Implementation</title>
		<link>http://www.worldofcode.com/recaptcha-classic-asp-implementation/</link>
		<comments>http://www.worldofcode.com/recaptcha-classic-asp-implementation/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 22:21:04 +0000</pubDate>
		<dc:creator>WorldofCode</dc:creator>
				<category><![CDATA[Classic ASP]]></category>
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.worldofcode.com/recaptcha-classic-asp-implementation/</guid>
		<description><![CDATA[Recently had to work with a new CAPTCHA program called reCAPTCHA.  It was fairly easy to implement with Classic ASP code but had some problems figuring out some parts of it. First off what is CAPTCHA?  It stands for Completely Automated Public Turing test to tell Computers and Humans Apart.  CAPTCHA is basically an image [...]]]></description>
			<content:encoded><![CDATA[<p><br />
Recently had to work with a new CAPTCHA program called <a href="http://recaptcha.net/" target="_blank">reCAPTCHA</a>.  It was fairly easy to implement with Classic ASP co<img src="http://www.worldofcode.com/wp-content/uploads/image/CAPTCHA_WorldofCode.jpg" border="0" alt="CAPTCHA - World of Code" hspace="5" vspace="5" width="200" height="100" align="right" />de but had some problems figuring out some parts of it.</p>
<p>First off what is CAPTCHA?  It stands for <strong>C</strong>ompletely <strong>A</strong>utomated <strong>P</strong>ublic <strong>T</strong>uring test to tell <strong>C</strong>omputers and <strong>H</strong>umans <strong>A</strong>part.  CAPTCHA is basically an image of letters and numbers that is randomly generated.  The image makes it difficult for spam bots to read.  So they can be used as a way to verify if a computer is submitting a form on a website or an actual person.  So we can eliminate all of that pesky spam!</p>
<p>The <a href="http://recaptcha.net/" target="_blank">reCAPTCHA</a> software is free to use and also helps digitize books when it is being used.  Check out their site for more information on that.</p>
<p>I needed to implement this software on a site that runs Classic ASP.  They did not have a specific example on how to do this but I was able to find an example done from a very kind person Andre F. Bruton on the discussion boards.  <a href="http://www.andrebruton.com/recaptcha/" target="_blank">Click here to go and view the example</a>.</p>
<p><span style="color: #ff0000;">Update it appears that the above site has gone down so here is a link to the example that was offered by that site.</span></p>
<p><a href="http://www.worldofcode.com/wp-content/uploads/2008/04/recaptcha_classic_asp.zip">Download the example.</a></p>
<p>The example worked great I just had to insert the code into my pages and I was off and running in no time.  However on a few of the pages I was running them in SSL which when using the reCAPTCHA software on those page brought up some secure errors.  Through searching around the internet and trying various things I found out that reCAPTCHA has a secure server to send to so you will no longer get the security errors.  That URL is <a href="https://api-secure.recaptcha.net">https://api-secure.recaptcha.net</a>. </p>
<p>Here is an example of where you need to put it in your code.</p>
<blockquote><p>function recaptcha_challenge_writer(publickey)<br />
recaptcha_challenge_writer = &#8220;&lt;script type=&#8221;"text/javascript&#8221;"&gt;&#8221; &amp; _<br />
&#8220;var RecaptchaOptions = {&#8221; &amp; _<br />
&#8221; theme : &#8216;white&#8217;,&#8221; &amp; _<br />
&#8221; tabindex : 0&#8243; &amp; _<br />
&#8220;};&#8221; &amp; _<br />
&#8220;&lt;/script&gt;&#8221; &amp; _<br />
&#8220;&lt;script type=&#8221;"text/javascript&#8221;" src=&#8221;"https://api-secure.recaptcha.net/challenge?k=&#8221; &amp; publickey &amp; &#8220;&#8221;"&gt;&lt;/script&gt;&#8221; &amp; _<br />
&#8220;&lt;noscript&gt;&#8221; &amp; _<br />
&#8220;&lt;iframe src=&#8221;"http://api.recaptcha.net/noscript?k=&#8221; &amp; publickey &amp; &#8220;&#8221;" frameborder=&#8221;"1&#8243;&#8221;&gt;&lt;/iframe&gt;&lt;br&gt;&#8221; &amp; _<br />
&#8220;&lt;textarea name=&#8221;"recaptcha_challenge_field&#8221;" rows=&#8221;"3&#8243;&#8221; cols=&#8221;"40&#8243;&#8221;&gt;&lt;/textarea&gt;&#8221; &amp; _<br />
&#8220;&lt;input type=&#8221;"hidden&#8221;" name=&#8221;"recaptcha_response_field&#8221;" value=&#8221;"manual_challenge&#8221;"&gt;&#8221; &amp; _<br />
&#8220;&lt;/noscript&gt;&#8221;<br />
end function</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.worldofcode.com/recaptcha-classic-asp-implementation/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

