CFIDE with multiple instance

Today I got the problem that I cannot use following sentence in one of my instance.

view plain print about
1<cftextarea skin="silver" toolbar="Basic" richtext="true" name="body" required="true">

And hit JS error and don't know why. That's why I just go viewsource and found that CFIDE is missing for one of my CF instances. I cannot convince why Adobe cannot include CFIDE for multiple instances installation. That's why I know there is two ways to solve this bug of Coldfusion multiple instance installation.

[More]

Your Ad Here

IncrementValue in Coldfusion is useful

Today, I've oddly found IncrementValue in Coldfusion. In my previous time, when I need to increase count in Coldfusion, I always use as follow.

view plain print about
1<cfset mycount = mycount + 1>
2
3<!--- CFScript version --->
4<cfscript>
5    mycount++;
6
</cfscript>

[More]

Coldfusion 9 exam preparation

I'm now planning to take Coldfusion 9 exam for my career enhancement. Because I'm Adobe Certified Expert in Coldfusion 8 and I feel like myself to take Coldfusion 9 either. Some people will argue that certificates are not needed if you really know of it but for new career, it's needed. When I want to apply for new job, I'm not sure whether the new employer know I really know Coldfusion or not without having certificate. 

Coldfusion 9 Exam Structure

  • Programming fundamentals
  • Working with the Application framework
  • Interacting with databases
  • Working with components
  • Interacting with persistent components
  • Working with XML
  • Reusing code
  • Interacting with remote systems
  • Managing files
  • Tuning application performance
  • Building advanced user interfaces
  • Reporting

[More]

ListToArray and Looping in Array

Today I need to fetch data from *.csv (which has nearly 15,000 records) file and insert such data into our database. At that time, I need to consider how to retrieve data from this file and how to insert into our database. So, I need to consider which method I need to use between "looping in array" and "ListToArray". That's why I've wrote with "looping in array" first.

Here is simple list data including in CSV file.

view plain print about
1007|PPSHEIN|MALE|COLDFUSION DEVELOPER
2008|MIKE|MALE|ANDROID DEVELOPER
3009|RAYMON|MALE|APPLE DEVELOPER

[More]

Merge Area Chart and Bar Chart in Coldfusion

These days I'm about to develop growth chart module for my current project enhancement. In this growth chart, I need to merge two chart series called area chart and bar chart to display patient percentile. In Coldfusion Chart, if we're trying to merge two chartseries, x-axis of both must be same records. If not, our chart might be displayed wrong data.

Here is my sample coding of CFChart.

view plain print about
1<cfchart
2 format="png"
3    xaxistitle="Age (mth)"
4    yaxistitle="HEAD"
5    chartwidth="500"
6    chartheight="500"
7 gridlines="6"
8 showborder="no">

9        <cfchartseries
10            type="bar"
11            paintstyle = "light"
12            seriescolor="000000"
13            seriesLabel="Patient's Information">
14            <cfchartdata item="
3" value="10">
15        </cfchartseries>                
16        <cfoutput query="
Getgrowth" group="PERCENTILE">
17            <cfset i = i + 1>

18            <cfset serColor = ListGetAt(ListCOLOR, i)>

19            <cfchartseries
20                type="
area"
21                markerStyle="
diamond"
22                seriescolor="
#serColor#"
23                seriesLabel="
#convertOrdinal(PERCENTILE)#">
24                <cfoutput><cfchartdata item="
#AGE#" value="#GETDATA#"></cfoutput>
25            </cfchartseries>
26        </cfoutput>
27</cfchart>

[More]

Playing with CFThrow

Today, I found that cfthrow is very useful to me for error handling in my project. Because prior programmer of my current wrote some funny code for error handling without using cfthrow. I'm not sure whether they don't know cfthrow or not. Honestly, I didn't know most of Coldfusion Tags and functions before I took CF8 exam. When preparing for CF8 exam, I know most of tags and functions of CF8. Thanks, CF8 exam.

