Dropbox and Time Machine don’t always play well together

October 15th, 2010 1 comment

Over the last couple of weeks I’ve noticed that my hourly Time Machine backup on my Mac Pro has been backing up almost 2GB of data every time it runs. I couldn’t for the life of me figure out what could be changing that much data each hour and Time Machine is less than helpful when you try to find out exactly what is being backed up each time. It will only tell you what the total size is of the files being backed up. Now, normally this wouldn’t be too big of an issue. However, in my case, I have Time Machine on 7 different Macs in the house backing up to a 1TB Time Capsule. Total free space just keep getting lower and lower so I started worrying when I got down to about 20% free space on the Time Capsule.
Read more…

Categories: Mac

Dynamically set ColdFusion ORM datasource

September 20th, 2010 4 comments

I’m a relative novice using ColdFusion’s ORM features having done just one “real” project so far that took advantage of it. I’m working on an application that needs to be able to set the datasource for each request based on the URL that the customer is using to access the site. For example, if a customer visits http://customera.demoapp.com I need the application to use the DSN named “dsn-customera”, http://customerb.demoapp.com gets “dsn-customerb” and so on.

Normally this wouldn’t be an issue–you’d do some sort of logic in the onRequestStart() method in Application.cfc and set a request or session scoped variable to the name of the DSN and go from there. However, when using ColdFusion’s ORM functions, this approach doesn’t work since “this.datasource” is configure in the pseudo-constructor at the top of Application.cfc like so:
Read more…

Categories: ColdFusion

Returning ColdFusion 9 ORM objects with JSON

July 19th, 2010 13 comments

Last week I was working on a client’s project that makes heavy use of ColdFusion 9′s ORM features. Everything we’d done with ORM up to that point had been going really well and I continue to be impressed by the amount of time ORM saves me in development. I had gotten to a point in the project where I needed to be able to use AJAX calls from jQuery to manage some of the data in the database. Based on my experiences using a RemoteFacade.cfc to feed data to a Flex app, I thought it should be pretty easy. Several hours later, I realized that my particular use case for this was anything but easy.
Read more…

Categories: ColdFusion, jQuery

Building Advanced Workflows with ColdSpring at cf.Obective()

April 24th, 2010 No comments

Thanks to all the folks that came to my Advanced Workflows with ColdSpring session today at cf.Objective(). The conference this year was outstanding and I’m honored to have been chosen to speak. If you’re interested in getting the slides and code, I’ve uploaded a zip file that includes everything I used in the session.

Embracing “New” in ColdFusion 9

April 16th, 2010 13 comments

I’m not sure how I missed this before but among the long list of things added to ColdFusion 9 is the ability to create a CFC using the “New” syntax. Up until now, to create a new object from a CFC we’d use the createObject() method like so

<cfset Team = createObject("component", "model.Team") />

Now, using the New keyword, we can shorten that to

<cfset Team = New model.Team() />

But wait, there’s more!
When you use the New keyword, ColdFusion will automatically look for and run any init() method that exists in the CFC. It also respects any arguments that your init() method specifies, meaning that if you have a Team.init() method that can accept team name, color and manager arguments, you can build them right into your the same line of code used to create your object like so

<cfset Team = New model.Team( "Bumblebees", "Yellow", "Benny Bee" ) />

Likewise, as you’d expect, named arguments are still supported. So if you had to send in arguments out of order or needed to omit some optional arguments at object creation, you could do

<cfset Team = New model.Team(
              manager="Benny Bee",
              color="Yellow",
              name="Bumblebees") />

I personally am going to make a point to start using this in my code because I can never seem to spell the word “component” correctly in the createObject() method.

Categories: ColdFusion