- January 2006 (1)
- January 2007 (1)
- July 2007 (8)
- August 2007 (3)
- September 2007 (3)
- October 2007 (2)
- November 2007 (3)
- January 2008 (5)
- February 2008 (4)
- March 2008 (1)
- April 2008 (5)
- June 2008 (3)
- July 2008 (2)
- August 2008 (1)
- September 2008 (6)
- November 2008 (3)
- December 2008 (1)
- January 2009 (4)
- March 2009 (1)
- April 2009 (14)
- May 2009 (9)
- June 2009 (7)
- July 2009 (6)
- August 2009 (4)
- September 2009 (4)
- October 2009 (2)
- November 2009 (23)
- December 2009 (23)
- January 2010 (4)
- February 2010 (3)
September 2007
.NET Event Logging
Thu, 09/20/2007 - 14:49 | by Kris(Nobody else will care about this. Move along. Nothing to see here now. Maybe I'll clean this up for public consumption later.)
After spending way too much time figuring out how to change the name of a custom event log my .NET-based service was writing messages to, I decided I need to save the snippet of code that finally worked.
For more info about the confusing world of .NET's EventLog class, see http://www.informit.com/guides/printerfriendly.aspx?g=dotnet&seqNum=238.
namespace BlahBlahBlah
{
class Log
{
// Lots of stuff left out here.
// ...
private static EventLog eventLog = null;
private static readonly string eventSource = "My Service";
private static readonly string eventLogName = "My Log";
private static readonly string eventLogMachineName = "."; // local
///
/// Initializer for Log class
///
static Log()
{
// Register this event source if necessary
try
{
bool needCreate = false;
if (EventLog.SourceExists(eventSource))
{
string logName = EventLog.LogNameFromSourceName(eventSource,
eventLogMachineName);
if (logName != eventLogName)
{
EventLog.DeleteEventSource(eventSource);
needCreate = true;
}
}
else
{
needCreate = true;
}
if (needCreate)
{
EventLog.CreateEventSource(eventSource, eventLogName);
}
}
catch
{
// Ignore failure
}
// Initialize our EventLog instance
try
{
eventLog = new EventLog(eventLogName, eventLogMachineName, eventSource);
// Ensure our event log has the "overwrite as needed" setting
eventLog.ModifyOverflowPolicy(OverflowAction.OverwriteAsNeeded,
eventLog.MinimumRetentionDays);
}
catch
{
// Ignore failure
}
}
// Lots more stuff left out
// ...
}
}
New Eyeglasses
Wed, 09/19/2007 - 20:11 | by KrisI've worn contact lenses since I was a teenager. I've never liked eyeglasses: they're too heavy, too fragile, too dusty, and just plain uncomfortable. In contrast, contacts are lightweight, they rarely get dirty, they provide peripheral vision, and you don't have to wear ugly clip-on sunglasses over them. I've never understood why anyone would prefer glasses, other than because their eyes simply can't handle them.
But, a persuasive woman suggested she'd like to see me in glasses more often, so I decided to give glasses another try. My fifteen-year-old pair had very large lenses, which are great for visibility but they are heavy and unfashionable. I wore them only in those rare times when my eyes were irritated by allergies or other problems. I decided to try some new frames, and after some searching, settled on this Ray-Ban #6127 Bronze frame.
I figure I'll wear them for the rest of the week to see if I can get used to them. I expect to be back in my contacts next week, except for time spent with the persuasive woman.
UPDATE: I hate wearing them, but the persuasive woman likes them, so, well...
Medication
Tue, 09/18/2007 - 01:18 | by KrisLast week, I had my first complete physical exam in twenty years. I figured that, because I'm 40, I ought to get one. I was wondering what problems they might find.
EKG, heart sounds, lungs, reflexes, and everything were fine. However, my blood pressure was high. It was also high when I had my aviation exam, and both my parents have high blood pressure, so I finally had to accept the fact that I have a problem that probably can't be solved with rest, exercise, and a good diet. The doctor prescribed a daily dosage of blood pressure control medication.
Medication. In one sense, it's no big deal; lots of people are on medication. But, for the first time, I've been prescribed a daily dosage that I'll probably have to take for the rest of my life.
Does this make me officially middle-aged?
UPDATE: This means that if I want to fly again, I'll have to get cleared by the FAA medical staff again, which is a 4-to-6-week procedure. My medication is one that is approved by the FAA, but they review such things on a case-by-case basis.

Recent comments
4 days 1 hour ago
1 week 3 days ago
1 week 3 days ago
1 week 4 days ago
1 week 5 days ago
3 weeks 3 days ago
3 weeks 5 days ago
3 weeks 6 days ago
5 weeks 5 days ago
6 weeks 1 day ago