dans.blog


The miscellaneous ramblings and thoughts of Dan G. Switzer, II

Inserting CDATA into an XML element using CFMX...

I was having a horrible time trying to insert some CDATA into an element using the CFMX version of an XML "DOM." I use the word "DOM" very lighty w/CFMX, because it really is a hacked together solution that doesn't do much of anything well.

Anyway, I had tried everything under the sun to get my CDATA inserted and I was having absolutely no luck. If I tried to insert the text using xmlText, the CDATA tag would get escape—which is obviously not the behavior I wanted.

Fortunately, Nathan Dintenfass was quick to respond to my disperate cry on one of my mailing lists, with a link from Macromedia's LiveDocs:

more…


UDF: xmlDelete() for CFMX

I needed a way to filter out nodes from an XML document in CFMX. XPath is a great mechanism for finding nodes, so I decided to throw together a little UDF which would allow me to delete any nodes in an XPath expression. Here's the UDF:

/****************************************************************
UDF: xmlDelete(xml, xpath)
Author: Dan G. Switzer, II
Date: 5/27/2004

Arguments:
xml - the xml document to delete nodes from
xpath - the xpath statement which defines the nodes to delete
****************************************************************/

function xmlDelete(oXml, sXpath){
    var oNodes = xmlSearch(oXml, sXpath);
    var bNodesFound = iif(arrayLen(oNodes) gt 0, true, false);
    while( arrayLen(oNodes) GT 0 ){
        arrayClear(oNodes[1]);
        arrayDeleteAt(oNodes, 1);
    }
    return bNodesFound;
}

If you need to delete all the nodes which have an attribute of "active" where the value is "false", you can use the follow:

more…


New Van Halen Single Blows...

I heard the new Van Halen single, It's About Time, on the radio this morning. All I can say is "Wow... That song really sucks..." It's got to be the worse song Van Halen's ever written. Not sure how a song like that gets released, let alone released as a single. Is Eddie's ego so strong that people were just afraid to tell him the song sucks? It's a real shame to hear a band that's put out some classic hard rock songs end up doing crap like this.

NOTE:
As big of a fan I am of Extreme's work, I never heard the Van Halen album w/Cherone. I know Van Halen fans don't even consider that a VH. I suspect they'll think the same way towards this single.


Update to component() UDF...

I made a modification to my component() UDF that I blogged about last year. I basically added a try/catch to spit out a friendlier error message if the component isn't loaded when passing in a relative path.


What I'd Like To See In Blackstone: Request-based Mappings

Ok, in honor of Tim Buntel's new blog, I'm going to start a little series of blog entries entitled "What I'd Like To See In Blackstone." I'm going to start off the series with a feature I've wanted in the language since CF3 first came out and I started using CF-based custom tags, and that's the ability to create a request-based mappings.

I'd love to be able to create dynamic mappings on page request for both the location of custom tags and for general mappings—which would be especially useful for referencing components. What I'd love to see is a syntax like the following:

<cfmapping
    type="alias"
    logical="/com"
    path="c:\root\site\build\com\"
    />


<cfmapping
    type="customTag"
    path="c:\root\site\build\customTags\"
    />

more…


Tim Buntel's ColdFusion Blackstone Blog

Apparently Ben Forta has finally convinced Tim Buntel, product management for ColdFusion, to open up a blog covering Blackstone—the next version of the ColdFusion product.

There's nothing much but an introduction and a picture in the opening post. Hopefully Tim will make this a good source for what's coming in Blackstone—the good stuff only known by those currently under NDA.


Gas $2.33 Per Gallon...

I had to fill up my 4runner this morning. I like to keep premium in the tanks, and "premium" sure is the right word for that gas, 'cause that's what it costs. I paid $2.33 a gallon for gas today. That's just ridiculous. I need to get into the Oil business.


Lunch w/Dad...

My dad was in town for some blood work today, so we hooked up for lunch. We decided to meet at El Vaquero's—which is one of the best spots in Columbus to get good authentic Mexican food. The foods always good there, and they make the salsa and chips fresh. Anyway, it's one of my dad's and my favorite spots to eat, so it was a pretty easy decision to eat there (plus, neither of us have eaten there in a while.)

After lunch, dad stopped over to see the dogs. I think he was a little upset he didn't get to spend more time with them on Mother's Day—as he was stuck working the store most of the day. The dogs smothered him when he sat down on the couch—both of them licking his face vigorously. Nikki was a bit to enthusatic and manage to nip his ear enough to draw blood. She doesn't bite hard but if you pull away when she's biting, her teeth are razor sharp.

Anyway, I was glad he stopped by for the visit.

more…


Damn Dirty Dogs!!!

The dogs decided to play in the mud today. Maddie used to be a Yellow Lab, looks like she wanted to see what it was like to be a Chocolate Lab. :)

I ended up just pulling the hose in from the garage and stuck it out the window to clean them off a bit before bringing them inside. That technique worked suprisingly well.

dirty.dogs.jpg

more…


Breast Baring Popular in 1600s...

Women of the 1600s, from queens to prostitutes, commonly exposed one or both breasts in public and in the popular media of the day, according to a study of fashion, portraits, prints, and thousands of woodcuts from 17th-century ballads.

Since Fashion styles seem to go in cycles, when is this cycle going to come back into style? Maybe Janet Jackson was just trying to bring back 17th-century fashion when she exposed her breast at the Superbowl, then again maybe not. :)


