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.
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.
Source
.NET 2.0 assembly
.NET 3.5 assembly
.NET 2.0 assembly + XML + readme + licence
.NET 3.5 assembly + XML + readme + licence
Changes:
Source
.NET 2.0 assembly
.NET 3.5 assembly
.NET 2.0 assembly + XML + readme + licence
.NET 3.5 assembly + XML + readme + licence
Changes:
ReverseLineReader
for reading lines from the end of a stream (usually a file)
Source
.NET 2.0 assembly
.NET 3.5 assembly
.NET 2.0 assembly + XML + readme + licence
.NET 3.5 assembly + XML + readme + licence
Changes:
ProjectionEqualityComparer<T>
to compare objects for equality via a projection.IComparer<T>.ThenBy
extension method to create a compound comparison.Range
DictionaryByType
: a mapping from a type to an instance of that type.
(See blog post.)NonNullable
- an experiment really, but could be handy.
(See blog post.)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.ProjectionEqualityComparer
- like ProjectionComparer
but for equality.
Source
.NET 2.0 assembly
.NET 3.5 assembly
.NET 2.0 assembly + XML + readme + licence
.NET 3.5 assembly + XML + readme + licence
Changes:
EndianBinaryReader.Read
error detection, spotted by Jamie RothfederProjectionComparer
(makes it easy to create comparers based on properties etc)
Source
.NET 2.0 assembly
.NET 3.5 assembly
.NET 2.0 assembly + XML + readme + licence
.NET 3.5 assembly + XML + readme + licence
Changes:
19.June(1976) + 8.Hours()
Range
class and associated iterator. Usage notes coming soon (ditto for the items below).ReverseComparer
to allow for easy order reversalLineReader
to iterate over arbitrary text sources - great for LINQ processing of text files.I'm still transitioning the previous history etc. Hopefully I'll get round to documenting more of the library too. Just bear in mind that I won't be updating the contents of the page below here...
The library currently contains the following items:
Comparison<T>
and Comparer<T>
System.String
, but with a
UTF-32 encoding (rather than UTF-16). This means surrogate pairs are counted as a single character.
Range
which is still a work in progress. Full SmartEnumerable
support.
StreamUtil
in the download. Sorry folks!
StreamUtil
.
IBufferManager
and implementations.
StaticRandom
and Vcdiff
.
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.
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.
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.
Back to the main page.