"All we have to decide is what to do with the time that is given to us." -- J. R. R. Tolkien
Friday, November 25, 2005
Dear Sign
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
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?
Wednesday, September 21, 2005
Ready? Cue the Sun... - New York Times
Times Opinion: Ready? Cue the Sun...
Tuesday, August 16, 2005
Using the XMLHttpRequest Object and AJAX to Spy On You
Wednesday, July 27, 2005
Wednesday, July 13, 2005
Lake Pend Oreille Sailing
Tuesday, July 12, 2005
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.