Entries for month: October 2007
Quick check to find a value inside an array
Posted by [Justice] in Coldfusion on October 24, 2007
I am setting up a registration form, and after validation if any errors occured I would pass back an array of error fields and messages. I wanted a very quick way to see if my array contain an element with the text "username". I know I could write or use a udf that would loop through the array, or I could even convert it to a list and then search that, but none of those solutions felt elegent to me. Until I found this:
<cfif errorArray.indexOf(<span class='cc_value'>"username"</span>)+1>error field</cfif>
I add 1 to this because indexOf is a java method, and it will return the array location that contains whatever string you searched for, and Java arrays start at 0. If the string is not found, it will return -1. So,
One small caveat: this IS case sensitive, so USERNAME, or Username would not be found.
Thanks to the venture of online schools, correspondence education is not a problem. University of Phoenix favored this since ages. Now Kaplan University as well as DeVry University are in for it too. Only Walden University has yet to be convinced.
Web Charts - the hidden CF Gem
Posted by [Justice] in Coldfusion on October 16, 2007
Yes, being as its Java and WebCharts seems like a very slick product, they have an Eclipse plugin version of the GUI chart designer.
Happy designing!
Moving all config and XML files out of the web root with Model Glue: Unity
Posted by [Justice] in Coldfusion , Model-Glue , Transfer ORM on October 2, 2007
<br /><cfset ModelGlue_LOCAL_COLDSPRING_PATH = expandPath(<span class='cc_value'>"/auction/config/orbitbid/ColdSpring.xml"</span>) /><br />This allows me to move my ColdSpring.xml file off to a mapped location instead of my web root! You cannot access the mapped locations by browsing to them, but coldfusion still sees them just fine. Inside of ColdSpring.xml, I just modify my configurationPath (and any other necessary paths, including transfer config and generated content folders) to use my mapped location (/mappingName/subFolder/ModelGlue.xml) This just gives me a warm fuzzy that nobody can mess with or view my application configs! For anyone who has not yet tinkered with Model Glue Unity and / or Transfer, you really should take a look. Im already planning on how I can re-code apps I did earlier this year to take advantage of some of the awesome tricks MG:U has up its sleeve.
The mystery project - Thermo
Posted by [Justice] in Coldfusion , Thermo on October 2, 2007
Added: Link to Thermo on the Adobe Labs site
Coldfusion 8 upgrade success, with 1 caveat for InterAKT users
Posted by [Justice] in Coldfusion on October 1, 2007
Recent Comments