BlackRabbitCoder
Name: BlackRabbitCoder
Score: 695.01
Last Seen: 78 days, 12 hours, 5 minutes ago
Member Since: 11 February, 2011
DotNetShoutout
atom rss
2
Shouts

C#/.NET Little Pitfalls: Stopwatch Ticks are not TimeSpan Ticks

published 496 days, 20 hours, 7 minutes ago posted by BlackRabbitCoderBlackRabbitCoder 499 days, 7 hours, 29 minutes ago
Sunday, January 15, 2012 11:54:38 AM GMT Friday, January 13, 2012 12:32:42 AM GMT
The System.Diagnostics.Stopwatch class is very useful for elapsed time measurements in .NET applications. Today we’ll look at the ElapsedTicks member of the Stopwatch class, and some of the confusion of what this quantity represents, especially compared to TimeSpan or DateTime Ticks. (more)
category: Web Dev | clicked: 12 | 2 comments | | source: www.blackrabbitcoder.net
tags: .NET, DateTime, C#, Stopwatch, CSharp, TimeSpan, Little Pitfalls
2
Shouts

C#/.NET Little Wonders: The DateTime TryParsae() and ParseExact() Methods

published 503 days, 18 hours, 17 minutes ago posted by BlackRabbitCoderBlackRabbitCoder 506 days, 7 hours, 17 minutes ago
Sunday, January 08, 2012 1:43:59 PM GMT Friday, January 06, 2012 12:44:17 AM GMT
A while back I talked about some goodies in DateTime, mostly the properties that let you split out just the date or time. This week, I wanted to look at a couple more methods of the DateTime struct that give you additional control over parsing an input string into a DateTime. Most of us have dealt with using DateTime.Parse() for these tasks, but sometimes you are wanting to parse something that may not be a valid DateTime, or may be in a non-standard format. So let’s look at the TryParse() and ParseEx... (more)
category: Web Dev | clicked: 13 | 2 comments | | source: blackrabbitcoder.net
tags: .NET, DateTime, Parse, Little Wonders, C#, ParseExact, TryParse, CSharp
5
Shouts

C#/.NET Fundamentals: Unit Testing with Func Generators

published 516 days, 23 hours, 46 minutes ago posted by BlackRabbitCoderBlackRabbitCoder 520 days, 8 hours, 23 minutes ago
Monday, December 26, 2011 8:15:27 AM GMT Thursday, December 22, 2011 11:38:06 PM GMT
I wanted to attempt a brief post before the holidays, so I decided to quickly revisit part a post I wrote a few weeks back on The Generic Func Delegates, and in particular, the sidebar on using Func as a generator for unit testing. At the time, I did not give that short sidebar the attention I really wanted, including showing the setup of the unit tests and discussing the performance impact (if any) of such a practice. So this week I hope to rectify this by revisiting and enhancing the discussion. (more)
category: Web Dev | clicked: 11 | 1 comment | | source: www.blackrabbitcoder.net
tags: .NET, C#, fundamentals, delegates, Func, CSharp, unit testing
4
Shouts

C# Fundamentals: Returning Zero or One Item As IEnumerable

published 531 days, 19 hours, 49 minutes ago posted by BlackRabbitCoderBlackRabbitCoder 534 days, 7 hours, 25 minutes ago
Sunday, December 11, 2011 12:12:15 PM GMT Friday, December 09, 2011 12:36:09 AM GMT
There are times when we are writing a method that returns a sequence of items, that it occasionally becomes necessary in base-class, interface implementation, error, or default conditions to return a sequence of only one or even zero items. There are many ways to do this, of course, which begs the question of which way is best, in terms of readability, maintainability, and performance. (more)
category: Web Dev | clicked: 21 | 1 comment | | source: blackrabbitcoder.net
tags: .NET, C#, fundamentals, IEnumerable, CSharp
2
Shouts

C#/.NET Fundamentals: Safely and Efficiently Raising Events

