Scott Hanselman

Hanselminutes Podcast 52 - End to End Tracing

February 22, '07 Comments [4] Posted in Podcast | Programming
Sponsored By

My fifty-second podcast is up - that's a full year of podcasts. Oy! This one talks about End to End Tracing, and how there's magic in the XmlTextListener. You don't need WCF to do E2ETracing, but it helps.

ACTION: Please vote for us on Podcast Alley! Digg us at Digg Podcasts!

Links from the Show

SVC Trace Viewer (WCF) (m45)
CorrelationManager Class (m48)
Live Service Trace Viewer (m4b)
Using the Trace Viewer (m46)
Traces in User Code (m49)
Who's On (m4e)
End to End Tracing (m47)
End to End Tracing is Essential - PDF (m4a)

Subscribe: Feed-icon-16x16 Subscribe to my Podcast in iTunes

Do also remember the archives are always up and they have PDF Transcripts, a little known feature that show up a few weeks after each show.

Our sponsors are /n software and Telerik.

 Telerik is a new sponsor. Check out their UI Suite of controls for ASP.NET. It's very hardcore stuff. One of the things I appreciate about Telerik is their commitment to completeness. For example, they have a page about their Right-to-Left support while some vendors have zero support, or don't bother testing. They also are committed to XHTML compliance and publish their roadmap. It's nice when your controls vendor is very transparent.

As I've said before this show comes to you with the audio expertise and stewardship of Carl Franklin. The name comes from Travis Illig, but the goal of the show is simple. Avoid wasting the listener's time. (and make the commute less boring)

  • The basic MP3 feed is here, and the iPod friendly one is here. There's a number of other ways you can get it (streaming, straight download, etc) that are all up on the site just below the fold. I use iTunes, myself, to listen to most podcasts, but I also use FeedDemon and it's built in support.
  • Note that for now, because of bandwidth constraints, the feeds always have just the current show. If you want to get an old show (and because many Podcasting Clients aren't smart enough to not download the file more than once) you can always find them at http://www.hanselminutes.com.
  • I have, and will, also include the enclosures to this feed you're reading, so if you're already subscribed to ComputerZen and you're not interested in cluttering your life with another feed, you have the choice to get the 'cast as well.
  • If there's a topic you'd like to hear, perhaps one that is better spoken than presented on a blog, or a great tool you can't live without, contact me and I'll get it in the queue!

Enjoy. Who knows what'll happen in the next show?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Binary Fortress Software's ASP.NET ViewState Helper - A Treasure Trove of Tools

February 22, '07 Comments [2] Posted in ASP.NET | Reviews | Tools | ViewState
Sponsored By

I was working on some demos here at Corillian and I needed to check the size of the ViewState on a page. There's lots of ways and lots of tools that can help you do this. Certainly FireFox's Web Developer Toolbar, while not specific to ViewState, can help you analyze a page.

Nikhil Kothari's Web Development Helper is also very good at this, but requires a little more setup and ASP.NET 2.0. An awesome tool, though.

I stumbled on Binary Fortress Software's ASP.NET ViewState Helper (their support forum is brand new, but if you have trouble go there).

What a slick tool! A 300k download, and works on ASP.NET from the outside - by futzing with IE's object model. It watches you surf and collects statistics. You can then double click on any of the pages and view the decoded ViewState.

I like a tool that does its job, doesn't run inside of IE (I've had it with Browser Helper Objects), and gets out of the way when I'm done. Recommended. This tool is a very useful addition to your c:\utils.

(BTW, their Web Performance Monitor has promise too, but I haven't looked at it yet).

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

OpenDNS

February 22, '07 Comments [20] Posted in Tools
Sponsored By

Use OpenDNSDNS is one of these things that we just take for granted. You type www.cnn.com and it resolves to an IP Address.

Who've have thought you could take a stodgie old protocol like DNS and hack a business model around it?

UPDATE: One of the founders of OpenDNS, David Ulevitch, has responded with some helpful info in the comments area.

OpenDNS has. Just set you DNS settings to 208.67.222.222 and 208.67.220.220 or click the button in the upper right corner of this post.

Interestingly, that button is a SMART button. If YOU are already using OpenDNS, you'll see one image, while everyone else sees the other.

They not only offer faster DNS lookups, but they'll

They make their money when you completely booger up a domain name, or DNS doesn't resolve, and you'll get a search page with their advertisers on it.

Now, to be clear, the protocol purists will hate this, declaring things like in the comments here:

I also don't like that "spelling correction" or "anti-phishing" feature. That doesn't belong in the cache; it belongs at the resolver. I would agree [snip] — OpenDNS is unsuitable for use as an enterprise DNS cache. It might be a good solution for people who want to run their own personal cache on a local node.

Personally, I'm loving it. I loves me a clever hack and this be one. Take a look at their FAQ. Since there's no software to install, and you can undo it anytime, it seems harmless to me.

If you want to try it with nslookup on Windows, remember to include the trailing . after the domain name.

C:\Users\Scott>nslookup www.craigslist.org.
Server: resolver1.opendns.com
Address: 208.67.222.222:53

Non-authoritative answer:
Name: www.craigslist.org
Address: 66.150.253.241

C:\Users\Scott>nslookup www.craigslist.orr.
Server: resolver1.opendns.com
Address: 208.67.222.222:53

Non-authoritative answer:
Name: www.craigslist.orr
Address: 208.67.219.41

Notice how the misspelled domain points to a 208.67.x.x address? That's OpenDNS. They'll redirect requests to craigslist.orr to the real site, that's how they handle misspellings - they're actually misspelled in the cache.

Take a look at their http://system.opendns.com Status page. They are pretty hard core. I'll be hooking the parents and relatives up with this one, ASAP. If you're a parent or relative of me, go here to the Getting Started Page if you like, and follow the instructions, and call me if you have trouble. When you're done, visit http://welcome.opendns.com and you'll know if it worked or not.

Comcast's (my ISP) DNS tends to suck, and I have been compensating by running DNS Masq here at the house on my Linksys Router.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

LifeHack: Carry Fewer Club Cards with BarCodes and lose the Costanza Wallet

February 22, '07 Comments [7] Posted in Musings
Sponsored By

I've been meaning to scan the six stupid "club cards" that The Man uses to track me as I do my shopping around town into one single card like this guy.

This has been more on my mind since I started using the Umbra Bungee Wallet exclusively. I freaking love this wallet. No more Costanza Wallet for me.

Now I've created a custom single uber-club-card (Yes, I know they are tracking me, and No, these aren't my real numbers) using JustOneClubCard.

