category: coldfusion


Map and Reduce in Coldfusion, a pratical example


 
A few weeks ago I started a project called Collections.cfc that brings iteration functions such as map(), reduce() and filter() to Coldfusion collections. JavaScript and a few other languages have had these features for some time so I felt that it would be fun to try and bring that behavior over into the CF world.

Traditionally, functions such as map() and reduce() have been limited to Arrays, but being that Coldfusion rocks hard \m/, I wanted to go one step further and extend the functionality to Structures as well.

This example makes use of both types of collections types (arrays and structs) and several Collections.cfc methods to find the most popular keywords used in the descriptions of the blogs that ColdfusionBloggers.org aggregates. read more... 


 

Simple Maze Generation using Coldfusion: Kruskal's Algorithm


 
In my first post on maze generation I looked into creating a maze using the simple Recursive Backtracking algorithm. A lot of credit in my understanding of that algorithm and the framework in which to apply the maze algorithms goes to Jamis Buck and his fantastic series on Maze Generation. Exploring Kruskal's Algorithm for maze generation was no exception.
read more... 


 

Simple Maze Generation using Coldfusion


 
As a kid, I always loved to solve mazes as well as try to create them using graph paper and a trusty #2 pencil. My mazes were never terribly complex but that did't matter, they were fun to build and fun to try and solve. Fast forward 20+ years and I still enjoy mazes but had not't given much thought in way of creating them.

Luckily I ran across Jamis Buck's blog, the { buckblogs :here } and was amazed to see all of the different algorithms that could be used to create mazes. Jamis does an awesome job of putting the algorithms into simple terms with lots of pictures, a visual demo (in JS) and some code samples in ruby. His post inspired me to try my hand at implementing some in Coldfusion. read more... 


 

Issues when calling a Coldfusion web services with optional arguments


 
I ran into several interesting issues the other day while unit testing a webservice method that had optional arguments. Most of the problems spawned from wrong information in the docs, but it also uncovered some legitimate bugs that I wanted to share in case anyone encountered the same issues. read more... 


 

CFDUMP isn't always what is seems


 
While working with <cfpdf> to split mutlipage PDFs I ran into a strange issue. In dumping the resulting variable from an <cfpdf action="read"> call, the output shows the variable being a structure with several properties. The problem is, if you try to access any of these properties using normal access notation (ie. object.property), an exception will be thrown stating that the property doesn't exist.

Take the following example: read more...