I'm returning to the Team in Training program this year - a little healthier, a little lighter, and a whole lot happier knowing that we all helped make a difference for the Leukemia & Lymphoma Society last year. (See here for a picture of me at the top of the last major climb last year.) I feel very blessed to have made a lot of good friends last year, all of whom have a shared passion to help out such an important cause. It must have been worthwhile, because here I go again! I've committed to raise a minimum of $4,200 for the Leukemia Society. By donating your money, you get a tax deductible donation, and also help an organization provide support to patients and research a cure. The easiest way to donate is to donate online by going to my fund-raising web page at http://www.active.com/donate/tntwi/tntwiDMiser1. Many strides have been made - partly as a result of the nearly $1 billion raised by Team In Training - but there is more to be done. I am riding in honor of this year's beneficiary, Jesus Vega Ramos. I am also riding in memory of Lewis Challoner. Lewis was the father of my best friend, Steve, and he took us on some century rides (the Rock 100) when we were in high school. He continued to be heavily involved in the biking community, with patents granted on bikes to help the disabled, in addition to being an avid and hard-core rider of long distances into his 60s. Lewis was like a second father to me. If you want/need to send a check, or have any other questions, please feel free to email me. Thanks for your time, and I look forward to your donation. If you know of anyone else that might like to help, please pass this on. Every little bit helps!
I'm using NHibernate a lot more lately, and it's been working great. One of the downsides, though, is the fact that you need to build up the mapping files by hand. Well, no more. I stumbled upon the open source project, active-record-gen, on Google Code. One of the templates that it provides is one that will generate NHibernate mapping files for tables in an MSSQL database. I tried this on a couple of databases and it works rather well. A few small suggestions: - Implement a better pluralization/singularization strategy by using Inflector.NET.
- Work with more databases than just MSSQL.
- Allow for the connection string to be built up with more options. Right now, it requires SSPI integration, and attached databases don't work as well as they should. See here for more details.
This link explains the unit testing tools available in VS.NET 2008 Professional. My take after reading that section is that Microsoft doesn't get it. Here is my list of observations about this section. Feel free to leave a comment to tell me where I'm wrong. - I feel like this is nothing more than an upsell to get me to go and buy VS.NET TeamSystem. Sorry, that's not going to happen. TeamSystem is way too expensive (both initially and in setup/maintenance time for a TFS server). Besides, we have an existing development infrastructure setup since we use multiple (non-MS) languages/platforms here.
- It looks like MS wants to ignore the thriving and long-standing community of open source unit testing tools. I'm willing to bet that NUnit (and MbUnit, etc.) has more code using it than Microsoft.VisualStudio.TestTools.UnitTesting. Yet, if I want to use the integrated Test menu in VS.NET, I need to rewrite my unit test code to use near-identical attributes for my unit tests (e.g. [TestMethod()] vs. [Test]).
- Code coverage is not available in VS.NET Pro. I guess code coverage isn't something that developers should be doing - well, unless they shell out tons of money to get it done. Thankfully, there are free alternatives, with cheap upgrades to the latest version.
- I want to easily run and debug my unit tests. I know Resharper can do this, but I haven't installed that in VS.NET 2008 due to the number of issues I had with it. (Yes, I know an EAP is coming out soon, but I also have CodeRush and Refactor, which work fine with 2008.) I like TestDriven.net, but I'd like to be sure that it doesn't go away.
- The documentation is too cluttered. If you're going to give me a list of what's included and what's not included in the Pro version, then why not just separate the documentation to make it easier for me to see what capabilities I have (and what I don't).
In short, it's disappointing that MS has chosen to force people to one specific way of writing unit tests that is against industry norms. ASP.NET has shown me that they do understand the provider model, so why not use it here to allow me to run and debug my unit tests using whatever tools I want.
I would like to take it upon myself to announce the formation of the Milwaukee chapter of the ALT.NET UserGroup. It will meet the first Wednesday of every month, with the first meeting to take place on 3/5/08 @ 7pm at 10000 Innovation Drive, Milwaukee, WI. Pizza and drinks will be served, and the event will be free to attend. Thanks to SpiderLogic for sponsoring the first meeting. This group will cover agile development tools and techniques with .NET, best practices for architecture and coding, emerging technologies, and anything else the group decides to cover. For more backstory on ALT.NET, read this post. The use group will be a very participant-driven group. I will not look to lead this group in any significant way, other than to call this group to order, and get people involved in sustaining it. I've learned from other user groups that if a group is too dependent upon one person, it is a matter of time before it fails. For the first meeting's agenda, I propose we get some volunteers to take on some minimum responsibilities and then break into an OpenSpaces format, where technical topics will be presented by anyone who wants to present. I don't want this to be yet another 1-way presentation medium for 1-2 hour topics, so be prepared to be engaged, discuss, and share (bring your laptop to showcase code and/or slides). I'll take a swipe at talking about ASP.NET MVC this first meeting. If you have something you want to see covered, or especially if you want to cover something, post a comment, and we'll get it on the agenda. Please pass this notice around to anyone you think will be interested! If you plan on attending, I would appreciate either a comment on this blog or email to dmiser@distribucon.com, just so we can gauge how much food and drink to have on hand. I am really excited about this, and look forward to seeing everyone there!!
I have a .NET application that generates an XML file via serialization (through XmlTextWriter) and submits the data via https. Recently, they changed something on their end to only accept an upper cased UTF-8 encoding, like this:
<?xml version="1.0" encoding="UTF-8"?>
Unfortunately, using the .NET classes mentioned above, it generates the encoding string in lower case. I could find one mention of this on google, and they said to have the other company change (not an option here), or override XmlTextWriter. I went with that approach, making heavy use of Reflector along the way. I started by looking at the WriteStartDocument method, but realized that the private StartDocument is the thing that generates the output. It also gets called by the overloaded WriteStartDocument, so I'd need to override that method, too. However, in the private StartDocument method, it uses a bunch of private variables and generates output via another private method, InternalWriteProcessingInstructions. Ugly. At this point I realize that XmlTextWriter is not a class made for inheriting.
Back to Reflector, and I notice that the Encoding.WebName is the property used to write out the encoding string. I now create a descendant class of UTF8Encoding. The class is listed below. Now I just call XmlTextWriter, passing in UpperCaseUTF8Encoding.UpperCaseUTF8 for the Encoding type, and everything works perfectly. public class UpperCaseUTF8Encoding : UTF8Encoding
{
public override string WebName
{
get { return base.WebName.ToUpper(); }
}
public static UpperCaseUTF8Encoding UpperCaseUTF8
{
get
{
if (upperCaseUtf8Encoding == null)
upperCaseUtf8Encoding = new UpperCaseUTF8Encoding();
return upperCaseUtf8Encoding;
}
}
private static UpperCaseUTF8Encoding upperCaseUtf8Encoding = null;
}
I went in search of an application that would synchronize my bookmarks. It needed to meet the following minimum specifications: - Sync between Windows and Macintosh
- Sync bookmarks between IE, Mozilla, and Safari
- Sync between machines
- Automatic synchronization. If I have to perform a manual step, I'm not interested.
- Could not be an Internet-only bookmark storage service
- Good conflict detection and resolution
Sync2It met all of those requirements, and after using it for a couple of weeks with no real major issues, I bought it. Diigo and Google bookmarks were very good applications, too, but didn't pass some portion of my needs. I did email the author about some enhancements I'd like to see to make Sync2It even better. I'd encourage you to try and buy Sync2It. That way, maybe these suggestions have a chance of getting implemented.  - While the Mac download doesn't say it, it does appear to work with Leopard.
- The Mac version only syncs with IE and Safari. We need Mozilla support on this platform.
- Provide an easy way to auto-launch the Sync2It application as a daemon when logging in.
- We need to be certain that Safari 3 is supported (both on Mac and Windows).
- It would be nice to have some kind of log to see the actual activity of a given sync.
Here's hoping this will let me focus on saving and categorizing bookmarks, as opposed to constantly leaving stray bookmarks around and needing that one bookmark on the one machine I'm not currently using!
I had a need to move some VB.NET code to C# today. We're still not at the point where we can just mix and match languages within an assembly, and in this case, it would be more work than I wanted to separate things out. I looked around the net, and the best code converter that I found (read: it successfully converted everything I threw at it, where others failed) was this one.
I needed to put 2 test assemblies into my automated CruiseControl.NET build and get coverage results. It appears that this is a pretty common need, with some tricks to get things working properly. According to http://www.kiwidude.com/blog/2006/10/ncoverexplorer-merging-ncover-reports.html, you need to either use an NUnit project file to contain all of the unit tests or merge the coverage xml files in the NCoverExplorer task. NUnit project setup and problems By using an NUnit project file, all of the tests are executed within one call, which produces one coverage.xml file. This allows tests from multiple test assemblies to be merged together into one coverage file that NCoverExplorer will understand automatically. <TestAssemblies Include="MyApp.Tests.nunit" />
MyApp.Tests.nunit contents: <NUnitProject>
<Config name="Default" binpathtype="Auto">
<assembly path="MyApp.DAL.Test\bin\Debug\MyApp.DAL.Test.dll" />
<assembly path="MyApp.Service.Test\bin\Debug\MyApp.Service.Test.dll" />
</Config>
</NUnitProject>
The major downside of this approach is that, according to http://nunit.com/blogs/?p=9, when using the NUnit project file, the config file that gets loaded needs to be based off of the NUnit project filename (i.e. in this case, MyAppT.Tests.config) and not the individual test assembly filenames. This means that we need to continually merge all of the app.config files into one "master" config file. This is not exactly a long-term, maintainable solution.
NCoverExplorer task setup
That brings us to the second possible solution presented above, namely to merge multiple coverage files together. To do this, you need to take some care in how you set the properties up for the tasks so that you don't overwrite coverage output files. My current build project looks similar to the one below. One other thing to keep in mind is to include the *.CoverageMerge.xml file in your CC.NET config file's <merge> section for this project. <ItemGroup>
<TestAssemblies Include="$(DALTestAssembly)" />
<TestAssemblies Include="$(ServiceTestAssembly)" />
<NCoverAssemblies Include="$(DALAssembly)" />
<NCoverAssemblies Include="$(ServiceAssembly)" />
<NCoverCoverageFiles Include="**.Coverage.xml" />
</ItemGroup>
<Target Name="Test" DependsOnTargets="CoreBuild">
<NCover ToolPath="lib\NCover\"
CommandLineArgs="%(TestAssemblies.FullPath) /xml=%(TestAssemblies.Filename).xml /labels /nologo"
CommandLineExe="lib\NUnit\nunit-console.exe"
CoverageFile="%(TestAssemblies.Filename).Coverage.xml"
LogFile="%(TestAssemblies.Filename).Coverage.log"
LogLevel="Verbose"
WorkingDirectory="$(MSBuildProjectDirectory)"
Assemblies="@(NCoverAssemblies)"
/>
<NCoverExplorer
ProjectName="MyApp"
ReportType="ModuleClassSummary"
OutputDir="$(MSBuildProjectDirectory)"
XmlReportName="MyApp.CoverageSummary.xml"
HtmlReportName="MyApp.CoverageSummary.html"
ShowExcluded="True"
SatisfactoryCoverage="80"
CoverageFiles="@(NCoverCoverageFiles)"
MergeFileName="MyApp.CoverageMerge.xml"
ToolPath="lib\NCover\Explorer"
/>
</Target>
|