Mr. Bad Example

We're all examples: some good, some bad, some ugly.

January 2005 - Posts

InfoTec 2005: I'll Be There!

Just heard from the conference organizers that my session on SQL Server 2005 XML and CLR features has been approved for the Midwest's leading IT Conference -- InfoTec 2005 at the Qwest Center in Omaha. I'll be speaking at 10:30 on Wednesday, 6 April.

Here's the session description:

Pushing the Envelope: XML and CLR in SQL Server 2005

You've probably heard alot about Microsoft's SQL Server 2005 product offering, but what's hype and what's real? In this session, we will look at the how the nature of data and applications has driven changes in SQL Server 2005 and how you can take advantage of them. We will exploring using XML as a data type as well as using the .NET runtime within SQL Server.

My Crazy Friend Hilary Went and Did It...

...a Web cast, that is. See, aside from being one the nicest guys on the planet, Hilary Cotter knows SQL Server Replication. He knows it so well that's he's written a Four-Pound book on topic. And now, he's doing a Web Cast to boot.

While I can honestly say that this is a must watch for everybody, if you're even a little bit curious about what you can do with SQL Server replication, this is a great place to learn

Regularly Expressing IIS Log Files

If it seems like I'm obsessed with IIS Log files -- well, okay, I am. My latest adventure with them has been figuring out how to merge logs from IIS5 with logs running on IIS6 to our analysis tools and do their thing with them. Turns out that the IIS6 log file fields vary in sequence from IIS5 and my have an extra value in them at maximum logging levels. So I wanted to write write a set of RegExs that determined if a given line of useful data came from IIS5 or IIS6 without having any of the file headers.

Yeah, really. I'm that big of a geek. :)

It didn't take long to figure that this isn't as trivial of a tasks as it sounds and I needed a way to test my RegExs -- sort of a RegEx Editor and Debugger, if you will. And I found a great one in Regex Buddy. Granted, you might never had need for this tool, but if you're regularly working with RegExs, it just rocks.

For me the coolest thing is it's color-coding features that make it easy to tell patterns apart. The paren balance color feature is very helpful too. But the coolest feature is that you can load pattern file into it and it will show you match/not matching lines by color coding. I highly recommend this tool for anybody that's doing non-trivial work with Regular Expressions.

And did I mention it has a visual tool for building Regexs based on "human friendly" terms as a list/tree? This this tool in bag of tricks, you really don't even have to have a full command of RegExs to make full of them. Tell me that doesn't rock!

Anyway, here's my nicely annotated RegEx for IIS5 logs.

