Tuesday, December 22, 2009

Catch Those Pesky WPF Data Binding Errors!

After months of changes to a WPF app, today I noticed that the Visual Studio output windows was frought with warnings about "System.Windows.Data Error" when debugging the application.

Aside from a poorly performing app, on principal I dispise any uncaught problems in an application, wanrings, errors or otherwise. Leaving it up to the runtime to deal with misbehaving code is a sign of a lazy developer.

After looking into it more deeply, I remembered an off-handed article I read some time back about how WPF has implemented XAML data binding errors as warnings rather than hard exceptions. While there's no way to change this aspect of the runtime that I know of, there are a few helpful hints here: http://beacosta.com/blog/?p=52

A note to developers: fewer exceptions (caught or uncaught) in your code means a faster performing application...period. The less the runtime has to babysit what your app is doing, the more time your application has to do what it's supposed to do.

Serves me right for disregarding the optup window for so long.

Monday, December 21, 2009

SQL Server 2005 Database Diagrams

Trying to Make Sense of the Mess

So database diagrams are supposed to help you ensure that proper indexing and referential integrity is enforced where it should be in your database. Oh yeah, and it should help to visualize the relationships in your database.

On the first account, it does, and I definately see its usefulness when implemented successfully. On the second, it only helps visualize the most trivial of databases. Anything beyond 10 related tables and you can forget about *any* single useful view of your database; databases are not meant to be visualized from a 2D surface.

However, there are some caveats to database diagrams.

Copying the Diagram

For one, copying the diagram to another database is, er um, not as straight forward as one would expect.

If you want to copy the *visual* depiction as a graphic, say for print-out, all you have to do is open the diagram up, wait for it to load completely, then right-click the surface and select the 'Copy to Clipboard' option. But again, this is really only useful for small database diagrams, unless you like the idea of single-handedly killing the rainforest with all those reams of paper you intend to print the diagram out on...just so that you have a nice, pretty picture up on your wall of the chaos that is your enterprise database schema.

If you want to transfer the diagram to another database though, you have some options:
  • Restore the database from a backup of the source database where the diagram is in-tact.

    CON: This doesn't take into account differences in data between the source and destination databases.
  • Script the diagram out to T-SQL from within the source database, then execute it on the destination database.

    PRO: While this option isn't available from Management Studio as you would expect it to be, considering that you can do this with just about every other database artifact, there's already a solution for how to do this on codeproject.

    CON: This method requires you to add artifacts to your source database, which not all of us have the luxury of doing (e.g. a closed vendor product, production audit processes, etc.)
I ended up using the second approach, since export of a database diagram into the SVN repository is explainable in a SQL audit. However, I wish Microsoft had implemented this in Management Studio to begin with. It was probably something that didn't make the final cut of the tool set before RTM.

A real shame it didn't though.

Friday, December 11, 2009

ODBC on x64 (MDAC x86)

Note to self:

When developing with old components and receiving wierd messages, try compiling for x86 and running. Chances are, if the code can't see a GAC'd dll, it's because you're running in x64 and the 'missing' component is compiled for x86.

This occurred when attempting to use the Microsoft Text Driver from an x64 machine. The ODBC Data Sources dialog doesn't show all the (x86) drivers installed...that is unless you run it from an x86 command prompt. So I thought I had to install MDAC 2.8, but even after doing that, the code was still choking.

I also ran into this while working on a project that required the SQL Server Replication components, which are also compiled for x86. Fortunately, my brain was switched on today.

Wednesday, December 9, 2009

Links from SQL Server 2008 Analysis Services Training in Boston

Went in to the city Mon-Wed for SSAS training and Compuworks. Highly recommend them.

Links from conversations in the training will be posted tomorrow (2009-12-10 Thu) when I get back in to my desk at Gordon.

Sunday, December 6, 2009

Linq to SQL and Temporary Tables in Stored Prodecures

If you have problems when dragging a stored procedure from the server explorer to your Linq-to-SQL designer surface, try adding the following T-SQL code to the beginning of your stored procedure body:

IF 1=0 BEGIN
SET FMTONLY OFF
END

Sunday, November 29, 2009

WtvWatcher Now Supports Any Conversion Tool


The latest version of WtvWatcher now supports customizing the action performed on each WTV file to be processed.

This sort of makes WtvWatcher a general WTV batch processor now, since you can specify litteraly any 3rd-party tool as the target of the action.

One user asked for Wtv2Mpeg support, and since this update was on the concept table anyway, it was pretty easy to accomodate his request.

Essentially, I run this 'action command mask' through the 'System.String.Format' method, then hand the result to the System.Diagnostic.Process.Start' method. Not rocket science.

Anywho, now I can move on to actual weekend work. Not that that's paying work either, but I like to think that I'm the type of guy who can make such subtle distinctions without getting caught up about differences between the hourly rate of $0.00 and...well...$0.00.

Monday, November 23, 2009

Initial Thoughts on Open Source Technology

