musings

March 26, 2008

Create a Random List in ColdFusion

Filed under: ColdFusion — aliaspooryorik @ 3:51 pm

A post on how to randomise a list with ColdFusion: http://www.aliaspooryorik.com/blog/index.cfm/e/posts.details/post/create-a-random-list-in-coldfusion-38

*update*

I’ve found a comprehensive post by Ben Nadel about this:
http://www.bennadel.com/blog/219-Randomly-Sorting-A-ColdFusion-List.htm 

March 25, 2008

Getting MS SQL Database size using ColdFusion

Filed under: ColdFusion, SQL statements — aliaspooryorik @ 3:09 pm

Someone asked how to retrieve the size of all MS SQL Server databases using Coldfusion. There is a handy built in stored procedure called sp_spaceused which will do the job for you.

You can view the code to do this here

Fusebox powered blog

Filed under: ColdFusion, Fusebox — aliaspooryorik @ 2:01 pm

I’ve finally got round to writing my own blog web app. It is built on Fusebox 5.5, using the new implicit cfc based circuits instead of the traditional XML method.

You can see my new blog at: www.aliaspooryorik.com/blog/

So, why did I write my own blog software? Well, I’m a ColdFusion developer and I wanted to try out the new no xml approach to writing Fusebox apps in a real world situation. If anyone wants a Fusebox based blog or just wants to see a Fusebox application written without XML, then let me know. If there is any interest then I’ll be happy to release it a a free and open source project on riaforge.

March 20, 2008

Fusebox 5.5 Application.cfc and webservice bug

Filed under: ColdFusion, Fusebox — aliaspooryorik @ 4:21 pm

I just discovered a bug in Fusebox 5.5.1. You can replicate it by downloading the sample application from Fusebox.org.

If you create a CFC at the same level as your Application.cfc and call it as a webservice, it fails on line 32 of Fusebox.Application.cfc with the message

"Variable FORM is undefined. "

I solved this by changing the code in Fusebox5.Application.cfc to:

<cfif StructKeyExists(Variables, "URL")>
  <cfset structAppend(attributes,URL,true) />
</cfif>
<cfif StructKeyExists(Variables, "form")>
  <cfset structAppend(attributes,form,true) />
</cfif>

* Update *

Sean Corfield has now raised a ticket (#330) for this and added the fix to the Core files. He also spotted another scenario where this might occur. For now you need to download the latest trunk/corefiles/Application.cfc file from the SVN if you have the same problem until Fusebox 5.6 is released.

March 19, 2008

SQL Server Express 2005 and ColdFusion 8

Filed under: ColdFusion, SQL statements — aliaspooryorik @ 9:00 am

ColdFusion does not connect to the default install of SQL Server Express 2005. After much swearing I discovered that you need to enable TCP/IP (which is disabled by default).

To enable it go to Start -> Programs -> Microsoft SQL Server 2005 -> Configuration Tools -> SQL Server Configuration Manager. In the SQL Server 2005 Network Configuration, click on Protocols for SQLEXPRESS. Click on TCP/IP, and tick the box to enable it. Note: You will need to restart the SQL Server Service, which you can do from Services in your Control Panel.

If you have a firewall, then you need to allow SQL Server. It is a good idea to lock TCP/IP connections down to one port for security. SQL Server 2000 used port 1433. To set the port, clear the value for “TCP Dynamic Ports” and enter the port you want to use in the “TcpPort” box. Note: you will need to use the same port in the ColdFusion CFIDE administrator.

Next Page »

Blog at WordPress.com.