<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>crunchlife: Category Expect the Unexpected</title>
    <link>http://crunchlife.com/articles/category/expect-the-unexpected</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Removing Duplicate Items from an Abstract Generic List</title>
      <description>&lt;p&gt;&lt;img src="/files/rocking_chair.jpg" class="right" /&gt;I&amp;#8217;ve got some explaining to do. I
was hesitant in posting this code for fear that it might be too niche
to benefit anyone. It may be, but the underlying problem affects many
programmers working in the IT industry. What do you do when the company
legacy system&amp;#8217;s data model doesn&amp;#8217;t work with your fancy &lt;a href="http://en.wikipedia.org/wiki/Object-relational_mapping" target="_blank"&gt;ORM (Object-relational mapping)&lt;/a&gt;?&lt;/p&gt;

&lt;blockquote&gt;
&amp;#8220;Any problem in computer science can be solved with another layer of indirection. But that usually will create another problem.&amp;#8221; - &lt;a href="http://en.wikipedia.org/wiki/David_Wheeler_(computer_scientist)" target="_blank"&gt;David Wheeler&lt;/a&gt;
&lt;/blockquote&gt;

&lt;p&gt;At my last job, the &lt;a href="http://en.wikipedia.org/wiki/Enterprise_resource_planning" target="_blank"&gt;ERP (Enterprise resource planning)&lt;/a&gt; system was something of mystery and voodoo. Only a few had sufficient knowledge to work with it and because of its arcane nature it was deemed untouchable. Within my first months as an employee I wrote a rudimentary ORM to serve as a layer between our client applications and the ERP system. Its performance was terrible. I wrote it off as &amp;#8220;experience&amp;#8221; and the department ultimately decided to ignore interfacing directly with the ERP system.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m using the &lt;a href="http://subsonicproject.com/" target="_blank"&gt;SubSonic&lt;/a&gt; ORM on a few ASP.NET projects with my current employer. SubSonic has worked great, but a
few of its database requirements have left me in the dust with yet another ERP system. The ERP&amp;#8217;s tables have no primary keys, constraints, or relationships, but rather than write a complete ORM I decided to roll my own data layer.&lt;/p&gt;

&lt;p&gt;All of the strongly-typed collections in the ERP&amp;#8217;s data layer implement the AbstractList type. AbstractList implements List&lt;ItemType&gt; where ItemType implements IUniqueIdentifier. That is a mouthful, but the key (pun intended) to removing duplicate items is to make sure they&amp;#8217;re unique.&lt;/p&gt;

