Struct in Coldfusion led get 28 error in mysql

My blog was almost dead last weekend because which encountered get 28 error in mysql. That's why I was seeking how come this error occurred in my blog. After a few hours, I found that query cache in mysql exceed the limited amount due to struct function of Coldfusion.

view plain print about
1<cfset titles = StructNew()>

As the outcome of troubleshooting, using Struct in coldfusion may leak database memory and should make clear all value in Struct after using.

In mysql, Coldfusion create the blank temporary table for struct function when we using it. After assigning value into struct by developers, Coldfusion also adding value from struct into the blank temporary table.

For every single request, Coldfusion always create the single blank temporary table for struct. For million requests, Coldfusion will also do like that? :)

enablecfoutputonly in cfsetting can suppress white space

Today, I found that using enablecfoutputonly in cfsetting can suppress white space.

Normal coding

view plain print about
1<cfloop from="1" to="10" index="i">
2    <cfoutput>#i#<br></cfoutput>
3</cfloop>

Render this coding and look at View source. You will get there is "space" between number and [br] tag.

view plain print about
11<br> 2<br> 3<br> 4<br> 5<br> 6<br> 7<br> 8<br> 9<br> 10<br>

With cfsetting with enablecfoutputonly.

view plain print about
1<cfsetting enablecfoutputonly = "yes">
2 <cfloop from="1" to="10" index="i">
3        <cfoutput>#i#<br></cfoutput>
4    </cfloop>
5<cfsetting enablecfoutputonly = "no">

Render this coding and look at View source. You will get there is no "space" between number and [br] tag.

view plain print about
11<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br>

CFCache with dependson

Since I've been assigned into application project, I'm too rare to use cfcache in my project. Because it's live-time application that's why we don't need to cache any information anyhow. But now, it's time to use cfcache in our application for enhancing performance. So I gotta learn through the usage of cfcache and the properties of the attributes of it. Among them, I really like "dependson" attritube of cfcache. How it works is, it will flush the page if found any value in this attribute is changed.

view plain print about
1<!--- Assign ID come from URL and get minute of Now --->
2<cfset CacheParam = url.myID & minute(now()) />
3
4<!---
5    cfcache will flush
6    if found different ID and different minute.
7    OR
8    cfcache will take on-hold
9    if found same ID and same minute.
10 --->

11<cfcache action="serverCache" dependson="CacheParam">
12 <cfoutput>
13 The value of CacheParam #CacheParam#.<br>
14     Current time : #timeformat(now(), "HH:mm:ss tt")#
15 </cfoutput>
16</cfcache>

HL7 interface and me

Well, I'm very new to involve at any interfaces in my life. Since August 2010, I have a chance to learn HL7 interface for my company which are going to integrate with another hospital software. When I need to send our information to another system, I always generate XML file and send them. When receive their information from them, receive XML file either and install our system. Once I heard HL7 interface, I thought they will also use integrated file as XML (because XML is standardize file system for integrated two systems). Actually, they use txt file as their integrated file.

HL7 means Health Level Seven which dedicated to share information between two hospitals (maybe, to others as well). In HL7, there are so many standardize events and segments (which has one to many relationships means one event has so many segments). For example, A01 event called Admit Patient which has MSH, EVN, PID, PV1 and so on.

[More]

Finally I'm on BlogCFC

I've spent 24 hours for migration my official blog from MangoBlog to BlogCFC. I don't want to clarify why I decided to move from MangoBlog to BlogCFC because most of facts have been clarified by Nil at his blog. http://nil.checksite.co.uk

For me, the important reason that I choose BlogCFC because of Mobile version and others are such as tweetbacks and gravatars picture from comment (which I really like this one :)).

MangoBlog has also advantages such as one-click-plugin-installation and themes which are based on Blogger and Wordpress. Please don't get me wrong either.

Database migration? No idea. I configured two databases by myself(manual) because my hosting is based on Railo which doesn't currently support ORM.

[More]

cfcontinue is same as continue of javascript

Today, I found that cfcontinue is same as continue of javascript. I'm not sure whether it would be useful or not even you're trying to use looping. I'm not sure why Adobe add cfcontinue as new tag in Coldfusion 9. I think, it would be useful for somewhere else. But for me, it's so far to use. Usage of cfcontinue is just like continue in javascript. If action happen in condition, Coldfusion will skip this action and will continue the rest of looping.

view plain print about
1<cfoutput>
2    <cfloop index="x" from="1" to="5">
3        <cfif x eq 1>
4            Gosh..!! I've been caught in #x#
5            <cfcontinue>
6        </cfif>
7        current count : #x#
8    </cfloop>
9</cfoutput>

[More]

simple usage of cfcomponent

Honestly, I'm so far to use cfcomponent in my life rather than cffunction. Because, most of our applications are based on Coldfusion MX7 before and which have been recently upgraded to coldfusion 9 for almost 1 year. That's why I lost some new features of Coldfusion 8 and 9. As CFdevelopers told, CFC is the most powerful tool in Coldfusion and can recover the some weakness of Coldfusion MX. That's why, I tried to use CFC and cfcomponent is very simple and not make developers to feel complicated. First of all, I need to create new cfc file called myTest.cfc.

view plain print about
1<cfcomponent displayname="myTest">
2    <cffunction name="displayMyName" access="public" returntype="string">
3        <cfargument name="getName" type="string" required="yes">
4        <cfreturn getName>
5    </cffuntion>
6</cfcomponent>

[More]

Different between setTimeout and setInterval

In these days, I'm so far to learn for my javascript enhancement. In my last project, I need to write about auto-refresh timer for ChChRart. In these coding, I was supposed to use setTimeOut. Unfortunately, it can't support my Chart to refresh always. Actually, it can refresh only one time once the page has been rendered. That's why I tried to use setInterval.

setTimeOut : action will be run (only one time) defined milliseconds are timeout. setInterval: action will be run always whenever defined milliseconds are timeout.

[More]

DOCTYPE Declaration for CSS

Before time, I didn't notice doctype declaration at the top of every pages and I don't either know how does it work. Yesterday, I created a new style sheet about change button style when mouse-over. As you know, it's very simple to do for developers and don't need to create much coding for it. After creating and then I tested, it doesn't work. I bet all are correct in my style. Here is stylesheet.

view plain print about
1/* button style */
2    .button
3    {
4        color: #feeef5;
5        border: solid 1px #d2729e;
6        background: #f895c2;
7        font: 14px/100% Arial, Helvetica, sans-serif;
8        padding: .5em 2em .55em;
9    }
10    
11    .button:hover
12    {
13        background: #f90442;
14        text-decoration: none;
15    }
16    .button:active
17    {
18     color: #f3c3d9;
19    }

[More]

Coldfusion load content like Facebook and Twitter

Today, I've tested how to load content like facebook and twitter when scrolling down at the bottom of document. I feel it's cool and flexible for developers and users. As mention in previous post, don't need to include pagination and don't need to retrieve all data from database.By using like that, we can save our client time to click pagination link and don't need them to worry how many pages he/she already clicked. In this demo, index.cfm is the main page and action.cfm will display the rest of limited records when scrolling down at the bottom of document.

[More]

More Entries

Top of Page