posted by BlackRabbitCoderBlackRabbitCoder 541 days, 4 hours, 22 minutes ago
Friday, December 02, 2011 3:39:04 AM GMT
A couple of posts ago, I discussed the EventHandler (more)
category: Web Dev | clicked: 6 | 1 comment | | source: www.blackrabbitcoder.net
tags: .NET, C#, fundamentals, delegates, Events, CSharp
3
Shouts

C#/.NET Little Wonders: The Predicate, Comparison, and Converter Generic Delegates

published 547 days, 3 hours, 36 minutes ago posted by BlackRabbitCoderBlackRabbitCoder 548 days, 4 hours, 47 minutes ago
Saturday, November 26, 2011 4:25:17 AM GMT Friday, November 25, 2011 3:14:24 AM GMT
In the last three weeks, we examined the Action family of delegates (and delegates in general), the Func family of delegates, and the EventHandler family of delegates and how they can be used to support generic, reusable algorithms and classes. This week I will be completing my series on the generic delegates in the .NET Framework with a discussion of three more, somewhat less used, generic delegates: Predicate (more)
category: Web Dev | clicked: 33 | 2 comments | | source: blackrabbitcoder.net
tags: .NET, Generics, Little Wonders, C#, delegates, CSharp
3
Shouts

C#/.NET Little Wonders: The Generic Func Delegates

published 560 days, 1 hour, 35 minutes ago posted by BlackRabbitCoderBlackRabbitCoder 562 days, 7 hours, 37 minutes ago
Sunday, November 13, 2011 6:26:32 AM GMT Friday, November 11, 2011 12:24:49 AM GMT
Back in one of my three original “Little Wonders” Trilogy of posts, I had listed generic delegates as one of the Little Wonders of .NET. Later, someone posted a comment saying said that they would love more detail on the generic delegates and their uses, since my original entry just scratched the surface of them. Last week, I began our look at some of the handy generic delegates built into .NET with a description of delegates in general, and the Action family of delegates. For this week, I’ll launch i... (more)
category: Web Dev | clicked: 16 | 1 comment | | source: blackrabbitcoder.net
tags: .NET, Little Wonders, C#, delegates, Func, CSharp
4
Shouts

C#/.NET Little Wonders: The Generic Action Delegates

posted by BlackRabbitCoderBlackRabbitCoder 569 days, 6 hours, 43 minutes ago
Friday, November 04, 2011 1:18:52 AM GMT
Back in one of my three original “Little Wonders” Trilogy of posts, I had listed generic delegates as one of the Little Wonders of .NET. Later, someone posted a comment saying said that they would love more detail on the generic delegates and their uses, since my original entry just scratched the surface on them. So over the next few weeks, I’ll be looking at some of the handy generic delegates built into .NET. For this week, I’ll give a quick overview of delegates and their usefulness. Then I’ll lau... (more)
category: Web Dev | clicked: 3 | comment | | source: www.blackrabbitcoder.net
tags: .NET, Little Wonders, C#, delegates, CSharp, action
2
Shouts

C#/.NET Little Wonders: TPL Wonders - The Parallel.For() Method

posted by BlackRabbitCoderBlackRabbitCoder 583 days, 6 hours, 52 minutes ago
Friday, October 21, 2011 1:09:31 AM GMT
Previously, I had created some posts about the Task Parallel Library’s Concurrent Collections – which are very efficient collections designed for concurrent use with minimal contention – but in this next series of Little Wonders posts, I’d like to explore the parts of the TPL that can simplify and improve the way you perform parallel programming. For this week, we are going to start looking at the Parallel static class’s, For() static method, which is a quick and easy way to perform parallel processing ... (more)
category: Web Dev | clicked: 5 | comment | | source: blackrabbitcoder.net
tags: .NET, TPL, Little Wonders, Parallel, C#, for, CSharp
2
Shouts

C#/.NET Toolbox: Creating a "Safer" Task Dispose()

