James Michael Hare

...hare-brained ideas from the realm of software development...
posts - 160 , comments - 1338 , 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

.NET

Topics about .NET in general
Solution to Little Puzzlers - Lowest Common Ancestor
This is the way I went about the "Lowest Common Ancestor" problem. However, keep in mind there are multiple ways to solve this, so don't worry if your solution has variations and it’s entirely possible there are more efficient ways. Feel free to suggest your solution in the comments here or in the original post, but please be respectful of others’ efforts. The Solution The first tendency in this problem is to want to walk back up the tree. This is obviously problematic because we do not have a parent ......

Posted On Thursday, August 27, 2015 12:52 AM | Comments (0) | Filed Under [ My Blog C# Software .NET Little Puzzlers Technology ]

Solution to Little Puzzlers–“List All Anagrams in a Word”
This is the way I went about the "List all anagrams in a word” problems. However, keep in mind there are multiple ways to solve this, so don't worry if your solution has variations and it’s entirely possible there are more efficient ways. Feel free to suggest your solution in the comments here or in the original post, but please be respectful of others’ efforts. The Solution There are many ways to tackle this problem. Ultimately, the main goal of this problem was to be able to return all the anagram ......

Posted On Tuesday, August 4, 2015 4:22 PM | Comments (6) | Filed Under [ My Blog C# Software .NET Little Puzzlers Technology CSharp ]

Little Puzzlers–List all anagrams for a word
I like to keep my brain sharp by working on programming puzzlers. On off weeks I'm going to start posting programming puzzlers I've collected over the years. Hopefully you'll find them as entertaining as I do. The Problem Given a file of all valid words in the English language, write an algorithm that would be suitable for a web page that will list all valid English words that are complete anagrams of the word entered by the user on the page. That is, if the user visits the page and types in POST, ......

Posted On Tuesday, July 28, 2015 1:43 AM | Comments (11) | Filed Under [ My Blog C# Software .NET Little Puzzlers Technology ]

Solution to Little Puzzlers–Find the Majority Element
This is the way I went about the "The Majority Element” problems. However, keep in mind there are multiple ways to solve this, so don't worry if your solution has variations and it’s entirely possible there are more efficient ways. Feel free to suggest your solution in the comments here or in the original post, but please be respectful of others’ efforts. A Linear-Time, Linear-Space Solution As with so many puzzlers, there is more than one way to tackle this problem. Let’s first consider the more ......

Posted On Monday, July 20, 2015 10:53 AM | Comments (5) | Filed Under [ My Blog C# Software .NET Little Puzzlers Technology ]

No new Little Wonders of C# 6 this week
Sorry folks, I totally intended to write a new Little Wonders of C# 6 post this week, but have been ill.  I fully intend to continue next week with a new puzzler and a new Little Wonder.

Until then, check out my previous post on The Little Wonders of C# 6 - a Presentation.

Thanks!

-Jim

Posted On Thursday, April 30, 2015 7:58 PM | Comments (2) | Filed Under [ My Blog C# Software .NET Little Wonders vNext .NET vNext Little Wonders ]

St. Louis .NET User Group
Hey folks, I won’t be posting a new Little Wonders of C# 6 post (you can see my previous posts here) this week. I’ve been preparing a presentation for the St. Louis .NET User Group about all the new C# 6 goodness. If you’ve enjoyed these posts and are in the St. Louis area on April 27th, feel free to pop in and have a listen! I’ll be covering some new wonders I haven’t had a chance to blog about yet. For more information, go to the St. Louis .NET User Group site here. Hope to see you there! Stay ......

Posted On Thursday, April 23, 2015 10:59 AM | Comments (0) | Filed Under [ My Blog C# Software .NET Little Wonders vNext ]

C#/.NET Little Wonders: String Padding and Trimming - Not Just for Spaces!
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. This post continues a series of Little Wonders in the BCL String class. Yes, we all work with strings in .NET daily, so perhaps you already know most of these. However, there are a lot of little fun things that the String class can do that often get overlooked. ......

Posted On Thursday, September 22, 2011 6:27 PM | Comments (7) | Filed Under [ My Blog C# Software .NET Little Wonders ]

C#/.NET Little Wonders: The String Remove() and Replace() Methods
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. This post continues a series of Little Wonders in the BCL String class. Yes, we all work with strings in .NET daily, so perhaps you already know most of these. However, there are a lot of little fun things that the String class can do that often get overlooked. ......

Posted On Thursday, September 15, 2011 6:31 PM | Comments (9) | Filed Under [ My Blog C# Software .NET Little Wonders ]

C#/.NET Little Wonders: The String Split() and Join() methods
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. This post continues a series of Little Wonders in the BCL String class. Yes, we all work with strings in .NET daily, so perhaps you already know most of these. However, there are a lot of little fun things that the String class can do that often get overlooked. ......

Posted On Thursday, September 8, 2011 7:21 PM | Comments (20) | Filed Under [ My Blog C# Software .NET Little Wonders ]

C#/.NET Little Wonders: An Oft Overlooked String Constructor
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. I’m going to begin a series of Little Wonders in the BCL String class. Yes, we all work with strings in .NET daily, so perhaps you already know most of these. However, there are a lot of little fun things that the String class can do that often get overlooked and ......

Posted On Thursday, September 1, 2011 6:45 PM | Comments (6) | Filed Under [ My Blog C# Software .NET Little Wonders ]

C#/.NET Little Wonders: Five Easy Sequence Aggregators
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. Today we will look at five easy ways to aggregate sequences. Often times when we’re looking at a sequence of objects, we want to do perform some sort of aggregation across those sequences to find a calculated result from the sequence. The methods we will be looking ......

Posted On Thursday, August 25, 2011 9:05 PM | Comments (5) | Filed Under [ My Blog C# Software .NET Little Wonders ]

C#/.NET Little Wonders: The ReferenceEquals() method
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. Today we’re going to look at a very small, and sometimes helpful static method of the object class. Of course, we know most of the key methods of the object class by heart, especially the ones we tend to override often such as Equals(), GetHashCode(), and ToString(). ......

Posted On Thursday, August 18, 2011 7:03 PM | Comments (8) | Filed Under [ My Blog C# Software .NET Little Wonders ]

Little Puzzlers–Largest Square of ‘1’s in a Matrix
I like to keep my brain sharp by working on programming puzzlers. On off weeks I'm going to start posting programming puzzlers I've collected over the years. Hopefully you'll find them as entertaining as I do. Another fun one that I enjoyed solving. As usual with these problems, there’s a fairly straightforward solution -- and a very efficient but harder to find solution. The Problem Given a square 2D array of 1s and 0s, find the starting position (top left row, column) and size of the largest, solid ......

Posted On Monday, April 20, 2015 11:38 AM | Comments (8) | Filed Under [ My Blog C# Software .NET Little Puzzlers ]

C#/.NET Little Wonders: Static Using Statements in C# 6
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 posts can be found here. Visual Studio 2015 is on the horizon! In fact, some of you may already have played with the preview and seen some of the many neat new things to come – both in the IDE and in the C# language. For those who haven’t been keeping up with the announcements, I’m taking ......

Posted On Thursday, April 16, 2015 8:14 PM | Comments (9) | Filed Under [ My Blog C# Software .NET Little Wonders vNext ]

Solution to Little Puzzlers–Largest Puddle on a Bar Chart
This is the way I went about the “Largest Puddle on a Bar Chart” problem. However, keep in mind there are multiple ways to solve this, so don't worry if your solution has variations and it’s entirely possible there are more efficient ways. Feel free to suggest your solution in the comments here or in the original post, but please be respectful of others efforts. My Approach Of course, the most straight-forward approach could be performed by taking each bar, and finding the pool starting at that bar ......

Posted On Monday, April 13, 2015 8:56 PM | Comments (2) | Filed Under [ My Blog C# Software .NET Little Puzzlers ]

C#/.NET Little Wonders: Exception Filtering in C# 6
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 posts can be found here. Visual Studio 2015 is on the horizon! In fact, some of you may already have played with the preview and seen some of the many neat new things to come – both in the IDE and in the C# language. For those who haven’t been keeping up with the announcements, I’m taking ......

Posted On Thursday, April 9, 2015 6:36 PM | Comments (3) | Filed Under [ My Blog C# Software .NET Little Wonders vNext ]

C#/.NET Little Wonders: The Timeout static class
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 posts can be found here. When I started the “Little Wonders” series, I really wanted to pay homage to parts of the .NET Framework that are often small but can help in big ways. The item I have to discuss today really is a very small item in the .NET BCL, but once again I feel it can help ......

Posted On Thursday, September 20, 2012 7:52 PM | Comments (4) | Filed Under [ My Blog C# Software .NET Little Wonders ]

C#/.NET Little Wonders: Interlocked CompareExchange()
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 posts can be found here. Two posts ago, I discussed the Interlocked Add(), Increment(), and Decrement() methods (here) for adding and subtracting values in a thread-safe, lightweight manner. Then, last post I talked about the Interlocked Read() and Exchange() methods (here) for safely ......

Posted On Thursday, September 6, 2012 7:14 PM | Comments (11) | Filed Under [ My Blog C# Software .NET Little Wonders ]

C#/.NET Little Wonders: Interlocked Read() and Exchange()
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 posts can be found here. Last time we discussed the Interlocked class and its Add(), Increment(), and Decrement() methods which are all useful for updating a value atomically by adding (or subtracting). However, this begs the question of how do we set and read those values atomically as ......

Posted On Thursday, August 23, 2012 6:03 PM | Comments (3) | Filed Under [ My Blog C# Software .NET Little Wonders ]

C#/.NET Little Wonders: Interlocked Increment(), Decrement(), and Add()
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 posts can be found here. Often times, we need to update a count in a multi-threaded program. This may be an incrementing, decrementing, or adding a value in a thread-safe manner. This post will discuss one of the lightest ways to do this: the Interlocked class. Problem: Increments Are ......

Posted On Thursday, August 9, 2012 8:02 PM | Comments (7) | Filed Under [ My Blog C# Software .NET Little Wonders ]

Full .NET Archive

Powered by: