logo
  • Jobs
  • About Me
  • Contact
  • Home

Archive for November, 2004

« Previous Entries

TestDriven.NET 1.0

Looks like Jamie finally released TestDriven.NET version 1.0 today. This is the tool formerly known as NUnitAddin. Jamie has taken this thing *so* much further, now providing integrated support for all major unit testing frameworks, including the forthcoming Team System.

I was using the NUnitGUI until I came across this tool. No more. No more switching back and forth between NUnitGUI and VS.NET. TestDriven.NET runs all of your tests from a right click context menu in VS.NET. Test output goes directly to the output window.

What do you want to test? A single method? Right click on the method and click Run Test(s). An entire class? Right click on the class name and click Run Test(s). A namespace? Right click on the namespace and click Run Test(s). You get the idea.

Again, this is compatible with all major unit testing frameworks, so the Right click/Run Test(s) technique works whether your using mbUnit, nUnit or even Team System. How cool is that?

Ad-hoc tests are also supported. Ad-hoc tests offer a useful alternative to those throw-away console applications which we use to explore private methods or 3rd party code. Any method can be executed as an ad-hoc test by right clicking inside it and selecting Run Test(s). Are you starting to see a theme here? :=)

On a side note, I’ve been really exploring mbUnit lately. (It is distributed with TestDriven.NET). This tool is definately worth a look, as it provides a lot of stuff that requires you to jump through hoops to do with nUnit. For example:

  • A Rollback attribute, which would come in handy for unit testing a data layer. This attribute uses EnterpriseServices to create a COM+ domain around the test. All tests are transacted and rolled back when completed.
  • A Duration attribute. This verifies that the method call duration is below a given value.

Earlier today I came across a very interesting feature of mbUnit. TypeFixture lets you write a fixture for a specific type and apply it to a number of instances of this type. For me, this came in really handy for writing a single fixture for an interface and applying the fixture to all the types that implement the interface.

Wow! This is what people had in mind by doing continuous integration and TDD…

1 Comment

Set Collections for .NET

The collections available in the .NET framework are sufficient for most types of operations you will encounter. However, there is one type that is missing. A Set is a collection that contains no duplicate elements. The Set is not used very often, but when you do need it, you *really* need it.

I’ve recently encountered the real need for a Set implementation and stumbled across a very nice one (with source code) over at Code Project.

Jason’s implementation has some very nice features, including:

  • Union (a Set containing all elements from both input sets)
  • Intersect (a Set containing all elements that are in both A and B)
  • ExclusiveOr (a Set containing all elements that are in A or B, but are not in both A and B)
  • Minus (a Set containing all the elements of A, with the elements from B removed)

Jason’s implementation has allowed me to remove massive amounts of this type of code, which was done to filter duplicates:

ArrayList list1 = SomeMethodToPopulateAList();
ArrayList list2 = new ArrayList();
foreach (object o in list1)
{
    if (!list2.Contains(o))
        list2.Add(o);
}

This now becomes:

ISet mySet = new HashedSet(SomeMethodToPopulateAList());

There were also opportunities for me to take advantage of the Minus functionality, eliminating three ArrayLists (to track items to be inserted and removed) and a lot of stinky code.

Best of all, ISet also implements ICollection, so assuming you’re returning interfaces from your methods rather than implementations, you will be just fine by changing things from ArrayList to ISet.

Ive not checked into Whidbey yet, so hopefully someone can let me know if Set collections will be available in the BCL. For now though, this is a wonderful piece of code and something you should definately add to your code library.

No Comments

My first iTunes purchase

So, today I finally made my first iTunes Music Store purchase. You know, one of my biggest gripes with music has typically been the price. It’s incredibly frustrating to spend $18+ for a CD that will typically contain one or two quality tracks.

However, using iTunes, I was able to get a preview of each track on the disc. If I so desire, I could purchase only the tracks I wanted for 99 cents. Entire discs are $9.99.

This was one of the most enjoyable experiences Ive had as far as shopping for music. If you havent used iTunes yet, it is also definately worth a look. The features in this music library package are fantastic…

Oh, the disc I bought? U2 – How to Dismantle an Atomic Bomb. An excellent album…

No Comments

Happy Thanksgiving!

I’ll be out of town for the Thanksgiving break, enjoying the snow in Salt Lake City.

I wish everyone a very safe and happy Thanksgiving day.

No Comments

Virtual PC and sound problems

Megan Davis over at Microsoft Weblogs has a post that details some troubleshooting tips if your virutal machines consistently hang or your keyboard and mouse behave irratically.

I havent had problems like that, and havent had any real problems with my VPC virtual machines except for the fact that the sound was ridiculously choppy.

Since I was running on a Dell notebook with SpeedStep, I tried her tip number 2. The tip involved getting the latest version of the SpeedStep utility. If that didnt work, try to remove SpeedStep or disable it in your BIOS. Being one for the quick fix, I opted for the last option which was to change my power management profile to ‘Always On’ in the control panel.

I’m *very* pleased to say that it worked for me. Audio quality is back to normal.

No Comments

Friday Night Fights at the NBA

