Blog

December 30, 2011
Passing additional data to CALLBACK function of jQuery.ajax

Now a days we can not imagine web application with AJAX and jQuery make stuff lot easier to us. We normally need to use ajax call to update web content asyncronously. $.ajax is really simple to use, well I haven't write this post to advertise $.ajax but to explain how we can pass our custom arguments to its callback function.

$.ajax callback function have three default parameter 1. Content 2.Status 3. HTTPResponse object and in most of the case this are enough information in case you want to alert user or display message on particular dom object.

Comments(0)
Tags: jQuery
December 24, 2011
Saving with EC2 Reserved instance: AWS

Recently working with client to move ColdFusion project to AWS which has seasonal traffic. Key points are saving cost and easily upgrade/degrade server whenever needed. Initially start with On-Demand instance to make sure everything working fine before we permanently move to Cloud. As to save we have option to create reservered instance instead of ondemand. Recently Amazon introduce three type of reserved instance.   Light Utilization Medium Utilization Heavy Utilization ...

Comments(0)
Tags: AWS
December 23, 2011
.cfc page not supported in ColdFusion 5, make it work using .cfm page

Recently I use ColdFusion 9 for development, one of the project in that I create findcity.cfc page that contains function 'findCity()' to get list of cities(with zipcode) of specified state. I use one javascript function that send Ajax request that call 'findCity()' funciton. Issue is that project build on ColdFusion 5, so that not support .cfc pages.For that I create 'searchCity.cfm' page that provide the same fuctionality same as 'findCity()' function of findcity.cfc page ...

Comments(0)
Tags: ColdFusion5
October 31, 2011
Strange ColdFusion issue, JRUN eating up to 50% of CPU.

For one of our project we recently move to Amazon EC2 to make system easily scalable. This is kind of seasonal website which has high traffic during September and October and rest of the year traffic reduced to 70% with compare to October month. I think Amazon's usage based model is perfect for this client as he doesn't need to pay much on his off season also we can easily scale and add new instances during peak season and cover cost that we saved during off season.

Finally we happily moved everything on cloud EC2 and working fine. Suddenly after 1 hour of so CPU usage increased to 50% and remain constance 50% for hour or so. While looking into Task manager we realize that JRUN is eating up that CPU but there wan't much traffic at that time (average 1 user/sec) and system was happily handling this much traffic in our dedicated server. Tried to install Fusion Reactor to see realtime users and other stats but it seem that even Fusion Reactor can not figure out who is eating up CPU. For a day we keep running server as our all sites working correctly and wasn't making much performance issue.

Comments(4)
Tags: ColdFusion
October 31, 2011
Configure ColdFusion with VisualVM.

For one of our project we are facing jrun high usage issue. When looking into task manager (Window 2008) I found jRun continously eating up 50% CPU usage even though there is no traffic (or may be 2 to 3 users) only on site. Initially I tried to install FusionReactor to get all kind of detail regarding ColdFusion. Started with trial version and thought if useful then get full version but it seems that giving me all application ColdFusion application related information but can't find anything why JRun eating 50% of CPU usage. After bit googing I found VISUALVM and JConsole for monitoring and troubleshooting java application. I like VisualVm due to it's nice GUI and also I can integrate JConsole as plugin to it. It win - win kind of situation.

Comments(0)
Tags: ColdFusion, Visualvm
October 21, 2011
Task Scheduler was not working Social Engine video upload module - Solved

Hi,

Recently I started reviewing SocialEngine (Short desc: create your own social networking site), and I face some issue with video uploading process.

I am using SocialEngine 4.1.7.

By default, user can only embed Video from YouTube and Vemio. But if you want to upload the Video file, you need to allow it by enabling settings from the Administrative area.

By Vikas
Comments(11)
Tags: Miscellaneous
September 28, 2011
Sql Server Rank() v/s Dense_rank()

Hello Friends, Some days before I was googling on sql server's system function and I got one site having sql server query puzzle. The site have very interesting puzzle. I got a puzzle during surfing and it is to find out second highest salary of each department and tie salary should also count. There are inbuilt functions in sql server to give rank as per result set. The Rank() function of sql server returns the position of value within a partition of a result set. Rank() function left ...

By Bharat Patel
Comments(2)
Tags: SqlServer
September 20, 2011
Read File line by line in ColdFusion by using Java Classes

HI,
I was having situation where I wanted to read a file and process each line.
I think cffile tag is not much to do it, so I use java classes.
Basically we need two kinds of classes.
1. InputSream
2. Buffer reader

Buffer reader is capable to read any input stream line by line.

Final code will look like:

<cfscript>
	FileName = expandPath('/temp.txt');
	objFileReader = createObject("java","java.io.FileReader");
	InputStreamReader = objFileReader.init(FileName);
	objBuffer = createObject("java","java.io.BufferedReader" );
	LineIO = objBuffer.init(InputStreamReader);
	</cfscript>
	
	<cfset eof = 0>
	<cfset cnt = 1>
	<cfloop condition="not eof">
	<cfset currline = LineIO.readline()>
	<cfif isdefined("currline") eq "no">
	<cfset eof = 1>
	<cfbreak>
	</cfif>
	<cfoutput>line #cnt#: #currline#<br/></cfoutput>
	<cfset cnt = cnt + 1>
	<cfflush>
	</cfloop>

By Vikas
Comments(2)
Tags: File, ColdFusion
September 20, 2011
Complex password strength checking through regular expression

Currently working on project for well non credit card company where they have online registration form. They really want user enter enter strong password for their account and criteria for password listed below..

  1. Password must length between 8 to 18.
  2. Password must contain atleast one alpha and on numeric.
  3. Password must have one special characters from @,#,$.
  4. Password can not have repeative alpha and numeric.

This is really complex but can be done with four different conditions easily (right?) but I decided to make things more complex and check all four condition with single regular expression. After spending time on this finally figure out regular expression can perform all four condition.

Comments(0)
Tags: Regular Expression, ColdFusion
September 6, 2011
Making Paypal standard checkbout more user friendly

Recently working with paypal standard checkout and it so easy to integrate with any application as it will redirect to paypal site and customer login and make all kind of payment stuff at paypal site only. But this task make really tuff for new customer who has limited knowledge of intenernet/paypal.

How this works? Well, paypal has very good documentation here. Basic flow is.

  1. Customer click on "Paypal" button which redirect to paypal site.
  2. Customer need to login or enter credit card information.
  3. Paypal ask for confirmation of payment.
  4. Thanks page for placing order with link to return original site.
Comments(0)
Tags: Paypal