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

Two important CF8 bugs/issues detailed yesterday

There were two important blog posts I came across yesterday that detail similarly related problems in ColdFusion 8. Both issues revolve around changes to the JDBC drivers in ColdFusion 8 and they're both essentially transparent issues (unless your running SeeFusion.)

The first issue relates to a new feature in the datasource configuration called the "Validation Query." ColdFusion 8 introduced the ability to define a query that run each time a connection to a DSN is reused after a period of inactivity. This is useful in cases where the CF server might lose connection to the database server due to network issues.

As Daryl Banttari of Webapper reported yesterday, the problem is there's a bug in the Admin API that causes the "Validation Query" for each DSN it touches to be set to the value of "0". This causes ColdFusion to silently through a java.sql.SQLException each time the validation query is executed. Since this is a silent exception, you have no idea it's happening.


Reminder: Don't assume user's browsers are caching content

This is actually old news—but I thought it was important to be reminded of it. Last year Yahoo's UI blog posted some findings on user browser cache usage. Here's what they found:

40-60% of Yahoo!’s users have an empty cache experience and ~20% of all page views are done with an empty cache. To my knowledge, there’s no other research that shows this kind of information. And I don’t know about you, but these results came to us as a big surprise. It says that even if your assets are optimized for maximum caching, there are a significant number of users that will always have an empty cache. This goes back to the earlier point that reducing the number of HTTP requests has the biggest impact on reducing response time. The percentage of users with an empty cache for different web pages may vary, especially for pages with a high number of active (daily) users. However, we found in our study that regardless of usage patterns, the percentage of page views with an empty cache is always ~20%.

I definitely recommend reading the whole post as there's lots of good information on optimizing your site for performance. This article is just one posting in a series of posts on how to improve your site's HTTP performance.

Microsoft releases IIS deployment tool for migrating servers

Microsoft has released an IIS deployment tool which allows you to sync settings between IIS servers or to migrate settings from an IIS6 server to an IIS7 server. From the Microsoft Web Deployment Team Blog:

So what is this new deployment tool? You may have read Scott Guthrie’s post about the future of ASP.NET and IIS. In the post he mentioned the roadmap for a web deployment framework, that’s us. :) In our first version, we’re releasing a command-line tool called msdeploy.exe that provides support for deploying, synchronizing and migrating IIS 6.0 and 7.0.

It supports moving configuration, content, SSL certificates and other types of data associated with a web server. You can choose to sync a single site or the entire web server. Because we know that one tool can never ‘automagically’ guess what your application relies on, we’ve tried to be pretty flexible and powerful – you can customize exactly what you want to sync using a manifest file. You can also skip sites or other objects, or you can perform regular expression replacements during a sync (like changing the home directory on the destination machine).

The goal of the tool is to help you keep servers in sync, to make deployment easier and also to help with migrating to new versions of IIS. You could use a sync on two machines in a web farm, for example. Or maybe you need to move to a new server of the same version, you can use this tool. Of course, we also enable you to do a migration from IIS 6.0 to 7.0.

Microsoft has released some walkthroughs to teach you how to use the tool and has released both an x86 version and an x64 version.

jQuery Calculation Plug-in: Making calculating easy...

I actually wrote this plug-in months ago, but only made passing mention about in on the jQuery mailing list. Since the topic of dynamic calculation came up again today on the mailing list, I thought I'd go ahead and officially announce the plug-in here.

My jQuery Calculation Plug-in was designed as a generic mathematical library to make it easy to do things like sum or average values that are displayed on the page. For example, to get the sum of all of the elements with the class of "price" you'd use:

alert( $(".price").sum() );


Just how does a browser render 12.5px anyway?

John Resig decided to do a little experiment to see how browsers handle sub-pixel problems in CSS. John wanted to see what happens when you have 4 floated divs, each with a width of 25% that were contained inside a parent element with a fixed width of 50 pixels. This poses a problem since the correct mathematical width of each floated div should be 12.5px and browsers typically can't handle sub-pixel rendering.

Here's what John found:


