<?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>Tadlock Enterprises &#187; tips &amp; tricks</title>
	<atom:link href="http://www.tadlockenterprises.com/category/tips-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tadlockenterprises.com</link>
	<description>A specialized west coast firm focused on product and technology vision, planning and execution.</description>
	<lastBuildDate>Thu, 18 Mar 2010 07:45:03 +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>Ignore an Invalid SSL Cert in .NET</title>
		<link>http://www.tadlockenterprises.com/2010/03/ignore-an-invalid-ssl-cert-in-net/</link>
		<comments>http://www.tadlockenterprises.com/2010/03/ignore-an-invalid-ssl-cert-in-net/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 01:08:13 +0000</pubDate>
		<dc:creator>Craig Tadlock</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[tips & tricks]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[IP]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[web service]]></category>

		<guid isPermaLink="false">http://www.tadlockenterprises.com/?p=456</guid>
		<description><![CDATA[One of our clients integrates with a financial services company which provides an API to access data. Obviously this needs to be secure. Their QA environment is secured via SSL but is exposed only by IP address. A .NET client will by default throw a security exception when you try to create a SSL connection [...]]]></description>
			<content:encoded><![CDATA[<p>One of our clients integrates with a financial services company which provides an API to access data. Obviously this needs to be secure. Their QA environment is secured via SSL but is exposed only by IP address. A .NET client will by default throw a security exception when you try to create a SSL connection by IP because the certificate has been issued to a name. This code will get you past that&#8230;</p>
<p><em>ServicePointManager.ServerCertificateValidationCallback += ((sender, certificate, chain, sslPolicyErrors) =&gt; true);</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tadlockenterprises.com/2010/03/ignore-an-invalid-ssl-cert-in-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SMTP Diagnostics Tool for Windows</title>
		<link>http://www.tadlockenterprises.com/2010/02/smtp-diagnostics-tool-for-windows/</link>
		<comments>http://www.tadlockenterprises.com/2010/02/smtp-diagnostics-tool-for-windows/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 08:18:21 +0000</pubDate>
		<dc:creator>Craig Tadlock</dc:creator>
				<category><![CDATA[it]]></category>
		<category><![CDATA[tips & tricks]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[smtp]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.tadlockenterprises.com/?p=448</guid>
		<description><![CDATA[Are you running a SMTP server on a Windows Server? Then you need to use the Microsoft Exchange Server SMTPDiag Tool. It will verify your SMTP, DNS and firewall settings to ensure everything is setup properly and you are able to send email.
]]></description>
			<content:encoded><![CDATA[<p>Are you running a SMTP server on a Windows Server? Then you need to use the <a href="http://www.microsoft.com/downloads/details.aspx?familyid=BC1881C7-925D-4A29-BD42-71E8563C80A9&amp;displaylang=en" target="_blank">Microsoft Exchange Server SMTPDiag Tool</a>. It will verify your SMTP, DNS and firewall settings to ensure everything is setup properly and you are able to send email.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tadlockenterprises.com/2010/02/smtp-diagnostics-tool-for-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix Loopback 401 Errors in Windows Server 2008</title>
		<link>http://www.tadlockenterprises.com/2010/02/fix-loopback-401-errors-in-windows-server-2008/</link>
		<comments>http://www.tadlockenterprises.com/2010/02/fix-loopback-401-errors-in-windows-server-2008/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 08:13:16 +0000</pubDate>
		<dc:creator>Craig Tadlock</dc:creator>
				<category><![CDATA[it]]></category>
		<category><![CDATA[tips & tricks]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[regedit]]></category>
		<category><![CDATA[registry]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.tadlockenterprises.com/?p=446</guid>
		<description><![CDATA[If you use a loopback address (127.0.0.1) or hosts files on your Windows Server to reference a local IIS web application with Windows Authentication it will probably fail with a 401 error due to a new security constraint. This is often the case if you use a public url for your Sharepoint of TFS server. [...]]]></description>
			<content:encoded><![CDATA[<p>If you use a loopback address (127.0.0.1) or hosts files on your Windows Server to reference a local IIS web application with Windows Authentication it will probably fail with a 401 error due to a new security constraint. This is often the case if you use a public url for your Sharepoint of TFS server. To resolve this you need to add a registry key&#8230;</p>
<ol>
<li>Open <em>regedit</em></li>
<li>Open the key <em>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa</em></li>
<li>Create a new DWORD under <em>Lsa </em>named <em>DisableLoopbackCheck</em></li>
<li>Set its value to 1</li>
<li>Restart the server for good measure</li>
</ol>
<p><strong>Related Links</strong></p>
<p><a href="http://support.microsoft.com/kb/896861" target="_blank">http://support.microsoft.com/kb/896861</a></p>
<p><a href="http://ppalakollu.blogspot.com/2009/04/ie-8-ntlm-authentication-on-windows.html" target="_blank">http://ppalakollu.blogspot.com/2009/04/ie-8-ntlm-authentication-on-windows.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tadlockenterprises.com/2010/02/fix-loopback-401-errors-in-windows-server-2008/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Auto Generate a Code Column Value in SQL</title>
		<link>http://www.tadlockenterprises.com/2010/02/auto-generate-a-code-column-value-in-sql/</link>
		<comments>http://www.tadlockenterprises.com/2010/02/auto-generate-a-code-column-value-in-sql/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 21:58:09 +0000</pubDate>
		<dc:creator>Craig Tadlock</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[tips & tricks]]></category>
		<category><![CDATA[data design]]></category>
		<category><![CDATA[data model]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sql server]]></category>

		<guid isPermaLink="false">http://www.tadlockenterprises.com/?p=437</guid>
		<description><![CDATA[Often in database design a table has a secondary unique key which defines a random alpha-numeric value; lets call this Code. While the table&#8217;s primary key is used for foreign key references in the database, the Code column has several advantages and uses. Since it is not a sequential value it can be shown to [...]]]></description>
			<content:encoded><![CDATA[<p>Often in database design a table has a secondary unique key which defines a random alpha-numeric value; lets call this Code. While the table&#8217;s primary key is used for foreign key references in the database, the Code column has several advantages and uses. Since it is not a sequential value it can be shown to the user without giving away possible valuable information; for example <a href="http://www.techcrunch.com/2010/02/04/nexus-one-google-sales/" target="_blank">giving away your sales volume</a>. It can also be used as a URL query parameter to discourage one-up-attacks (note this should not be a replacement for proper data security).</p>
<p>So now that we are sold on having a Code column, what is the best way to implement it? Here is a method you can use to implement a proper Code column and have the database generate the value for you. This is a similar design pattern to using an <em>IDENTITY </em>column to generate the next value for a primary key. We would like for the column to have a default value of a new Code value, such that the application tier doesn&#8217;t have to worry about setting the value. An issue with this in SQL Server is that column default values do not allow for &#8216;dynamic&#8217; values; we can use a view to get around this. As for the Code generation algorithm I piggybacked on the <em>NEWID()</em> function which generates a new <em>uniqueidentifier</em>. There are countless other algorithms you could use for this.</p>
<p>Create a view to generate the new codes&#8230;</p>
<p><em>CREATE VIEW [dbo].[Codes]<br />
AS<br />
SELECT LOWER(SUBSTRING(REPLACE(NEWID(), &#8216;-&#8217;, &#8221;), 0, 16)) AS Code;</em></p>
<p>Create a function which returns a new code&#8230;</p>
<p><em>CREATE FUNCTION [dbo].[NewCode]<br />
( )<br />
RETURNS NVARCHAR (50)<br />
AS<br />
BEGIN<br />
RETURN (SELECT Code FROM Codes)<br />
END</em></p>
<p>Now we can use the <em>dbo.NewCode()</em> function as the default value for our table&#8217;s Code column..</p>
<p><em>ALTER TABLE [dbo].[XXX] ADD  CONSTRAINT [DF_XXX_Code]  DEFAULT ([dbo].[NewCode]()) FOR [Code]</em></p>
<p>That&#8217;s it! Now if you insert a row into the table the Code column will have a new value in it by default. Simple.</p>
<p><strong>UPDATE</strong></p>
<p>Here is a much better algorithm to generate codes. The previous algorithm has a &#8216;hidden&#8217; issue; the <em>NEWID()</em> function only generates the letters A-H, so you don&#8217;t get the security of the full 26 character alphabet. The algorithm below also lets you choose which characters you want. This allows you to prevent issues like 1 and I, and 0 and O confusion.</p>
<p><em>CREATE VIEW [dbo].[Codes]<br />
AS<br />
select<br />
[Code] =<br />
substring(ch, convert(int, RAND() * (LEN(ch) &#8211; 1)) + 1, 1) +<br />
substring(ch, convert(int, RAND() * (LEN(ch) &#8211; 1)) + 1, 1) +<br />
substring(ch, convert(int, RAND() * (LEN(ch) &#8211; 1)) + 1, 1) +<br />
substring(ch, convert(int, RAND() * (LEN(ch) &#8211; 1)) + 1, 1) +<br />
substring(ch, convert(int, RAND() * (LEN(ch) &#8211; 1)) + 1, 1) +<br />
substring(ch, convert(int, RAND() * (LEN(ch) &#8211; 1)) + 1, 1) +<br />
substring(ch, convert(int, RAND() * (LEN(ch) &#8211; 1)) + 1, 1) +<br />
substring(ch, convert(int, RAND() * (LEN(ch) &#8211; 1)) + 1, 1)<br />
from<br />
(select ch = &#8216;ABCDEFGHJKLMNPQURSUVWXYZ23456789&#8242;) a</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tadlockenterprises.com/2010/02/auto-generate-a-code-column-value-in-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate Lorem Ipsum Text in MS Word</title>
		<link>http://www.tadlockenterprises.com/2010/02/generate-lorem-ipsum-text-in-ms-word/</link>
		<comments>http://www.tadlockenterprises.com/2010/02/generate-lorem-ipsum-text-in-ms-word/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 04:47:45 +0000</pubDate>
		<dc:creator>Craig Tadlock</dc:creator>
				<category><![CDATA[tips & tricks]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[latin]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[word]]></category>

		<guid isPermaLink="false">http://www.tadlockenterprises.com/?p=435</guid>
		<description><![CDATA[Here&#8217;s a quick tip: To generate &#8220;Lorem ipsum&#8221; text in Microsoft Word type &#8220;=lorem(x, y)&#8221;; where x is the number of paragraphs and y is the number is sentences. I regularly use this for fake text when developing websites.
]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick tip: To generate &#8220;Lorem ipsum&#8221; text in Microsoft Word type &#8220;=lorem(x, y)&#8221;; where x is the number of paragraphs and y is the number is sentences. I regularly use this for fake text when developing websites.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tadlockenterprises.com/2010/02/generate-lorem-ipsum-text-in-ms-word/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visio 2010?</title>
		<link>http://www.tadlockenterprises.com/2009/11/visio-2010/</link>
		<comments>http://www.tadlockenterprises.com/2009/11/visio-2010/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 05:57:54 +0000</pubDate>
		<dc:creator>Craig Tadlock</dc:creator>
				<category><![CDATA[tips & tricks]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[msdn]]></category>
		<category><![CDATA[visio]]></category>

		<guid isPermaLink="false">http://www.tadlockenterprises.com/?p=186</guid>
		<description><![CDATA[The beta for Visio 2010 is up on MSDN. I didn&#8217;t even know there was a new version coming out. Given the number of &#8220;pretty pictures&#8221; I make, this is quite an exciting time.
More info on Visio 2010 at&#8230;
http://visiotoolbox.com/2010/
I&#8217;ll post my feedback once I&#8217;ve taken it for a spin.
]]></description>
			<content:encoded><![CDATA[<p>The beta for Visio 2010 is up on MSDN. I didn&#8217;t even know there was a new version coming out. Given the number of &#8220;pretty pictures&#8221; I make, this is quite an exciting time.</p>
<p>More info on Visio 2010 at&#8230;</p>
<p><a href="http://visiotoolbox.com/2010/">http://visiotoolbox.com/2010/</a></p>
<p>I&#8217;ll post my feedback once I&#8217;ve taken it for a spin.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tadlockenterprises.com/2009/11/visio-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extended Version of Notepad2</title>
		<link>http://www.tadlockenterprises.com/2009/11/extended-version-of-notepad2/</link>
		<comments>http://www.tadlockenterprises.com/2009/11/extended-version-of-notepad2/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 08:42:03 +0000</pubDate>
		<dc:creator>Craig Tadlock</dc:creator>
				<category><![CDATA[tips & tricks]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.tadlockenterprises.com/?p=142</guid>
		<description><![CDATA[If you are still using plain-old notepad.exe then I highly suggest you check out Notepad2. It is a much improved version of notepad but without all the bloat and madness of Word. If you&#8217;re using Notepad2 already then you might want to check out the extended version. It adds some additional features such as code [...]]]></description>
			<content:encoded><![CDATA[<p>If you are still using plain-old notepad.exe then I highly suggest you check out <a href="http://www.flos-freeware.ch/notepad2.html">Notepad2</a>. It is a much improved version of notepad but without all the bloat and madness of Word. If you&#8217;re using Notepad2 already then you might want to check out the extended version. It adds some additional features such as code collapsing and the installer does the Windows work to replace notepad.exe with notepad2.exe.</p>
<p><a href="http://code.kliu.org/misc/notepad2/">http://code.kliu.org/misc/notepad2/</a></p>
<p><img class="alignnone size-full wp-image-143" title="Notepad2 Code Screenshot" src="http://www.tadlockenterprises.com/wp-content/uploads/2009/11/Notepad2-4.0.22-Classic-C.png" alt="Notepad2 Code Screenshot" width="480" height="420" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tadlockenterprises.com/2009/11/extended-version-of-notepad2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Encrypt / Decrypt Context Menu in Windows 7</title>
		<link>http://www.tadlockenterprises.com/2009/11/encrypt-decrypt-context-menu-in-windows-7/</link>
		<comments>http://www.tadlockenterprises.com/2009/11/encrypt-decrypt-context-menu-in-windows-7/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 08:34:57 +0000</pubDate>
		<dc:creator>Craig Tadlock</dc:creator>
				<category><![CDATA[tips & tricks]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.tadlockenterprises.com/?p=136</guid>
		<description><![CDATA[This one is pretty self explanatory&#8230; I&#8217;m not sure why Microsoft didn&#8217;t enable this by default.
http://www.howtogeek.com/howto/windows-vista/add-encrypt-decrypt-options-to-windows-vista-right-click-menu/
MAKE SURE TO BACKUP YOUR ENCRYPTION KEY TO AN OFF-SITE LOCATION
If you move an encrypted file to another machine (like in the case of a OS rebuild) you MUST have the encryption key to restore the files. If you don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>This one is pretty self explanatory&#8230; I&#8217;m not sure why Microsoft didn&#8217;t enable this by default.</p>
<p><a href="http://www.howtogeek.com/howto/windows-vista/add-encrypt-decrypt-options-to-windows-vista-right-click-menu/">http://www.howtogeek.com/howto/windows-vista/add-encrypt-decrypt-options-to-windows-vista-right-click-menu/</a></p>
<p>MAKE SURE TO BACKUP YOUR ENCRYPTION KEY TO AN OFF-SITE LOCATION</p>
<p>If you move an encrypted file to another machine (like in the case of a OS rebuild) you MUST have the encryption key to restore the files. If you don&#8217;t have it; you&#8217;re out of luck.</p>
<p><a href="http://www.howtogeek.com/howto/windows-vista/back-up-your-file-encryption-key-in-windows-vista/">http://www.howtogeek.com/howto/windows-vista/back-up-your-file-encryption-key-in-windows-vista/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tadlockenterprises.com/2009/11/encrypt-decrypt-context-menu-in-windows-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
