Jason Nadal

Restless C#ding
JNFileCombiner V1.0 Freeware

As I had written here, I am working on a freeware program called JNFileCombiner to combine parts of files numbered .001 through .nnn. I had seen other programs do this, as well as batch files (just by copying the files together), but I figured this was a very simple project to get started with fully unit-testing code.

Peter Waldschmidt of Gnoso was kind enough to support this open-source project by giving a license to NCover free of charge, and already I have seen benefits to improving my unit tests. I've found that exception scenarios were not covered by my tests.

Last night, I posted the first version of the application, with source, to a new codeplex project here. It's a bit rough around the edges, but it works. I really need to work on complete comment coverage, simplification of the unit tests, and some refactoring, but I'm working that into the plan for V1.1.

FileCombiner Freeware

I've decided to delve more into fully unit-tested code and write an application from scratch using TDD methodologies after being re-invigorated by Robert C. Martin's fantastic Craftsman article series ( http://www.objectmentor.com/resources/publishedArticles.html -- click on the "Test Driven Development" category).

 I'm using NUnit ( http://www.nunit.org/index.php ) to do unit tests, with TestDriven.NET ( http://www.testdriven.net/quickstart.aspx ) used along with an obsolete version of NCover ( http://www.ncover.com ).

 I have no complaints with NUnit, but TestDriven.NET has some strangeness in studio 2008 that I will detail shortly, once I make sure the issues that I am facing are not simply due to PEBKAC on my part. NCover seems quite nice to be able to have a way to see NUnit coverage, without resorting to the MS tools (which do not seem to play nicely with external testing frameworks like NUnit).

 Next steps:

  • Try new version of NCover and review it (the version I have now does not seem to respect the setup and teardown attributes before running tests)
  • Complete first release of FileCombiner (I'd estimate the initial features are at about 85%, with ~85% code coverage according to NCover)
  • Publish release, with unit tests.
  • Beautify the UI; use WPF, include progress bar and diminish use of textbox as a vehicle for reporting progress
Review: SSW Code Auditor

I had found out about SSW's Code Auditor product through one of those ubiquitous Top 10 .NET Developer Tool lists recently, and as I'm at the start of a new project, felt that I should run it through an auditor to nip common code errors in the bud as early as possible. This tool retails for about $305US, and can embed itself right into Visual Studio. Here's my thoughts on it. 

 The Good:

1) Customized rules are possible to match your own inhouse conventions.

2) The individual rules are mostly great.

3) Works with Team Foundation

4) Works against uncompiled code -- this is very cool.

5) Integrated with JetBrains dotTrace Profiler

 What I'd Suggest (Improvements):

1) Trial version does not scan all files -- non-complete trial.

2) Initial run against my web site (just starting out) caused the application to throw an exception. Actually all subsequent attempts to use the addin were also unsuccessful.

3) Spell check for programmers! But there should be a quick button to just run the spell checking rule against the open document via the auditor toolbar.

4) Rule about starting boolean properties with a verb does not take into account existing verbs used in the .NET framework like "Enable" in the case of "EnablePasswordRetrieval"
as in System.Web.Security.MembershipProvider.  It caught "Requires" as not being a verb as well as in "RequiresUniqueEmail", which is technically correct, however
this is not something the end user will be able to have control over.

5) Cascading rules should be removed as they are checked off -- ie. When fixing an "Empty Catch Block", this could also fix "No empty code blocks".

6) On the html output report, switching back and forth between views remembers your checkboxes, which is great. However, if I check off that I fixed 3 different rules associated
with the same file in the "By rule" view, and change to the "By file" view, it doesn't know that I fixed all rules associated with that file.

7) The "The Rules" view is fantastic.. they show you each of the rules they check for, the regular expression used to check against, and how many hits for that regex.

8) I'm not convinced all rules can be created via regex. 

 The Verdict:

I'd use it. I spend so much time in visual studio, and am not alone on the team.  Being able to have checkin policies that force a certain level of code quality is worth using this product in and of itself, even without SSW's ability to add customized rules.

Free Stuff

