Friday, November 25, 2005

Dear Sign

I took up a new hobby when I moved back to Idaho a few years ago, deer hunting. What began as a simple interest has now flared to an annual 6 week obsession. My wife is usually pretty good about the time I spend out in the woods. However, by the end of November I begin overhearing whispered words such as “intersession” and “addiction” in her phone conversations.
I really blew it big just two Saturdays ago when I spent the whole day, dawn-to-dark hunting. Just a normal November Saturday except this time I was leaving the next day for a week-long training class. This would have been a good time to have studied “dear” sign instead of deer sign because I missed all the clues. I am resolved not to make that mistake again.
This week’s hunting is off to a promising start. Because of Thanksgiving, I will have Thursday morning and all the weekend to find that big buck I missed. I won’t be in trouble with my wife because all the relatives will be here to keep her company. As I head out the door with rifle in hand I catch a funny look from my wife…I think a relative is starting to get on her nerves.

Tuesday, October 18, 2005

Beware Of Crosswalks

All over Sandpoint are signs declaring “Sandpoint is a walking town” reminding motorists to stop for people in crosswalks.  The Sandpoint Police Department is ever vigilant to enforce this law.  Perhaps the police would not have to work so hard if more pedestrians acted in the manner of this elderly woman.
Enjoy!

Thursday, October 06, 2005

Web Application Settings With XML

The Web.config file of an ASP.Net web application is a good place to store settings for the application (see Reading from the Web.config File). However, one problem I’ve run into is editing the Web.config resets the web application. I needed a way to change settings for several dynamic user controls without resetting the whole application.
The class below will load the file from cache or the file system. It is then available to retrieve the node value requested. In addition, naming the file with a “.config” extension instead of “.xml” will prevent IIS from serving the xml file to browsers.

Additional functions can be added to provide short cuts to frequently accessed values, such as database settings.


using System;
using System.Web;
using System.Xml;
using System.Web.Caching;

namespace WebTools
{
public class Settings
{
private XmlDocument m_XmlDoc = null;

public Settings(string XMLSettingsFile)
{
m_XmlDoc = new System.Xml.XmlDocument();
// Check if file can be loaded from cache
if (HttpContext.Current != null && HttpContext.Current.Cache[XMLSettingsFile]!= null)
{
m_XmlDoc = (XmlDocument)HttpContext.Current.Cache[XMLSettingsFile];
}
else
{
string filePath = null;
// Get the complete file path
filePath = HttpContext.Current.Server.MapPath(XMLSettingsFile);

m_XmlDoc = new System.Xml.XmlDocument();
m_XmlDoc.Load(filePath);

//save in a file based cache
if (HttpContext.Current != null)
{
HttpContext.Current.Cache.Insert(XMLSettingsFile,m_XmlDoc,new CacheDependency(filePath));
}
}
}

public string GetValue( string nodePath)
{
XmlNodeReader myXmlNodeReader;
myXmlNodeReader = new System.Xml.XmlNodeReader(m_XmlDoc.SelectSingleNode(nodePath).FirstChild);
myXmlNodeReader.Read();
return myXmlNodeReader.Value();
}
}
}

Friday, September 30, 2005

Going Mental?

Do you ever feel like you're becoming a mental case. Try calling the Irish Mental Health Line (here).

Wednesday, September 21, 2005

Ready? Cue the Sun... - New York Times

This is funny! I can just picture the Robert's confirmation hearings playing out like a translated Japanese movie, their lips are moving but this is really what they are saying.
Times Opinion: Ready? Cue the Sun...

Tuesday, August 16, 2005

Using the XMLHttpRequest Object and AJAX to Spy On You

I haven't made the time yet to play with AJAX (Asynchronous JavaScript and XML). It seems to be a great way to program a more interactive user interface for the web. Google Maps is a good example of the usefulness of this approach. I also agree that there are some hidden dangers to this new approach as this article, Using the XMLHttpRequest Object and AJAX to Spy On You, discusses. I think time will tell if AJAX will become the web application architecture of the future or not. My prediction is it will be another useful tool that will continue to gain in popularity and gain an equal footing with traditional "post and response" web applications.

Wednesday, July 13, 2005

Lake Pend Oreille Sailing

I'm getting ready to take my sailboat out this afternoon for the first time this summer. One place I check for current conditions out on the lake is the LPO Current Weather Table site. This site even has a web cam. My sailboat is an 14" O'Day Javelin, a day sailor, easy to launch. I'm pumped about taking the boat out tonight.

Tuesday, June 28, 2005

Backyard


I had a little help planting my backyard last weekend. My son wanted to help and he did a great job copying what dad was doing.
My dog, Shelby, was another story, it will be a miracle if grass grows at all after her antics. She had a great time running through the sprinkler, jumping up to catch the water dropplets. Then, throughly soaked she would take a good roll in dry, dusty area I hadn't watered yet.

Wednesday, June 22, 2005

Singing In The Cube

There I was minding my own business, tuned out to the world, loudly listening to music with my headphones on. It is a great way to focus on writing code and tune out the regular business noise around me. Unfortunately, I tuned out too much and spontaneously broke out in song. Unfortunate for my cube-mates as well I suppose.