Pages

Thursday, January 23, 2014

populating a table from cfquery result

 this is how you can insert into a table from cfquery resultset.

many insert cfquery will be a bad idea. this is also not a very efficient way but kind of okay.  best thing you can do is to prepare a xml set and insert through  a stored proc through xml insert.

this is easy to do in cf.
1. your query is "qryCodeValue"

<cfsavecontent variable="qryTorun">                     
                    INSERT INTO table (ListNumber,listvalue) VALUES
                    <cfoutput query="qryCodeValue">                                          
                        (#qryCodeValue.ListNumber#, '#qryCodeValue.codevalue#)
                    <cfif qryCodeValue.currentRow EQ qryCodeValue.recordCount>;<cfelse>,</cfif>
                    </cfoutput>
</cfsavecontent>

 <cfquery name="qryRunInsertVar" datasource="#yourDS#">                                                               
              #REReplace(qryTorun,"''","'","ALL")#                          
 </cfquery>


Wednesday, September 25, 2013

red text in viewsource in firefox / why code is in red in firefox view source

 
 
 
if you wonder why you see red text in view source in firefox.   
 
 
<b><u><font size="2">EN </u></b></font> 
 
refer above example. 
 

here is the reason. 
there must be wrong with its start/end tag, missing double quote, missing single quote
or wrong  opening or closing of tag. 
 
in above example you can see i m closing font at last but i 
should close  it immediately after  text "EN".

Saturday, September 21, 2013

adding a blank value in a list

some times we need to add a blank value in a list. 


just as a note blank value will not be added if you are not adding a space in it



code 1 :     <cfset lstBOtitle = listappend(lstBOtitle,"",",")/>   -- will not work

code 2:     <cfset lstBOtitle = listappend(lstBOtitle," ",",")/>   -- will work
(above code has a space in it )




Thursday, March 28, 2013

showing /r/n for carriage returns and new line in ColdFusion Builder

showing whitespace in coldfusion Builder as r n

this is very common that some time while writing our code in coldfusion builder we press CTRL + period key (.) and coldfusion builder starts showing while space, carriage return as \r \n and you start feeling kind of :( .

simply toggle with pressing CTRL + . (period key) and it will be okay.

Tuesday, February 19, 2013

eq operator in coldfusion is case insenitive (:) very easy to mistake)

eq operator in coldfusion is case insensitive

its very common mistake. remember eq operator in coldfusion is case insensitive.
see below example.

<cfset a = "USD">
<cfset b = "usd">

<cfif a  eq b >   
    <cfoutput>
        yes
    </cfoutput>
<cfelse>       
    <cfoutput>
        else
    </cfoutput>
</cfif>

Friday, February 15, 2013

how to check if attribute exists in a xml node in coldfusion

how to check if attribute exists in a xml node in coldfusion



<cfif structKeyExists( node[1].xmlAttributes, "name" )>                                   
            <cfset statefileName = node[1].xmlAttributes.name/>
<cfelse>
           <cfset statefileName = ""/>
</cfif>


here Name is attribute thats i am trying to know if it is defined or not. 
isdefined fuction will not work here in finding node or attribute.

structKeyExists will help in finding if an attribute is present in a node or not.

Monday, September 10, 2012

Project Estimating, project estimation




I believe we should consider these points for estimation  process. there may be more, pls feel free to add. 
1.       Risks, Scope  and complexity of the project
2.       Domain/Functional/Technical Knowledge for requirements of team
3.       know strengths and weaknesses of individuals team members for requirement
4.       Know weaknesses of requirement with analysis meetings with functional expertise team members, QA, Architects and business analysts. 
5.       Process time:  process hours of project (including QA push process, development label creation, SCRUM meeting and any developer environment setup (not main environment setup) )
6.       Development time: real development hours
7.       Unit testing time: unit testing hours 
      
       EXCEPTION Handling:
8.       Developer buffer time
a.       waiting period for dependency information
b.      Estimations Can Go Wrong
c.       Unrealistic interpretation of original requirements
d.      Inadequate/unclear requirements
9.       Management buffer time ( Buffer time as per risks of project)
a.       Availability of All the Resource
b.      System outage
c.       Estimations Can Go Wrong

Few points
1.       Historical data for the previous estimation for improvement and accuracy

2.       It’s good to include assigned developers in estimation process after 1st level of estimation (after Architects estimate).
3.       In estimation process, it will be good to give enough time to developer so he can at least go through limitations of current system and resource, learning curves of new technology for project.
4.       It will be good, if we get time for proof of concept depends on project, if project needs proof of concept.   
5.       More meetings with business analyst and QA will help to understand and streamlining the project requirements. 
6.       Estimation will be more accurate and efficient if developer will be included in design phase.