dans.blog


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

What I Hate About Your Programming Language

http://www.onlamp.com/pub/a/onlamp/2003/05/12/languagephilosophy.html


Working on qForms v2.0

I got some more work done on the masking routines I'm going to use for qForms. I'm still trying to decide the best way to implement some of the functionality. I'll probably break everything out that uses keyboard event handling into it's own library.

Anyway, the API is coming along quite nicely. There are still a number of features that I would like to see included in the first release of v2, but I'm still trying to figure out the best way to implement them. The concept of "groups" is still one of the main one's I'm struggling with. I just can't decide on the best way to implement them. I'd like to try to introduce the concept without bloating the code, but I think there's going to be a good amount of code needed to do everything w/groups that I'd like to do. Anyway, I continue to play with it and I'm sure I'll figure something out I'm happy with.


10th Anniversary of the Modern Day "Browser"

Well, the modern day "browser" is no officially 10 years. The first version of Mosaic was released 10 years ago today. Mosaic was written by several college students at the University of Illinois. Prior to the release of Mosaic, "surfing the web" was text-based only. Mosaic brought many of the common day functions to web browsing, such as: back/forward buttons, search, image support and the home button. Anyway, whether they knew it at the time or not, this little program affected the life of millions—including myself. I don't know what I'd be doing today if I weren't designing web applications.

On April 22, 1993, a group of students at the University of Illinois released a piece of computer code designed to get information from various public networks. Little did they know that their pet project, a humble application named Mosaic, would fundamentally change everyday life. While Web browsers with graphical interfaces had traded hands among academics years earlier, Mosaic was the first to be widely adopted and introduce the masses to the Internet.
- CNET


"Search Friendly URLs" with CFMX/IIS

In order to get "Search Friendly URLs" working in CFMX under IIS, make sure you've done the following:

  • In the cfusionmx\wwwroot\web-inf\web.xml file, make sure that you have a mapping pattern that will make sure to parse content after the .cfm extension. For example:

    <servlet-mapping>   <servlet-name>CfmServlet</servlet-name>   <url-pattern>.cfm*</url-pattern> </servlet-mapping>
    By default, CFMX Updater 3 out to have mappings like this in the web.xml file. If those mappings don't work, you can try a generic mapping to have the servlet parse everything:

    <servlet-mapping>   <servlet-name>CfmServlet</servlet-name>   <url-pattern>*</url-pattern> </servlet-mapping>
  • You may need to run the "Remove_ALL_connectors.bat" file located in the cfusionmx\bin\connectors. Try skipping this step first (especially if you have a lot of virtual servers already set up.) If things don't work the first time, try running this batch file. After running this batch file, you'll need to run the "IIS_connector.bat" in the same directory to reset all the associations to JRun and ColdFusion.

more…


404 Weirdness After Rebooting with CFMX/IIS5

Ok, so I ran in to a really odd problem today. One of our servers decided that it wanted to start giving 404 errors on any request after the box was rebooted—it didn't matter if it was a static html page or a dynamic page. If I restarted all the services, things would start working again. This meant though, that if the box was restarted you manually had to run a batch file to recycle the services—which is unacceptable.

After doing some investigation on the box, I learned that the jrun log files in the CFusionMX\runtime\lib\wsconfig\1\ directory were generating lines like the following:

04:03:20 jrISAPI[init] JRun 4.0 (Build 55228) ISAPI Extension - Nov 21 2002 20:12:06 04:03:21 jrISAPI[init] initProxy failed to fetch server properties 04:03:21 jrISAPI[init] could not initialize Server_1:127.0.0.1:51010 04:03:21 jrISAPI[init] Couldn't initialize from remote server, deferring init till request time. 04:03:21 jrISAPI[init] JRun 4.0 (Build 55228) ISAPI Extension - Nov 21 2002 20:12:08 04:03:32 jrISAPI[filter] initProxy failed to fetch server properties 04:03:32 jrISAPI[filter] could not initialize Server_1:127.0.0.1:51010 04:03:32 jrISAPI[filter] Couldn't initialize from remote server, JRun server(s) probably down.

more…


Encryption, Hashing, and Obfuscation?!?!

ZDNet recently published an article covering what the terms "encryption", "hashing" and "obfuscation" mean. If you're familiar with these terms, don't bother reading the article—you won't learn anything you don't already know. However, if you uncertain what the terms mean or simply unfamiliar with them, it does a good job of defining the words and provides some good examples.

Encryption, hashing, and obfuscation


Iterator Objects in CFMX

This is the second part in a series on design patterns for use with CFMX. I posting this because the idea of using iterators in CF appeals to me. I'm thinking about throwing together a generic iterator object which will convert any CFMX native variable type (array, query, string [list] and structure) into an iterator. This would definitely simplify looping constructs in CFMX, as you could use the same looping syntax for every variable.

Design Patterns in ColdFusion: Iterator Pattern (Part 2)


The Future of the Web: Rich Clients, Rich Browsers, Rich Portals

Here's an interesting presentation on the future of many web-based technologies. The presentation, written by Gerald Bauer, covers XUL, XForms, Curl, Rebol—just to name a few. If you're a web developer, or just interesting in where the web is going, this is an interesting read.

The Future of the Web: Rich Clients, Rich Browsers, Rich Portals


Holes found in RealPlayer, QuickTime

