Miscellaneous Utility Library

Every so often, someone on the newsgroup asks about something which doesn't
exist in the framework, but which I think should. Sometimes, I'll write some
code for them to plug the gap. Just occasionally, I'll tidy up the code, add
XML documentation comments etc, and include it in my miscellaneous utility library.
This library will, of course, grow over time.

Due to the nature of the library, some of the code may not have been particularly
rigorously tested. You are strongly advised to give it a thorough testing before
including it in any important code. Note: as of November 2006, I'm gradually adding
unit tests, so the quality should improve significantly.

Language/framework compatibility and build notes

As of February 2008, MiscUtil is built with Visual Studio 2008 and uses features of C# 3.
However, with a bit of jiggery pokery we have it building in two configurations: one targeting
.NET 2.0, and one targeting .NET 3.5. Not all of MiscUtil works with .NET 2.0. Some of it can't,
because it requires significant features such as expression trees. Other parts work with a few
pieces of .NET 3.5 imported. In particular, in the .NET 2.0 build of MiscUtil we've included the
Func and Action delegates, ExtensionAttribute for
extension methods, and the IGrouping/ILookup interfaces. This achieves
source level compatibility with .NET 3.5, so if you upgrade from .NET 2.0 to .NET 3.5 you should
be able to replace the MiscUtil assembly with the .NET 3.5 version, recompile and everything should
still work. You could possibly get away with still using the .NET 2.0 version, but I'd recommend against
it - you'll have system types with the same name defined in two different places, which is never
a good place to be.

Each release comes with 5 files: a source zip file, a .NET 2.0 assembly, a .NET 3.5 assembly, a .NET 2.0
zip file (assembly, XML, licence, readme) and the same for .NET 3.5.

MiscUtil is now version stamped with the Subversion revision which built it. This is in the
AssemblyFileVersion attribute rather than the AssemblyVersion attribute
- the latter will stay at 1.0.0.0 for the foreseeable future. All released versions will now remain
available, rather than only the latest one.

MiscUtil is now strongly named. The key is shipped with the source so you can easily rebuild it
and keep the strong naming - this is for purposes of ease-of-use with other strongly named assemblies
instead of non-repudiation. If anyone ever wants a version which I've signed with a properly secured key,
I'm happy to do that - but I think the approach I've taken is the most pragmatic one for the moment.

Added DictionaryByType: a mapping from a type to an instance of that type.
(See blog post.)

Added NonNullable - an experiment really, but could be handy.
(See blog post.)

Added UnicodeRange which allows you to easily find which unicode range a character is in, and get the range by name (as a property).
There's probably more scope here, but I haven't fully explored it yet.

Added ProjectionEqualityComparer - like ProjectionComparer but for equality.

February 14th 2005: Fix to the "fix" to BigEndianBitConverter which had made it completely useless!

February 9th 2005: Fix to bugs in Big/LittleEndianBitConverter which meant they ignored the start index passed in.

January 19th 2005: Improvements to CustomThreadPool, in particular when several jobs are queued in quick succession.

November 28th 2004: Added SyncLock and related types

October 19th 2004: Major improvements to CustomThreadPool

September 15th 2004: Added VCDIFF and Adler32 support

August 24th 2004: Initial offering on website

.NET 1.1 version

As of November 2006, I am no longer easily able to provide a .NET 1.1 version of the
miscellaneous utility library. I'm converting the source to use .NET 2.0 features where
appropriate, and no future development will continue on the .NET 1.1 code. I can apply
bug fixes if requested, but I expect most people are now using .NET 2.0 anyway. Please
mail me if you need to continue using the utility
in a critical manner and need fixes.

Licence

This software is licensed under the Apache licence. The specific
licence for this library is available here and is
also included in the zipped up versions of the library. Essentially, you're
free to use any part of it in commercial software, provided you include
a little acknowledgement. It may also, of course, be used in open source
projects with a compatible licence.

Wishlist

These are the items I want to get round to at some stage. Please mail me
if you think there's something else I should cover.