qForms Build 138 Released!

Well, since v2 is taking longer than planned, I'm releasing build 138. There's a few fixes that I've made and I've added a couple of useful properties. The highlight of this build is that you can now toggle off validation for a form by setting the qForm object's _skipValidation property to true, the validation rules will be ignored. This will be useful for those users looking for a way to "Save & Exit" from a form, without applying the validation rules. Here's a list of what's changed:

[-] Fixed a bug in the is/validateFormat() method which affected masks
    which contained 3 or fewer characters.
[-] Fixed bug in Opera v7.x where single checkbox elements where not
    working w/the setValue()/getValue() methods. I had fixed this in
    the v2 builds already.
[-] Fixed bug w/validateLengthGT and LT if the value was equal to
    the specified argument than no error was thrown (and it should
    be).
[+] Added qFormAPI.styleAttribute which allows you to specify a single
    property to apply a style change to. This defaults to "backgroundColor".
    This provides a quick CSS hack until v2 is released. If you change
    the qFormAPI.errorColor to a valid CSS property value you can do
    more than change the color. For example:
	qFormAPI.styleAttribute = "border";
	qFormAPI.errorColor = "1px dotted red";

    NOTE: This is experimental at best, you need test in different
          browser.

[+] Added obj._skipValidation property which allows you to toggle
    validation off/on for an entire form. Setting the property to
    true will cause the validation routines to be skipped for that
    form object.
[+] Added the validation_addon.js library. At this point, this contains
    one additional validation method called validateAtLeastOne(), which
    you can use to confirm that at least one field out of a list of
    fields contain a value.

As always, you can download the latest version of qForms from http://www.pengoworks.com/qforms/download/.


Mexican Gov't Releases UFO Video

It seems the Mexican Air Force has released a video of what they describe as a UFO. The video was apparently shot well doing routine checks for drug traffickers.

Articles with Videos

Mexican Air Force Pilots Film 11 UFOs
Mexico Releases Video Of Objects Surrounding Military Plane
U.F.O. Close Encounter

more…


Mozilla Firefox Extensions Every Developer Needs!!!

Ok, I thought I'd compile a little list of Firefox extensions that are useful for any web developer (and a few that are good for any user of Firefox.) For those of you who read my blog, you'll know that I've switched to Firefox as my primary browser—it's just fantastic. Anyway, here's a list of the extensions you shouldn't be without.

General Extensions (Stuff For Everyone)

  • Tabbrowser Extensions
    This might be the best of the extensions as it makes Firefox and Mozilla's tab interface work the way it should work out of the box. First, it adds the ability to re-order the tabs by dragging and dropping the tabs. Oddly enough, I find myself re-ordering tabs quite a bit. Next, it will remember all your open tabs when you close Firefox and will automatically re-open them. I love this feature, since there are 3 or 4 sites I tend to have open all the time. Also, if you ever need to reboot while you have a ton of tabs open, you don't have to worry about trying to restore all your windows after reboot—just close Firefox and reboot your PC. The last feature I'm highlighting is you can configure the extension to open all "new window" links into a new tab instead. This extension does more than what I've highlighted, but these are the key features that make it a must download.
  • Bookmarks Synchronizer
    Allows you to synchronize your Firefox bookmarks among different installations of Firefox. I use it to keep my laptop and desktop in sync.
  • RSS Reader Panel
    This extension adds an RSS Panel to Firefox. Just set up a bookmark folder containing links and folders to all your favorite RSS URIs, and hit [ALT]+[R] to bring up the RSS Panel. The panel is split into two sections. The upper section shows the RSS feeds and the lower section shows the snippets from the RSS feed. Click on the headings in the lower section to bring up the actual RSS entry.

more…


Two Utilities No Windows User Should Be Without...

Mark Russinovich, over at Sysinternals, has written written a ton of useful utilities—two of which no real Windows user should be without: Process Explorer & TCPView.

Process Explorer is a replacement for the Windows Task Manager's "Processes" tab—actually it really could be a replacement for the entire Windows Task Manager. This program adds some functionality really missing from the Windows Task Manager. First, it can show you the entire command line path to the all the process running. Next, it will show you all the handles and threads opened by the each process—and it's even searchable. This is great for tracking down rogue process or finding out what problems are locking a file down. This is one of the first things I download when a friend is having PC problems. I'll use this to discover various process that shouldn't be running (such as Trojans and Spyware.) It's extremely helpful. Best of all, no fancy install, just download and extact it to your system.

TCPView was designed to show all the open TCP & UDP ports currently on your computer. Just like Process Explorer, all this information is updated in near realtime (for actual realtime spool of your traffic, check out their free tool TDIMon.) With TCPView, you can quickly located what programs may be listening for remote traffic or for what programs may be trying to connect to remote servers. This is especially useful for finding programs that should not be accessing the Internet—such as trojans and spyware.

more…


Tyson The Skateboarding Bulldog...

I first saw Tyson the Skateboarding Bulldog a few months ago. While it was pretty amazing, he really couldn't do much w/a short stage. Fortunately his owner(s) have put up a web page with both some pictures and movies. You definitely need to check out the two movies—they're great. I'd also recommend reading the FAQ, seems the owner's have no clue how to teach your dog how to skateboard since Tyson taught himself.

Video of Tyson skating in October 2003
Video of Tyson skating in April 2004