Yesterday I saw a post on the Brazilian ColdFusion list CF-BRASIL where a colleague was asking for any function to convert a value into the Brazilian currency “Reais” in the form of text. I remembered that I wrote a custom tag for that in 2002, but it had some problems writing the cents. Well, I worked on it tonight and accomplished to make a component which I called “rpMoneyBrExt.cfc“. Since I’m tired, I didn’t test it thoroughly, but I made it sure to write the cents correctly now. So if you want to use, troubleshoot or modify it, be my guest, just send me your changes and keep my copyright notice. Download the component and a test template rpMoneyExtBr
I found an interesting ColdFusion component in an article on a Brazilian site written by Pedro Claudio Silva, who has authorized me to translate it into English. This component helps you to generate or modify images by using the CFIMAGE functions supplied with CF8.
The methods in this component are:
This function receives a person’s name and inverts the first and last names.
It will insert a comma after the last name if it is reverted.
Example: “John C. Doe” becomes “Doe, John C.” and “Doe, Jane K.” becomes “Jane K. Doe”
Argument: sName (required), name to be converted
In 2002 I wrote a CF custom tag to convert a raw text coming from a database table column into a HTML paragraph by replacing all tabs and carriage returns with “ ” and “<br>”.
Recently I needed to use that custom tag again and decided to transform it into a CF function named:
Download the function here.
In order to help with documentation of MS-SQL databases, I wrote this small ColdFusion utility to produce the table schemas from a given database. It is very simple and easy to install. I just recommend you to use it only on your development server or localhost, without external access, otherwise you will be supplying information to hackers.
It is composed of one ColdFusion template (CFM) and a component (CFC).
There is only one required URL attribute to be passed and 3 optional ones:
- datasource (required): datasource (registered in CF admin)
- table (optional): table name
- fList (optional): list of columns you want to show
- fLabels (optional): labels for the columns
If you omit the table attribute, the utility will list all tables in the database.
You may download the code here.
Last June I attended the CFUnited 2008 in Washington DC, together with my fellow CF developer Matt Horrell from the company we work for. Lots of information, more than we could possibily assimilate, 4 days of hard work attending sessions from 8:30 AM to 10 PM, but it was worthed every penny.
The visit to the Museum of Crime & Punishment was fantastic, not only the museum content but also the drinks and aperitifs served by Teratech. I almost got drunk from the good wine. The good thing was the way back to the hotel, allowed me to walk and come back to normal.
It is always good to meet the icons of our CF world like Sean Corfield, Sandra Clark, Ray Camden, Hal Helms, Charles Arehart and others. Matt and I had the opportunity to have lunch with John Farrar, Sean Corfield, Joe Rinehart and a group of Adobe personnel.