This is actually something I've wondered about for a long time, but never taken the time to research how the browsers handle it.

I'd definitely go take a look at John's post because it contains lots of good information and comments.

Will X-UA-Compatible cause more browser harm than good?

There's lots of talk today about the new proposed X-UA-Compatible header which is being driven by the WaSP-Microsoft Task Force. The goal of the proposed meta tag header is to provide future compatible for IE and other browsers. The idea is you add a tag to your HTML that locks in browsers to that capability mode:

<meta http-equiv="X-UA-Compatible" content="IE=8;FF=3;OtherUA=4" />

The above tag theoretically would prevent Internet Explorer 9 or Firefox 4 from breaking because of changes to their standards support by making the run just like prior versions.

While the goal is a noble one, I actually see this causing more harm than good. From past experience, something tells me that future products won't get backwards compatibility 100% correct. Since the whole point is to prevent sites from breaking with future releases, what problem have you solved if the browsers going to have bugs rendering in a compatibility mode anyway?

I like the idea that browser vendors (especially Microsoft) are trying to make web development more future proof, but I think there's got to be a better solution.

Aptana releases Ajax Server "Jaxer"

Aptana just released a new project called Jaxer. In a nutshell, Jaxer is server filter which parses files and can execute JavaScript on the server. It's like a headless version of Firefox. All your client side libraries (like jQuery) will run in Jaxer—which is pretty neat.

What this means is that the JavaScript you write can be used in both the client and the server. Jaxer actually resolves one of the most complicated problems web developers face—ensuring data is validated using the exact same rules on both the client and the server. Because Jaxer is able to execute your JS code on the server, you can write one set of validation functions and use them both place.

Aptana's posted a screencast showing a simple client/server validation example using Jaxer that I recommend viewing. It's a simple example, but shows off the potential power of Jaxer.

I also recommend checking out Ajaxian's post on Jaxer as well as John Resig's post which both provide example code and give further insight.

At this point this product has a high "Cool!" and "Wow!" factor, but I really wonder who their target audience is. Hopefully I'll have some free time to play around with this sometime soon.

Virtual Reality using the Nintendo's Wii controls

I saw Marco Casario's post yesterday about Johnny Chung Lee experiment using the Wii controls to create VR effects. I about gave up on the video, but then he got to the actual VR portion of the video and I must saw the effect is extremely good.

In the past the best 3D/VR effects I've seen were based on polarized 3D glasses—where there's a shutter in each lens that alternates between off and on (when one lens is on, the other is off.) This creates a pretty decent visual effect, but it can definitely lead to headaches.

This is by far the best example I've seen of 3D/VR on a purely 2-dimensional screen. The effect that Johnny is able to achieve is quite remarkable. I recommend watching the entire video, but it gets really interesting about 3/4 quarters of the way through.

Yahoo announces support for OpenID

Yahoo announced that they're supporting the OpenID standard for a universal log-in. This could go a long way for more web site adopting OpenID. The idea of a single log-in that you can use on any website is a noble goal.

I'm not sure I'd ever use a global login account on important websites (such as those dealing with financial information,) but for general information based sites this would be a welcome improvement to managing tons of log-ins and passwords.

Invoke CFCs outside of webroot without mappings

Ben Nadel posted about using a ColdFusion custom tag to act as a proxy to invoke a CFC. The benefit of this technique is that you're able to invoke CFCs from outside the webroot without creating any server-level mappings.

There have been several solutions to invoking CFCs without using a mapping—including the component() UDF solution I've blogged in the past. The reason I think most people hesitate to use component() UDF—which allows for using relative paths—is that it uses underlying Java calls which are not supported. Now this UDF works in ColdFusion versions 6 through 8, I understand why people might be hesitant to use it.


Bill Gate's Farewell Video...

At CES 2008 Microsoft showed off a "Bill Gate's Farewell Video." I just now watched it for the first time and it's pretty darn funny. Lots of cameos (Steven Spielberg, Bono, George Clooney, etc) and several really funny scenes.

Funny stuff!

Display ColdFusion JDBC Drivers on Windows