posted by BlackRabbitCoderBlackRabbitCoder 597 days, 7 hours, 9 minutes ago
Friday, October 07, 2011 12:52:42 AM GMT
So recently, I’ve been moving some older utility classes logic over to use the excellent .NET Task Parallel Library (TPL). This library contains, at it’s core, a class called Task which allows parallel programming without the need of working directly with threads. During this process, I wrote a few extension methods I found to be useful in dealing with tasks in an easier manner, and thought I’d share them in a few posts. Today's will discuss an extension method to make disposing a task a little bit "sa... (more)
category: Web Dev | clicked: 12 | 2 comments | | source: www.blackrabbitcoder.net
tags: .NET, TPL, C#, Task, ToolBox, CSharp, Dispose
2
Shouts

C#/.NET Little Wonders: String Padding and Trimming - Not Just for Spaces!

posted by BlackRabbitCoderBlackRabbitCoder 611 days, 8 hours, 1 minute ago
Friday, September 23, 2011 12:00:30 AM GMT
I’m going to wrap up my little side excursion into the String class with just a quick post on two features we’ve probably all used from time to time, but with a little twist: padding and trimming. Yes, we’ve probably all padded strings with spaces and numbers with zeros before, or trimmed off extra spaces, but did you know these methods aren’t just confined to whitespace? (more)
category: Web Dev | clicked: 0 | comment | | source: www.blackrabbitcoder.net
tags: .NET, String, Little Wonders, C#, CSharp, pad, trim
3
Shouts

C#/.NET Little Wonders: The String Remove() and Replace() Methods

posted by BlackRabbitCoderBlackRabbitCoder 618 days, 8 hours, 20 minutes ago
Thursday, September 15, 2011 11:41:02 PM GMT
When manipulating string data, many times you want to either remove parts of a String or replace characters in a String. You can do this yourself, of course, by building a new String while manually inspecting each char in turn, but this gets to be a bit expensive and is less maintainable. Instead, there are two methods in the String class, ready to use, that let you do this easily: Remove() and Replace(). (more)
category: Web Dev | clicked: 2 | comment | | source: www.blackrabbitcoder.net
tags: .NET, String, Little Wonders, C#, replace, remove, CSharp
4
Shouts

C#/.NET Little Wonders: The String Split() and Join() methods

published 623 days, 22 hours, 31 minutes ago posted by BlackRabbitCoderBlackRabbitCoder 625 days, 7 hours, 34 minutes ago
Saturday, September 10, 2011 9:30:21 AM GMT Friday, September 09, 2011 12:27:32 AM GMT
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. Today we are going to look at a pair of String method families to Split() and Join() string data. (more)
category: Web Dev | clicked: 11 | comment | | source: www.blackrabbitcoder.net
tags: .NET, Split, String, join, C#, CSharp
5
Shouts

C#/.NET Little Wonders: An Oft Overlooked String Constructor

published 630 days, 21 hours, 41 minutes ago posted by BlackRabbitCoderBlackRabbitCoder 632 days, 4 hours, 35 minutes ago
Saturday, September 03, 2011 10:20:57 AM GMT Friday, September 02, 2011 3:26:58 AM GMT
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 in the C# class that some folks newer to the language may be less aware of. This post takes a look at a version of the String constructor which lets you create strings of a repeated character easily and efficiently. (more)
category: Web Dev | clicked: 24 | comment | | source: www.blackrabbitcoder.net
tags: .NET, String, Little Wonders, C#, constructor, CSharp
5
Shouts

C#/.NET Little Wonders: Five Easy Sequence Aggregators

published 636 days, 11 hours, 15 minutes ago posted by BlackRabbitCoderBlackRabbitCoder 639 days, 5 hours, 40 minutes ago
Sunday, August 28, 2011 8:46:16 PM GMT Friday, August 26, 2011 2:21:44 AM GMT
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 perform some sort of aggregation across those sequences to find a calculated result. This may involve calculating the values of the sequence or projections on those values. We will look at Sum(), Average(), Min(), Max(), and Aggregate() (more)
category: Web Dev | clicked: 36 | 2 comments | | source: www.blackrabbitcoder.net
tags: .NET, Little Wonders, C#, Aggregation, CSharp, Linq
3
Shouts

