My Bio

Posted by Admin on January 8, 2008  |  Comments (1)  |  Related Categories: Resume

I am a self-taught programmer with a passion for learning new technologies. After creating both large and small applications in ColdFusion since version 4.5 (2000), I began building more scalable applications with Model-Glue, a ColdFusion application framework, two years ago. I have been administering MS SQL Server since 2001 and am well-versed in MySQL and Oracle.

Quick note

Posted by Admin on December 27, 2007  |  Comments (0)  |  Related Categories: ColdFusion

Cool free template Marine/
100 Excellent Free WordPress Themes

How to send text messages from ColdFusion.
Verizon Wireless
number@vtext.com

Sprint
number@messaging.sprintpcs.com

T-Mobile
number@tmomail.net

Cingular
number@cingularME.com

Nextel
number@messaging.nextel.com

Virgin Mobile
number@vmobl.com

Ray's Friday Puzzler

Posted by Admin on December 10, 2007  |  Comments (0)  |  Related Categories: ColdFusion

<!---
* What files exist in folder A, but not B
* What files exist in folder B, but not A
* What files exist in both, but APPEAR different (size, date)
--->



<cffunction access="public"
         name="compareDir"
         output="true"
         returntype="struct">

   <cfargument default="" name="pathA" required="true">
   <cfargument default="" name="pathB" required="true">
   <cfset var qryDirA = "" />
   <cfset var qryDirB = "" />
   <cfset var sameFiles = "" />
   <cfset var myReturn = structNew() />

   <cfif directoryExists(expandPath(arguments.pathA))
       AND directoryExists(expandPath(arguments.pathB))>

      <cfdirectory action="list"
               directory="#expandPath(arguments.pathA)#"
               name="qryDirA"
               filter="*.*">

      <cfdirectory action="list"
               directory="#expandPath(arguments.pathB)#"
               name="qryDirB"
               filter="*.*">

      
      <cfquery name="sameFiles" dbtype="query">
         select qryDirB.* from
         qryDirB,
         qryDirA
         where qryDirA.name = qryDirB.name
         and (
          qryDirA.DATELASTMODIFIED != qryDirB.DATELASTMODIFIED
         )
      </cfquery>
      
      <cfset myReturn.SameFilesDiffDT = ValueList(sameFiles.name) />
      <cfset myReturn.DirectoryAOnly = "" />
      <cfset myReturn.DirectoryBOnly = "" />
      
      <cfloop query="qryDirB" >
         <cfif not ListFindNoCase(ValueList(qryDirA.name),name)>
            <cfset myReturn.DirectoryAOnly = ListAppend(myReturn.DirectoryAOnly,name,',') />
         </cfif>
      </cfloop>
      
      <cfloop query="qryDirA">
         <cfif not ListFindnocase(ValueList(qryDirB.name),name)>
            <cfset myReturn.DirectoryBOnly = ListAppend(myReturn.DirectoryBOnly,name,',') />
         </cfif>
      </cfloop>
   </cfif>
      
   <cfreturn myReturn>
</cffunction>

<cfdump var="#compareDir('a','b')#">

SES URL

Posted by Admin on December 6, 2007  |  Comments (0)  |  Related Categories: codeColdFusion

It seems like everyone has SES URL's so I thought it was time I make my site have them as well. So since I don’t have access to the server on my site to do something like this ISAPI Rewrite, I thought I would write my own so here it is.

<cfif Len(Trim(cgi.PATH_INFO))>   
   <!--- Create a struct to hold all of our variables so
         we can debug easier --->

   <cfset ses = StructNew() />   
   <cfset ses.urlVars=
         ReReplaceNoCase(Trim(cgi.path_info), '.+\.cfm/? *', '')>

   <!--- since I am using Model-Glue event will always be first
         in the list so set it and then strip it --->
   <cfset url['event'] = ListFirst(ses.urlVars,'/') />
   <cfset ses.urlVars = ListDeleteAt(ses.urlVars,1,'/') />
   <!--- Now that we deleted the first item we need to check to
         see if still have a list --->

   <cfif ListLen(ses.urlVars,'/')>
      <!--- This is just in case some trys to pass another
             event variable --->

      <cfset ses.urlVars =
            ListDeleteAt(ses.urlVars,ListFindNoCase(ses.urlvars,'event','/'),'/')>

      <cfset ses.urlVars = listRest(ses.urlVars,'/') />
      <!--- Loop over the our list and step by two that way we
            can set name value pairs --->

      <cfloop from="1" to="#ListLen(ses.urlVars,'/')#" index="ses.i" step="2">
         <!--- Set the current url name --->
         <cfset ses.CurName = Listgetat(ses.urlVars,ses.i,'/') />
         <!--- Check to see if there are enough items in the list
         to set the current url value --->

         <cfif ListLen(ses.urlVars,'/') gte ses.i + 1>
            <cfset ses.CurValue = listgetat(ses.urlVars,ses.i + 1,'/') />         
         <cfelse>
            <cfset ses.CurValue = "" />
         </cfif>
         <!--- Create your url name value pair --->
         <cfset url[ses.CurName] = ses.CurValue />
      </cfloop>
   </cfif>
</cfif>

Calculate B-days

Posted by Admin on November 28, 2007  |  Comments (0)  |  Related Categories: code

Again this is just for my reference.  year * 365.25

Ajax Engine

