James Michael Hare

...hare-brained ideas from the realm of software development...
posts - 159 , comments - 1334 , trackbacks - 0

My Links

News

Welcome to my blog! I'm a Sr. Software Development Engineer in the Seattle area, who has been performing C++/C#/Java development for over 20 years, but have definitely learned that there is always more to learn!

All thoughts and opinions expressed in my blog and my comments are my own and do not represent the thoughts of my employer.

Blogs I Read

Follow BlkRabbitCoder on Twitter

Tag Cloud

Archives

Post Categories

.NET

CSharp

Little Wonders

Little Wonders

vNext

Toolbox

Generic Utility Classes I've developed to make my life a little easier as a developer.
C#/.NET Little Wonders: Searching Strings With Contains(), StartsWith(), EndsWith(), and IndexOf()
Once again, in this series of posts I look at the parts of the .NET Framework that may seem trivial, but can help improve your code by making it easier to write and maintain. The index of all my past little wonders post can be found here. Two weeks ago I decided to stop my Little Wonders in the String class, but I recanted and decided to do one more before wrapping up String. So today we’ll look at ways to find a out if a given source String has a target String inside of it (and where). IndexOf() ......

Posted On Thursday, October 13, 2011 6:23 PM | Comments (6) | Filed Under [ My Blog C# Software .NET Little Wonders Toolbox ]

C#/.NET Toolbox: Creating a "Safer" Task Dispose()
This post is another in a series that contains generic utility classes I’ve developed along the way to help make coding a bit easier. If these already exist as part of the framework and I’ve overlooked them, feel free to let me know! And if you know of a better way to implement them, do the same! I’m never too old to learn something new (I hope!). Update: modified the TryDispose() method to check for IsCompleted first and mark any Task exceptions as handled. So recently, I’ve been moving some older ......

Posted On Thursday, October 6, 2011 7:41 PM | Comments (2) | Filed Under [ My Blog C# Software .NET Toolbox ]

C#/.NET Toolbox: Adding a ToHashSet() Extension Method
This post is another in a series that will just contain little GUCs (Generic Utility Classes) I’ve developed along the way. If these already exist as part of the framework and I’ve overlooked them, feel free to let me know! And if you know of a better way to implement them, do the same! I’m never too old to learn something new (I hope!). I've blogged in the past about how useful the overlooked HashSet class can be (here) and about the very useful ToDictionary(), ToList(), and ToLookup() LINQ extension ......

Posted On Thursday, March 31, 2011 6:21 PM | Comments (1) | Filed Under [ My Blog C# Software .NET Toolbox ]

C#/.NET Toolbox: A Debugable, Self-Installable Windows Service Template (Redux)
The Original Posts I had written a pair of posts before about creating a debug-able and self-installing windows service template in C#. This is a template I began creating to ease creating windows services and to take some of the mundane tasks out of the coding effort. The original posts were here: C# Windows Services (1 of 2) - Debug-able Windows Services C# Windows Services (2 of 2) - Self-Installing Windows Services But at the time, though I gave the code samples I didn't have a downloadable for ......

Posted On Tuesday, March 1, 2011 1:08 AM | Comments (6) | Filed Under [ My Blog C# Software .NET Toolbox ]

C#/.NET Toolbox: Generic Reversing Comparers
I’m going to start another series of posts that I’m calling C#/.NET Toolbox that will just contain little GUCs (Generic Utility Classes) I’ve developed along the way. If these already exist as part of the framework and I’ve overlooked them, feel free to let me know! And if you know of a better way to implement them, do the same! I’m never too old to learn something new (I hope!). Update: improved the ReverseComparer and added an extension method that will reverse any comparer instance. The Problem: ......

Posted On Thursday, December 2, 2010 7:37 PM | Comments (5) | Filed Under [ My Blog C# Software .NET Toolbox ]

C# Toolbox: A Debuggable, Self-Installing Windows Service Template (2 of 2)
Update: I have now placed the zip containing the source for the end result of part 1 and 2 of this service template here. Two weeks ago I began the series with a discussion on how to make a new C# Windows Service template that is “debuggable” (you can find the article here). I had then intended the next week to follow up with a discussion on how to modify that template to make the service “self-installing”. Unfortunately, with my work schedule I wasn’t able to complete the series last week due to ......

Posted On Thursday, October 7, 2010 4:43 PM | Comments (25) | Filed Under [ My Blog C# Software .NET Toolbox ]

C# Toolbox: A Debuggable, Self-Installing Windows Service Template (1 of 2)
Update: I have now placed the zip containing the source for the end result of part 1 and 2 of this service template here. I decided to write a pair of posts on making it easier to create Windows Services in C# (and in .NET in general). This is the first post that talks about how to make a Windows Service debuggable (the default visual studio template does not allow the service to be easily debugged), and then next week’s post will discuss making the Windows Service self-installing. Now, these posts ......

Posted On Thursday, September 23, 2010 5:59 PM | Comments (6) | Filed Under [ My Blog C# Software .NET Toolbox ]

C# Toolbox: Building a Loosely Coupled Translator
In my last fundamentals post, Chuck had requested an example of how to translate between enum and int without resorting to casting or other hard-coded mechanisms that depend on the actual values of the enum. One of the problems, of course, with casting between enum and int (for example to represent the enum as an int in database) is that it is a very tightly-coupled bond. Any changes to the underlying data or to the enum could have disastrous consequences. Thus, it is often more desirable to have ......

Posted On Tuesday, July 13, 2010 11:10 PM | Comments (2) | Filed Under [ My Blog C# Software .NET Fundamentals Toolbox ]

Powered by: