Tag Archives: C#

Building a site – Part 2

Implementing¬†towards Alpha Now that I have the initial idea for waidmonitor.com, the next thing to do was to figure out the big technical unknowns of the project: How to get the current users window & detect if the user is … Continue reading

Posted in .Net, Architecture, C# | Tagged , , , , , | Leave a comment

Flume from C#

Apache Flume is a distributed, reliable, and available service for efficiently collecting, aggregating, and moving large amounts of log data. Flume has an appender for log4j, but no support for log4net or NLog was provided. ¬†I created a opensource appenders … Continue reading

Aside | Posted on by | Tagged , , , , | Leave a comment

Project Euler – Math Is Fun

I recently came across Project Euler – A cool site with interesting math problems to solve. It has hundreds of problems to solve and it keeps track of what problems you have solved. The site also lists the number of … Continue reading

Posted in C# | Tagged , , , | Leave a comment

IEnumerable Guard Clause Best Practice

IEnumerable is C#’s built-in implementation of the iterator design pattern. It’s very powerful. Below is how to iterate through IEnumerable in C#: The Gotcha. IEnumerable defers execution until code actually acts on the elements returned from IEnumerable. This also defers … Continue reading

Posted in C#, Unit Testing | Tagged , , , , | Leave a comment

Create a MSBuild Task

MSBuild comes with a lot of excellent built-in build tasks and there are also well-supported open source Build tasks such as MSBuild Community Tasks. I have found myself wanting something not available in any of those tasks. In this post … Continue reading

Posted in C# | Tagged , , | Leave a comment

Reading an Excel .xlsx file from C#

*Updated 06/28/2017* – Fixed the code sample. It was simply wrong before. I have often written code to parse CSV files. Excel supports editing CSV files so this seemed to be a good method of managing moderate-sized data sets. I … Continue reading

Posted in C# | Tagged , , , , | 15 Comments

Service Architecture: DRY vs SRP Principles

When building n-tiered services, the Single Responsibility Principle (SRP) appears to violate the Don’t-Repeat-Yourself (DRY) Principle. This can best be seen when comparing an OData/Entity-Framework service and a more traditional service. Traditional Service In a traditional service, to expose a … Continue reading

Posted in Architecture | Tagged , , , | Leave a comment