Sunday 9 September 2012

HTML5 Presentation Tool

In my final semester of University I was part of a team who developed a prototype tool for creating interactive presentations targeted for Tablet devices. The client, Portable Studios, asked us to take advantage of the latest touch technology, and we built the project using the Sencha Touch Framework. The prototype uses a MySQL Database, and uses PHP to interface with this database, by using the CakePHP Framework.

I was mainly involved in the PHP and database development for the project.

Click on the link below to watch the video presentation of our project.



Many thanks to Rob Shilo for helping us make the video.

Project Team:
Alex Koumoundouros
Truong Thien Nguyen
Josephat Kadira
Alexander Conn
Jing Zhang

Wednesday 5 September 2012

Problem Caching Queries with ColdFusion

ColdFusion will only cache queries if the SQL used within them stays exactly the same. This also means that the query's
  • Name,
  • Datasource,
  • Database type,
  • Username & password
must also remain the same. I ran into the mistake of adding the datetime variable Now() for a datetime field, and the query would not cache. Once I realised what the issue was, to get around it I simply used the date + hours portion of Now(), and replaced it in the query.

Below is an example of a query which can be cached for 1 hour.


When using cached queries, you should always ensure that the 'Maximum number of cached queries' in ColdFusion admin (Server Settings > Caching) is set to a higher number (I found my ColdFusion 9 was set to only cache 1 query). The value should be set depending on the amount of RAM in your server and the performance of your database.


Friday 31 August 2012

Delete Offline Files in Windows 7


As a user of the 'Always available offline' feature in Windows 7, I find the interface for it is very counterintuitive. One of the missing features which I find most irritating is that you cannot simply remove the files (and hence free up some space) which you no longer want to be available offline. If you are finding the same problem, then follow these steps I used to successfully delete the files. Note that you must have administrative rights to perform these tasks, and the method below will delete all the offline files, so make sure everything is backed up.

  1. Firstly, disable offline files by typing in 'manage offline files' into your start menu and hitting disable. You must restart for this to take effect.
  2. You can now edit your registry (with care) to tell Windows to purge the files.
  3. Open regedit.exe. Navigate to HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > services > CSC > Parameters. Create a new parameter of type DWORD and call it 'FormatDatabase' and set its value to 1.
  4. Reboot. After rebooting, you can re-enable offline files and all of your existing offline files should be removed.

Tuesday 28 August 2012

Merge PDFs with ColdFusion

ColdFusion cfpdf merge function

Use ColdFusion to merge 2 (or more) PDF files together. 'Order' is a parameter which can be used to specify the order in which to merge the documents.

This example merges 2 PDF documents and assumes the directories exist from the server root '/upload/' and '/upload/merged/'




Click here for a Demo or find this tutorial on learncf.com

Tuesday 21 August 2012

Error Executing Database Query

[Macromedia][SQLServer JDBC Driver]Value can not be converted to requested type.

I received this vague error after I had added some extra columns into a table.

The code:



It turns out the error was being caused by the SELECT * as the ColdFusion server must have been caching the query. Restarting ColdFusion server fixed this, but to avoid receiving this error in the future only the columns that are required in the query should be listed.

Monday 13 August 2012

ColdFusion 10 and MS SQL Server 2012 Express

How to set up ColdFusion 10 with MS SQL Server 2012 Express

These are the steps I followed to set it up. I found I had to use SQL server's "sa" account in order to get it working properly, but I would not recommend doing this on anything which requires security.

  1. Install MS SQL Server, choose the option to install a 'New SQL stand-alone installation...'
  2. Choose the option to customise each feature and select the features as shown below.

  1. In the Database Engine Configuration page, choose Mixed Mode and create a password as well as adding the current Windows user account (to easily allow access with SQL Server Management Studio).

  1. Complete the installation and then open the SQL Server Configuration Manager.
  2. On the side panel, expand SQL Server Network Configuration, and select Protocols for SQLEXPRESS. Enable TCP/IP and click properties.
  3. In the properties tab, set the port number for each field in the IP Addresses tab, I used port 3306.
  4. Again on the side panel, select SQL Server Services and restart SQL Server (SQLEXPRESS).
  5. Open MS SQL Server Management Studio and login using Windows authentication.
  6. Expand security > logins, right click properties on "sa". Set the password.
  7. Open ColdFusion Administrator and select the Data Sources tab.
  8. Enter the name you wish to use to refer to the data source, and select MS SQL Server for the driver.
  9. Enter the database name, server IP address and port set in step 6, and username "sa" with the password set in step 9 and submit. If all is well, ColdFusion should display a confirmation message in green text.

I hope you found this helpful. Please leave me a comment.