Im sure by now most everyone has seen the melee that occurred at Friday night’s NBA game between the Detroit Pistons and the Indiana Pacers. This is easily one of the most disgusting displays ever seen in sports history.

Earlier today, the NBA commissioner handed down the harshest penalties in the history of the NBA. The major player in the fracas, Ron Artest, is suspended for the rest of the season. In my opinion, this guy should be out of the league. Permanently. If you cant control your emotions, then you have no right being there.

The two other major players in this deal got a combined 55 game suspension, not nearly enough for cold-cocking a fan. I’m not going to completely exonerate the fans here. The two that got cold-cocked were on the basketball floor. The fans have no right to be there. However, standing on the floor and jawing a player does not deserve that kind of reaction. What we saw on Friday night was how these types of things get handled on the street.

It is completely uncalled for for a player to enter the stands. *Ever*. These atheletes are paid millions of dollars and should be expected to show some restraint. I guess this is what happens when you give street thugs a multi-million dollar contract. This is a sport whos poster boy is Allen Iverson, the same guy that a few years ago was charged with assault and multiple other offenses for forcing his way into an apartment with a gun and threatening two men while looking for his wife.

This incident caused a big black eye for the NBA. I’m anxious to see how they work through this. They’ve got a long way to go…

5 Comments

Hotmail Update

Awesome. I just logged into my Hotmail account and noticed that I finally got the promised 2GB update. Now I have that much more room for spam. ;)

In all seriousness, I think Hotmail’s junk filter has gotten tremendously better in the last several months. It still has a ways to go though to match GMail’s junk filter. In the several months that Ive had the GMail account, I’ve not had one single piece of junk mail slip through.

59 Comments

Windows XP File Association Web Service

Via Darrell Norton comes one of the best tips ever:

When you open a filetype that is unregistered on your system, you get presented with a time-wasting dialog about if you would like to use a web service to find the appropriate program, or select the program from a list. This tip involves bypassing that dialog and going straight to the Choose Program dialog.

Option 1:
Using the Registry Editor, navigate to HKCU (or HKLM, if you want to make it machine wide)\Software\Microsoft\Windows\CurrentVersion\Explorer. In the right panel, set REG_DWORD InternetOpenWith to 0, creating it if it doesnt exist.

Option 2:
Using the Registry Editor, navigate to HKCU (or HKLM, if you want to make it machine wide)\Software\Microsoft\Windows\CurrentVersion\Policies\System. In the right panel, create a REG_DWORD value named NoInternetOpenWith and set its data to 1.

Enjoy!

8 Comments

Need an SSL certificate to develop with?

There may be times when you encounter an issue that only manifests itself in an SSL environment. We just had one of these recently. When this happens, it helps to have a certificate that you can install on your development machine. Once you have that certificate installed, you can debug your application through an SSL layer.

As I said, we had one of these issues recently. I didnt have easy access to a certificate server to create a new certificate and therefore had to look for other options.

The first option I found was installing Perl and OpenSSL and creating the certificate that way. Uh. No. I dont have anything against Perl, but that seemed way too much work.

After digging a little bit more, I found the IIS 6.0 Resource Kit. Even though it’s titled the IIS 6.0 resource kit, there are some tools in this kit that do work with Windows XP. The tool from this kit that I was after was called SelfSSL. Simply stated, this tool creates and installs a certificate to the local IIS server.

All I needed to do was type SelfSSL.exe from the installed directory. This is significantly easier than the Perl/OpenSSL option, with the same results.

No Comments

Virtual Server 2005 and Windows XP SP2

After spending the last couple hours troubleshooting why all of the sudden Virtual Server 2005 stopped working on my boss’s Windows XP box, I stumbled across a Google post which mentioned the Virtual Server release notes.

The relevant portion, for anyone else that might be suffering from this problem:

If you upgrade to Windows XP Service Pack 2 after installing Virtual Server 2005, you may receive an “Access denied” error when you try to open the Administration Web site in Virtual Server. You can correct this problem by uninstalling and then reinstalling Virtual Server.

2 Comments
« Previous Entries
flag
Favorite Charity
wounded warrior project
Search
Social
  • mattberther on twitter
  • mattberther on linkedin
Syndication
Archives
  • January 2010
  • September 2009
  • July 2009
  • June 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • September 2008
  • August 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007
  • February 2007
  • January 2007
  • December 2006
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • May 2006
  • April 2006
  • March 2006
  • February 2006
  • January 2006
  • December 2005
  • November 2005
  • October 2005
  • September 2005
  • August 2005
  • July 2005
  • June 2005
  • May 2005
  • April 2005
  • March 2005
  • February 2005
  • January 2005
  • December 2004
  • November 2004
  • October 2004
  • September 2004
  • August 2004
  • July 2004
  • June 2004
  • May 2004
  • April 2004
  • March 2004
  • February 2004
  • January 2004
  • December 2003
  • November 2003
  • October 2003
  • September 2003
  • August 2003
  • July 2003
  • June 2003
  • May 2003
  • April 2003
  • March 2003
mattberther.com © 2003 - 2010