IE7's Inanimate GIF

Posted by Ryan Baxter Wed, 11 Jun 2008 12:06:00 GMT

Animated GIFs are most often used as activity indicators in modern AJAX (asynchronous JavaScript and XML) enabled websites. I decided to use a GIF (Graphic Interchange Format) from ajaxload.info on an application that I’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.

I wanted the animated GIF to appear when the file upload button was clicked so I placed the image within a DIV tag and hid it by setting a blank CSS display property. OnClick of the upload button, a JavaScript function toggled the display value to “block”, making the DIV appear. This worked as expected in Firefox and IE6, but not in IE7. The DIV appeared in IE7, but it’s GIF wasn’t moving.

A little googling turned up a helpful comment on Rick Strahl’s blog.

I’ve run into a problem with animated gifs inside of a hidden area of a Web page that is hidden with style.display=’none’. 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]

Apparently IE7 doesn’t like to animate hidden GIFs. User submitted comments on Rick Strahl’s blog provided many solutions, but only a couple worked in my situation. The first uses the JavaScript setTimeout method to populate the image’s SRC attribute 200 ms after the function call. The second sets the DIV’s innerHTML to a string containing an IMG tag with the animated GIF.

<script language='javascript'> 
    function ShowLoading(elementId) 
    {
        document.getElementById(elementId).style.display = "block"; 
        setTimeout('document.images["loadingImage"].src = "../images/loading.gif"', 200); 
    } 
</script>

Neither solution is ideal, but setting the element’s innerHTML felt a little bit cleaner to me.

<script language='javascript'>
    function ShowLoading(elementId)
    {   
        var element = document.getElementById(elementId);    

        element.innerHTML = "<img src='../images/loading.gif'>";    
        element.style.display = "block";
    }
</script>

*IE7 may have animations disabled. Go to Tools > Internet Options > Advanced > Multimedia. Checking “Play animations in webpages” may affect how IE7 renders your animated GIFs.

System.Drawing.Color Hex Values

Posted by Ryan Baxter Wed, 16 Apr 2008 23:29:00 GMT

Do you know the hexidecimal value of PapayaWhip? How about BlanchedAlmond? Me either. I’m not a big fan of the System.Drawing.Color structure in the Microsoft .NET Framework. I don’t think the addition of color names makes good framework design sense. Unless you’re an Interior Designer; the majority of these colors won’t make sense to you either.

I’ve recently spent time reworking a few design elements of an ASP.NET website. All design related ASP.NET attributes were replaced with Cascading Style Sheets (CSS) 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.

http://www.opinionatedgeek.com/DotNet/Tools/Colors/default.aspx

Expect the Unexpected: Source Fource

Posted by Ryan Baxter Wed, 20 Feb 2008 16:09:00 GMT

OK, this is ridiculous. I must be getting too old for their marketing demographic. I do, however, look remarkably similar to figure below when wearing my dobak.

Expect the Unexpected: Irony

Posted by Ryan Baxter Tue, 27 Nov 2007 05:45:00 GMT

Expect the Unexpected: Your password must contain between 6 and 10 characters.

Posted by Ryan Baxter Mon, 19 Nov 2007 22:48:00 GMT

While registering for an account on my health care provider’s website, I was prompted with a message that read, “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”.



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?

Expect the Unexpected: Irregular Expressions

Posted by Ryan Baxter Tue, 28 Aug 2007 02:49:00 GMT

If I'm to be punished in the afterlife, I pray my torture does not involve regular expressions. Can you guess what this one does?

