Regular Expressions and LINQ

Regular expressions are a great, albeit sometimes overused, tool for parsing and extracting text data. Sometimes I find myself looking at a list of data that I want to execute a regular expression against. I could do a for loop or encode a Regex match in a lambda but both interrupt the flow and require […]

Query Excel File Using LINQ

Lately at work I’ve had to pull data from a variety of Excel worksheets. Excel interop is quite handy, but making sure to release the used COM objects and dealing with ranges can be quite a pain. I found a nice little article that shows a basic example of loading all the data from a […]

Code Complete Wisdom

Steve McConnell’s Code Complete is a classic work in computer science. A friend sent along these quotes. The penalty for failing to define the problem is that you can waste a lot of time solving the wrong problem. This is a double-barreled penalty because you also don’t solve the right problem. And a corollary: Paying […]

Renewing Self-Signed “Temporary” Certificates

If you’re like me—writing internal apps for a small company—you create your own self-signed certificates when publishing a ClickOnce application. Visual Studio will create these certificates for you automatically on the first publish, but they’ll only be good for a couple of years. That’s when you find yourself under pressure, updating a malfunctioning application, and […]

Editable Label in WPF

While still in the dark woods of learning WPF, I was completely lost trying to fulfill a requirement to make an editable label that showed a formatted value when not selected. In my case, the formatted value would round a decimal value to a few digits to make long number more readable. I asked over […]

Detect InputBox Cancel

So we’ve all had the situation where we’d like to get an input from the user and we’re not too keen on creating a form, adding controls, and writing all the other underlying functionality. Many times, it’s just a lot easier to use an InputBox and validate the data afterward. Usually everything will go smoothly, […]