Sorcerer's Tower

Beyond Tables, Beyond Divs - Simple JavaScript Calculator III

As we (hopefully) all know, using HTML tables for layout is Bad and Wrong.

Unfortunately, the most common way people avoid using tables is to just replace their table, tr and td tags with divs, divs and more divs.

The div tag is a generic container that should be used as a last resort, if there are no other more suitable options.

Whilst the problem of excess divs is not limited to the conversion of table layouts, it is perhaps most obvious here, as it shows the developer is still stuck in the column+row frame of mind, rather than thinking about what they are actually displaying.

In this blog entry, I show an example of how avoiding this mindset can result in much simpler and cleaner code.

QueryParam Scanner - Eclipse Plugin

The first pre-release version of the qpScanner Eclipse Plugin is now available.

This is the very first Eclipse plugin I have created. It was an interesting experience, and something that I will be writing up in a separate entry as soon as I can collect my thoughts.

It order to use the plugin, you must be using v0.7 or higher of qpScanner - if you do not yet have this, you can download the latest development version of qpScanner, which contains details of the Update Site to use. If for any reason you cannot use the regular Eclipse Update method, you can directly download the qpScanner Eclipse Plugin instead.

Just to be clear, both v0.7 of QueryParam Scanner and v0.1 of the qpScanner Eclipse Plugin are currently considered development releases, and are being made available so that they can be tested and any bugs that might exist can be found - if you are unwilling to use pre-release software you should wait until the official release.

If you do get the Eclipse Plugin, or even just qpScanner on its own, I welcome any and all feedback you might have - whether to report bugs you have found, request new features you would like, or simply to let me know that works with your local setup.

Please send feedback via the GitHub Issue system.

Related websites:

QueryParam Scanner v0.7-dev

The latest development version of qpScanner is now in SVN at RIAForge.

It would be great if people could test it out and let me know of any issues they encounter.

As before, it is all self-contained, so it can be installed and run with minimal effort.

Note: As this is still the development version, you need to use the zip option at the bottom of the RIAForge page, not the "Download Project" link - the button will only give the old version.

When released, v0.7 will be a significant new version, so I want to give a quick discussion of the new features...

expandPath bug in CF8

I've just encountered a very annoying bug with the expandPath function in CF8.

Take the following code:

<cfset MyDir = "."/>

<cfloop index="i" from="1" to="5">
    <cfset MyDir = expandPath(MyDir)/>
    <cfoutput><br/>#MyDir#</cfoutput>
</cfloop>

Run the code through Railo and you will get exactly the right behaviour, with the current directory output five times:

C:\dev\scratch
C:\dev\scratch
C:\dev\scratch
C:\dev\scratch
C:\dev\scratch

Now go run the same code with CF8 - and this is what you get:

F:\ColdFusion8\wwwroot\scratch
F:\ColdFusion8\wwwroot\scratch\F:\ColdFusion8\wwwroot\scratch
F:\ColdFusion8\wwwroot\scratch\F:\ColdFusion8\wwwroot\scratch\F:\ColdFusion8\wwwroot\scratch
F:\ColdFusion8\wwwroot\scratch\F:\ColdFusion8\wwwroot\scratch\F:\ColdFusion8\wwwroot\scratch\F:\ColdFusion8\wwwroot\scratch
F:\ColdFusion8\wwwroot\scratch\F:\ColdFusion8\wwwroot\scratch\F:\ColdFusion8\wwwroot\scratch\F:\ColdFusion8\wwwroot\scratch\F:\ColdFusion8\wwwroot\scratch

It simply stacks the current directory onto the front each time. Very frustrating.


In order to get round this, I created a regular expression to pull off the last value of any directory containing more than one colon - this will work for Windows machines, but may need to be changed for Linux or MacOSX machines (if the bug affects these).

<cfif isDefined('Server.ColdFusion.ProductName')
    AND Server.ColdFusion.ProductName EQ 'ColdFusion Server'
    AND ListLen( MyDir ,':') GT 2>
    <cfset MyDir = REreplace( MyDir , "^.*([A-Z]:[^:]+)$" , "\1" )/>
</cfif>

Railo goes Open Source with JBoss.org (Update)

As promised previously, here is a more detailed entry on the announcement to Open Source the Railo CFML engine.