C#/.NET Little Wonders: The ReferenceEquals() method

posted by BlackRabbitCoderBlackRabbitCoder 646 days, 7 hours, 55 minutes ago
Friday, August 19, 2011 12:06:16 AM GMT
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. But this method is an often overlooked method t... (more)
category: Web Dev | clicked: 2 | comment | | source: blackrabbitcoder.net
tags: .NET, Object, Little Wonders, C#, operator overloading, CSharp, ReferenceEquals
6
Shouts

C#/.NET Little Wonders & Pitfalls: The Complete Collection (so far...)

published 650 days, 11 hours, 8 minutes ago posted by BlackRabbitCoderBlackRabbitCoder 653 days, 8 hours, 53 minutes ago
Sunday, August 14, 2011 8:53:00 PM GMT Thursday, August 11, 2011 11:08:12 PM GMT
Since I gave my “Little Wonders” and “Little Pitfalls” of C#/.NET presentations at the St. Louis Day of .NET last week, I thought it would be a good idea to post an index of my posts for all of the Little Wonders and Little Pitfalls. So here are all of the Little Wonders and Little Pitfalls of C#/.NET that I have written so far. Enjoy! (more)
category: Web Dev | clicked: 33 | 1 comment | | source: www.blackrabbitcoder.net
tags: .NET, Little Wonders, C#, Little Pitfalls
2
Shouts

C#/.NET Little Wonders and Little Pitfalls at the St. Louis Day of .NET

published 657 days, 11 hours, 21 minutes ago posted by BlackRabbitCoderBlackRabbitCoder 660 days, 4 hours, 48 minutes ago
Sunday, August 07, 2011 8:39:59 PM GMT Friday, August 05, 2011 3:13:42 AM GMT
I'll be presenting my C#/.NET Little Wonders and Little Pitfalls presentations at the St. Louis Day of .NET Conference this weekend in St. Louis. These are the two presentations I will be presenting. (more)
category: Web Dev | clicked: 12 | 1 comment | | source: blackrabbitcoder.net
tags: .NET, Little Wonders, C#, Little Pitfalls
3
Shouts

C#/.NET Little Pitfalls: Default Parameters are Compile-Time Substitutions

published 664 days, 12 hours, 9 minutes ago posted by BlackRabbitCoderBlackRabbitCoder 667 days, 8 hours, 30 minutes ago
Sunday, July 31, 2011 7:52:05 PM GMT Thursday, July 28, 2011 11:31:26 PM GMT
Default parameters have been around forever both in C++ and in VB. When Java was introduced, however, they were eschewed as being a problematic source of potential code-safety issues. Having been bitten by default parameters before in less strongly-typed languages, I can understand this to an extent. But in many ways this forced us to write heavier code (using overloads) where a default parameter would have been easier to maintain. Java seemed to throw out the baby with the bathwater, just in my opi... (more)
category: Web Dev | clicked: 15 | comment | | source: www.blackrabbitcoder.net
tags: .NET, C#, CSharp, Little Pitfalls, Default Parameters
2
Shouts

C#/.NET Little Pitfalls: The Default is to Hide, Not Override

published 672 days, 23 hours, 48 minutes ago posted by BlackRabbitCoderBlackRabbitCoder 674 days, 8 hours, 30 minutes ago
Saturday, July 23, 2011 8:13:37 AM GMT Thursday, July 21, 2011 11:31:46 PM GMT
C# is a wonderful language for modern programming.  While everything in C# has a reason and a place, occasionally, there are things that can be confusing for a developer who isn’t aware of what is happening behind the scenes. Today we are going to look at a potential pitfall that can bite developers who expect the default behavior of declaring the same method (with same signature) in a subclass to perform an override. In particular, if the developer came from the C++ world, this may run counter to th... (more)
category: Web Dev | clicked: 10 | 1 comment | | source: www.blackrabbitcoder.net
tags: .NET, hide, override, C#, CSharp, Little Pitfalls