Wednesday, October 17, 2007
Accessing properties on the document object is slow in Internet Explorer. I used to use the document object as a place to store globals, ie
function onclick() {
document.clicks +=1;
}

But this is slow in IE. Instead use:

var clicks;
function onclick() {
clicks += 1;
}
Here is a full page that demonstrates this idea. I use onmousemove to simplify doing an action over and over, and you can also FEEL how slow it is by moving your mouse around the page.

And the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Document Object Test</title>

<script type="text/javascript">
var totalObj = new Object();
var flag = false;
function loaded() {
document.onmousemove = useDocument;
}

function useDocument() {
document.total += 5;
}

function useGlobal() {
totalObj.total += 5;
}

function flip() {
if (flag) {
document.onmousemove = useDocument;
document.getElementById('styleType').innerHTML = '&nbsp;document object';

}

else {
document.onmousemove = useGlobal;
document.getElementById('styleType').innerHTML = '&nbsp;global object';
}
flag = !flag;
}

</script>
</head>
<body onload="loaded();">

<a href="#" onclick="flip(); return false;">Click to flip styles</a><span id="styleType"> document</span>

</body>
</html>

Posted By: Chris Burkhardt on October 17, 2007  #    Disclaimer  |  Comments [0]  | 
 Thursday, October 11, 2007
Today I downloaded IE7 and set it to my default browser, leaving Firefox after about 5 years of use. Firefox is still a good browser, but with IE implementing tabbed browsing I don't have to put up with the annoyances of Firefox to get tabs. Here are the 10 main reasons I am switching.

1. Tools-->Options-->Show Passwords-->Show Passwords WTF? I should have stopped using firefox when someone showed me this for the first time.

2. The real last straw was Firefox's support for EV(Extended Verification) certificates. I can't find any solid information if they will be supported in FF3, or even when FF3 is scheduled to come out. I found this post, but this kind of attitude of denouncing a decision after it has been made rather than trying to help the process really bothers me. 

3. Auto update. I don't know why firefox updates in the background and then gives me a crap dialog box to "install now or later" nagging me every time I start it. Did they get bought out by Adobe?

4. Firefox still has memory problems. If I surf for 2-3 hours, opening a lot of tabs, and then trim down to 2-3 base tabs Firefox will still be around 200meg.

5. Buggy CSS. As much as firefox fans crow about how good their CSS is, there are still way to many bugs/inconsistencies.

6. Too many versions. There are too many versions and no clear road map. We don't really need 2.0.3, and all the versions give fan boys a crutch, "Well, have you updated to 2.0.3a? That will fix your problem"

7. Firefox crashes too much. I'm on my computer all day on XP and Server 2003 and programs don't really crash anymore. Sometimes I kill them, but Firefox crashes at least once a month.

8. Too much blame on extensions. Any problem with FF is shoved off to "its probably an extension". Extensions should not be allowed to crash the main program.

9. If I open a new tab and type the url too fast, it does not work. This, surprisingly, is my second biggest reason for leaving Firefox. I used to be able to Ctrl-T, and start typing. Now when I try the cursor is in the address bar blinking, but typing does nothing. I have to lose focus of the address bar and then put it back in.

10. If I have too many tabs open, copy/past breaks. That is, I cannot copy from Firefox to another app. I can copy from notepad to another app, but not Firefox. I cannot reproduce this on purpose, so I don't know for sure it is FF, but I suspect.



Posted By: Chris Burkhardt on October 11, 2007  #    Disclaimer  |  Comments [1]  | 
 Tuesday, October 09, 2007
If you have floated boxes followed by a cleared box, firefox will not honor margin-top on that box.

Here is a page demostrating the firefox bug (pops)

I think Firefox is assuming that the extended margins of float left and right apply to cleared boxes, while the specs do not say or imply that. Here is the relevent section from the spec for the clear property:

left
The top margin of the generated box is increased enough that the top border edge is below the bottom outer edge of any left-floating boxes that resulted from elements earlier in the source document.
right
The top margin of the generated box is increased enough that the top border edge is below the bottom outer edge of any right-floating boxes that resulted from elements earlier in the source document.
both
The generated box is moved below all floating boxes of earlier elements in the source document..
none
No constraint on the box's position with respect to floats.

Here is a baseline html/css sample:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Firefox css bug</title>
</head>
<body>
<div id="container">
<div style="background-color: Orange; width: 100px; height: 35px; float: left">
</div>
<div style="background-color: green; width: 100px; height: 35px; float: left">
</div>
<div style="background-color: black; width: 100px; height: 35px; clear: both; margin-top: 30px;">
</div>
</div>
</body>
</html>


Posted By: Chris Burkhardt on October 9, 2007  #    Disclaimer  |  Comments [0]  | 
 Wednesday, October 03, 2007
I just spent about 4 hours trying to debug this problem.