Ok, let's continue. Here is funny coding our prior programmer wrote.

[More]

Type in cflock is very important

Today, I realized that "type" in cflock is very important and essential for shared data manipulation. In Adobe Coldfusion documentation, which said "type" is optional in cflock but when we need to process shared data, it's not optional. IT'S VERY IMPORTANT. Why I know like that is because of I'm currently preventing about concurrency issues for my project. In these coding, we already used cftransaction as putting the whole queries and processes within cftransaction but cannot prevent at all. After that, I've put cflock again outside of cftransaction like that.

[More]

ListToArray save my time

Currently, I'm on HL7 module for my current project. For HL7 project, we need to collect all of patient information and save it into text file. After that, we need to send this text file to another party. So we need to send all patient data by creating list value and separated by "|" as delimiters.

Here is example of MSH segment information.

view plain print about
1MSH|^~\&|HISSAH|HISSAH|PCS||201106011138||ADT^A36|AHIS00000004|P|2.3|||AL|NE|||||

For this case, we don't know how to check whether all of sequences are correct or not. If we check manually, it will take so long and not efficient for our testers and system analyst. That's why I need to write simple Coldfusion program for that. That's why I wrote the following coding.

view plain print about
1<cfset MyList = "^~\&|HISSAH|HISSAH|PCS||201106011138||ADT^A36|AHIS00000004|P|2.3|||AL|NE|||||">
2
3<cfloop index="i" list="#MyList#" delimiters="|">
4    <cfoutput>#i#</cfoutput><br>    
5</cfloop>

[More]

FileExists vs IsImage in Coldfusion

Today, I'm very clear to know how to use FileExists and IsImage in coldfusion. Before time, I though these two tags working in the same boat but once I used these two, both are very different but slightly same.

What's the slightly same? It's very simple that we're not using the full path of file like that.

view plain print about
1<!--- Checking image --->
2<cfif FileExists("image.jpg")>
3    Image exists.
4<cfelse>
5    Image doesn't exist.
6</cfif>
7
8<!--- Checking file --->
9<cfif FileExists("myfile.txt")>
10    File exists.
11<cfelse>
12    File doesn't exist.
13</cfif>

If we're using the full path of image/file, FileExists doesn't work at all. At that time, we need to use IsImage for checking image exist or not.

view plain print about
1<!--- Checking Image with full path --->
2<cfif IsImage("http://www.ppshein.net/images/ppshein_banner.jpg")>
3    Image exists.
4<cfelse>
5    Image doesn't exist.
6</cfif>

Because, FileExists can check the directory of image/file and cannot check the full path URL of image/file. In this case, we need to use IsImage for checking image exists or valid type of image.

Sorry, I really missed out IsImageFile function of coldfusion which can support to check whether an image file is valid. Thanks, Ray for commenting about that.

Funny usage of CFImage within CFTry/CFCatch

Last Friday, my boss told me that I need to cooperate my module into other team's huge project called HIS (Hospital Information System) about displaying patient's photograph. That's why I needed to review their existing coding and needed to know the image path (directory). In this coding, I've found the following funny usage about cfimage within cftry/cfcatch.

view plain print about
1<cftry>
2    <cfimage
3        action = "info"
4        source = "#image_dir_path##myimage#"
5        structname = "my_img">

6    <cfcatch>
7        <cfset error_msg = "#cfcatch.message#">
8    </cfcatch>
9</cftry>

If I'm not mistaken, the purpose of above coding is the error message will be shown if no image found. As my experience, don't need to use cfimage, cftry, cfcatch tags if we need to check whether the image is existed or not. Just simple to use FileExists. It's very useful and don't need to write that much coding like above.

Here is very simple and useful for checking file/image exists or not.

view plain print about
1<cfif NOT FileExists("#image_dir_path##myimage#")>
2    <cfset error_message = "Image file doesn't exist.">
3</cfif>

More Entries

Top of Page