Problems with Day() and CreateTimeSpan()

I'm attempting to use CreateTimeSpan() to hold information about how long my system will be down for maintenance given a starting date and time, and I've been running into a few interesting issues. I'd have thought that this would be a simple matter, as adding a timespan to an existing time stamp would be a useful mechanic, but it seems as though there are some hidden gotchas and, perhaps, some outright bugs.

 

Useful Link: Hacking your ColdFusion Administrator Password

I found myself in a tight spot earlier today; I couldn't remember the password I supplied to ColdFusion Administrator on one of my machines. Since Adobe doesn't offer a recovery mechanism, I was worried I'd need to do a full re installation to purge the password. I turns out the solution is a lot easier than I expected:

http://coldfusion8.blogspot.com/2008/08/what-if-you-forget-coldfusion-admin.html

 

Legitimate use for Evaluate()? Do Not Want!

I hate Evaluate(). I hate it like I hate mornings without coffee. I hate it like getting Visual Studio's Debugger to work. I hate Evaluate(), and thats why I'm sad to say that I think I've found a case where I can't use any of my standard tricks to avoid using Evaluate(), and have to give the ugly beast its moment of glory.

 

Back to CF, Back to Blogging

Man, this blog has gotten a little musty! Time to freshen things up with some more frequent posts and an maybe a re-skinning if I'm feeling bold. I'm working on my first new post in what seems like ages, but I'm going to be holding it for Monday cause that seems like when the most people hit my site or click through from coldfusionBloggers.org/. To give you a hint: I think I've found legit reason to use Evaluate()! Given how much I hate Evaluate() and all of its degenerate ilk, you'll want to tune back Monday to see if I've found a crazy corner case, or if I'm just nuts.

 

Broken Icons in Windows 7

After uninstalling and installing some applications the other day, I noticed that some of my desktop icons had gotten "broken" in that they still worked fine, but the icon was the generic icon that Windows 7 uses when it doesn't know what the file is, rather than what it was supposed to be. Changing the icon to a different one worked fine, but changing it back left the icon still broken. Let me be clear: the icon displayed, but the image was wrong, and this was only some of my icons, not all of them.

After a bit of digging, I found this link which tells you how to fix fix the problem. I'm not really sure what went wrong, but this definitely fixes the error and gets your icons looking right again.

 

Java i18n: I throw in the towel

I've been trying to get Java's ResourceBundle object working for ColdFusion based i18n working off and on for months now, and finally today I bit the bullet and gave up. If you're messing around with ResourceBundle trying to figure out why ColdFusion refuses to find your .properties file, I recommend that you stop, take a deep breath, and check out the following: rbJava/JavaRB CFC.

Basically, it is a wrapper for the technique described in this ColdFusion Developer's Journal article, that uses FileInputStream to read in an individual properties file. It seems that no one's found a way to get Java to pick the right file for you in ColdFusion.

That link offers three different underlying techniques for localization; I went with the coreJava version, but depending on your needs you might want to choose something else. The coreJava implementation gave me more than enough options, it worked out of the box, and I got it working with new keys and some new wrapping logic in 30 minutes.

 

More Entries

Jon Hartmann, July 2011

I'm Jon Hartmann and I'm a Javascript fanatic, UX/UI evangelist and former ColdFusion master. I blog about mysterious error messages, user interface design questions, and all things baffling and irksome about programming for the web.

Learn more about me on LinkedIn.