&lt;p&gt;The IUniqueIdentifier interface contains only one property, UniqueIdentifier.&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;public interface IUniqueIdentifier
{
    string UniqueIdentifier
    {
        get;
        set;
    }
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt; 

&lt;p&gt;If the ERP system contained a table called Customers a Customer type implementing IUniqueIdentifier would be created. &lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;public class Customer : IUniqueIdentifier
{
    private string uniqueIdentifier;

    // etc...

    public UniqueIdentifier
    {
        get { return this.uniqueIdentifier; }
        set { this.uniqueIdentifier = value; }
    }
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I&amp;#8217;d also have a CustomerCollection class:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;public class CustomerCollection : AbstractList&amp;lt;Customer, CustomerCollection&amp;gt;
{
    // etc...
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;After such a long-winded introduction I can feel better about dumping the following code on anyone that has happened to read this far (kudos to you).&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;public abstract class AbstractList&amp;lt;ItemType, ListType&amp;gt; :
List&amp;lt;ItemType&amp;gt; where ItemType:IUniqueIdentifier where
ListType:AbstractList&amp;lt;ItemType, ListType&amp;gt;, new()
{
    public ListType RemoveDuplicates()
    {
        Dictionary&amp;lt;string, int&amp;gt; uniqueStore = new Dictionary&amp;lt;string, int&amp;gt;();
        ListType list = new ListType();

        foreach (ItemType item in this)
        {
            if (!uniqueStore.ContainsKey(item.UniqueIdentifier))
            {
                uniqueStore.Add(item.UniqueIdentifier, 0);
                list.Add(item);
            }
        }

        return list;
    }
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I&amp;#8217;d love to hear how others have worked around legacy systems and still kept their code clean. &lt;/p&gt;</description>
      <pubDate>Thu, 31 Jul 2008 07:40:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:f418da7f-eb68-46f7-9192-6c8254e39b4f</guid>
      <author>Ryan Baxter</author>
      <link>http://crunchlife.com/articles/2008/07/31/removing-duplicate-items-from-an-abstract-generic-list</link>
      <category>Code Snippets</category>
      <category>Expect the Unexpected</category>
      <category>CSharp</category>
      <category>dotNET</category>
      <category>ORM</category>
      <enclosure type="image/jpeg" url="http://crunchlife.com/files/rocking_chair.jpg" length="61497"/>
      <trackback:ping>http://crunchlife.com/articles/trackback/75</trackback:ping>
    </item>
    <item>
      <title>IE7's Inanimate GIF</title>
      <description>&lt;p&gt;Animated GIFs are most often used as activity indicators in modern &lt;a
href="http://en.wikipedia.org/wiki/Ajax_(programming)"
target="_blank"&gt;AJAX (asynchronous JavaScript and XML)&lt;/a&gt; enabled
websites. I decided to use a &lt;a
href="http://en.wikipedia.org/wiki/Gif" target="_blank"&gt;GIF (Graphic
Interchange Format)&lt;/a&gt; from &lt;a href="http://www.ajaxload.info/"
target="_blank"&gt;ajaxload.info&lt;/a&gt; on an application that I&amp;#8217;ve been
developing at work. The application performs server-side
processing on files uploaded by employees. Processing time varies depending on the size of the file. Larger files take longer.&lt;/p&gt;

&lt;p&gt;I wanted the animated GIF to appear when the file upload button was clicked so I placed the image within a &lt;a href="http://www.w3schools.com/tags/tag_DIV.asp" target="_blank"&gt;DIV&lt;/a&gt; tag and hid it by setting a blank &lt;a href="http://www.w3schools.com/css/pr_class_display.asp" target="_blank"&gt;CSS display property&lt;/a&gt;. OnClick of the upload button, a
JavaScript function toggled the display value to &amp;#8220;block&amp;#8221;, making the DIV appear. This worked as
expected in &lt;a href="http://www.mozilla.com/en-US/firefox/?utm_id=Q108&amp;amp;utm_source=google&amp;amp;utm_medium=ppc&amp;amp;gclid=CPnY35q27JMCFQtvGgodcnzhWg" target="_blank"&gt;Firefox&lt;/a&gt; and IE6, but not in IE7. The DIV appeared in IE7,
but it&amp;#8217;s GIF wasn&amp;#8217;t moving.&lt;/p&gt;

&lt;p&gt;A little googling turned up a helpful comment on &lt;a href="http://west-wind.com/WebLog/default.aspx" target="_blank"&gt;Rick Strahl&amp;#8217;s blog&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
I&amp;#8217;ve run into a problem with animated gifs inside of a hidden area of a Web page that is hidden with style.display=&amp;#8217;none&amp;#8217;. When the area is made visible again, in Internet Explorer this causes the image to not be displayed an animated GIF whatever I try. [sic] 
&lt;/blockquote&gt;

&lt;p&gt;Apparently IE7 doesn&amp;#8217;t like to animate hidden GIFs. User submitted comments on Rick Strahl&amp;#8217;s blog provided many solutions, but only a couple worked in my situation. The first uses the JavaScript setTimeout method to populate the image&amp;#8217;s SRC attribute 200 ms after the function call. The second sets the DIV&amp;#8217;s innerHTML to a string containing an &lt;a href="http://www.w3schools.com/tags/tag_IMG.asp" target="_blank"&gt;IMG&lt;/a&gt; tag with the animated GIF.&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;&amp;lt;script language='javascript'&amp;gt; 
    function ShowLoading(elementId) 
    {
        document.getElementById(elementId).style.display = &amp;quot;block&amp;quot;; 
        setTimeout('document.images[&amp;quot;loadingImage&amp;quot;].src = &amp;quot;../images/loading.gif&amp;quot;', 200); 
    } 
&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Neither solution is ideal, but setting the element&amp;#8217;s innerHTML felt a little bit cleaner to me.&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;&amp;lt;script language='javascript'&amp;gt;
    function ShowLoading(elementId)
    {   
        var element = document.getElementById(elementId);    

        element.innerHTML = &amp;quot;&amp;lt;img src='../images/loading.gif'&amp;gt;&amp;quot;;    
        element.style.display = &amp;quot;block&amp;quot;;
    }
&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;
*IE7 may have animations disabled. Go to Tools &gt; Internet Options &gt; Advanced &gt; Multimedia. Checking &amp;#8220;Play animations in webpages&amp;#8221; may affect how IE7 renders your animated GIFs.
&lt;/strong&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 11 Jun 2008 05:06:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:a2283586-36cd-4064-8291-8155c59f2cf9</guid>
      <author>Ryan Baxter</author>
      <link>http://crunchlife.com/articles/2008/06/11/ie7s-inanimate-gif</link>
      <category>Code Snippets</category>
      <category>Expect the Unexpected</category>
      <category>ASPNET</category>
      <category>JavaScript</category>
      <trackback:ping>http://crunchlife.com/articles/trackback/68</trackback:ping>
    </item>
    <item>
      <title>System.Drawing.Color Hex Values</title>
      <description>&lt;p&gt;Do you know the &lt;a href="http://en.wikipedia.org/wiki/Hexadecimal" target="_blank"&gt;hexidecimal&lt;/a&gt; value of PapayaWhip? How about BlanchedAlmond? Me either. I&amp;#8217;m not a big fan of the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.drawing.color.aspx" target="_blank"&gt;System.Drawing.Color&lt;/a&gt; structure in the Microsoft .NET Framework. I don&amp;#8217;t think the addition of color names makes good framework design sense. Unless you&amp;#8217;re an Interior Designer; the majority of &lt;a href="http://msdn2.microsoft.com/en-us/library/system.drawing.color_properties.aspx" target="_blank"&gt;these&lt;/a&gt; colors won&amp;#8217;t make sense to you either.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve recently spent time reworking a few design elements of an ASP.NET website. All design related ASP.NET attributes were replaced with &lt;a href="http://en.wikipedia.org/wiki/Cascading_Style_Sheets" target="_blank"&gt;Cascading Style Sheets (CSS)&lt;/a&gt; where applicable. Unfortunately the website was spattered with named colors from the System.Drawing.Color structure. To help replace these named colors with hexadecimal values, I found the following resource extremely helpful.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.opinionatedgeek.com/DotNet/Tools/Colors/default.aspx" target="_blank"&gt;http://www.opinionatedgeek.com/DotNet/Tools/Colors/default.aspx&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 16 Apr 2008 16:29:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:639ae4c8-8229-4ae4-83da-ae27bffdeb7d</guid>
      <author>Ryan Baxter</author>
      <link>http://crunchlife.com/articles/2008/04/16/system-drawing-color-hex-values</link>
      <category>Expect the Unexpected</category>
      <category>ASPNET</category>
      <category>dotNET</category>
      <trackback:ping>http://crunchlife.com/articles/trackback/54</trackback:ping>
    </item>
    <item>
      <title>Expect the Unexpected: Source Fource</title>
      <description>&lt;p&gt;OK, &lt;a href="http://msdn.microsoft.com/events/hero/" target="_blank"&gt;this&lt;/a&gt; is ridiculous. I must be getting too old for their marketing demographic. I do, however, look remarkably similar to figure below when wearing my &lt;a href="http://en.wikipedia.org/wiki/Dobak" target="_blank"&gt;dobak&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src="/files/fource.gif"&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 20 Feb 2008 08:09:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:70be9b5b-b48b-4c95-95ba-e0ae2cc01447</guid>
      <author>Ryan Baxter</author>
      <link>http://crunchlife.com/articles/2008/02/20/expect-the-unexpected-source-fource</link>
      <category>Expect the Unexpected</category>
      <category>dotNET</category>
      <enclosure type="image/gif" url="http://crunchlife.com/files/fource.gif" length="13730"/>
    </item>
    <item>
      <title>Expect the Unexpected: Irony</title>
      <description>&lt;p&gt;&lt;center&gt;&lt;a href="http://news.bbc.co.uk/2/hi/americas/7108835.stm" target="_blank"&gt;&lt;img src="/files/explorer.jpg"&gt;&lt;/a&gt;&lt;/center&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 26 Nov 2007 21:45:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:d8feb3c5-21bf-4ff7-b9dc-0accb5468303</guid>
      <author>Ryan Baxter</author>
      <link>http://crunchlife.com/articles/2007/11/26/irony</link>
      <category>Expect the Unexpected</category>
      <category>Oops</category>
      <enclosure type="image/jpeg" url="http://crunchlife.com/files/explorer.jpg" length="40598"/>
    </item>
    <item>
      <title>Expect the Unexpected: Your password must contain between 6 and 10 characters.</title>
      <description>&lt;p&gt;While registering for an account on my health care provider&#8217;s website, I was prompted with a message that read, &#8220;Your password must contain between 6 and 10 characters. It must contain a combination of alpha AND numeric characters. Spaces and special characters, such as question marks, cannot be a part of your password&#8221;.&lt;br /&gt;&lt;br /&gt;
&lt;center&gt;&lt;img src="/files/registration.jpg" class="photo"&gt;&lt;/center&gt;
&lt;br /&gt;&lt;br /&gt;
My passwords are often long and contain many special characters.  I do this to help keep my private information secure.  How, in the age of Internet ubiquity, can I trust a health care provider to keep my data secure with alphanumeric passwords between 6 and 10 characters?&lt;/p&gt;</description>
      <pubDate>Mon, 19 Nov 2007 14:48:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:fc720ac8-634f-4312-ad35-ec64cd36db23</guid>
      <author>Ryan Baxter</author>
      <link>http://crunchlife.com/articles/2007/11/19/expect-the-unexpected-your-password-must-contain-between-6-and-10-characters</link>
      <category>Expect the Unexpected</category>
      <enclosure type="image/jpeg" url="http://crunchlife.com/files/registration.jpg" length="27001"/>
    </item>
    <item>
      <title>Expect the Unexpected: Irregular Expressions</title>
      <description>If I'm to be punished in the afterlife, I pray my torture does not involve &lt;a href="http://en.wikipedia.org/wiki/Regular_expressions" target="_blank"&gt;regular expressions&lt;/a&gt;.  Can you guess what this one does?
&lt;br /&gt;&lt;br /&gt;
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode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A-Z\d\$\-_.!~*'(),
])|(?:%[a-fA-F\d]{2})|[:@&amp;amp;=+])*))*)?)))?)|(?:/(?:(?:(?:(?:(?:[a-zA-Z\d
\$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&amp;amp;=+])*)(?:/(?:(?:(?:[a-zA-Z\d\$\
-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&amp;amp;=+])*))*)?))|(?:(?:(?:(?:(?:[a-zA-
Z\d\$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&amp;amp;=+])*)(?:/(?:(?:(?:[a-zA-Z\d
\$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&amp;amp;=+])*))*)?)))&lt;/notextile&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
Oh, that one was easy? OK, try this one on for size. Using Google to cheat causes bad &lt;a href="http://en.wikipedia.org/wiki/Juju" target="_blank"&gt;juju&lt;/a&gt;.
&lt;br /&gt;&lt;br /&gt;
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;&lt;notextile&gt;(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]\000-\031]+(?:(?:(?:\r\n
)?[ \t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|&amp;quot;(?:[^\&amp;quot;\r\\]|\\.|(?:(?:\r\n)?
[\t]))*&amp;quot;(?:(?: \r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[\t])*(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\
[\] \000-\031]+(?:(?:( ?:\r\n)?[\t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|&amp;quot;(
?:[^\&amp;quot;\r\\]|\\.|(?:(?:\r\n)?[\t]))*&amp;quot;(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)
?[ \t])*(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]\000-\0 31]+(?:(?:(?:\r\n)?[\t])+|\Z|(?=[
\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.
(?:(?:\r\n)?[ \t])*(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]\000-\031]+ (?:(?:(?:\r\n)?[\t
])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ 
\t])*))*|(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\] \000-\031]+(?:(?:(?:\r\n)?[\t])+|\Z |(?
=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|&amp;quot;(?:[^\&amp;quot;\r\\]|\\.|(?:(?:\r\n)?[\t]))*&amp;quot;(?:(?:\
r\n) ?[ \t])*)*\&amp;lt;(?:(?:\r\n)?[\t])*(?:@(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\] \000-\031
]+(?:(?:(?:\ r\n)?[\t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|\[([^\[\]\r\\]|
\\.)*\](?:(?:\r\n)?[\t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\
]\000-\031]+(?:(?:(?:\r\n) ?[\t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|\[([^
\[\]\r\\]|\\.)*\](?:(?:\r\n)?[\t] )*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()
&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]\000-\031]+(?:(?:(?:\r\n)?[\t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\
[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[\t])* )(?:\.(?:(?:\r\n)?[ \t
])*(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]\000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[&amp;quot;()
&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[\t])*))*) *:(?:(?
:\r\n)?[ \t])*)?(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]\000-\031]+(?:(?:(?:\r\n)?[ \t])+ 
|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|&amp;quot;(?:[^\&amp;quot;\r\\]|\\.|(?:(?:\r\n)?[\t]))*&amp;quot;(
?:(?:\r \n)?[ \t])*)(?:\.(?:(?:\r\n)?[\t])*(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\] \000-
\031]+(?:(?:(?: \r\n)?[\t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|&amp;quot;(?:[^\&amp;quot;\r\
\]|\\.|(?:(?:\r\n)?[ \t]))*&amp;quot;(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*
(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]\000-\031 ]+(?:(?:(?:\r\n)?[\t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@
,;:\\&amp;quot;.\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r
\n)?[ \t])*(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]\000-\031]+(? :(?:(?:\r\n)?[\t])+|\Z|(
?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*
\&amp;gt;(?:(?:\r\n)?[ \t])*)|(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]\000-\031]+(?:(? :(?:\r\n)
?[\t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|&amp;quot;(?:[^\&amp;quot;\r\\]|\\.|(?:(?:\r\n)? [ 
\t]))*&amp;quot;(?:(?:\r\n)?[ \t])*)*:(?:(?:\r\n)?[\t])*(?:(?:(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.
\[\] \000-\031]+(?:(?:(?:\r\n)?[\t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|&amp;quot;(
?:[^\&amp;quot;\r\\]| \\.|(?:(?:\r\n)?[\t]))*&amp;quot;(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r
\n)?[ \t])*(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\] \000-\031]+(?:(?:(?:\r\n)?[\t])+|\Z|(
?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|&amp;quot; (?:[^\&amp;quot;\r\\]|\\.|(?:(?:\r\n)?[\t]))*&amp;quot;(?:(?
:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t] )*(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]\000-\031]+
(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|\[([^\[\]\r\\]|\\
.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[\t])*(? :[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]
 \000-\031]+(?:(?:(?:\r\n)?[\t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|\[([^\
 [\]\r\\]|\\.)*\](?:(?:\r\n)?[\t])*))*|(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\] \000- \03
 1]+(?:(?:(?:\r\n)?[\t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|&amp;quot;(?:[^\&amp;quot;\r\\]|
 \\.|( ?:(?:\r\n)?[\t]))*&amp;quot;(?:(?:\r\n)?[ \t])*)*\&amp;lt;(?:(?:\r\n)?[ \t])*(?
 :@(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\] \000-\031]+(?:(?:(?:\r\n)?[\t])+|\Z|(?=[\[&amp;quot;()
 &amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(
 ?:\r\n)?[\t])*(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot; .\[\] \000-\031]+(?:(?:(?:\r\n)?[\t])+
 |\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t
 ])*))*(?:,@(?:(?:\r\n)?[\t])*(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\ [\] \000-\031]+(?:(?:
 (?:\r\n)?[\t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|\[([^\[\]\r\\]|\\.)*\](
 ?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[\t])*(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\] \000-
 \031]+(?:(?:(?:\r\n)?[\t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|\[([^\[\]\r
 \\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[\t])*)?(?:[^()&amp;lt;&amp;gt;@,;:
 \\&amp;quot;.\[\] \0 00-\031]+(?:(?:(?:\r\n)?[\t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]
 ]))|&amp;quot;(?:[^\&amp;quot;\r\\]|\\ .|(?:(?:\r\n)?[\t]))*&amp;quot;(?:(?:\r\n)?[ \t])*)(?:\.(
 ?:(?:\r\n)?[ \t])*(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\] \000-\031]+(?:(?:(?:\r\n)?[\t
 ])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|&amp;quot;(? :[^\&amp;quot;\r\\]|\\.|(?:(?:\r\n)?[\t]
 ))*&amp;quot;(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])* (?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]\
 000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|\[([^\
 [\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[\t])*(?:[ ^()&amp;lt;&amp;gt;
 @,;:\\&amp;quot;.\[\] \000-\031]+(?:(?:(?:\r\n)?[\t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\
 [\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\&amp;gt;(?:(?:\r\n)?[\t]
 )*)(?:,\s*( ?:(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\] \000-\031]+(?:(?:(?:\r\n)?[\t])+|
 \Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\ &amp;quot;.\[\]]))|&amp;quot;(?:[^\&amp;quot;\r\\]|\\.|(?:(?:\r\n)?[\t]))*&amp;quot;
 (?:(?:\r\n)?[ \t])*)(?:\.(?:( ?:\r\n)?[\t])*(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\] \00
 0-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|&amp;quot;(?:[^\&amp;quot;
 \r\\]|\\.|(?:(?:\r\n)?[\t]))*&amp;quot;(?:(?:\r\n)?[ \t ])*))*@(?:(?:\r\n)?[ \
 t])*(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]\000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[&amp;quot;
 ()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[\t])*)(? :\.(?
 :(?:\r\n)?[ \t])*(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]\000-\031]+(?:(?:(?:\r\n)?[ \t]
 )+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[\
 t])*))*|(?: [^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\] \000-\031]+(?:(?:(?:\r\n)?[\t])+|\Z|(?
 =[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\ ]]))|&amp;quot;(?:[^\&amp;quot;\r\\]|\\.|(?:(?:\r\n)?[\t]))*&amp;quot;(?:(?
 :\r\n)?[ \t])*)*\&amp;lt;(?:(?:\r\n) ?[\t])*(?:@(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\] \000-\
 031]+(?:(?:(?:\r\n)?[\t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|\[([^\[\]\r\
 \]|\\.)*\](?:(?:\r\n)?[\t])*)(?:\.(?:(?:\r\n) ?[ \t])*(?:[^()&amp;lt;&amp;gt;@,;:\\
 &amp;quot;.\[\]\000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))
 |\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[\t])*))*(?:,@(?:(?:\r\n)?[ \t])*(
 ?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]\000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@
 ,;:\\&amp;quot;.\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[\t])*)(?:\.(?:(?:\r
 \n)?[ \t] )*(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]\000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z
 |(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*
 ))*)*:(?:(?:\r\n)?[\t])*)? (?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\] \000-\031]+(?:(?:(?:
 \r\n)?[\t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;. \[\]]))|&amp;quot;(?:[^\&amp;quot;\r\\]|\\.|(?:(?:\
 r\n)?[\t]))*&amp;quot;(?:(?:\r\n)?[ \t])*)(?:\.(?:(?: \r\n)?[\t])*(?:[^()&amp;lt;&amp;gt;@,;
 :\\&amp;quot;.\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\
 ]]))|&amp;quot;(?:[^\&amp;quot;\r\\]|\\.|(?:(?:\r\n)?[\t]))*&amp;quot;(?:(?:\r\n)?[ \t]) *))*@(?
 :(?:\r\n)?[ \t])*(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]\000-\031]+(?:(?:(?:\r\n)?[ \t]
 )+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[\
 t])*)(?:\ .(?:(?:\r\n)?[ \t])*(?:[^()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]\000-\031]+(?:(?:(
 ?:\r\n)?[ \t])+|\Z|(?=[\[&amp;quot;()&amp;lt;&amp;gt;@,;:\\&amp;quot;.\[\]]))|\[([^\[\]\r\\]|\\.)*\](
 ?:(?:\r\n)?[\t])*))*\&amp;gt;(?:( ?:\r\n)?[ \t])*))*)?;\s*)&lt;/notextile&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

</description>
      <pubDate>Mon, 27 Aug 2007 19:49:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:496b1aa1-9458-4501-97e3-129755f46dfb</guid>
      <author>Ryan Baxter</author>
      <link>http://crunchlife.com/articles/2007/08/27/expect-the-unexpected-irregular-expressions</link>
      <category>Expect the Unexpected</category>
    </item>
    <item>
      <title>Expect the Unexpected: The Phantom Menace</title>
      <description>&lt;p&gt;My Amazon Associates Order Report for August 2007 MTD is definitely a phantom menace.
&lt;br /&gt;&lt;br /&gt;
&lt;img src="/files/phantom_menace.jpg"&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 23 Aug 2007 21:57:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:2aa2a2fb-95ba-4edd-8b18-f728ed9b4e73</guid>
      <author>Ryan Baxter</author>
      <link>http://crunchlife.com/articles/2007/08/23/expect-the-unexpected-the-phantom-menace</link>
      <category>Expect the Unexpected</category>
    </item>
    <item>
      <title>Expect the Unexpected: THIS IS WAL-MART!</title>
      <description>&lt;p&gt;I purchased the Two-Disc Special Edition DVD of 300 from Wal-Mart this evening.  Attached to the cover was a sticker that read &#8220;DOWNLOAD THIS MOVIE&#8221; and in small print, &#8220;Must reside in U.S. Windows Media Compatible Only. Not compatible with iPods.&#8221;  Visiting &lt;a href="http://www.walmart.com/300" target="_blank"&gt;walmart.com/300&lt;/a&gt; in Firefox yielded the following:
&lt;br /&gt;&lt;br /&gt;
&lt;img src="/files/wal-mart.jpg"&gt;&lt;br /&gt;&lt;br /&gt;
It&amp;#8217;s 2007.  Why?&lt;/p&gt;</description>
      <pubDate>Mon, 06 Aug 2007 17:57:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:ef63f28f-22a7-4456-b972-9fb08a32b276</guid>
      <author>Ryan Baxter</author>
      <link>http://crunchlife.com/articles/2007/08/06/expect-the-unexpected-this-is-wal-mart</link>
      <category>Expect the Unexpected</category>
    </item>
    <item>
      <title>Expect the Unexpected: bool IsInRole(string role)</title>
      <description>&lt;p&gt;Running some tests yesterday, I was alarmed by an Exception that read, &amp;#8220;The trust relationship between the primary domain and the trusted domain failed.&amp;#8221;  What?!?  This code worked a few weeks ago!  The method in question called Page.User.IsInRole(&amp;#8220;DomainName\RoleName&amp;#8221;) to determine if a user was assigned to an administrator&amp;#8217;s role.  bool IsAdministrator().  Simple and efficient.  Why is this happening?!?&lt;/p&gt;

&lt;p&gt;&lt;img src="/files/IsInRole_Error.png" alt="IsInRole"/&gt;&lt;/p&gt;

&lt;p&gt;In short, the role that I was supplying Page.User.IsInRole with contained a typo.  What is interesting is the results of my test case found below.  Pay attention to the method signatures and their outcome.&lt;/p&gt;

&lt;p&gt;Page.User.IsInRole(&amp;#8220;DomainName\RoleName&amp;#8221;) returns true&lt;br /&gt;
Page.User.IsInRole(&amp;#8220;RoleName&amp;#8221;) returns true&lt;/p&gt;

&lt;p&gt;Page.User.IsInRole(&amp;#8220;DomainName\TypoRoleName&amp;#8221;) returns false&lt;/p&gt;

&lt;p&gt;But&amp;#8230;&lt;/p&gt;

&lt;p&gt;Page.User.IsInRole(&amp;#8220;TypoRoleName&amp;#8221;) throws the Exception&lt;/p&gt;

&lt;p&gt;Huh?&lt;/p&gt;

&lt;p&gt;I haven&amp;#8217;t had time to dig further into this, but I&amp;#8217;d definitely be interested in hearing some opinions.&lt;/p&gt;</description>
      <pubDate>Mon, 09 Jul 2007 19:34:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:5abe8be8-b46a-46c6-846d-ee10ec979f46</guid>
      <author>Ryan Baxter</author>
      <link>http://crunchlife.com/articles/2007/07/09/expect-the-unexpected-bool-isinrole-string-role</link>
      <category>Expect the Unexpected</category>
      <category>ASPNET</category>
    </item>
  </channel>
</rss>
