Coldfusion and Jquery's auotcomplete plugin

Jquery has many excellent plugins. The latest one that I have been playing around with is the autocomplete plugin. This plugin enables the user to autocomplete an input field to help quickly find and select some value, leveraging searching and filtering. The following demo will show you how to implement this plugin with coldfusion.

[More]

CFDump enhancements in Coldfusion 8

Have you ever needed to dump the results of a very large query or structure only to find that it is either very hard to read or that the CSS on the page is making it unreadable? Well Coldfusion 8 has added some nice little attributes to the cfdump tag that may help with this. Take a look at the following code

[More]

using java's split function in coldfusion

Another nice java.lang.string method is the split function. It's a little like the listToArray CF function. The main difference is that you can pass RegEx straight into the split method. Below I have a list of football players and their squad numbers. Using split() and a little RegEx I can extract the players from the list.

[More]

Coldfusion hidden string functions

Delving into the java.lang.String methods you can find a few hidden jems. The majority of function provided by java.lang.string are already available to CF in some form or another. The startsWith() and endsWith() functions are easy to implement and two of my personal favorites.

[More]

CFChart and webcharts.bat

ColdFusion includes the WebCharts3D utility, which you can use to create chart style files. CFCHART is based on a product called WebCharts that's actually included under the hood, and has been kept with Coldfusion.

[More]

The Basics of CFChart

Having never had the chance to use CFChart before I thought it was about time I had a look into it. As with most coldfusion tags it was easy and intuitive to pick up.

[More]

Great Circle Calculator

This function calculates great-circle distances between the two points ? that is, the shortest distance over the earth's surface ? using the 'Haversine' formula. It assumes a spherical earth, ignoring ellipsoidal effects ? which is accurate enough for most purposes... ? giving an 'as-the-crow-flies' distance between the two points (ignoring any hills!).

[More]

Outcodes & Incodes Regular Expression

Outcode - one or two alphabetic characters followed by one or two digts, or one or two characters followed by a digit and a character. Incode - a single digit followed by two characters (excluding C, I, K, M, O and V). Outcode RegEx = \b[A-Za-z]{1,2}\d[A-Za-z\d]?\b Incode Regex = \b(\d[ABD-HJLNP-UW-Zabd-hjlnp-uw-z]{2})\b

[More]

IP Addresses - Regular Expression

IP addresses are made up of four bytes separated by .characters. Each set of digits is one to three digits in length Text - My IP Address is 127.0.0.1. RegEx - (((\d{1,2})|(1\d{2})|(2[0-4]\d)|(25[0-5]))\.){3}((\d{1,2})|(1\d{2})|(2[0-4]\d)|(25[0-5])). Result - My IP Address is 127.0.0.1. The RegEx makes sure that the range of each set of digits in between 0-255 and does not end with a full stop.

UK Postcodes - Regular Expression

UK postcodes can be made up of five to seven characters and digits defined by the royal mail. The "outcode" is one or two alphabetic characters followed by one or two digts, or one or two characters followed by a digit and a character. The "incode" is a single digit followed by two characters (excluding C, I, K, M, O and V). The incode and outcode are seperated by a space. RegEx = [A-Z]{1,2}\d[A-Z\d]? \d[ABD-HJLNP-UW-Z]{2}. Below is a Coldfusion based example using this RegEx.

view plain print about
1<!--- example text ---> <cfset text = "Postcode 1 - N5 1BU, Postcode 2 - LM41 2YB, Postcode 3 - NW1 4TH"> <!--- Attempt to find match ---> <cfset AlteredText = reReplaceNoCase(text,"[A-Z]{1,2}\d[A-Z\d]? \d[ABD-HJLNP-UW-Z]{2}"," xxxx xxxx","All")> <!--- Display the results ---> <cfoutput>#AlteredText#</cfoutput>
AlteredText = Postcode 1 - xxxx xxxx, Postcode 2 - xxxx xxxx, Postcode 3 - xxxx xxxx

More Entries

BlogCFC was created by Raymond Camden. This blog is running version 5.9.5.004. Contact Blog Owner