It'll be a short posting day for me today as I get ready to head down to sunny Miami for a few days. Learn2Asp is providing free training webcasts for ASP.NET as well as the opportunity for free Visual Studio standard, a price reduction on MSDN Pro, and some other goodies. You can get to the webcasts here. They seem to be targetting crossover developers, as the material is tailored to 3 distinct areas: JSP devs, PHP devs, and ColdFusion developers.

The webcasts are too many to list (for being free, I was amazed at the width of scope of these 'casts). Here's the perks for attending three:

  • Microsoft® Visual Studio® 2005 Standard Edition (Not for Resale)
  • Five chapters of Programming ASP.NET 2.0 Core Reference, by Dino Esposito
  • A 30-day hosting account to try out your custom Web applications
  • Microsoft Developer Security DVD with how-tos, white papers, tools, webcasts, and code samples that demonstrate how to write more secure code
  • A 50% discount on a Microsoft Certified Professional Exam so you can add your new skills to your resume
  • A voucher that allows you to buy Visual Studio 2005 Professional Edition with an MSDN® Professional Subscription at renewal pricing (a $400 savings)



IIS7 ... Oh What a Difference!

Found a post on how to install IIS7 on the latest build of Vista (5308), and wanted to do some staging for my stagnant personal site on my laptop (that has Vista installed), and decided to give it a whirl. Thanks, Dan Bartels for doing the writeup. That's some great site design on his page!

We were told to keep an eye on IISSEVEN.COM, and I certainly will.With this build, after going to the usual IIS snap-in under MMC, you'll notice a difference. As they say, a picture is worth a thousand words...

Posted: Mar 03 2006, 08:28 AM by thejay2 | with 2 comment(s)
Filed under:
GridView and DataKeyNames
If you're trying to create a gridview, automatically bound to either a SqlDataSource or an ObjectDataSource (the better of the two options), and want edit and delete functionality, do not forget to set the DataKeyNames property to the primary key of the table or object you are trying to delete. Otherwise Edit/Update seems to work, but Delete will complain that it cannot find the parameter, even if you are defining DeleteParameters in the DataSource itself.
If you're not able to install the WinFX SDK (Feb CTP)....

...then you might be running into this issue with the installers, as reported by Jason Sacks. Keep your eye on his blog for a resolution to this. Here's the telltale sign in the install logs that you'd see:

[SDKSetup:Error] Config_Products_Install: Windows SDK Setup (failed): Installation of the "Microsoft Windows Software Development Kit" product has reported the following error: Fatal error during installation.

Update: seems this may be due to a bad iso -- either because of me or msdn. But the second download worked like a charm!

Posted: Feb 25 2006, 08:59 AM by thejay2 | with no comments
Filed under:
Check for the existence of a sql temp table

Here's an easy way to check if a temp table exists, before trying to create it (ie. for reusable scripts) from Simon Sabin's post :

IF object_id('tempdb..#MyTempTable') IS NOT NULL
   DROP TABLE #MyTempTable

   ID int IDENTITY(1,1),
   SomeValue varchar(100)

That way, if you have to change databases in the query window, you don't have to drop the tables before you run it again.

Posted: Feb 24 2006, 08:10 AM by thejay2 | with 26 comment(s)
Filed under:
Watching the Olympics ... in 3D
I had ordered some 3D glasses for a very old TV show, based on the Pulfrich effect, in fact the show mentioned on that site, Doctor Who. I found a place online selling them for only 99 cents each, called Science Stuff. The cool thing is that they are great for sports with a lot of motion (like skiing, or what happens to be on the Olympic coverage now, replay of Figure Skating. The principle is that by tinting one side, you're slightly slowing the light hitting your eye, causing your brain to percieve 3D. There's the normal sensation with 3D glasses after you take them off, where your eyes feel wierd seeing the same amount of light in both eyes again!
What's causing that bluescreen?
I found a great resource that is a knowledge base of extremely detailed info regarding stop errors, also irreverently known as Blue Screen of Death (BSOD) errors. For anyone thinking that they can't look up the error while the machine is in a blue screen, after a reboot, the stop error will be in the Event Log.
More Posts Next page »