December 31st, 2007
I sometimes wonder how often the default paste operation in an application is appropriate. Maybe I’m abnormal (maybe?) but it seems like 73.2% of the time, I want pasted text to match the formatting of where it is going rather than where it came from. I guess the exception is when I’m copying and pasting from within the same document. The result is that I use “Paste Special” a lot.
Read the rest of this entry »
2 Comments |
Office |
Permalink
Posted by Eric
October 15th, 2007
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.
Read the rest of this entry »
2 Comments |
.NET, Programming, Windows |
Permalink
Posted by Eric
October 11th, 2007
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 engineer showed me otherwise.
Read the rest of this entry »
No Comments » |
.NET, Bafflers, Programming, Windows |
Permalink
Posted by Eric
October 10th, 2007
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 back to the “main” thread. (When I say “main” thread, I mean the one on which BackgroundWorker.RunWorkerAsync() is called.)
Read the rest of this entry »
No Comments » |
.NET, Programming |
Permalink
Posted by Eric
September 4th, 2007
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, but not appear if it doesn’t. If your add-in gets uninstalled, for example, you clearly don’t want left-over customizations littering the application. For this reason, the Add method’s final parameter is a boolean that indicates whether a particular added control should be added temporarily. The documentation describes the parameter like this:
- Temporary
- Optional Object. True to make the new control temporary. Temporary controls are automatically deleted when the container application is closed. The default value is False.
This looks perfect. You can add the customizations at startup, and they’ll be gone at shutdown… except that it doesn’t work in Word.
Read the rest of this entry »
1 Comment |
Office, Programming |
Permalink
Posted by Eric
September 1st, 2007
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 phone. But that may actually change soon.
Read the rest of this entry »
No Comments » |
Hardware |
Permalink
Posted by Eric
August 29th, 2007
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 accomplish this.
Read the rest of this entry »
No Comments » |
.NET, Programming, Windows |
Permalink
Posted by Eric
July 20th, 2007
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 here!” I remember saying, a bit more harshly than was appropriate. I think my mom was a little taken aback, and didn’t bother to try to justify why the place deserved to have a name: It separates Utah valley from the Salt Lake Valley, and the counties with corresponding names; it’s the highest point on I-15 through the Wasatch Front and the place you’ll most likely hit snowy roads.
I realized later that I was just experiencing culture shock. After an email discussion with a coworker today, I realized that culture shock is possible between programming environments.
Read the rest of this entry »
No Comments » |
Software Development |
Permalink
Posted by Eric
June 28th, 2007
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 the hands-on labs.
Read the rest of this entry »
1 Comment |
Office |
Permalink
Posted by Eric
June 25th, 2007
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.
Read the rest of this entry »
No Comments » |
.NET, Bafflers, Programming |
Permalink
Posted by Eric