<?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>From the Land of Meh... &#187; Bills Posts</title>
	<atom:link href="http://www.billwatters.com/archives/category/bills-posts/feed" rel="self" type="application/rss+xml" />
	<link>http://www.billwatters.com</link>
	<description>The blog, rants, ravings, and commentaries of Bill Watters</description>
	<lastBuildDate>Thu, 29 Jul 2010 07:56:56 +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>Redheads Have More Sex</title>
		<link>http://www.billwatters.com/archives/217</link>
		<comments>http://www.billwatters.com/archives/217#comments</comments>
		<pubDate>Thu, 11 Jun 2009 20:33:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bills Posts]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.billwatters.com/archives/217</guid>
		<description><![CDATA[ Blondes may have more fun but redheads have more sex, according to new research in Germany. The study by Hamburg Sex Researcher Professor Dr Werner Habermehl looked at the sex lives of hundreds of German women and compared them with their hair color. 
Dr Habermehl said: “The sex lives of women with red hair [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.billwatters.com/wp-content/uploads/2009/06/redheads2381.jpg" rel="lightbox"><img style="border-right-width: 0px; margin: 0px 5px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="redheads-238[1]" border="0" alt="redheads-238[1]" align="left" src="http://www.billwatters.com/wp-content/uploads/2009/06/redheads2381-thumb.jpg" width="168" height="244" /></a> Blondes may have more fun but redheads have more sex, according to new research in Germany. The study by Hamburg Sex Researcher Professor Dr Werner Habermehl looked at the sex lives of hundreds of German women and compared them with their hair color. </p>
<p>Dr Habermehl said: “The sex lives of women with red hair were clearly more active than those with other hair color, with more partners and having sex more often than the average. The research shows that the fiery redhead certainly lives up to her reputation.”</p>
<p>He added that women who dyed their hair red from another color were signaling they were looking for a partner, and added: “Even women in a fixed relationship are letting their partners know they are unhappy if they dye their hair red. They are saying that they are looking for something better.”</p>
<h6><img style="margin: 0px 5px 0px 0px; display: inline" alt="Redheads Have More Sex" align="left" src="http://www.impactlab.com/wp-content/uploads/2008/09/redheads-231.jpg" width="188" height="240" /></h6>
<p>&#160;<img style="margin: 0px 0px 0px 5px; display: inline" alt="What could be more fun than researching the sex lives of young women?" align="right" src="http://www.impactlab.com/wp-content/uploads/2008/09/redheads-235.jpg" width="180" height="240" />Psychologist Christine Baumanns said however that it may not be the women who were to blame for the better sex lives of redheads.</p>
<p>She said: “Red stands for passion and when a man sees a redhead he will think he is dealing with a woman who won’t mess around, and gets straight to the point when it comes to sex.”</p>
<p> “Redheads have a fiery temperament. I love that sense of danger, not knowing whether the woman is going to smash a vase in a fit of wild anger or tear my clothes off in a fit of animal lust. That fire and passion will hold my interest over the long haul, no question.”</p>
<p><img style="margin: 0px 5px 0px 0px; display: inline" alt="Redheads Have More Sex" align="left" src="http://www.impactlab.com/wp-content/uploads/2008/09/redheads-233.jpg" width="160" height="240" /></p>
<p><img style="margin: 0px 0px 0px 5px; display: inline" alt="Redheads Have More Sex" align="right" src="http://www.impactlab.com/wp-content/uploads/2008/09/redheads-234.jpg" width="160" height="240" /></p>
<p>&#160;</p>
<p>Five important facts about redheads: </p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<ol>
<li>Only four percent of all people have natural red hair. </li>
<li>Only 2% of the US population are natural redheads. </li>
<li>Redheads require more anesthesia than blondes and brunettes. </li>
<li>Redheads don’t turn grey–rather their hair turns sandy and then white. </li>
<li>The sales of red hair color and dyes has increased 17% since 2000. </li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.billwatters.com/archives/217/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TSQL: A quick way to get the Day Name from a DateTime</title>
		<link>http://www.billwatters.com/archives/213</link>
		<comments>http://www.billwatters.com/archives/213#comments</comments>
		<pubDate>Fri, 30 Jan 2009 21:13:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bills Posts]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.billwatters.com/archives/213</guid>
		<description><![CDATA[create function getDayOfWeek
    (@date datetime)
returns varchar(10)
as
    begin
        declare @retVal varchar(10)
        select @retVal=
            case datepart(dw,@date)
           [...]]]></description>
			<content:encoded><![CDATA[<pre class="csharpcode"><span class="kwrd">create</span> <span class="kwrd">function</span> getDayOfWeek
    (@<span class="kwrd">date</span> datetime)
<span class="kwrd">returns</span> <span class="kwrd">varchar</span>(10)
<span class="kwrd">as</span>
    <span class="kwrd">begin</span>
        <span class="kwrd">declare</span> @retVal <span class="kwrd">varchar</span>(10)
        <span class="kwrd">select</span> @retVal=
            <span class="kwrd">case</span> datepart(dw,@<span class="kwrd">date</span>)
                <span class="kwrd">when</span> 1 <span class="kwrd">then</span> <span class="str">'Sun'</span>
                <span class="kwrd">when</span> 2 <span class="kwrd">then</span> <span class="str">'Mon'</span>
                <span class="kwrd">when</span> 3 <span class="kwrd">then</span> <span class="str">'Tue'</span>
                <span class="kwrd">when</span> 4 <span class="kwrd">then</span> <span class="str">'Wed'</span>
                <span class="kwrd">when</span> 5 <span class="kwrd">then</span> <span class="str">'Thu'</span>
                <span class="kwrd">when</span> 6 <span class="kwrd">then</span> <span class="str">'Fri'</span>
                <span class="kwrd">when</span> 7 <span class="kwrd">then</span> <span class="str">'Sat'</span>
            <span class="kwrd">end</span>
        <span class="kwrd">return</span> @retVal
    end</pre>
<p>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Then you can just call it as any other function in a select (or however you need it): </p>
<pre class="csharpcode"><span class="kwrd">select</span> dbo.getDayOfWeek(getdate())</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
]]></content:encoded>
			<wfw:commentRss>http://www.billwatters.com/archives/213/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TSQL: How to count the rows, columns, and size of each table in your db</title>
		<link>http://www.billwatters.com/archives/211</link>
		<comments>http://www.billwatters.com/archives/211#comments</comments>
		<pubDate>Fri, 30 Jan 2009 01:11:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bills Posts]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.billwatters.com/archives/211</guid>
		<description><![CDATA[USE [dbName]
GO
CREATE TABLE #temp (
table_name sysname ,
row_count INT,
reserved_size VARCHAR(50),
data_size VARCHAR(50),
index_size VARCHAR(50),
unused_size VARCHAR(50))
SET NOCOUNT ON
INSERT #temp
EXEC sp_msforeachtable 'sp_spaceused ''?'''
SELECT a.table_name,
a.row_count,
COUNT(*) AS col_count,
a.data_size
FROM #temp a
INNER JOIN information_schema.columns b
ON a.table_name collate database_default
= b.table_name collate database_default
GROUP BY a.table_name, a.row_count, a.data_size
ORDER BY CAST(REPLACE(a.data_size, ' KB', '') AS integer) DESC
DROP TABLE #temp

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: [...]]]></description>
			<content:encoded><![CDATA[<pre class="csharpcode"><span class="kwrd">USE</span> [dbName]
<span class="kwrd">GO</span>
<span class="kwrd">CREATE</span> <span class="kwrd">TABLE</span> #temp (
table_name sysname ,
row_count <span class="kwrd">INT</span>,
reserved_size <span class="kwrd">VARCHAR</span>(50),
data_size <span class="kwrd">VARCHAR</span>(50),
index_size <span class="kwrd">VARCHAR</span>(50),
unused_size <span class="kwrd">VARCHAR</span>(50))
<span class="kwrd">SET</span> NOCOUNT <span class="kwrd">ON</span>
INSERT #temp
<span class="kwrd">EXEC</span> sp_msforeachtable <span class="str">'sp_spaceused '</span><span class="str">'?'</span><span class="str">''</span>
<span class="kwrd">SELECT</span> a.table_name,
a.row_count,
<span class="kwrd">COUNT</span>(*) <span class="kwrd">AS</span> col_count,
a.data_size
<span class="kwrd">FROM</span> #temp a
<span class="kwrd">INNER</span> <span class="kwrd">JOIN</span> information_schema.columns b
<span class="kwrd">ON</span> a.table_name <span class="kwrd">collate</span> database_default
= b.table_name <span class="kwrd">collate</span> database_default
<span class="kwrd">GROUP</span> <span class="kwrd">BY</span> a.table_name, a.row_count, a.data_size
<span class="kwrd">ORDER</span> <span class="kwrd">BY</span> <span class="kwrd">CAST</span>(REPLACE(a.data_size, <span class="str">' KB'</span>, <span class="str">''</span>) <span class="kwrd">AS</span> <span class="kwrd">integer</span>) <span class="kwrd">DESC</span>
<span class="kwrd">DROP</span> <span class="kwrd">TABLE</span> #temp</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
]]></content:encoded>
			<wfw:commentRss>http://www.billwatters.com/archives/211/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C#: Using RegEx to strip html from a string</title>
		<link>http://www.billwatters.com/archives/209</link>
		<comments>http://www.billwatters.com/archives/209#comments</comments>
		<pubDate>Fri, 30 Jan 2009 00:13:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bills Posts]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.billwatters.com/archives/209</guid>
		<description><![CDATA[








using System.Text.RegularExpressions;

  ...

  public static string RemoveHTML(string in_HTML)
    {
      return Regex.Replace(in_HTML, &#34;&#60;(.&#124;\n)*?&#62;&#34;, &#34;&#34;);
    }

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { [...]]]></description>
			<content:encoded><![CDATA[<div id="wrapper">
<div class="clear-block" id="container">
<div id="center">
<div id="squeeze">
<div class="right-corner">
<div class="left-corner">
<div class="node">
<div class="post hentry category-aspnet category-aspnet-with-c tag-remove tag-html">
<div class="content">
<pre class="csharpcode"><span class="kwrd">using</span> System.Text.RegularExpressions;

  ...

  <span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">string</span> RemoveHTML(<span class="kwrd">string</span> in_HTML)
    {
      <span class="kwrd">return</span> Regex.Replace(in_HTML, <span class="str">&quot;&lt;(.|\n)*?&gt;&quot;</span>, <span class="str">&quot;&quot;</span>);
    }</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
</div></div>
</p></div>
</p></div>
</p></div>
</p></div>
</p></div>
</p></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.billwatters.com/archives/209/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOW TO: Rewrite URL / Implement URL Rewriting in ASP.NET</title>
		<link>http://www.billwatters.com/archives/208</link>
		<comments>http://www.billwatters.com/archives/208#comments</comments>
		<pubDate>Fri, 30 Jan 2009 00:11:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bills Posts]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.billwatters.com/archives/208</guid>
		<description><![CDATA[Reference articles:

Tip/Trick: Url Rewriting with ASP.NET by Scott Guthrie &#8211; Examines four approaches: 1) Use Request.PathInfo Parameters Instead of QueryStrings; 2) Using an HttpModule to Perform URL Rewriting; 3) Using an HttpModule to Perform Extension-Less URL Rewriting with IIS7; 4) ISAPIRewrite to enable Extension-less URL Rewriting for IIS5 and IIS6; also discusses how to handle [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Reference articles:</strong></p>
<ul>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx">Tip/Trick: Url Rewriting with ASP.NET</a> by Scott Guthrie &#8211; Examines four approaches: 1) Use Request.PathInfo Parameters Instead of QueryStrings; 2) Using an HttpModule to Perform URL Rewriting; 3) Using an HttpModule to Perform Extension-Less URL Rewriting with IIS7; 4) ISAPIRewrite to enable Extension-less URL Rewriting for IIS5 and IIS6; also discusses how to handle ASP.NET postbacks correctly with URL rewriting. </li>
</ul>
<ul>
<li><a href="http://www.csharpfriends.com/Articles/getTip.aspx?articleID=215">URL Rewriting</a> by Salman (CSharpFriends) &#8211; simple implementation of URL rewriting logic within the Application_BeginRequest() method of the Global.asax file. </li>
</ul>
<ul>
<li><a href="http://www.theukwebdesigncompany.com/articles/search-engine-friendly-urls-asp.php">Search Engine Friendly URLs using ASP.NET (C#.NET)</a> by Maziar Aflatoun (The UK Web Design Company) &#8211; similar to the above, but regular expression is used to match URLs. </li>
</ul>
<ul>
<li><a href="http://www.15seconds.com/issue/030522.htm">Rewrite.NET &#8211; A URL Rewriting Engine for .NET</a> by Robert Chartier (15Seconds.com). Solution steps:
<ul>
<li>Create the HttpModule to process the web request and rewrite the URL </li>
<li>Add the handler in Web.config </li>
<li>Create a configuration section in Web.config to define URL mapping rules </li>
<li>Add extensibility by creating a rules engine interface </li>
<li>Write class or classes to implement rules engine interface </li>
<li>Add code to the HttpModule to dynamically load the desired rules from Web.config </li>
</ul>
</li>
</ul>
<ul>
<li><a href="http://msdn.microsoft.com/asp.net/using/building/web/default.aspx?pull=/library/en-us/dnaspp/html/urlrewriting.asp">URL Rewriting in ASP.NET</a> by Scott Mitchell (MSDN) &#8211; examines how to implement URL rewriting in a HTTP module; also explains how to handle postbacks. </li>
</ul>
<ul>
<li><a href="http://www.codeproject.com/aspnet/URLRewriter.asp">URL Rewriting with ASP.NET</a> by Richard Birkby (CodeProject) &#8211; shows how legacy ASP sites can be upgraded to ASP.NET, while maintaining links from search engines. Solution steps:
<ul>
<li>Create the configuration section in Web.config for defining URL mapping rules </li>
<li>Write the configuration section handler class, incorporating the URL rewriting logic </li>
<li>Create a call to handler in Global.asax in Application_BeginRequest() method </li>
<li>Compile the code and install the rewriter assembly in the Global Assembly Cache (GAC) </li>
<li>Configure IIS to map non- .aspx files to the ASP.NET ISAPI extension </li>
</ul>
</li>
</ul>
<h5>Related Resources</h5>
<ul>
<li><a href="http://west-wind.com/weblog/posts/269.aspx">Making Sense of ASP.NET Paths</a> by Rick Strahl </li>
<li><a href="http://weblogs.asp.net/jezell/archive/2004/03/15/90045.aspx">Fixing Microsoft&#8217;s Bugs: URL Rewriting</a> by Jesse Ezell </li>
<li><a href="http://www.aspnetworld.com/store/itemdetails/B0000632ZU.aspx">Regular Expressions with .NET</a> by Dan Appleman and Daniel Appleman </li>
<li><a href="http://www.urlrewriting.net/">UrlRewritingNet.UrlRewrite</a> &#8211; an Open Source Component which allows you certainly to rewrite URLs with ASP.NET 2.0. </li>
<li><a href="http://urlrewriter.net/">Open Source URL Rewriter for .NET / IIS / ASP.NET</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.billwatters.com/archives/208/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