Here is the setup, a user with a slow connection was not able to view a .wmv on a site. The .wmv was 250mb and he was timing out at 11:34. Different browser, different computer, all that jazz. Our site runs on iis 5 with .NET 2.0 and the file is "hotlinked". That is, we are not using any kind of Response.Write to write to the stream, just linking to it and letting the client stream or download it.

I got a hold of dialup computer and account, and I was able to reproduce the problem, getting the server to send a RST about 15 minutes after starting to download the file. This looked like the .NET  Connection Timout setting, which is set to 900 seconds, or 15 minutes, as a default in iis 5.

However, when I made a new site to test this theory, setting the timeout to 20 seconds did not affect it at all. In fact, in the test site, I was not even able to reproduce the error. Besides, why could the .NET Connection Timeout have anything to do with iis sending the file over the wire?

After a ton of debugging, I found the culprit, wildcard application mapping.





The wildcard application mapping was telling .NET to handle ALL files. Because .NET was handling the file, the 900 second timeout was coming into play. This was a requirement for another part of the site to function, so we could not turn it off. What we ended up doing was making the "media" folder, where the wmv lived, its own application, and removing the mapping from there.

This solution was a lot better than upping the timeout because we didn't not want abandoned connections sitting around for ever.

Posted By: Chris Burkhardt on October 3, 2007  #    Disclaimer  |  Comments [0]  | 
 Thursday, September 27, 2007
Yesterday I posted about how I got ScribeFire to work with dasBlog. Today I will go into a little more detail, complete with pictures.

To start, under the "Blog" section, choose Add.

Step 1 -- Choose "Manually Configure"
ScribFire step 1

Step 2 -- Choose "Custome Blog"
ScribFire step 2

Step 3 -- Choose "MetaWeblog API" and enter the url of your blog + "blogger.aspx"
 ScribFire step 3

Step 4 is login, you don't need an image for that, just enter your credentials.

Finally, you should see your blog added to ScribeFire:
ScribFire step 4


Next, remove the auto-inserted ad "Powered by ScribFire". Click the "<<" in the upper left like so:
ScribFire step 5

This will open the options. Choose settings and uncheck"Automatically insert 'Powered by ScribFire'", like this:
ScribFire step 6

I really enjoy this firefox add-on. I added and edited this post from within firefox, and it seems a little snappier that the default editor in dasBlog.

Posted By: Chris Burkhardt on September 27, 2007  #    Disclaimer  |  Comments [0]  | 
According to the Live Search blog the live search I was complaining about before should be updated. Let's see if its fixed.

I guess the answer is, it depends...

Here is a shot on a search I just did for "your doing it wrong"


Look at the results, the #1 result is from 2003 and doesn't even include my search terms! The 5th result, and the 3rd site returned, is from 2005, and it is a forum post from some second rate hit counter. The post is 2 messages long! Here is what you see if you follow the webstat link:


That is what happens if I go to live.com and search.

However, it looks like I can access the new search if you append &FORM=PRESS. So if you use this query you can see the new and improved results. And they are indeed new and improved. The results are more topical, and they include my search terms. However, you have to either follow a link from a press release with the &FORM=PRESS or you have to know enough to put it on. Anyone who just types live.com, or live.search.com gets the old stuff. I don't know why, but it is typical Microsoft in the past 5 years. Shout about some new, cool thing and then it doesn't work or it is inaccessible.

By the way, here is a picture of the kind of thing I was searching for. I think its funny, and I guess so do the people at this site



Posted By: Chris Burkhardt on September 27, 2007  #    Disclaimer  |  Comments [0]  | 
 Tuesday, September 25, 2007
I recently switched this blog to dasBlog and I had a nice little firefox addon called ScibeFire that I could not get to work with it. Thanks to Kelly Keeton for the tip that made the connection in my head.

My confusion was the end point on dasBlog is called Blogger.aspx, but the type (API) is MetaBlogAPI, so when setting up the blog in ScibeFire you have to choose Manually Configure-->Custom Blog-->MetaBlog API then put in <%yourBlogPath%>/blogger.aspx.

Then it works great. In fact, this is my first post from ScribeFire.


Edit: The only problem is ScribeFire appends an ad to your post. To disable the add/trackback, click the ">>" in the upper left, choose "Settings" and uncheck "Automatically insert' Powered by ScibeFire'"
Posted By: Chris Burkhardt on September 25, 2007  #    Disclaimer  |  Comments [0]  | 
 Thursday, September 20, 2007
I'm a Microsoft guy, a fan, supporter whatever. I've been programing with Microsoft for Microsoft almost since I got my start. I want MS to do well so I do well, which is why their live search pisses me off. It's not very good in general, but when I see things like this, it makes it worse:




It's fixed now, but a search for "Your doing it wrong" shows 0 results on Live (Live Search?) and 69 Million on Google. I was using IE7 with Live as the default provider, and immediately switched.

Even now that live search returns results, they suck. Compare Live Vs Google


Posted By: Chris Burkhardt on September 20, 2007  #    Disclaimer  |  Comments [0]  |