Get Organized with Confluence

I’m a minimalist for sure. I hate piles of crap. Bills on the table and receipts in a cabinet. Manuals on shelves and taxes in the closet. Hundreds of emails. Passwords scribbled down on post-it notes. Table of Contents Getting Organized Setting Up Spaces Creating Pages The “Search” Feature A (Constant) WIP! Getting Organized The problem is, what do you do with all that stuff? A file cabinet and a shredder are good starting places. So is deciding what you actually need/want to keep, instead of keeping everything “just in case”. There will never be a situation where »

Under the Hood - Ternary Operator [ ?: ]

Someone posted the following question on Stack Overflow today: (since deleted) Is there a better way according to best practices to do this type of ternary operation without breaking it down into an if block? visitorInfo = string.IsNullOrEmpty(visitorInfo.latitude) ?  DetermineGeolocation(visitorInfo) : visitorInfo; Meaning, without breaking it into a complete if block, is there a way to avoid saying visitorInfo = visitorInfo on a false condition? Maybe something like: DoNothing() or some similar coding construct? I made the following comment, which may not have seemed entirely helpful to him, but it’s accurate. A ternary operation is equivalent to an if/ »

"Find and Replace" as Default Search in Visual Studio 2013

Visual Studio 2013 provides two search boxes, similar in functionality but differing considerably in design. The first one, accessible using Ctrl+F, is minimalist, pushed into the corner with all the controls packed together as tightly as possible. 5449-VisualStudio2013FindBox" title="" /> The second, accessible using Ctrl+Shift+F, is a more “standard” one, with ample spacing and utilizing the familiar popup dialog box. 0421-VisualStudio2013FindReplaceBox" title="" /> I imagine this is part of the ongoing effort to keep things “flattened” and maintain focus in the current screen (consider Peek Definition and the scrollbar’s Preview Tooltip). But I no like. It’s awkward »

Scott Hanselman and Rob Conery, on Engaging with the Tech Community

When I started programming, I had no clue about the wider technical community. It was several years before I went to my first user group. Since then, I’ve found others (thank you Meetup). The format of each is a bit different, but I enjoy them all. But sometimes it’s hard to get away for an evening. We’ve all got busy schedules and other obligations contending for our time. I’ve got 4 kids, so there’s always something going on. How else can I get involved? What other opportunities are available? After watching Get Involved!, I realize »

Mocking Dependencies (silly dependency! um... not that kind of mocking)

The code in this post is also available on Github. In a mood at work the other day (after hunting down some obscure bug that would’ve been more apparent, had I had some relevant failing tests to point me in the right direction), I started back-filling old code with unit tests. That meant removing some dependencies on things I didn’t actually need to test, so I’ll post a few (contrived) examples. Table of Contents Don’t Rely on External Dependencies Example 1: Mocking Your Own Classes Example 1b: Mocking the Interface Your Class Implements Example 2a: Mocking »

Review: Visual Studio 2013 Cookbook, by Jeff Martins and Richard Banks

I was recently offered a complimentary copy of Visual Studio 2013 Cookbook. This was timely, since I focus primarily on the Microsoft stack and use Visual Studio 2012 daily, and our team at work is considering upgrading soon. Before you read further, note that this book is neither an in-depth guide to Visual Studio for someone who’s never used it before, nor a complete tutorial on the C# language, .NET 4.5 / 4.51, or any particular construct(s) therein. Instead, this book is split between general enhancements, such as the Quick Find box and continuous testing, and enhancements »

Simple environments for quickly testing .NET functionality

This post was inspired by a question on SO. It was a simple question about what the integer data type in C# does with the decimal portion of a number. The question itself is not the point, as much as the fact that it could have easily been avoided altogether by running the code and comparing the results. The astounding part was this statement: “I have to know before I run the code, cause it will jack everything up if it is wrong.” Really. The only environment he has available to test code is production?! Yikes. Needless to say, he »

Our First "Raised Bed" Garden

Last year was the first time we really tried to put in a garden. I did no reading at all, bought some “top soil” from Lowe’s, tilled a corner of the yard tucked behind the garage under a tree and… yeah. It didn’t do great. Go figure. This year, I did some actual reading first. One topic I kept coming across was raised garden beds. The main advantages are better drainage (in wet areas) and easier to setup (vs tilling hard soil/clay). I wanted to get the garden out into the middle of the yard, but it’ »

Visual Studio - Add File As Link

We have a particular project in our solution at work, serving as a data access layer. It contains classes with two purposes: A few generic classes that can accept a few interfaces and actually handle retrieving any requested data Many other classes implementing those few interfaces, which request specific data (employees, customers, etc) Then someone on the team created separate projects with new classes to request data. They needed access to the more general classes in the first project, but simply referencing that project would pull in all kinds of references to other projects along with it… references the new »

Relative Ordering with IComparable and CompareTo

Someone asked a question on StackOverflow about the difference between the int CompareTo method and an ordinary If condition. As it turns out, the poster’s if statement is exactly how Int32 implements CompareTo. The IComparable and IComparable<T> interfaces each have only a single method, which can be used to compare two objects for the purpose of determining how they should be ordered relative to one another. // IComparable<T> - Compares the current object with another object of the same type. int CompareTo(T other); // IComparable - Compares the current object with another object. int »