Today I ran across an interesting post on cfSearching on how to display the ColdFusion JDBC driver versions on Windows. Knowing this could be useful debugging information, I decided to save the code snippet for future use. However, I quickly released it was targeted directly for ColdFusion MX 7 and also had some hard coded paths that would need to be changed in order to run it on every system.

Since I wanted to be able to run this on any version of ColdFusion, I decided to modify the code a bit so it would work with any version of ColdFusion v6.1 or higher and it shouldn't require changing any of the path information.

Here's my modified version of the code:

    This template will display the JDBC information contained in your ColdFusion

        v#replace(Server.ColdFusion.ProductVersion, ",", ".", "all")#
<cfset driverInfo = arrayNew(1) >
<cfset pathToJava = Server.ColdFusion.RootDir & "\runtime\jre\bin">
<cfset pathToDriverJar = Server.ColdFusion.RootDir & "\lib\macromedia_drivers.jar">
<cfset drivernames = "macromedia.jdbc.oracle.OracleDriver, macromedia.jdbc.db2.DB2Driver, macromedia.jdbc.informix.InformixDriver, macromedia.jdbc.sequelink.SequeLinkDriver, macromedia.jdbc.sqlserver.SQLServerDriver, macromedia.jdbc.sybase.SybaseDriver">
<cfloop list="#driverNames#" index="driver">
        arguments="/c #pathToJava#\java -cp #pathToDriverJar# #driver# 2>&1"

    <cfif IsDefined("out")>
        <cfset data = structNew()>
        <cfset data.class = driver>
        <cfset data.version = out>
        <cfset arrayAppend(driverInfo, data)>
<cfdump var="#driverInfo#">

I also modified the original code to output the version of ColdFusion that's running on the server. Credit goes to cfSearching for the original code.

jQuery celebrates 2nd Birthday with v1.2.2 release!

jQuery turned 2 years old today. To celebrate turning two, John Resig and gang released jQuery v1.2.2. Some of the key changes are:

  • 300% Speed Improvements to $(DOMElement)
  • $.ready() Overhaul — this is supposedly fix several bugs and provide even more consistent behavior across platforms. (NOTE: For those unfamiliar with the $.ready() function, it's designed to replace the window.onload event and fire immediately after the DOM is ready and not wait for all images to finish loading.)
  • New .bind(”mouseenter”) / .bind(”mouseleave”) events — these events are improvements on the typical mouseover/mouseout events as they don't fire when entering children elements (which is generally not the desired behavior.)
  • New .bind(”mousewheel”) event — this new event allows you to bind events to the mouse wheel.
  • The :not() selector now supports complex expressions
  • New AJAX "Accept Headers" added to XHR requests
  • Over 120 bug fixes
  • Test suite now includes over 1157 unit tests

Azentek's Atlas CPC-1000 - In-Vehicle PC

One of things I'd love to upgrade in my Toyota 4Runner when I finish paying it off at the end of the year, is the radio. It's currently got a JBL Radio/Navigation system in it, but I've not been able to find an interface that for the radio which will allow me to connect an mp3 player to it. I could buy an FM modulator, but I really don't want to lose sound quality if possible.

However, I'd really love to get a stereo with native hard drive for mp3s, Sirius support (so I can get rid of my Sportster—which I like, but would prefer not to have to have it on the dash) and I'd like to have handsfree Bluetooth support.


MTube - The world's smallest ColdFusion Server?

There's always tons of stuff shown off at CES each year. This year VIA showed off a prototype of 3.5" x86 PC that was running Linux. mtubeThey're promoting it as an advanced PMP, but I could definitely using it as some kind of portable server.

The specs I could find on Gizmodo list the following:

Processor: VIA C7-M @ 1.0 GHz
Storage: 8 GB Flash
Display: 2.8" LCD
Resolution: 640 x 480
Dimensions: 8.5 cm x 8.5 cm x 2 cm
Weight: 150 g
Battery Life: 4 hours
Connectivity: WiMAX & WiFi
Video Codecs: H.264, WMV, RMVB, MOV, FLV, DIVX