Code


Config files are easy to do in .net 2.0 and up. You add a little file to your project through the properties dialog and poof, you’ve got a strongly typed settings file stored in an easy to edit XML file.

Well, I deployed a dll with a config file (conveniently named dllfilename.dll.config) to our business server and despite all of the Settings.Default.Reload() statements that I put in, the darn thing would never update with the values that I put in there.

After I created a test project and fooled around with it a while, I came to understand that if you have an EXE calling a dll, the config file that your dll is going to look for will be named exefilename.exe.dll!

Sure would have been nice for microsoft to make that more prominent in their documentation!

So, after a few dozen failed attempts at asking Google for the answer, I finally figured out the correct wording to find what I needed…

…and of course it’s an ill-documented “magic word” to get it done…

AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", @"C:\somepath\someconfigfile");

So there it is, maybe next time someone wants to specify a config file for their dll, or override or replace or specify their own config file for an assembly, all of the words that I just typed out will help them find it….

One of the most frustrating things about working with MS’s Composite UI Application Block or CAB has been the inability to use the search function over at the GotDotNet forums.

Well, opensource to the rescue….

A gracious user just started a Wiki for the Composite UI Application Block over at http://cabpedia.com.

Hopefully this post will help spread the word about the new site so more users can contribute :)

A-motivated is the name of the game.

I *hate* VB6.

Someone please kill me (or give me another job)…

But on an uplifting note HelluvaBlog is back online…

And Mr. Horsepower has been kicking out some outstanding music reviews. Check out his Made/Remade series that’s showcasing some very interesting covers that have been made.

Well, I just took a few seconds and found all of the missing end tags, double li tags, etc and I’m finally W3C XHTML transitional valid…

Valid XHTML 1.0 Transitional

And my CSS is valid as well, YAY!

Valid CSS!

So I’ve spent most of this day at work playing around with WordPress, and various plugins that have been made for it.

For instance This Audioscrobbler plugin for WordPress made by Chris Coggburn. (Seen at the right under Recent Tracks) Unfortunately, Chris no longer updates that blog, and I can’t post the fix to a bug I found in his script.

I am not a PHP guru (by any means), but a bit of google goes a long way…

Anyway, here’s the fix, hopefully google will pick this up and it will help some other helpless soul out along the way:


Ok, i figured out why this thing is refreshing the cache file on each hit (at least on my site)

the function time() returns the number of seconds since the Unix Epoch and the function that is trying to figure out if the cache file needs to be updated uses it.

But it uses teh multiplier $rdfcachetime as if it’s for minutes because it only multiplies it by 60 instead of 3600 (the number of seconds in an hour).

So basically, change the following line (in audioscrobbler.php):
if (((!file_exists("cache_".$asusername.".rss")) || (time() - filemtime("cache_".$asusername.".rss")) > ($rdfcachetime * 60))) {

TO:
if (((!file_exists("cache_".$asusername.".rss")) || (time() - filemtime("cache_".$asusername.".rss")) > ($rdfcachetime * 3600))) {