Obvious in retrospect, but took me a minute to catch on to what’s going on here: This works like a trooper until someone passes in a byte.MaxValue in a unit test and i becomes 0 after reaching maximum and getting incremented again.
All posts by Anna Lear
How to create an infinite loop
Posted by Anna Lear on September 2, 2010
http://annalear.ca/2010/09/02/how-to-create-an-infinite-loop/
Are Comments Evil?
I’m a bit late to this party, with the majority of the opinions on the subject having been weighed in last week and the week before it, but after reading Jesse Liberty’s Coding Without a Net post and then Davy Brion’s response to it, I’ve been noodling on my own usage of comments in code [...]
Posted by Anna Lear on August 26, 2010
http://annalear.ca/2010/08/26/are-comments-evil/
New desktop specs
I have used a laptop as my main machine for a couple years now. I guess calling it a laptop would be a bit of a misnomer — it is an Alienware m9750, a relative powerhouse for its time, weighing in at 10 lbs and making my car think I’m a bad driver who lets [...]
Posted by Anna Lear on August 8, 2010
http://annalear.ca/2010/08/08/new-desktop-specs/
Why Excel thinks your CSV is a SYLK
Just a quick post to share a tip I discovered this morning. I was generating a CSV file and for some reason when I went to open it in Excel, I got a message saying the file’s extension was CSV, but the file format was SYLK. Clicking through a couple message boxes opened the file [...]
Posted by Anna Lear on June 10, 2010
http://annalear.ca/2010/06/10/why-excel-thinks-your-csv-is-a-sylk/
On Importance of Good Method Names and Paying Attention
I spent a somewhat frustrating hour at work today trying to plot a straight line on a chart using a framework that shall remain nameless. I quickly had the slope and the y-intercept worked out and all I needed were two x values to plug into the equation to calculate some points. I already had [...]
Posted by Anna Lear on May 25, 2010
http://annalear.ca/2010/05/25/on-importance-of-good-method-names-and-paying-attention/
ComboBox SelectedItem vs SelectedValue Question
Annoying discovery of the day: The following code works as you’d expect — MyProperty on the model is updated when the user picks a new item in the dropdown. The following, however, doesn’t work the same way and the model update isn’t triggered until the input focus moves to another control on the form: Does [...]
Posted by Anna Lear on May 21, 2010
http://annalear.ca/2010/05/21/combobox-selecteditem-vs-selectedvalue-question/
Replace Paper with Unit Tests: Code Snippets Edition
In my previous post about making mental notes about condition tests or new features through unit tests I offered an example of making a live template in ReSharper to automate some of the process. This post is about achieving a similar thing in plain Visual Studio with the help of the Code Snippets feature. Introduction [...]
Posted by Anna Lear on May 16, 2010
http://annalear.ca/2010/05/16/replace-paper-with-unit-tests-code-snippets-edition/
Toronto Code Camp 2010: Lessons Learned
This weekend I had the great opportunity to attend Toronto Code Camp 2010. It was my first code camp and my first major dev-related event, so I was pretty excited all around. I’m happy to say it didn’t disappoint. Over the next few days I’ll post some of the notes I’ve made and/or links to [...]
Posted by Anna Lear on May 3, 2010
http://annalear.ca/2010/05/03/toronto-code-camp-2010-lessons-learned/
Replace paper with unit tests
TDD, or Something Like It When I write new code, I often start out following the TDD principles: write a test, make it pass, refactor. But often, as I’m doing the refactoring or even the initial implementation, I find myself thinking of other tests I should do or features I should add. Instead of jotting [...]
Posted by Anna Lear on April 7, 2010
http://annalear.ca/2010/04/07/replace-paper-with-unit-tests/
ILMerge + Castle + Log4Net
At work we have recently merged the various Castle assemblies into one with ILMerge. It has worked great, but we found one gotcha with the Log4Net facility. Castle’s LoggingFacility class defines class types of various logging factories as static strings, which aren’t picked up by ILMerge. The solution has two parts: 1. Use the CustomLoggerFactory [...]
Posted by Anna Lear on March 3, 2010
http://annalear.ca/2010/03/03/ilmerge-castle-log4net/