It's just a little web app with a list of stores (mapped in the background to that stores barcode-style) that generates little double-sided cards for your wallet.

Elegant, clean, simple, very Web 1.5. Now I have six fewer key-chain dealies to carry around.

Thanks to JustOneClubCard, the Mark of the Beast is now that much more convenient to carry.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Using ISAPI_Rewrite to canonicalize ASP.NET URLs and remove default.aspx

February 22, '07 Comments [18] Posted in ASP.NET | HttpModule | Musings | Tools
Sponsored By

In the comments of my post on Google PageRanks, Jeff Atwood says:

[The existence of] Default.aspx is another reason to consider URL rewriting. A few of my rewrite rules relative to PR:
- I don't allow links to come in as codinghorror.com, I add the www. if it is not there.
- I remove index.html if it is present

This got me thinking, as it appears that are quite a few ways to get to my home page.

You get the idea...Heck, probably just by mentioning them I'm getting in trouble, right? The URI that dare not speak its name.

Away, if we start by assuming my home page is http://www.hanselman.com/blog/ and that includes the trailing slash. We know that if my browser requests http://www.hanselman.com/blog without the slash, it'll be told by the Web Server to try it again anyway, which is just wasteful.

Apache folks have mod_rewrite and love to remind ASP.NET/IIS folks about their awesomeness. Many sites rely on mod_rewrite for certain behaviors. It's really a fundamental part of the Apache experience. The IIS story becomes better in newer versions of IIS, but the easiest and most flexible way to handle these kinds of things is ISAPI_Rewrite.

Sure, one could create an HTTP Module for ASP.NET for some of this, but at some point you'll realize that you need to catch these requests WAY earlier. Now, ISAPI_Rewrite uses Regular Expressions, and now it's time for my oft-repeated favorite RegEx joke - get ready for it:

"So you've got a problem, and you want to use Regular Expressions to solve it. Now you've got two problems."

Thanks for indulging me. Yes, writing ISAPI_Rewrite stuff is freaking voodoo and I hate it. Once you've written them, they're done. Here's mine:

[ISAPI_Rewrite]
RewriteRule /blog/default\.aspx http\://www.hanselman.com/blog/ [I,RP]

RewriteCond Host: ^hanselman\.com
RewriteRule (.*) http\://www.hanselman.com$1 [I,RP]

RewriteCond Host: ^computerzen\.com
RewriteRule (.*) http\://www.hanselman.com$1 [I,RP]

RewriteCond Host: ^www.computerzen\.com
RewriteRule (.*) http\://www.hanselman.com/blog/ [I,RP]

This rules normalize (canonicalize), to the best of my ability, all the not-really-good URLs above. It'll put everyone to http://www.hanselman.com/blog/ and even take totally lame links like http://computerzen.com/blog/GooglePageRanksConsideredSubtle.aspx and make then "correct." The "I" means "case insensitive" and the "RP" means "Redirect Permanently" - an HTTP 301. If it was just "R" it'd be a 302. When you're testing with ISAPI_Rewrite, always start with "R" to do temporary redirects, because you don't get a second chance with a 301.

So now, even if someone asks for http://www.hanselman.com/blog, they'll be told where to go(here's an HTTP conversation):

  • GET /blog HTTP/1.1
    • Heh, uh, get me /blog, m'kay?
  • HTTP/1.1 301 Moved Permanently
    Location:
    http://www.hanselman.com/blog/
  • GET /blog/ HTTP/1.1
    • Gosh, sorrey (my browser is Canadian) get me /blog/ then.

And it was Good™.

This kind of control is useful in any public facing application or web site and one should take an hour or so and really think about their website's "public face." ISAPI_Rewrite can be a powerful component as part of a larger ASP.NET solution, especially one where Google Ranks do matter and hackable or "pretty" URLs are highly valued.

For us, in the banking industry, having nice URLs like http://www.foobank.com/banking/ or http://mobile.foobank.com makes everyone happy.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.