(?:http://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.
)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)
){3}))(?::(?:\d+))?)(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F
\d]{2}))|[;:@&=])*)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{
2}))|[;:@&=])*))*)(?:\?(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{
2}))|[;:@&=])*))?)?)|(?:ftp://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:[1-9]\d*
)))?(?:/;[Uu][Ii][Dd]=(?:[1-9]\d*))(?:(?:/;[Ss][Ee][Cc][Tt][Ii][Oo][Nn
]=(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[&=~:@/])+)))?))
)?)|(?:nfs:(?:(?://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-
Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:
\.(?:\d+)){3}))(?::(?:\d+))?)(?:(?:/(?:(?:(?:(?:(?:[a-zA-Z\d\$\-_.!~*'
(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*)(?:/(?:(?:(?:[a-zA-Z\d\$\-_.!~*'(),
])|(?:%[a-fA-F\d]{2})|[:@&=+])*))*)?)))?)|(?:/(?:(?:(?:(?:(?:[a-zA-Z\d
\$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*)(?:/(?:(?:(?:[a-zA-Z\d\$\
-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*))*)?))|(?:(?:(?:(?:(?:[a-zA-
Z\d\$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*)(?:/(?:(?:(?:[a-zA-Z\d
\$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*))*)?)))
Oh, that one was easy? OK, try this one on for size. Using Google to cheat causes bad juju.

(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\]\000-\031]+(?:(?:(?:\r\n
)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?
[\t]))*"(?:(?: \r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[\t])*(?:[^()<>@,;:\\".\
[\] \000-\031]+(?:(?:( ?:\r\n)?[\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(
?:[^\"\r\\]|\\.|(?:(?:\r\n)?[\t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)
?[ \t])*(?:[^()<>@,;:\\".\[\]\000-\0 31]+(?:(?:(?:\r\n)?[\t])+|\Z|(?=[
\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.
(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\]\000-\031]+ (?:(?:(?:\r\n)?[\t
])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ 
\t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[\t])+|\Z |(?
=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[\t]))*"(?:(?:\
r\n) ?[ \t])*)*\<(?:(?:\r\n)?[\t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031
]+(?:(?:(?:\ r\n)?[\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|
\\.)*\](?:(?:\r\n)?[\t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\
]\000-\031]+(?:(?:(?:\r\n) ?[\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^
\[\]\r\\]|\\.)*\](?:(?:\r\n)?[\t] )*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()
<>@,;:\\".\[\]\000-\031]+(?:(?:(?:\r\n)?[\t])+|\Z|(?=[\["()<>@,;:\\".\
[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[\t])* )(?:\.(?:(?:\r\n)?[ \t
])*(?:[^()<>@,;:\\".\[\]\000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()
<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[\t])*))*) *:(?:(?
:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\]\000-\031]+(?:(?:(?:\r\n)?[ \t])+ 
|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[\t]))*"(
?:(?:\r \n)?[ \t])*)(?:\.(?:(?:\r\n)?[\t])*(?:[^()<>@,;:\\".\[\] \000-
\031]+(?:(?:(?: \r\n)?[\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\
\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*
(?:[^()<>@,;:\\".\[\]\000-\031 ]+(?:(?:(?:\r\n)?[\t])+|\Z|(?=[\["()<>@
,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r
\n)?[ \t])*(?:[^()<>@,;:\\".\[\]\000-\031]+(? :(?:(?:\r\n)?[\t])+|\Z|(
?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*
\>(?:(?:\r\n)?[ \t])*)|(?:[^()<>@,;:\\".\[\]\000-\031]+(?:(? :(?:\r\n)
?[\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)? [ 
\t]))*"(?:(?:\r\n)?[ \t])*)*:(?:(?:\r\n)?[\t])*(?:(?:(?:[^()<>@,;:\\".
\[\] \000-\031]+(?:(?:(?:\r\n)?[\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(
?:[^\"\r\\]| \\.|(?:(?:\r\n)?[\t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r
\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[\t])+|\Z|(
?=[\["()<>@,;:\\".\[\]]))|" (?:[^\"\r\\]|\\.|(?:(?:\r\n)?[\t]))*"(?:(?
:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t] )*(?:[^()<>@,;:\\".\[\]\000-\031]+
(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\
.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[\t])*(? :[^()<>@,;:\\".\[\]
 \000-\031]+(?:(?:(?:\r\n)?[\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\
 [\]\r\\]|\\.)*\](?:(?:\r\n)?[\t])*))*|(?:[^()<>@,;:\\".\[\] \000- \03
 1]+(?:(?:(?:\r\n)?[\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|
 \\.|( ?:(?:\r\n)?[\t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?
 :@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[\t])+|\Z|(?=[\["()
 <>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(
 ?:\r\n)?[\t])*(?:[^()<>@,;:\\" .\[\] \000-\031]+(?:(?:(?:\r\n)?[\t])+
 |\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t
 ])*))*(?:,@(?:(?:\r\n)?[\t])*(?:[^()<>@,;:\\".\ [\] \000-\031]+(?:(?:
 (?:\r\n)?[\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](
 ?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[\t])*(?:[^()<>@,;:\\".\[\] \000-
 \031]+(?:(?:(?:\r\n)?[\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r
 \\]|\\.)*\](?:(?:\r\n)?[ \t])*))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 r\n)?[\t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?: \r\n)?[\t])*(?:[^()<>@,;
 :\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\
 ]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[\t]))*"(?:(?:\r\n)?[ \t]) *))*@(?
 :(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\]\000-\031]+(?:(?:(?:\r\n)?[ \t]
 )+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[\
 t])*)(?:\ .(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\]\000-\031]+(?:(?:(
 ?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](
 ?:(?:\r\n)?[\t])*))*\>(?:( ?:\r\n)?[ \t])*))*)?;\s*)

Expect the Unexpected: The Phantom Menace

Posted by Ryan Baxter Fri, 24 Aug 2007 04:57:00 GMT

My Amazon Associates Order Report for August 2007 MTD is definitely a phantom menace.

Expect the Unexpected: THIS IS WAL-MART!

Posted by Ryan Baxter Tue, 07 Aug 2007 00:57:00 GMT

I purchased the Two-Disc Special Edition DVD of 300 from Wal-Mart this evening. Attached to the cover was a sticker that read “DOWNLOAD THIS MOVIE” and in small print, “Must reside in U.S. Windows Media Compatible Only. Not compatible with iPods.” Visiting walmart.com/300 in Firefox yielded the following:



It’s 2007. Why?

Expect the Unexpected: bool IsInRole(string role)

Posted by Ryan Baxter Tue, 10 Jul 2007 02:34:00 GMT

Running some tests yesterday, I was alarmed by an Exception that read, “The trust relationship between the primary domain and the trusted domain failed.” What?!? This code worked a few weeks ago! The method in question called Page.User.IsInRole(“DomainName\RoleName”) to determine if a user was assigned to an administrator’s role. bool IsAdministrator(). Simple and efficient. Why is this happening?!?

IsInRole

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.

Page.User.IsInRole(“DomainName\RoleName”) returns true
Page.User.IsInRole(“RoleName”) returns true

Page.User.IsInRole(“DomainName\TypoRoleName”) returns false

But…

Page.User.IsInRole(“TypoRoleName”) throws the Exception

Huh?

I haven’t had time to dig further into this, but I’d definitely be interested in hearing some opinions.