BlogCFC simple add mobile ON/OFF feature with jQueryMobile

Yesterday I've added mobile version on/off feature in my blog with jQueryMobile. As we know, this mobile version on/off feature is already in BlogCFC. For my side, just put jQueryMobile button and add simple javascript.

Here is my change log in index.cfm file of BlogCFC mobile folder.

view plain print about
1<div data-role="fieldcontain" align="center">
2    <label for="slider">Mobile Version:</label>
3    <select name="slider" id="slider" data-role="slider">
4        <option value="nomobile">Off</option>
5        <option value="">On</option>
6    </select>
7</div>

[More]

CFLoop query is really getting slower than CFOutput query?

I've found some CF developers comment that "CFloop query is getting slow than Cfoutput query" here and there. Honestly, I always use CFOutput query because it's suitable to use and don't need to put CFOutput tag for displaying data within in CFLoop. Regarding their comments, I want to test which one is faster for retrieving data from database. It's not offense to anybody. It's just for testing purpose.

view plain print about
1<cfquery name="Testqry" datasource="myDSN">
2    SELECT ACCOUNT_NO FROM ACCOUNT_TABLE
3</cfquery>
4
5Total record : <cfoutput>#Testqry.recordcount#</cfoutput><br><br>
6
7<cfset outQueryStart = GetTickCount()>
8<cfoutput query="Testqry">
9    <cfset outputData = ACCOUNT_NO>
10</cfoutput>
11<cfoutput>Output Query : #GetTickCount() - outQueryStart#mms</cfoutput><br>
12
13<cfset loopQueryStart = GetTickCount()>
14<cfloop query="Testqry">
15    <cfset loopputData = ACCOUNT_NO>
16</cfloop>
17<cfoutput>Loop Query : #GetTickCount() - loopQueryStart#mms</cfoutput>

[More]

One of my favourite changelogs in Firefox

I cannot say what I found in Firefox 4 aren't cool enough but they're awesome. Because of those, I cannot write that much coding for my projects when I push my clients to use Firefox 4 as our project default browser. Don't look at those new changelogs first. Just look GUI of Firefox4. I can feel it's cool because they can screw the layout of menu toolbar and the obvious button for previous browsing history. Another one is saving password. I can obviously see the message box after I typing password into my blog, email or etc.

Ok, here is one of my changelogs of Firefox4 for me.

  • Javascript Alert Box
  • Javascript Prompt Box
  • Javascript Confirm Box

[More]

Configure subdomain in Apache

Yesterday @christopher commented "how to configure subdomain in Apache" under the post "Install Apache and Create Virtual Directory in Window 7". To be honest, I'm now currently developing CF development on Window 7 that's why I know how to configure subdomain in Window 7, not on Linux or other OS. To configure in subdomain, we need to do in 2 parts.

  • To configure in hosts file of window
  • To configure in Apache httpd.conf

1) To configure in hosts file of window

First of all, we need to find hosts under the following location. C:\Windows\System32\drivers\etc (it's for window7, if you're using another window version, search under System32 folder.) Then, open hosts with notepad and you will see the following codings.

Here is the below part of hosts file.

[More]

Install Apache and Create Virtual Directory in Window 7

My laptop is getting slow when I run IIS7 and CF9. Honestly, the physical memory of my laptop is just 2G and happening so because of lack of memory. That's why I need to remove IIS7 and install Apache as my web-server. Before installing Apache in window 7, I though it's difficult to install and configure because my OS is window. As we all know, the configuration setting in Apache isn't same as IIS because IIS GUI is quite nice for developers and don't need to configure like add codings in Apache. In Apache, it's a bit messy but I can cool.

Here is the instruction guide of Installation Apache.

1) Download Apache installer

You can download installer under this link Download Apache Installer. For me, my downloaded file is httpd-2.2.17-win32-x86-no_ssl.msi.

2) Install Apache

Install Apache. When you reach the following screen (Server Information)

Server Information

[More]

Coldfusion ORM in CFScript version

In these days, I feel like myself to write all of CF coding in CFScript version. Because most of CF Developers said CFScript coding can enhance your projects than normal CFML coding. That's why I want to develop my simple ORM projects with CFScript as testing purpose.

view plain print about
1<!--- Application.cfm --->
2
3component output="false" {
4THIS.name = "CFScriptORM";
5THIS.applicationTimeout = createTimeSpan(0, 1, 0, 0);
6THIS.clientManagement = false;
7THIS.datasource = "cfartgallery";
8
9THIS.loginStorage = "cookie";
10THIS.sessionManagement = true;
11THIS.sessionTimeout = createTimeSpan(0, 0, 30, 0);
12
13THIS.ormenabled = true;
14THIS.ormsettings = {};
15
16public void function onError(required any Exception, required string EventName) {
17
18 if (ListFindNoCase("onSessionEnd, onApplicationEnd", Arguments.EventName) IS 0)
19 {
20 WriteOutput("<h2>An unexpected error occurred.</h2>");
21 WriteOutput("<p>Please provide the following information to technical support:</p>");
22 WriteOutput("<p>Error Event: #Arguments.EventName#</p>");
23 WriteOutput("<p>Error details: #Arguments.Exception.message#<br>");
24 }
25return;
26}
27}