Posted by Admin on November 28, 2007  |  Comments (0)  |  Related Categories: JavaScript

I am just adding this for my own reference this is an Ajax Engine that I wrote a while ago.
function Ajaxengine(){
};
Ajaxengine.loadStatus=false;
Ajaxengine.loadDoc = function (url, sMethod, method, params, msg){
   try{      
       try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
       catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
       catch (e) { try { xmlhttp = new XMLHttpRequest(); }
       catch (e) { xmlhttp = false; }}}
      if(!Ajaxengine.loadStatus){
         if(msg){
            Ajaxengine.addMessage(msg);
         }         
         Ajaxengine.loadStatus=true;
         call = new Object();
         call.method=method;
         call.xmlhttp=xmlhttp;
         var urlParams=null;
         for (var element in params){
            temp=params[element];
            temp=temp.split(":");
            if(!urlParams){
               urlParams=temp[0] + "=" + temp[1];
            }else{
               urlParams=urlParams + "&" + temp[0] + "=" + temp[1];
            }
         }
         urlParams = encodeURI(urlParams);
       temp="";
         /* branch for native XMLHttpRequest object*/
         
         sURL=url + '?' + urlParams
          if (sMethod == "GET"){
            call.xmlhttp.open(sMethod, sURL, true);
            sVars = "";
          }else {
            call.xmlhttp.open(sMethod, sURL, true);
            call.xmlhttp.setRequestHeader("Method", "POST "+sURL+" HTTP/1.1");
            call.xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
          }
          call.xmlhttp.onreadystatechange = function() { Ajaxengine._Change(call); };
          call.xmlhttp.send(urlParams);         
      }
   }catch(oException) {
alert("Got the following expection data (1): " + oException);
}

};
Ajaxengine._Change = function (call) {   
   try{
   if (call.xmlhttp.readyState == 4) {
      
      var txt=null;

      txt=call.xmlhttp.responseText;   
      call.method(txt);
      Ajaxengine.loadStatus=false;
      Ajaxengine.removeMessage();
      if (call.xmlhttp.status == 200) {            
         return true;
      } else {
         return false;
      alert("There was a problem retrieving the XML data:\n" + call.req.statusText);
      }
   }   
   }catch(oException) {
alert("Got the following expection data: _change " + oException);
}
}

Ajaxengine.addMessage = function (msg){
   var _message=getEL("messagebox");
   if(_message){
      document.body.removeChild(_message);
      return false;
   }
   var _messageSpanShell = document.createElement("span");
   _messageSpanShell.id = "messagebox";
   _messageSpanShell.className="messagebox";
   _messageSpanShell.innerHTML=msg;
   document.body.appendChild(_messageSpanShell);
}

Ajaxengine.removeMessage = function (){
   var _message=getEL("messagebox");
   if(_message){
      document.body.removeChild(_message);
      return false;
   }
   
}

Joke of the day

Posted by Admin on November 27, 2007  |  Comments (0)  |  Related Categories: Funny

Two blondes meet

Blonde
#1 How are you?
#2 Fine
#1 are you dating
#2 I've met this great guy. Good looking, big house, drives a Mercedes, lots of money. Just one problem. He has a severe case of dandruff.
#1 You should give him Head and Shoulder's.
#2 I know how to give head but how do you give shoulders?

Making a row in a CFGrid a link

Posted by Admin on November 26, 2007  |  Comments (0)  |  Related Categories: ColdFusion

Making a row in a CFGrid(Flash Form) a link
<cfgrid name="data" query="qry_docs" height="400" rowheaders="no" onchange="getUrl(data.selectedItem.yourURL)">
   <cfgridcolumn name="display_name" header="Name" />
   <cfgridcolumn name="yourURL" display="no"/>
   <cfgridcolumn header="Category" name="category" />
   <cfgridcolumn header="Upload Date" name="upload_date" mask="mm/dd/yyyy" />
   <cfgridcolumn header="Modify Date" name="modify_date" mask="mm/dd/yyyy" />
</cfgrid>

CFLdap Code

Posted by Admin on November 26, 2007  |  Comments (0)  |  Related Categories: LDAPColdFusion

Querying LDAP
<cfldap action="query"
   name="users"
   start="cn=users,dc=<company>.,dc=ad"

   attributes="uid,company,manager,co,st,streetAddress,L,postalCode,title,cn,givenname,sn, department, mail,ipphone,samAccountName,memberof,telephoneNumber,accountDisabled "
   server="<domain>..ad"
   port="389"
   username="<username>@<domain>.ad"
   password="<password>"
/>

Updating LDAP

<cfset attributelist="streetAddress=<streetaddress>;department=#DEPARTMENT#; title=#title#; ipphone=#ipphone#; TELEPHONENUMBER=#TELEPHONENUMBER#" />
   <cfldap action="modify"
      modifytype="replace"
      attributes="#attributeList#"
      dn="cn=#trim(CN)#, cn=users,dc=wha,dc=ad"
      server="<username>@<domain>.ad"

      port="389"
      username="<username>@<domain>.ad"
    password="<password>"
   />

New Vista Ad

Posted by Admin on November 22, 2007  |  Comments (0)  |  Related Categories: MAC

Well I don't have Vista installed anymore I guess I am just like most of and I have switched back to XP for my work PC the best Windows OS by far. I don't think I have to tell anyone that knows me that I use a MAC for personal use.