Sql-Server-Performance.com recently posted a really well written article on a new feature included in MS SQL 2005 SP2 called the Performance Dashboard. This article was written by Brad M. McGehee and really does a good job walking you through installation and usage of this new Performance Dashboard report.
I just installed this report this morning and it looks very promising. One issue I did run into, is that your database must be set to 9.0 compatibility in order to get the benefits of the Performance Dashboard. Here's a brief quote from the article:
In brief, the SQL Server 2005 Dashboard is a custom report (custom reports are a new feature of Service Pack 2) for Management Studio that gathers data from the many Dynamic Management Views (DMVs) and Dynamic Management Functions (DMFs) available in SQL Server 2005. It is not a replacement for other performance tools, but an adjunct tool to help DBAs better identify and troubleshoot performance problems. In many ways, the SQL Server 2005 Dashboard reports are similar to the many built-in reports already offered by Management Studio.
I wanted to post my presentation files for the demo I'll be giving at Spring <br /> Conference 2007 tomorrow morning. This file contains the Powerpoint Presentation, plus all the example file (plus some that I probably won't have a time to get to!)
I probably went overboard on the examples—I seriously doubt I can get through them all in 60 minutes, but hopefully you'll find the source code commented well enough that even if you don't set through my presentation, you can still follow what's going on.
One of the many projects I'm currently working on is some code to delay sending of e-mails until a specified window of time. We're generating some report data for clients during the offhours, but the clients want the results e-mailed no earlier than 8am.
Our reports often contain images or other attachments that need to be included e-mails. One issue I really don't like about the implementation of CFMAIL in CFMX is that it requires attachments to be written to disk before you can send the mail. This means if I want to use the CFMAIL tag to deliver delayed e-mails, I would to manage attachments until I'm sure the message is delivered. I don't like that solution, so I set out to see if there might be other ways of generating attachments from binary data in memory. This lead me to researching the JavaMail API—which is the API that CFMAIL uses behind the scenes.
I quickly learned that even CFMX v7.02 still uses JavaMail v1.3.1—which is an older version of the API. One of the issues in v1.3.1 is that it does not include any classes for taking a binary stream from memory and converting to an attachment. It comes with a FileDataSource class—which will read in a file and convert it to the correct data source. This might be the reason that Macromedia/Adobe requires the file to be written to disk.
On a recent project I was working on, I needed an "autocomplete" form field that could do both local data array and AJAX lookups. After doing some searching, I came across Dylan Verheul's jQuery Autcomplete plug-in.
This plug-in did a lot of what I needed, but was still missing some of the functionality I required. So, I just modified the library so it worked the way I needed it to. Here's a list of the changes/enhancements I made:
Mark Drew posted a question on his blog wondering how you might pass data to a custom tag that acts as a loop. In his post, he's trying to get the following code:
I was talking to a buddy this morning and he'd never seen the syntax for a derived table in MSSQL before. He couldn't quite grasp why they might be useful and I was having difficulty explaining via instant messenger, so I thought I'd blog a real world example of how derived tables can be useful.
In very basic terms, a derived table is a virtual table that's calculated on the fly from a select statement. They can be tremendously useful in certain situations. For my example below, I'm going to use the Northwind database that included with MSSQL 2000.
Let's say you've been asked to generate a report that shows off the total number of orders each customer placed in 1996. "Not a problem." you think to yourself. "This is just an easy aggregated join query." So, you sit down and generate your query and come up with:
Reading blogs the other day, I came across the Dina Programming Font. I've been testing it out for the past couple of days in Eclipse and so far I really like it.
Over the years I've tried a number of different fonts for my IDE, but I always end up back with Courier New—mainly because it's familiar. However, I've been able to use the Dina font at 8pt and it retains it's readability very well at 1028x768. Lowering the point size while not adding strain for my eyes, allows me to see more code on the page w/less scrolling. Since I have carpal tunnel, anything that reduces mouse movement is a welcome change.
I just started using Dreamweaver for a site I'm working on. I'm keeping a repository of the files in Subversion, but found that trying to get Dreamweaver to ignore the SVN files when synchronizing is a bit of a pain.
Since I was in a quick solution, I ended up just setting Dreamweaver to show hidden files and then manually went to each .svn to cloak. Later on in the day, I did some searching to see if I could find an easier solution (because doing it manually really sucks.)
I found a blog entry by Josh Buhler in which he talks discusses cloaking/uncloaking SCM directories in Dreamweaver. He found a Dreamweaver extension called Cloak/Uncloak SCM Directories in Dreamweaver which appears to do the trick.
I recently upgraded a few of my installation of TortoiseSVN to the latest revision. Every since doing this, I've been unable to use Subclipse v1.0.3 (in Eclipse v3.1) to change repositories that have been touched with TortoiseSVN. This is because the newest version of TortoiseSVN using the v1.4 of the client libraries and Subclipse v1.0.3 is based on the old v1.3 client files.
Since one of my development boxes only has Eclipse w/Subclipse, it's been a pain to deal w/this compatibility issue. So, this morning I set out to find a solution to this issue.
Fortunately, I was able to find a post by Mark Phippard that addresses solving this issue (while for Subclipse v1.1.6 anyway.) I did run into an issue that apparently doesn't affect the newer version of Subclipse, but since I'm still using Eclipse v3.1 at the moment, I'm stuck using Subclipse v1.0.3.
I'm an Eclipse guy. When it comes to HTML/code, I've always been a "hands on" kind of guy—wanting complete control over the code. However, I've just recently needed to use DreamWeaver on a project. While I've toiled around w/DreamWeaver in the past, I've never used it extensively.
One of the things I needed to do was to was compare two versions of a file. I was trying to track down a display issue in the HTML. Eclipse has a nice compare built-in, but DreamWeaver doesn't come with any native compare function. It does however allow you to use an external tool for comparing files.
I found that PrestoSoft's ExamDiff (a free visual compare tool) works great w/DreamWeaver. You can buy the professional version for $35, but the free version has all the basics you probably need.
In response to Microsoft releasing Internet Explorer 7, Mozilla has released Firefox v2.0. You can download the English version of FF2 for Windows at http://www.mozilla.com/products/download.html?product=firefox-2.0&os=win&lang=en-US.
I haven't installed this yet. I may actually do a completely clean/fresh install of FF2 (just because I haven't done a clean install in a long time of Firefox) and then just migrate my settings over.
Ok, so everyone is blogging about IE7—and probably rightfully so. It's been 4 years since a major release of Internet Explorer. I was a huge fan of Internet Explorer from 1998-2003. While IE4 went against the W3 spec in a lot of ways, it was a far better environment for building interactive web applications than any release of Netscape version 4. The only thing I thought Netscape managed to do better back then was w/their JavaScript debugging tools—which were immensly more useful.
However, back in 2003 I started testing early betas of Firefox. While I had tested the Mozilla browser and even Netscape v6, I really wasn't in love w/the Gecko engine (which is what all those browsers are based on.) Despite all the promise I kept reading about, I still found it slower and less responsive than IE. Firefox changed that though. The one of the original goals of Firefox was to cut out all the bloat that Netscape had been building into their browser (e-mail clients, HTML editors, etc.) and you definitely noticed the difference. Switching to Firefox as my main browser came unexpectantly to me—happening almost over night. I've really been using it as my main browsers since the v0.7x releases. It still shocks me how quickly I switched to Firefox, since I was such a huge proponent of Internet Explorer.
So, I've really been looking forward to seeing Internet Explorer v7 in a final state—just to see if they can make it worth it to switch back. Unfortunately, I've been really unhappy w/the new release. I really find the new UI unintuitive. Maybe this will change over time, but I think people used to using IE6 will be lost. Novice computer users don't adjust well to change. They're used to doing things in a certain fashion and radical change is hard for them to adjust to. I'm really surprised Microsoft didn't include an IE6 skin that could at least be selected for people who want the old look.
You know, sometimes query analyzer in MSSQL 2000 just doesn't get things right. I had a query that was taking a very long time to execute in MSSQL. The query on average would take 30-60 seconds to complete execution. The query was running a LIKE search over a text data type. Not ideal by any means, but the execution was mind boggling slow.
Figuring my problem was in the fact that I'm doing a LIKE operation on a text data type over hundreds of thousands of records, I figured that was the main culprit. So one of the very first things I tried was setting up a Full Text Index on the data, so I could do a FTS over the data instead. Much to my chagrin, this really showed no noticeable performance increase (maybe like 2-3 seconds faster, but not nearly enough to warrant making radical changes to implement FTS.)
So where was my problem? I really started studying the execution plan. Everything I looked at seem to imply that the LIKE operator was the problem, and it was mandatory (especially since FTS provided no real performance increase.)
If you're getting an Error casting an object of type to an incompatible type
message while when using CFMX's urlDecode() function, this is because
you're using the wrong charset.
I was getting this error trying to parse some data coming from an XHTML document. Turns out the urlDecode() uses the charset of the URL scope as the default charset to use when decoding a string. Since the charset of the text in my XML document was different than that of my URL scope, I was getting the error. The message isn't very descriptive to the problem, so I spent time trying to cast the string using javaCast() function.
See the urlDecode() documentation for more information.
Ever needed to parse a qualified URI to examine a URL for specific information? I'm working on some code that needs to examine links in a document and extract information about the links.
To make sure I was doing things by the spec, I made sure to check out RFC2396. Fortunately, the RFC has a nice little regular expression for breaking a URI into it's core pieces: scheme, authority, path, query and fragment.
However, those core portions are still pretty broad. The authority can include user info, domain and port information. The path can include embedded parameters inside each segment. So, I took the core regular expression to break up a URI and then I do further parsing on the authority and path portions of the URI.