Tag Archives: Comments

Unintentionally Funny Spam

Even with all the automated spam filtering that I have on both my e-mail and on the comments for the various blog sites I host, it is still annoying that spam gets through.

Having said that, every so often you get one that is quite funny, like the one I got this morning.

The people who sent it are fairly obviously using a simple phrase matching technique to post to what they think are relevant posts – sadly not in this case… That’s all the more surprising when you realise that whatever posted the comment got past the CAPTCHA test that gets given to anything the system thinks is dodgy – not that getting through mattered as I was able to boot the comment fairly swiftly when I found it. Perhaps some more time on the routine that selects relevant posts is needed…

Anyway, I digress. The blog post on which they commented was this one about clergy safety, highlighting the story of a vicar whose vicarage was machine-gunned. This is the comment that was posted (with the link removed obviously)…

I very much agree with what your article says. True enough, the use of dog collars such as no bark collars that are effective, humane and safe for controlling unwanted barking can be beneficial to your pet dogs.

So anyone else need to control unwanted barking from their vicar?

NDoc and VBCommenter Gotcha’s

One of the must have tools for any C# programmer has to be NDoc, which takes in all the meaningful XML comments you’ve added, and produces documentation in one of a number of common formats.

The big problem when going over to doing work in VB.Net, is that although the development environment can make use of the XML comment files, out of the box there is no way to produce them. Luckily, there is a handy little tool called VBCommenter, that provides the missing feature.

I grabbed a copy of VBCommenter when I started off with my current VB.Net project, and it’s worked pretty well, indeed with the add-in in place it has been pretty much the same as working with C#. That was until today.

This afternoon I had one of those afternoons where things fairly obviously weren’t working, but I was left scratching my head as to why. I’d added comments to an assembly, run the project through NDoc and it was resolutely not picking up my comments. Indeed on one particular class there was just a single method that was failing to appear. Looking at the XML files produced by VBCommenter I couldn’t spot any obvious problems in the sections of the file that were not being picked up. I even got to the point of reinstalling both NDoc and VBCommenter, all to no avail.

Typically the source of the problem turned out to be two quite trivial problems. The single method that was failing was caused by a problem in the what VBCommenter produces for arrays. The method in question was taking an array of strings as a parameter, which in C# would be declared as ‘System.String[]’, and in VB.Net is ‘System.String()’ – note the different brackets. VBCommenter wrote the VB.Net version to the XML file, whilst NDoc was looking for the C# version. The other problem was as a result of a change I had made last week. I had replaced a property with a method call, to solve a bug, and had temporarily commented out the property whilst I tested the new method. However, looking through the XML file produced I spotted that rather than ignore the commented out property, VBCommenter had written the lines out to the XML file, complete with comment characters. Simply removing the commented out method resulted in the documentation being produced as expected.

Interestingly when having found the problem I ran the file with the comment in it through XMLSpy it did come back as being a badly formed file – however NDoc will quite happily process it without raising any sort of complaint, or even dropping a hint that there might be a problem!