The vulnerabilities have cropped up in RealNetworks' RealPlayer and Apple Computer's QuickTime. While unrelated, the weak spots could allow an intruder to execute damaging arbitrary code on a victim's computer. In both cases, updates are available to remedy the problem.


Run For Cover; It's Mozilla 1.4 Alpha

Mozilla 1.4 Alpha is out. This release features dynamic image and table resizing in Composer, smooth scrolling (see release notes for enabling this feature,) and usability improvements to spam filtering. In addition to these feature improvements, 1.4a also contains fixes for performance, stability, standards support and website compatibility. This is an alpha release so expect bugs, and don't use it unless you are willing to live with the risks inherent in such a release (ie. crashes, data loss, etc.). More information is available in the release notes."


Web-based XML Editors

Lately I've been thinking about building a WYSIWYG XML editor to use within a content management. I've never been a huge fan of storing pure HTML as content, because you're extremely limited in what you can do with the content. So, I've been re-reading some information on building an browser-based XML editor. I may decide to tackle creating a cross browser (i.e. IE6+/Mozilla v1.2+) XML editor, in the meantime, here are a couple links:

Xopus (Cross Browser XML Editor)
XML Editing: A WYSIWYG XML Document Editor
Bitflux Editor for Mozilla


Blogger Bakeoff

Matt Liotta suggested on the CFCDev listserv that a "bakeoff" occur to get some comparison metrics on all the different proposed frameworks and methodologies which would leverage the capabilites of CFMX.

It appears that several developers are game to this idea and the current concensus is for everyone to write a "Blog" application in CFMX. Here's the original message from Matt:

It seems that since the release of CFMX many CF developers have been rethinking how they build CF applications thanks to new abilities through the use of CFCs and/or tighter Java integration. This has led to quite a lot of discussion over frameworks and methodologies as of late. I thought it might be interesting to have a bakeoff to get some comparison metrics on these different techniques.

The idea would be to take one set of application requirements and then build an application using each of these techniques. Metrics like time taken to develop, lines of code, performance, etc could all be captured for each. Obviously, developing all of these applications would take a considerable amount of time. However, if many people were interested we could each take one technique each and then share our results.

- Matt Liotta via CFCDev

more…


UDF: component() for CFMX

Have you ever had the need to invoke an instance of a componet based upon it's relative path? I know I have, so I threw this little UDF together.

To invoke a component, you simply call the component() function using either the standard dot notation or you can specify either a relative or absolute path to the CFC. I tried to make the "type" argument somewhat intelligent and it'll probably work correctly 99% of the time for you, but if you want to be absolutely sure you get the expected behavior, specify the type argument for the function.

/****************************************************************
UDF: component(path, type)
Author: Dan G. Switzer, II
Date: 5/26/2004

Arguments:
path - the path to the component. can be standard
dot notation, relative path or absolute path
type - the type of path specified. "component" uses
the standard CF dot notation. "relative" uses
a relative path the the CFC (including file
extension.) "absolute" indicates your using
the direct OS path to the CFC. By default
this tag will either be set to "component"
(if no dots or no slashes and dots are found)
or it'll be set to "relative". As a shortcut,
you can use just the first letter of the type.
(i.e. "c" for "component, etc.)
Notes:
This is based upon some code that has floated around the
different CF lists.
****************************************************************/

function component(path){
    var sPath=Arguments.path;var oProxy="";var oFile="";var sType="";var sProxyPath = "";
    if( arrayLen(Arguments) gt 1 ) sType = lCase(Arguments[2]);

    // determine a default type
    if( len(sType) eq 0 ){
        if( (sPath DOES NOT CONTAIN ".") OR ((sPath CONTAINS ".") AND (sPath DOES NOT CONTAIN "/") AND (sPath DOES NOT CONTAIN "\")) ) sType = "component";
        else sType = "relative";
    }

    // create the component
    switch( left(sType,1) ){
        case "c":
            return createObject("component", sPath);
        break;

        default:
            if( left(sType, 1) neq "a" ) sPath = expandPath(sPath);
            // updated to work w/CFMX v6.1 and v6.0
            // if this code breaks, MACR has either moved the TemplateProxy
            // again or simply prevented it from being publically accessed
            if( left(server.coldFusion.productVersion, 3) eq "6,0") sProxyPath = "coldfusion.runtime.TemplateProxy";
            else sProxyPath = "coldfusion.runtime.TemplateProxyFactory";
            try {
                oProxy = createObject("java", sProxyPath);
                oFile = createObject("java", "java.io.File");
                oFile.init(sPath);
                return oProxy.resolveFile(getPageContext(), oFile);
            }
            catch(Any exception){
                writeOutput("An error occured initializing the component #arguments.path#.");
                return;
            }
        break;
    }
}

more…


UDF: xslt() for CFMX

I wrote this CFMX-based UDF a while ago, and I thought I'd share it. One of my big gripes about the xslTransform() function in CFMX is that it doesn't support passing parameters to the transformation engine.

Passing parameters can be extremely useful, as it'll allow you to do some conditional operations on in your XSL sheets based upon values determined by the ColdFusion.

In a nutshell, this UDF accomplish this by parsing the XSL stylesheet and looking for instances of the <xsl:param> tag name attributes that match the key in the structure you passed in. Once it's looped through the entire "Params" structure, it'll use the modified XSL stylesheet to do the transformation. Basically, it just temporarily hard codes those values in the param for you.

more…