26.02.2010
After installing a brand new Ubuntu 9.10 64bit on VMWare i got the message:
ACPI: I/O resource piix4_smbus [0x1040-0x1047] conflicts with ACPI region SMB_ [0x1040-0x104b]
Resolved this by adding
blacklist i2c_piix4
at the end of /etc/modprobe.d/blacklist.conf
23.02.2010
Amazon S3 is a great way to store files that need to be exposed on the web. Every uploaded file can be accessible to the public or accessible to authorized users only via a clever system of expiring signatures.
Joe Danziger wrote an excellent CFC to do all kinds of operations via the S3 REST interface.
The only missing part is the new way Amazon is offering to upload files without the need to first buffer them on your own server.
The old way:
- You send a user (let's say a user of your CMS) to a page where he can upload a file
- The user clicks on 'Browse' to find the file on his harddisk and submits the form.
- The file is sent to your server.
- You send the file to S3 via a REST put.
- On success: you save a record in your database so you can remember what you sent to
S3
The better way:
- You send a user to a page where he can
upload a file
- The user clicks on 'Browse' to find the file on his harddisk and submits the form.
- The file is sent directly to a certain bucket of your Amazon S3 storage
- Amazon tells you about a successful upload and you update your database.
11.02.2010
In Apache i used something like:
to redirect a certain direcotory to another server.
In Nginx there is no redirect, so we gotta use something like:
01.02.2010
Starting to work with the Google Data API in coldfusion is bumpy. This is mostly because of the initial learning curve on how Google handles the authorization process with AUTH and AUTHSUB methods.
I just uploaded a fully working example to access the Picasa Albums API via Coldfusion to Github and would welcome some comments on it.
Coldfusion-Google-Data-API
17.12.2009
Just a quick one. I wrote this generic function today to convert any query to a valid JSON string with lowercase element names.
<cffunction name="queryToJSON" returntype="string" access="public" output="yes">
<cfargument name="q" type="query" required="yes" />
<cfset var o=ArrayNew(1)>
<cfset var i=0>
<cfset var r=0>
<cfloop query="Arguments.q">
<cfset r=Currentrow>
<cfloop index="i" list="#LCase(Arguments.q.columnList)#">
<cfset o[r][i]=Evaluate(i)>
</cfloop>
</cfloop>
<cfreturn SerializeJSON(o)>
</cffunction>
Just call this function with:
<cfset myJSON=queryToJSON(yourQueryName)>
24.11.2009
This tutorial is meant to get you up and running with ColdFusion and CouchDB. If you have never heard about CouchDB i suggest you read Matt Woodward's slighty chaotic but very informative article about CouchDB.
Step 1: Getting a CouchDB instance up and running
Currently (as of version 0.10) CouchDB is available for Linux and Mac. If you are running Linux, you might know how to get it up and running. If you got a Mac available (either your own or in your network) then things are very easy. Just download CouchDBX and you are ready to go in 1 minute.
After you started CouchDB you will see the administration interface called Futon. If you want to reach your CouchDB from another server, you will have to change the IP address on which CouchDB listens to requests:

Set the bind_address to 0.0.0.0 to make it listen to all requests or set it to the IP of that machine (e.g. 192.168.120.120) so it can only be reached within your network. If you leave it to the default (127.0.0.1) you will have a hard time reaching CouchDB through the network.
15.11.2009
While pumping lots of records / docs / bulk inserts to the new CouchDB Server i got a mysterious connection timeout that appeared always after about 4000+ inserted records.
By using cfhttp.errorDetail i got the error:
I/O Exception: Address already in use: connect
To save you some time here is what i found.
06.11.2009
While playing around with CouchDB, ColdFusion and SerializeJSON i found that the SerializeJSON does not honor the SetLocale setting. It will use the "Java Default Locale" which is set for the JRE.
So if your Windows installation is German, you will have a DE_de locale.
Now if you us SerializeJSON for a date you will get a date like "März, 21. 2009". Not really good to use this in another DB.
21.10.2009
The usual setup is ColdFusion on either Windows with IIS or on Linux with Apache.
Both webservers are great webservers unless you get excessive load on them. At that time you wish that you had one server to do all the static files and one or more servers to do the ColdFusion requests.
Enter Nginx, the lightweight webserver written by Igor Sysoev. Nginx is one of the fastest webservers around and due to its different architecture will yawn at the load while Apache is already collapsing.
06.10.2009
CF9 offers a nice new feature: the server.cfc.
The Server.cfc can be enabled in all CF editions to be called once the server starts. Much like a bootscript or the good'ol autoexec.bat from MS-DOS.
We use Memcached a lot for our projects and always had the problem that each CF server spawned multiple connections to the memcached server. This was because at startup there were already dozens of requests waiting and they all fired in the very same second.