Entries Tagged as "ColdFusion"

Flash Builder 4 & ColdFusion Builder Install Issues

While installing both Flash Builder 4 and ColdFusion Builder I ran into an issue that had me wondering what I did wrong. Here is the setup I was going for: Flash Builder 4 Premium Standalone with ColdFusion Builder Eclipse Plug-in installed into the Flash Builder install. This was all done on Windows 7 64-bit.

Step 1. Install Flash Builder 4 Premium Standalone. Everything went great! No issue with this install, as you can see.

Step 2. Install ColdFusion Builder Eclipse Plug-in into the Flash Builder install. The install went well, as expected. The problem was when I launched Flash Builder, I could not find the ColdFusion Builder perspective.

After uninstalling ColdFusion Builder and re-installing with the same results, I tried one last thing. I fired up Flash Builder by right-clicking and "Run as administrator" and I could finally bring up the ColdFusion Builder perspective just fine!

And the results...

Hope this info helps!

4 Comments

ColdFusion 8.0.1 Now Available

This is just a reminder for myself, as many of you already know...

ColdFusion 8.0.1 Now Available

No Comments

ColdFusion 8: Creating CAPTCHA images


I recently had a project where my customer was getting alot of spam thru a contact form. So I thought I could use some CAPTCHA on the web form to stop some spam. I knew CF8 had the functionality to create CAPTCHA images, but I didn't know how to actually implement it. So after a bit of googling, I found Ben Nadel's post on creating and validating CAPTCHA images on forms.

I will briefly go over his code and show you my final result...

No Comments

ColdFusion 8: Rounded Corners & Reflection


As you may have known, Foundeo has created an Image Effects CFC that can generate image gradients, reflection, drop shadows, and some more cool effects by taking advantage of the new image features in ColdFusion 8.

Some people have been trying to replicate some of the functions this package has, especially the gradients, reflection and rounded corners functions. John Hartmann did an excellent job in replicating the reflect() and gradientMask() functions.

Jeff Coughlin also started building a CFImage Effects Plugin for FarCry based off of John Hartmann's functions. His Plugin has code to replicate the rounded corners.

Now, lets get into the code...

No Comments

Search Thru a Multi-Dimensional Array

I ran into a situation today where I needed to search thru a multi-dimensional array to update quantities and total prices for backordered products coming from a query. Unfortunately ColdFusion doesn't have an ArrayFind() function like it does for structs. I did a search on CFLib and found a UDF that did the trick.

The ArrayFindByDimension() UDF allows you to pass it an array, the value to find, dimension to search and returns the numeric array position if found, 0 if not found.

Here is some of my sample code:

<!---
Search a multidimensional array for a value.

@param arrayToSearch     Array to search. (Required)
@param valueToFind     Value to find. (Required)
@param dimensionToSearch     Dimension to search. (Required)
@return Returns a number.
@author Grant Szabo (grant@quagmire.com)
@version 1, September 23, 2004
--->

<cffunction name="ArrayFindByDimension" access="public" returntype="numeric" output="false">
   <cfargument name="arrayToSearch" type="array" required="Yes">
   <cfargument name="valueToFind" type="string" required="Yes">
   <cfargument name="dimensionToSearch" type="numeric" required="Yes">
   <cfscript>
      var ii = 1;
      
      //loop through the array, looking for the value
      for(; ii LTE arrayLen(arguments.arrayToSearch); ii = ii + 1){
         //if this is the value, return the index
         if(NOT compareNoCase(arguments.arrayToSearch[ii][arguments.dimensionToSearch], arguments.valueToFind))
            return ii;
      }
      //if we've gotten this far, it means the value was not found, so return 0
      return 0;
   </cfscript>
</cffunction>

<!--- begin the count --->
<cfset i = 1>
<!--- create the array --->
<cfset products = ArrayNew(2)>

<cfloop query="backordered">
   <!--- search array --->
   <cfset arrPos = arrayFindByDimension(products, "#backordered.product_code#", 2)>
   <cfif arrPos EQ 0>
      <cfset products[i][1] = backordered.product_id>
      <cfset products[i][2] = backordered.product_code>
      <cfset products[i][3] = backordered.order_details_quanity>
      <cfset products[i][4] = backordered.order_details_price * backordered.order_details_quanity>
      <cfset i = i + 1>
   <cfelse>
      <cfset products[arrPos][3] = products[arrPos][3] + backordered.order_details_quanity>
      <cfset products[arrPos][4] = products[arrPos][4] + (backordered.order_details_price * backordered.order_details_quanity)>
   </cfif>
</cfloop>

<!--- dump the array --->
<cfdump var="#products#">

No Comments