((?# date)\d{4}\-\d{2}\-\d{2}\s+)((?# time)\d{2}\:\d{2}\:\d{2}\s+)((?# c-ip)\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\s+)((?# cs-username).+?\s+)((?# s-sitename).+?\s+)((?# s-computername).+?\s+)((?# s-ip)\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\s+)((?# s-port)\d{1,3}\s+)((?# cs-method).+?\s+)((?# cs-uri-stem).+?\s+)((?# cs-uri-query).+?\s+)((?# sc-status)\d{1,3}\s+)((?# sc-win32-status)\d+\s+)((?# sc-bytes)\d+\s+)((?# cs-bytes)\d+\s+)((?# time-taken)\d+\s+)((?# cs-version)(HTTP\/\d\.\d)|\-\s+)((?# cs-host).+?\s+)((?# csUser-Agent).+?\s+)((?# csCookie).+?\s+)((?# csReferer).+)

And one for IIS6 logs.

((?# date)\d{4}\-\d{2}\-\d{2}\s+)((?# time)\d{2}\:\d{2}\:\d{2}\s+)((?# s-sitename).+?\s+)((?# s-computername).+?\s+)((?# s-ip)\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\s+)((?# cs-method).+?\s+)((?# cs-uri-stem).+?\s+)((?# cs-uri-query).+?\s+)((?# s-port)\d{1,3}\s+)((?# cs-username).+?\s+)((?# c-ip)\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\s+)((?# cs-version)(HTTP\/\d\.\d)|\-\s+)((?# csUser-Agent).+?\s+)((?# csCookie).+?\s+)((?# csReferer).+)((?# cs-host).+?\s+)((?# sc-status)\d{1,3}\s+)((?# sc-substatus)\d{1,3}\s+)((?# sc-win32-status)\d+\s+)((?# sc-bytes)\d+\s+)((?# cs-bytes)\d+\s+)((?# time-taken)\d+)


Posted: Jan 31 2005, 10:28 PM by ktegels | with no comments
Filed under:
Installing the AdventureWorks DB on SQL Express

I've just posted an article about how to install the AdventureWorks database into the default instance of SQLExpress. Not hard, but I thought if I could make it easier for folks, that's cut down on the complaining about it not being done by default.


Service Broker: Complex But Not Hard.

I've been thinking a lot recently about Yukon's Service Broker in preparation for some talks I'm working. Pretty much everything I've learned so far has come from Dan Sullivan (who really needs to get a blog) or Robert Hurlbut, two names to follow if you're going to be serious about SSB (well, other than Roger Wolter, but you better already know who he is…).

Today I had a chance to start reading Towbridge et. al. Integration Patterns book and something just clicked. We hear a lot of folks asking the question: "Well, if it had a GUI, why would I still use BizTalk?" My answer now is "because BizTalk is a Process Integration Controller, where as Service Broker is what its name implies." To understand that answer, you have to understand the differences between Process Integration Control and Message Brokering. I couldn't really hope to that justice here, and the definition of what a Process Manager does is pretty much describes what BizTalk does. The seeming lack of differences between an SSB Service Application (typically a stored proc, T-SQL or otherwise) and a BizTalk orchestration muddies waters further. But the key difference in my mind is how you use them. For example, SSB also fits nicely within this book's definition of a message brokering system -- basically a concentrator/multiplexer for messages between. BizTalk, however, makes it easier to build out more finely-grained process integration programs that operation between most any set of endpoints (between bounds, OS and the myriad of other factors.)

That thought helped confirmed a mnemonic for SSB that I've been working on for a while: Complex, but not hard. But be careful to understand that's not literally what I'm saying -- its just a shortcut for remembering the following:

SSB provides a framework for building Asynchronous, Distributed, Transacted and Queue Messages (ADTQM for short). It takes care of the hard-to-code problems like guaranteeing in-order delivery and message correlation. In other words, you don't have to (or likely want to) do that hard work if SSB is an option in environment. What SSB also does is allow you to focus on the complex parts more immediately. That is: how do I design an application for the business problem. Think of it this way: suppose you working on a "e-tailing" application that lets customers buy products from you online. SSB removes one of the barriers you have to making that kind of application scale up and out gracefully by giving you the framework to work with that solves the hard parts of writing messaging applications. How you choose to solve the complexities like making sure that a customer's credit is okay, or posting charges to the general ledger or creating a shipping order for the warehouse are done right and in the right order is left up to you.

Now if we just had a nice GUI for doing that! I'd be a nice surprise to see one ship with SQL Server 2005 though. That's not to say that the community or third-party ISVs couldn't create some very good ones indeed. I'm sure several will.

I'm spying on myself?

So I ran the new MS Anti-Spyware beta (codenamed "Titan") on my laptop this morning after seeing something, well, interesting. While it didn't find anything on my system, it pointed out that was possible a problem with my HOSTS file. Those of you who have done a bit of networking know that this file (located in %systemroot%/system32/drivers/etc/hosts) is useful for overriding host names returned by DNS for legimate reasons (like making a staging host look like a production host to an application). I reguarly tweak this file for just that purpose. Titan noticed that I did that and decided to return that a problem.

The lesson learned here is that you have to pay close attention to what programs like this do on development hosts, and you have to understand the implications of the changes they want to make. In this case, "fixing" that file might have well caused me to treat a production data like it was a staging data. I'd better not be changing the first, where its okay for me to play a bit with the second.

Posted: Jan 25 2005, 08:27 AM by ktegels | with no comments
Filed under:
So you want breadcrumbs for ASP.NET do you?

Omaha .NET Guru offered up this control (source here) for doing just that. What's extra cool is that he turned this into a pretty good tutorial on writing server controls too.

At the intersection of .Text and InfoPath…
…you'll find this spiffy Form called SimpleBlogger that lets you compose posts for .Text using InfoPath. That really appeals to me for two reasons: it means I can compose posts with being connected to any network and it’s a good example of what you can do with InfoPath when you put your mind down to it. Why is that important? I've long be searching for an example that shows InfoPath conversing directly with a Web Service rather than going through SharePoint to do meaningful (well at least non-trivial) work. Now, I have one.
 
Thanks to Brian Johnson for the pointer on this.
Posted: Jan 22 2005, 09:51 AM by ktegels | with no comments
Filed under: ,
Rocky, Mono and the future of the CLR.

I love reading Rocky Lhotka's blog. You should read it too. Why? Because he's not afraid to call a spade a spade. Well, that, and he loves VB.NET.

Check this out:

"If you read the article you’ll find that the Longhorn OS will seriously change the way that .NET itself is versioned. In fact, it turns out that to a serious degree the whole idea of installing “side-by-side” versions of .NET itself will go away when Longhorn shows up.  Oh sure, they have plans for a complex scheme by which assemblies can be categorized into different dependency levels. Some levels can be versioned more easily, while others can only be versioned with the OS itself.  What this really means is that .NET is losing its independence from the OS. In the end, we’ll only get new versions of .NET when we get new versions of the OS – and we all know how often that happens… I’d say that this was inevitable, but frankly it was not. Java hasn’t fallen into this trap, and .NET doesn’t need to either. Not that it will be easy to avoid, but the end result of the current train of thought portrayed by Richter is devastating."

I so have to agree: not the future I signed-up for. 

I agree with Rocky that there is good news too:

Fortunately there’s the mono project. As .NET becomes more brittle and stagnant due to its binding with Longhorn, we might find that mono on Windows becomes a very compelling story. mono will be able to innovate, change and adapt much faster than the .NET that inspired it.

And That's A Good Thing because, as Rocky so iconclastically puts it

"Hopefully Microsoft will realize what they are doing to themselves before all this comes to pass. Otherwise, I foresee a bright future for mono on Windows."

Personally, I already think there is one. This is just another reason to go learn more about Mono now.

Upcoming Events of Local Interest

Lots of stuff going on in the next few weeks here the Omaha area:

  • The Greater Omaha SQL Server User Group will be meeting this Thursday night. Our speaker will be Don Bryner, Principal Technology Specialist from Microsoft Corporation who will be introducting us to SQL Server 2005. Meeting starts at 6:30 PM on the 13th. We're meeting at:1Staff Training and Development, 10845 Emmet Street, Omaha, NE 68164. I'm really pleased to announce we've got a great big door prize: one full suite of Visual Studio Virtual Developer (that's right, full license production versions of SQL Server 2000, Visual Studio.NET 2002, Windows Server 2003 and Virtual PC 2004)! We also have a number of books and goodies to dole out, all complements of Microsoft.
  • FunWith.NET has one our favorite INETA speakers -- Ken Getz -- rolling into for our meeting on the 20th. More details at http://www.funwith.net/DesktopDefault.aspx?tabid=24.
  • The next "big day" for Omaha has been announced for February 24. The MSDN folks will be presenting on WinForms, debugging ASP.NET and Visual Studio Team System. We'll be back at the AMC 24. You can register for that event here. Got to believe that Mike Benkovich will be giving us yet another afternoon filled with .NET knowledge.

Hope to see you there!

More Posts Next page »