My most recent open source venture has been to provide a utility that bridges the TV file format gap on Windows 7 machines. While this in and of itself isn’t all that interesting and was for my own benefit primarily, the pleasant and unintended consequence of contributing this code to the community was much larger than I expected.

After reviewing the feedback I’ve received on this project so far, I believe my initial thoughts can be characterized in three points:

  • People are more likely to provide constructive feedback in entertainment and non-commercial software when the venture is often of a personal nature, and the outcome is perceived to direct affect their enjoyment of technology.
    When people feel ownership of the problem, they are more likely to contribute to solving the problem.
  • The difficulty of extracting feedback from Line-of-Business software users stems from the reality that they’re too busy trying to get some specific task done, and don’t necessarily have time to comment on inane little details of what’s wrong with the software, simultaneous to their greater goals. The difference between software that ‘gets in the way’ vs. software that ‘provides a way’ must be interpreted within a context that includes what the person is trying to do and how much they understand about both their goals and the technology itself.
    People ignore the value of software if it is proposed in the wrong context or at the wrong time.
  • Open source software can be means of extracting the more general ‘concept’ feedback from a wide range of users, and can represent a source of valid measurement data on technology applicability and effectiveness without demanding the same initial financial or infrastructure costs that a full-on software release often can.
    While no feedback is completely ‘free’ (without some cost), open source is sometimes more affordable than traditional startup cycles.

Just thought I’d share my [currently evolving] hypotheses regarding the convergence of business and open source technology.

Sunday, November 15, 2009

First Weekend Stats for WtvWatcher

WtvWatcher 1.0.0.32 (Update)

New version of WtvWatcher is out with support for 'Exit Time' and 'Processing Rules'.

http://wtvwatcher.codeplex.com/documentation

Thanks to the community for all the feedback!

Paul

Friday, November 13, 2009

First Week Stats for New WtvWatcher

Looks like people are really taking to the new software. For free software that I wrote in my spare time, it's still surprising to me that sprinkling a few links here and there adds up to the following PR stats:


Hopefully I'll be able to carve out some time this upcoming weekend to integrate some of the features/feedback that I've been getting in the forums. There are smart people out there, and alot of them are also the same people that like my software!

WtvWatcher Article on Hack7mc.com


A new article on hack7mc.com about WtvWatcher writes:

"For those looking for a simple solution to automatically convert WTV files to DVR-MS, it doesn’t get much simpler than WTVWatcher."
- and -

"...WTVWatcher performed flawlessly as expected."
- and -

"...WTVWatcher does what it was designed to do well and without any fuss or muss."

Nice to see I can write software that a) works, b) people like, and c) people share with others.

http://wtvwatcher.codeplex.com/

Monday, November 9, 2009

Donations for Free Software Are a Beautiful Thing

Just received my first set of donations for WtvWatcher. Goes a long way to prove that people looking for free software are absolutely worth my time.

Automatically Convert WTV to DVR-MS

I know there are already a handful of solutions to this problem out there already, but none quite as elegant as mine.

A simple .exe file to drop in your Recorded TV folder and launch on startup. Converts WTV files using the built-in 'WtvConverter.exe' utility from Microsoft, just automates the scanning of folder contents so you can sit back and enjoy.

http://wtvwatcher.codeplex.com/

Direct download link: http://wtvwatcher.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33922#DownloadId=86184




BizTalk Diagnosing: One at a Time

When diagnosing and resolving failed BizTalk messaging, sometimes I forget to play by the same rules as the originating processing model.

Namely, selecting all the suspended message in the queue and just resuming them again may cause all kinds of concurrency (SQL locking) problems on top of the original issue.

This touches on a much deeper topic of knowing what you’re getting into before messing with stuff, but that’s a conversation for another day.

Moral of the story here: when diagnosing problems, work on one thing at a time. Resume one message, wait for the results, then confirm that the 'solution' actually solved the problem.

T-SQL 'STR' Function Notes

If you recieve the SQL error message:
Error converting data type varchar to float
The above error message is basically telling you that it can't convert your varchar data to a numeric value first, before it converts it back from numeric to varchar form.

Check to make sure that you're not improperly using the STR function on data that is already in varchar form. This function is for converting numeric data to string format, and I often use it as follows:
LTRIM(RTRIM(STR([NumericFields])))
This pattern compensates for the STR function's inane tendancy to pad its output, and is useful if you like to see your data formatted as if you called a ".ToString" method (like as in the C# world).

Sunday, November 8, 2009

WtvWatcher Review on The Digital Lifestyle


Looks like Simon May at TheDigitalLifestyle.com really gets my new WtvWatcher software. Aside from an earlier praise of the first version (console app), this newest post continues the happy sound of software satisfaction.

This open software thing is proving to be just the kind of response that Line of Business software never receives without a price. Free testing and feedback is definately something I'm going to take into my consulting and FT job moving forward. It's teaching me things you just don't get from a day job.

http://wtvwatcher.codeplex.com/