Why StringComparison.Ordinal Is Usually the Right Choice

By Eric — 2 minute read

A question that arose in response to my previous post (about how string comparisons can produce unexpected results when done in a culture-sensitive way) was Which is right, StringComparison.Ordinal or StringComparison.InvariantCulture? The short answer: StringComparison.Ordinal.

There is a good article explaining the differences between the StringComparison enum …

Read more...

Unicode Surprises

By Eric — 2 minute read

I got a defect from QA today saying that our product was unable to track files in paths containing Unicode characters. I'll admit that I was skeptical. I had just tried that myself the other day and it worked perfectly. Trying it again today also worked perfectly, but the QA …

Read more...

.NET BackgroundWorker Summary

By Eric — 3 minute read

The System.ComponentModel.BackgroundWorker class makes it easy to code a long running operation with the ability to provide progress, cancellation, and notification of completion. It is particularly nice for UI because while the long running operation executes on a thread pool thread, notifications of progress and completion are marshalled …

Read more...

Coming Up Gadget - A Windows Desktop Gadget

By Eric — 1 minute read

Download

Download Gadget
Version 0.9.3
08 Jun 2010
Around 20 KB

Coming Up Gadget is a reminder tool for upcoming events for Windows Vista or Windows 7. It retrieves events either from Microsoft Outlook or a Google Calendar account (including Google Apps). Coming Up is intended to remind …

Read more...

Temporary CommandBar Customizations in Word

By Eric — 3 minute read

It's common for an Office add-in to put some custom menu items or toolbar buttons in the UI of the hosting application. The method to call to do this is CommandBars.Add. It is also typical that you'd like those customizations to appear so long as the add-in gets loaded …

Read more...

Them Newfangled Cellphone Things

By Eric — 4 minute read

I have to admit to being a bit of a Luddite when it comes to cell phones. In spite of being in the generally gadget-friendly demographic of software engineers, and someone who bought the very first Palm Pilot model within days of its launch, I've not yet owned a cell …

Read more...

Sleep Mode from .NET

By Eric

I have a little backup program that I wrote that includes the ability to shut down the machine when a backup is complete. I wanted to add the option of putting the machine to sleep instead of shutting down, but it took me a while to figure out how to …

Read more...

Culture Shock

By Eric — 3 minute read

Over twenty years ago, I moved from Oregon to Utah to start going to school at BYU. As we were driving to Provo from the north, my mom, who had been born in Utah, commented, "This place right here is called the point of the mountain."

"That's stupid, there's nothing …

Read more...

Office Open XML Deep Dive

By Eric — 2 minute read

Last week I went to San Francisco to take a dive off the deep end into the new XML file formats in Microsoft Office 2007. The training was hosted by MindJet, and presented by Doug Mahugh of Microsoft, and Chris Predeek, a consultant who put together the code samples for …

Read more...

Finding Unmanaged Memory Leaks

By Eric — 5 minute read

At work we had a long-running .NET process whose memory usage seemed to be going up, but not coming down. In investigating, I learned a few things about leak hunting, and ultimately tracked down perhaps the most insidious leak I've ever seen.

My first approach was to try to profile …

Read more...