[More]

Repeat String Function in Oracle

Now, I'm fixing the coding of HL7 interface project and clean any unnecessary coding and function from Coldfusion and Oracle Stored Procedure for performance. Among them, I've found that I've used looping in Oracle Stored Procedure for concatenating string as like follow.

view plain print about
1V_FIRST_STRING := 'PPSHEIN';
2V_LOOP := 10;
3FOR LCOUNT IN 1.. V_LOOP
4LOOP
5    V_ZERO := V_ZERO || '0';
6END LOOP;
7V_FINAL_STRING := V_FIRST_STRING || V_ZERO;

When I developed this coding, I didn't know there is RepeatString built-in function like Coldfusion in Oracle. My senior told me that there is RepeatString in Oracle but he forgot it. In this time, I was in rush and I decided to try with Looping.

Now, it's time for me to consider the performance of my HL7 interface project. In Coldfusion, Every CF developers know repeat string in Coldfusion is RepeatString function. In Oracle, RepeatString build-in function is what? So, I've kept searching around Oracle forums and documentations. Finally, I found there is RPAD function in Oracle acts like RepeatString in Coldfusion. Usage is slightly like Coldfusion.

[More]

Pagination in BlogCFC with jQuery Mobile

I've wrote how to integrate blogCFC into jQuerymobile. Honestly, it's just simple integration and don't have pagination features and comments at that time. Because it's my testing purpose and just want to play jQueryMobile. Now, it's time for me to add pagination feature in blogCFC with jQueryMobile. For about that, we need to add some codings in index.cfm and completely don't need to include posts.cfm from index.cfm of blogCFC mobile folder. Because I just took some coding reference from existing mobile version of blogCFC.

First of all, we need to declare following two parameters in index.cfm.

view plain print about
1<cfparam name="curPage" default="1">
2<cfparam name="Page" default="1">

After that, we need to replace the following coding from existing "posts.cfm" instead of "including=posts.cfm". In this point, I've changed some codes and add any needed function into it.

[More]

Extracting CFMX 6.1 exe file error with DEP

Today I need to install CFMX 6.1 into Windows Server 2003 Enterprise. I though Single Server Coldfusion installation is very simple and don't need to take that much time for accomplish it. Unfortunately, I got the problem when I extract CFMX6.1 installer at the server. Because it cannot extract and disappear when I double click on this installer. I kept trying again and again but not successful. So, I need to go event viewer of the server and check application error logs. Oddly, I found the following error message

apllication log: Faulting application coldfusion-61-win.exe, version 5.0.0.0, faulting module coldfusion-61-win.exe, version 5.0.0.0, fault address 0x00021cb0.

That's why I kept searching around internet and finally got the solution for this weird problem. It's because of I need to add CFMX6.1 installer into "DEP = Data Execution Prevention".

  • Click Start, click Run, type sysdm.cpl in the Open box, and then click OK.
  • Click the Advanced tab, and then click Settings under Performance.
  • Click the Data Execution Prevention tab, and then use one of the following procedures:
  • Click Turn on DEP for essential Windows programs and services only to select the OptIn policy.
  • Click Turn on DEP for all programs and services except those I select to select the OptOut policy,
    and then click Add to add the programs that you do not want to use the DEP feature.
  • Click OK two times.

[More]

To save data into localStorage when Offline

Today I've found how to save the information of your data when offline (when your internet connection is disconnect). That's same as when Google email work. It's very useful to use because our submitted data is sometimes lost when our connection is disconnect or offline. Using this feature in HTML5 can prevent these bad situation. The important part is we need to check whether our browser can support "localStorage" or not. If not support, cannot develop anymore. If support, let's go.

First of all, we need to create manifest file for "localStorage". It's the main part to let browser know our application will be using "localStorage". So, we need to add all of files name we will be using into this manifest file as follow. Current my simple application, I've used 2 files called index.html and lc.js. So, I need to add as follow

view plain print about
1CACHE MANIFEST
2index.html
3lc.js

Now I need to let our clients know he/she is now online or office with following javascript.

view plain print about
1navigator.onLine ? "online" :"offline"

After that, I need to create index.html file. As HTML5 standard, I need to follow the rule of HTML5.

view plain print about
1<!DOCTYPE HTML>
2<html manifest="/loc.manifest">

[More]

More Entries

Top of Page