An easy stack layout panel for WinForms

This is a simple, but useful tip. Users of WPF are spoiled. They have all sorts of layout options. Those of us still working in WinForms have FlowLayoutPanel and TableLayoutPanel. That’s it. WPF has those and more.
For my current project, I needed a panel to layout controls vertically. The TableLayoutPanel can be awkward to work [...]

Popularity: 11% [?]

NDepend: A short review

NDepend is a tool I’d heard about for years, but had yet to really dive into recently. Thanks to the good folks developing it, I was able to try out a copy and have been analyzing my own projects with it.
Here’s a brief run-down of my initial experience with it.
Installation
There is no installation file—everything is [...]

Popularity: 10% [?]

log4cxx + VS2005 + Windows SDK v6.0 = compile error

If you are following the instructions to build log4cxx 0.10 in Visual Studio 2005, and you have the Windows Platform SDK v6.0 installed, you may get errors compiling multicast.c in the apr project.
I found the solution, and it’s pretty easy. Open up multicast.c and edit the lines:
136: #if MCAST_JOIN_SOURCE_GROUP
148: #if MCAST_JOIN_SOURCE_GROUP
to [...]

Popularity: 7% [?]

Formational Experiences

When I was 9, I started playing with GW-BASIC by typing in programs found in the old kid’s 3-2-1 Contact magazine. This soon progressed to QBASIC, where I mostly made cool graphics with lines and circles.
(click for larger image)
QBASIC is not included in Windows anymore, but you can still get it.
 
(click for larger image)
I had [...]

Popularity: 7% [?]

Tracking database changes using triggers

Tracking changes in database tables is an incredibly useful feature–especially for operational data that can change often. Having recently had to implement this feature, I thought I’d share some of the techniques I learned.

Sample Database
First, let’s conceptualize a very simple database consisting of user information (name, date of birth), and e-mails. A user can have [...]

Popularity: 6% [?]

Announcing: GeekSoftworks.com

I’ve setup a new domain for a front page for my software hobbies and what will eventually be my “store front”:
Geek Softworks
It uses WordPress, but it’s not a blog–it’s for the software I write. So far, only a few products are up, including DiskSlicer (a new version!), Windows Media Top 10 Plugin, and Word Count [...]

Popularity: 3% [?]

In this universe we obey the law of commutativity

This kind of thing has happened to be a few times now, so I thought I’d share the fun.
In one of our pieces of software we have a process that looks like this:

void MyThread()
{
while (true)
{
DoFunctionA();
[...]

Popularity: 4% [?]

GetTextExtent vs. DrawText (with DT_CALCRECT)

Working on an MFC app that has just been converted to Unicode (finally!), I noticed that one button (which is created dynamically) is too small to fit the text in Korean (and Russian and a few other languages).
The code was calling something like:

CSize sz = m_btAdjustColors.GetDC()->GetTextExtent(sCaption);

It seems correct, but these script languages are throwing it [...]

Popularity: 5% [?]

Never make assumptions about performance

The importance of measuring performance changes is a topic that has been covered by others smarter and more experienced than me, but I have a recent simple tale.
I’ve simplified the code quite a bit in order to demonstrate the issue. Suppose I have a wrapper around an image (it has many more attributes):

[...]

Popularity: 5% [?]

6 Ways to Increase Your Confidence As You Code

One of the key requirements for being able to reliably update software is the confidence that the changes you are making are safe. The amount of confidence required increases with the complexity of the system.
In my day job I work on a real-time messaging system that can have very, very little downtime. As the service [...]

Popularity: 19% [?]