The Ramblings of a ColdFusion junkie tag:think-lab.net,2010:/blog/ A mango blog (edit your blog description in the administration) Mango 1.2.4 ColdFusion Developer Telecommute - Part-Time urn:uuid:6ECC77BD-D56B-AA5C-306B25D7068DEEA9 2010-05-06T11:05:04Z 2010-05-06T11:05:00Z spiraldev ColdFusion Developer - Part-Time Company: Event Ready http://www.eventready.com/erSite/ Location: Telecommute is ok Position(s): Part-Time or Internship Hours: Flexible Hours M-F, 8:00 a.m. to 5:00 p.m. Min-Requirements: 1 to 3 years ColdFusion Experience The position requires 9-12 hours per week (M-F 8:30 a.m. to 5:00 p.m.). Some flexibility on hours/days based on needs. This position may turn into a fulltime position. Please send your resume by email to matt [at] eventready.com. Position open until filled. Start date: ASAP. Birthday is coming up urn:uuid:BB4991FD-D56B-AA5C-3AE0CA2CC478BE55 2010-04-01T01:04:03Z 2010-04-01T01:04:00Z spiraldev My Birthday is just around the corner so if anyone would like to to donate to my Birthday fund. <br> <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="hosted_button_id" value="KF5YZBU689864"> <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> </form> RegEx Help urn:uuid:A299EF68-D56B-AA5C-3B61F62A0E3D6332 2009-10-29T03:10:56Z 2009-10-29T03:10:00Z spiraldev I need a RegEx to get all of the html between <form></form>. Looking for Membship App. urn:uuid:985C20B9-D56B-AA5C-3DC0640CFF5092A4 2009-10-27T03:10:36Z 2009-10-27T03:10:00Z spiraldev I am looking for an open source/free membership application written in ColdFusion. If anyone know of please let me know. Google Wave Invites urn:uuid:984E7507-D56B-AA5C-39C25415B4913232 2009-10-27T03:10:13Z 2009-10-27T04:10:00Z spiraldev <p><strong>Update they're all gone.</strong></p> <p> </p> <p>I have Google wave invites. If you would like one please respond and I'll hand them first come first serve.</p> <p> </p> <p> </p> JAVA UUID using ColdFusion urn:uuid:552B7879-D56B-AA5C-368611C95678BD98 2009-10-14T03:10:21Z 2009-10-14T03:10:00Z spiraldev This is just a note to myself <textarea name="code" class='coldfusion'> <cfset uuidGen = createObject("java", "org.safehaus.uuid.UUIDGenerator").getInstance() /> <cfset uuidGen.generateTimeBasedUUID() /> </textarea> Using WDDX as a Datasource urn:uuid:CA028E26-D56B-AA5C-3FA7EEF2ABD8085A 2009-09-17T02:09:19Z 2009-09-17T03:09:00Z <p>I did some work for a friend a couple of months ago and he needed me create an XML document to house student information never more than 10 students. So I thought simple of I’ll just create a simple XML Doc and loop through it. And then I remembered that I wasn’t that fond working with XML. So I decided to create a ColdFusion and store it in memory.</p> <textarea name="code" class='coldfusion'> application.qStudents = queryNew("studentID,StudentName,Major,GradeAvg,Gender","VarChar,VarChar,VarChar,Integer,VarChar"); for(i=1;i LTE totalStudents;i=i+1){ QueryAddRow(qStudents); QuerySetCell(qStudents, "studentID", createUUID()); QuerySetCell(qStudents, "StudentName", baseStudentName & " " & i); QuerySetCell(qStudents, "Major", get('majors')); QuerySetCell(qStudents, "GradeAvg", get('gradeAve')); QuerySetCell(qStudents, "Gender", get('genders')); } </textarea> spiraldev <p>I did some work for a friend a couple of months ago and he needed me create an XML document to house student information never more than 10 students. So I thought simple of I’ll just create a simple XML Doc and loop through it. And then I remembered that I wasn’t that fond working with XML. So I decided to create a ColdFusion and store it in memory.</p> <textarea name="code" class='coldfusion'> application.qStudents = queryNew("studentID,StudentName,Major,GradeAvg,Gender","VarChar,VarChar,VarChar,Integer,VarChar"); for(i=1;i LTE totalStudents;i=i+1){ QueryAddRow(qStudents); QuerySetCell(qStudents, "studentID", createUUID()); QuerySetCell(qStudents, "StudentName", baseStudentName & " " & i); QuerySetCell(qStudents, "Major", get('majors')); QuerySetCell(qStudents, "GradeAvg", get('gradeAve')); QuerySetCell(qStudents, "Gender", get('genders')); } </textarea> <p>I know that wasn’t a good, so I decided to create a ColdFusion query and then turn it into WDDX format then save it to a file.</p> <textarea name="code" class='coldfusion'> <cfwddx action="cfml2wddx" input="#query#" output="sWDDX"> <cffile action="write" file="#wddxPath#" output="#sWDDx#"> </textarea> <p>Now I can just read the file and query and do all the CRUD operations against it the recordset. So now I had the problem how to update the data and what if they want to move to a real DB. Well this is what I did, I created a couple of CFC’s one of which is a base WDDXDAO which has these functions </p> <p>getWDDXRS This function reads my WDDX xml file and returns a ColdFusion Query</p> <textarea name="code" class='coldfusion'> <cffunction name="getWDDXRS" access="public" output="false" returntype="query" hint="I read the WDDX XML file and turn it into a query."> <!--- ************************************************************* ---> <cfargument name="wddxPath" required="true" type="string"> <!--- ************************************************************* ---> <cfset var sWDDX = '' /> <cfset var _query=''> <cffile action="read" file="#arguments.wddxPath#" variable="sWDDx"> <cfwddx action="wddx2cfml" input="#sWDDX#" output="_query"> <cfreturn _query/> </cffunction> </textarea> <p>saveWDDXRS This function saves my ColddFusion query into WDDX format </p> <textarea name="code" class='coldfusion'> <cffunction name="saveWDDXRS" access="public" output="false" returntype="void" hint="I save a query as a WDDX XML file"> <!--- ************************************************************* ---> <cfargument name="query" required="true" type="query"> <cfargument name="wddxPath" required="true" type="string"> <!--- ************************************************************* ---> <cfset var sWDDX = '' /> <cfwddx action="cfml2wddx" input="#arguments.query#" output="sWDDX"> <cffile action="write" file="#arguments.wddxPath#" output="#sWDDx#"> </cffunction> </textarea> <p>Now I can write my studentDAO which extends wddxDAO here is the init function you’ll notice that it is expecting an argument of dbfile, that is the absolute path to the WDDX file. Also in the init function you’ll notice that I am checking to see if the file exists and if it does I call the saveWDDXRS function from my WDDXDAO. </p> <textarea name="code" class='coldfusion'> <cffunction name="init" access="public" output="false" returntype="studentDAO"> <cfargument name="dbFile" type="string" required="true"> <cfset variables.dbFile = arguments.dbFile> <cfif NOT FileExists(arguments.dbFile)> <cfset saveWDDXRS(queryNew("studentID,StudentName,Major,GradeAvg,Gender","VarChar,VarChar,VarChar,Integer,VarChar"),arguments.dbFile) /> </cfif> <cfreturn this> </cffunction> </textarea> <p> Next function is getRS this function is really for my Gateway you will see that later. </p> <textarea name="code" class='coldfusion'> <cffunction name="getRS" access="public" output="false" returntype="query"> <cfreturn getWDDXRS(variables.dbFile)/> </cffunction> </textarea> <p> Create function this function create a new record in our WDDX RS, first we get the query from the WDDXDAO and then we add a new record to it and then save the file. </p> <textarea name="code" class='coldfusion'> <cffunction name="create" access="public" output="false" returntype="boolean"> <cfargument name="student" type="student" required="true" /> <cfscript> var qInsert = getWDDXRS(variables.dbFile); try{ if( not isValid('UUID',student.getStudentID())){ student.setStudentID(createUUID()); } QueryAddRow(qInsert); QuerySetCell(qInsert, "studentID", student.getStudentID()); QuerySetCell(qInsert, "StudentName", student.getStudentName()); QuerySetCell(qInsert, "Major", student.getMajor()); QuerySetCell(qInsert, "GradeAvg", student.getGradeAve()); QuerySetCell(qInsert, "Gender", student.getGenders()); saveWDDXRS(qInsert,variables.dbFile); return true; }catch (Any e){ return false; } </cfscript> </cffunction> </textarea> <p> read function will simply open the WDDX file again and query the RS for the studentID that the user is looking for. </p> <textarea name="code" class='coldfusion'> <cffunction name="read" access="public" output="false" returntype="void"> <cfargument name="student" type="student" required="true" /> <cfset var qRead = getWDDXRS(variables.dbFile) /> <cfset var strReturn = structNew() /> <cftry> <cfquery name="qRead" dbtype="query"> SELECT * FROM qRead WHERE lower(studentID) = <cfqueryparam value="#lcase(arguments.student.getStudentID())#" CFSQLType="cf_sql_varchar" /> </cfquery> <cfcatch type="database"> <!--- leave the bean as is and set an empty query for the conditional logic below ---> <cfset qRead = queryNew("id") /> </cfcatch> </cftry> <cfif qRead.recordCount> <cfset strReturn = queryRowToStruct(qRead)> <cfset arguments.student.init(argumentCollection=strReturn)> </cfif> </cffunction> </textarea> <p> update function here I open the WDDX file and do a listFindNoCase to get the current row number to update. </p> <textarea name="code" class='coldfusion'> <cffunction name="update" access="public" output="false" returntype="boolean"> <cfargument name="student" type="student" required="true" /> <cfscript> var rowNum = 1; var qUpdate = getWDDXRS(variables.dbFile); try{ rowNum = ListFindNocase(valueList(qUpdate.studentID),student.getStudentID()); QuerySetCell(qUpdate, "StudentName", student.getStudentName(),rowNum); QuerySetCell(qUpdate, "Major", student.getMajor(),rowNum); QuerySetCell(qUpdate, "GradeAvg", student.getGradeAvg(),rowNum); QuerySetCell(qUpdate, "Gender", student.getGender(),rowNum); saveWDDXRS(qUpdate,variables.dbFile); return true; }catch (Any e){ return false; } </cfscript> </cffunction> </textarea> <p> delete function here I open the WDDX file then query the RS for everything that is not equal to the current studentID and then save that RS. </p> <textarea name="code" class='coldfusion'> <cffunction name="delete" access="public" output="false" returntype="boolean"> <cfargument name="student" type="student" required="true" /> <cfset var sWDDX = ""> <cfset var qDelete = ""> <cftry> <cfset qDelete = getWDDXRS(variables.dbFile)> <cfquery name="qDelete" dbtype="query" maxrows="1"> SELECT * FROM qDelete WHERE lower(studentID) <> <cfqueryparam value="#lcase(arguments.student.getstudentID())#" CFSQLType="cf_sql_varchar" /> </cfquery> <cfset saveWDDXRS(qDelete,variables.dbFile)> <cfcatch type="database"> <cfreturn false /> </cfcatch> </cftry> <cfreturn true /> </cffunction> </textarea> <p> Exists function this function checks to see if a record exists or not. </p> <textarea name="code" class='coldfusion'> <cffunction name="exists" access="public" output="false" returntype="boolean"> <cfargument name="student" type="student" required="true" /> <cfset var qExists = getWDDXRS(variables.dbFile)> <cfquery name="qExists" dbtype="query" maxrows="1"> SELECT studentID FROM qExists WHERE studentID = <cfqueryparam value="#arguments.student.getStudentID()#" CFSQLType="cf_sql_varchar" /> </cfquery> <cfif qExists.recordCount> <cfreturn true /> <cfelse> <cfreturn false /> </cfif> </cffunction> </textarea> <p> save here we call our Exists function and if a record does exists we call the update function and if doesn’t we call the create function. </p> <textarea name="code" class='coldfusion'> <cffunction name="save" access="public" output="false" returntype="boolean"> <cfargument name="student" type="student" required="true" /> <cfset var success = false /> <cfif exists(arguments.student)> <cfset success = update(arguments.student) /> <cfelse> <cfset success = create(arguments.student) /> </cfif> <cfreturn success /> </cffunction> </textarea> <p> Here is my my student bean it has one method and extends my base Bean CFC. </p> <textarea name="code" class='coldfusion'> <cffunction name="init" access="public" returntype="student" output="false"> <cfargument name="studentID" type="string" required="false" default="" /> <cfargument name="StudentName" type="string" required="false" default="" /> <cfargument name="Major" type="string" required="false" default="" /> <cfargument name="GradeAvg" type="string" required="false" default="" /> <cfargument name="Gender" type="string" required="false" default="" /> <!--- run setters ---> <cfset this.setstudentID(arguments.studentID) /> <cfset this.setStudentName(arguments.StudentName) /> <cfset this.setMajor(arguments.Major) /> <cfset this.setGradeAvg(arguments.GradeAvg) /> <cfset this.setGender(arguments.Gender) /> <cfreturn this /> </cffunction> </textarea> <p> Here is my base bean CFC </p> <textarea name="code" class='coldfusion'> <cfcomponent output="false" hint="I am a base singleton."> <cfset VARIABLES.Instance = structNew() /> <!----------------------------------- PUBLIC ------------------------------> <cffunction name="setMemento" access="public" returntype="events" output="false"> <cfargument name="memento" type="struct" required="yes"/> <cfset variables.instance = arguments.memento /> <cfreturn this /> </cffunction> <cffunction name="getMemento" access="public" returntype="struct" output="false" > <cfreturn variables.instance /> </cffunction> <cffunction name="OnMissingMethod" hint="" access="public" returntype="any" output="false"> <cfargument name="MissingMethodName" type="string" required="true" hint="I am the name of the method that was called." /> <cfargument name="MissingMethodArguments" type="struct" required="true" hint="I am the arguments that were passed to the missing method." /> <cfif REFindNoCase( "^Get.+", ARGUMENTS.MissingMethodName )> <!--- Get the property name from the method. ---> <cfset local.Property = REReplace(arguments.MissingMethodName,"^.{3}","","one") /> <!--- Return the "Get" of this property. ---> <cfreturn this.get( local.property ) /> <!--- Check to see if the method name is a valid Set method. ---> <cfelseif REFindNoCase( "^set.+", arguments.MissingMethodName )> <cfset local.Property = REReplace(arguments.MissingMethodName,"^.{3}","","one") /> <!--- Return the "Get" of this property. ---> <cfreturn this.set( LOCAL.Property, arguments.MissingMethodArguments[1]) /> </cfif> </cffunction> <!--- Global Setter and Getter ---> <cffunction name="set" hint="I set a variable into the variable scope." access="public" output="false" returntype="void"> <!--- ************************************************************* ---> <cfargument name="property" required="true" type="string" > <cfargument name="propertyVal" required="true" type="any" > <cfargument name="AppendPropertyVal" required="false" type="boolean" default="false" > <!--- ************************************************************* ---> <cfset var local = structNew() /> <cfif StructKeyExists(variables,"set#arguments.property#")> <!--- Get the meta data for the function. ---> <cfset local.metadata = getMetaData(variables["set#arguments.property#"]) /> <cfinvoke method="set#arguments.property#"> <cfinvokeargument name="#local.metadata.parameters[ 1 ].Name#" value="#arguments.value#"/> </cfinvoke> <cfelse> <cfif StructKeyExists(arguments,"AppendPropertyVal") AND arguments.AppendPropertyVal EQ true> <cfset VARIABLES.Instance[arguments.property] = VARIABLES.Instance[arguments.property] & arguments.propertyVal /> <cfelse> <cfset VARIABLES.Instance[arguments.property] = arguments.propertyVal /> </cfif> </cfif> </cffunction> <cffunction name="get" hint="I get a variable in the variable scope." access="public" output="false" returntype="any"> <!--- ************************************************************* ---> <cfargument name="property" required="true" type="string" > <!--- ************************************************************* ---> <cfif StructKeyExists(variables,"set#arguments.property#")> <cfinvoke method="get#arguments.property#" argumentcollection="#arguments#" returnvariable="local.returnvar" /> <cfreturn local.returnVar /> <cfelse> <cfif structkeyexists(variables.instance,arguments.property)> <cfreturn variables.instance[arguments.property] /> <cfelse> <cfreturn '' /> </cfif> </cfif> </cffunction> <cffunction name="dump" hint="I dump a any variable passed to the function." access="private" output="false" returntype="void"> <!--- ************************************************************* ---> <cfargument name="abort" type="boolean" required="false"> <!--- ************************************************************* ---> <cfset var sReturn =""> <cfdump var="#variables.instance#" /> <cfif StructKeyExists(arguments,'abort') and len(arguments.abort)> <cfabort> </cfif> </cffunction> </cfcomponent> </textarea> <p> Here is my gateway CFC. </p> <textarea name="code" class='coldfusion'> <cfcomponent displayname="StudentGateway" output="false"> <cffunction name="init" access="public" output="false" returntype="StudentGateway"> <cfargument name="studentDAO" type="studentDAO" required="true" /> <cfset variables.studentDAO = arguments.studentDAO /> <cfreturn this /> </cffunction> <cffunction name="getByAttributesQuery" access="public" output="false" returntype="query"> <cfargument name="studentID" type="string" required="false" default="" /> <cfargument name="StudentName" type="string" required="false" default="" /> <cfargument name="Major" type="string" required="false" default="" /> <cfargument name="GradeAvg" type="string" required="false" default="" /> <cfargument name="Gender" type="string" required="false" default="" /> <cfset var qList = variables.studentDAO.getRS(true) /> <cfquery name="qList" dbtype="query"> SELECT * FROM qList WHERE 0=0 <cfif structKeyExists(arguments,"studentID") and len(arguments.studentID)> AND LOWER(studentID) = <cfqueryparam value="#lcase(arguments.studentID)#" CFSQLType="cf_sql_varchar" /> </cfif> <cfif structKeyExists(arguments,"StudentName") and len(arguments.StudentName)> AND LOWER(StudentName) = <cfqueryparam value="#lcase(arguments.Client_Name)#" CFSQLType="cf_sql_varchar" /> </cfif> <cfif structKeyExists(arguments,"Major") and len(arguments.Major)> AND LOWER(Major) = <cfqueryparam value="#lcase(arguments.Major)#" CFSQLType="cf_sql_varchar" /> </cfif> <cfif structKeyExists(arguments,"GradeAvg") and len(arguments.GradeAvg)> AND GradeAvg = <cfqueryparam value="#arguments.GradeAvg#" CFSQLType="cf_sql_integer" /> </cfif> <cfif structKeyExists(arguments,"Gender") and len(arguments.Gender)> AND LOWER(Gender) = <cfqueryparam value="#lcase(arguments.Gender)#" CFSQLType="cf_sql_varchar" /> </cfif> <cfif structKeyExists(arguments, "orderby") and len(arguments.orderBy)> ORDER BY #arguments.orderby# </cfif> </cfquery> <cfreturn qList /> </cffunction> <cffunction name="create" access="public" output="false" returntype="student"> <cfargument name="studentID" type="string" required="false" default="" /> <cfargument name="StudentName" type="string" required="false" default="" /> <cfargument name="Major" type="string" required="false" default="" /> <cfargument name="GradeAvg" type="string" required="false" default="" /> <cfargument name="Gender" type="string" required="false" default="" /> <cfset var student = createObject("component","student").init(argumentCollection=arguments) /> <cfreturn student /> </cffunction> <cffunction name="getBean" access="public" output="false" returntype="student"> <cfargument name="studentID" type="string" required="true" /> <cfset var student = create(argumentCollection=arguments) /> <cfset variables.studentDAO.read(student) /> <cfreturn student /> </cffunction> <cffunction name="save" access="public" output="false" returntype="boolean"> <cfargument name="student" type="student" required="true" /> <cfreturn variables.studentDAO.save(student) /> </cffunction> <cffunction name="delete" access="public" output="false" returntype="boolean"> <cfargument name="studentID" type="string" required="true" /> <cfset var student = create(argumentCollection=arguments) /> <cfreturn variables.studentDAO.delete(student) /> </cffunction> </cfcomponent> </textarea> <p>Now I know this seems to be a bit much for a small website and for 10 students but think in terms of scalability. Now if he comes back to me and says I need to migrate to SQL Server or MySQL all I need to do is create a new Gateway and DAO.</p> <p> I would love to hear any and all thoughts on this.</p> Communicating with Developers urn:uuid:29349F20-D56B-AA5C-38BFA67C60FC19D8 2009-08-17T09:08:48Z 2009-08-17T09:08:00Z spiraldev <a title="How To Effectively Communicate With Developers" rel="bookmark" href="http://www.smashingmagazine.com/2009/08/14/how-to-effectively-communicate-with-developers/">How To Effectively Communicate With Developers</a> <p>'"If you have ever worked with a developer or a development team, this article will probably strike close to home. As designers, we work with dozens of developers across the globe each year. Some of us are fortunate enough to find a gem; a developer that just gets it. A developer that you feel is on your same wavelength in terms of what needs to be accomplished with the user interface, and what it needs to happen. Most often, however, we find developers that we generally don’t see eye to eye with." </p> <img src="/blog/assets/content//work.gif" alt="" width="500" height="313" /> CSS + jQuery Menu urn:uuid:C4AA1A1C-D56B-AA5C-3BEEAA875DF3DC96 2009-07-28T08:07:15Z 2009-07-28T09:07:00Z spiraldev First the jQuery <textarea class="javascript" name="code"> <script type="text/javascript" src="jquery-1.3.2.min.js"></script> <script type="text/javascript"> function showmenu(){ $("#nav li").hover(function(){ $(this).find('ul:first').css({visibility:"visible", display:"none"}).show(); }, function(){ $(this).find('ul:first').css({visibility:"hidden"}); }); } $(document).ready(function(){ showmenu(); }); </script> </textarea> Second the CSS <textarea class="css" name="code"> #nav, #nav ul{ margin:0; padding:0; list-style-type:none; list-style-position:outside; position:relative; line-height:26px; } #nav a:link, #nav a:active, #nav a:visited{ display:block; color:#FFF; text-decoration:none; background:#444; height:26px; line-height:26px; padding:0 6px; margin-right:1px; } #nav a:hover{ background:#0066FF; color:#FFF; } #nav li{ float:left; position:relative; } #nav ul { position:absolute; width:12em; top:26px; display:none; } #nav li ul a{ width:12em; float:left; } #nav ul ul{ width:12em; top:auto; } #nav li ul ul {margin:0 0 0 13em;} #nav li:hover ul ul, #nav li:hover ul ul ul, #nav li:hover ul ul ul ul{display:none;} #nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li li li li:hover ul{display:block;} </textarea> last the HTML <textarea class="html" name="code"> <ul id="nav"> <li><a href="#">Link 1</a></li> <li><a href="#">Link 2</a></li> <li><a href="#">Link 3</a> <ul> <li><a href="#">Link 3.1</a></li> <li><a href="#">Link 3.2</a></li> <ul> </li> </ul> </textarea> Regular expressions syntax note urn:uuid:C356C5F2-D56B-AA5C-31E0B788872C8B21 2009-07-28T02:07:32Z 2009-07-28T02:07:00Z spiraldev <table border="0" cellspacing="1" cellpadding="5" width="100%"> <tbody> <tr> <td bgcolor="#eeeeee">Regular Expression</td> <td bgcolor="#eeeeee">Will match...</td> </tr> <tr> <td>CF</td> <td>The string "CF"</td> </tr> <tr> <td bgcolor="#f9fcff">^CF</td> <td bgcolor="#f9fcff">"CF" at the start of a string</td> </tr> <tr> <td>CF$</td> <td>"CF" at the end of a string</td> </tr> <tr> <td bgcolor="#f9fcff">^CF$</td> <td bgcolor="#f9fcff">"CF" when it is alone on a string</td> </tr> <tr> <td>[abc]</td> <td>a, b, or c</td> </tr> <tr> <td bgcolor="#f9fcff">[a-z]</td> <td bgcolor="#f9fcff">Any lowercase letter</td> </tr> <tr> <td>[^A-Z]</td> <td>Any character that is not a uppercase letter</td> </tr> <tr> <td bgcolor="#f9fcff">(gif|jpg)</td> <td bgcolor="#f9fcff">Matches either "gif" or "jpeg"</td> </tr> <tr> <td>[a-z]+</td> <td>One or more lowercase letters</td> </tr> <tr> <td bgcolor="#f9fcff">[0-9.-]</td> <td bgcolor="#f9fcff">?ny number, dot, or minus sign</td> </tr> <tr> <td>^[a-zA-Z0-9_]{1,}$</td> <td>Any word of at least one letter, number or _</td> </tr> <tr> <td bgcolor="#f9fcff">([wx])([yz])</td> <td bgcolor="#f9fcff">wy, wz, xy, or xz</td> </tr> <tr> <td>[^A-Za-z0-9]</td> <td>Any symbol (not a number or a letter)</td> </tr> <tr> <td bgcolor="#f9fcff">([A-Z]{3}|[0-9]{4})</td> <td bgcolor="#f9fcff">Matches three letters or four numbers</td> </tr> </tbody> </table> Employee begs for Firefox urn:uuid:85328313-D56B-AA5C-31E8CA6A6C301592 2009-07-16T01:07:06Z 2009-07-16T01:07:00Z spiraldev <p> Not sure what to say about this. <br> <a href="http://news.cnet.com/8301-13505_3-10287084-16.html?part=rss&subj=news&tag=2547-1023_3-0-5" target="_blank">State Dept. to Clinton: Please let us use Firefox</a> </p> <object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/5Z4UEr2ekOY&color1=0xb1b1b1&color2=0xcfcfcf&hl=en&feature=player_embedded&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/5Z4UEr2ekOY&color1=0xb1b1b1&color2=0xcfcfcf&hl=en&feature=player_embedded&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></embed></object> New UDF (makeDistinctList) urn:uuid:84AD007D-D56B-AA5C-3A2443B9BFB6535B 2009-07-16T10:07:20Z 2009-07-16T12:07:00Z spiraldev <p> Quick and dirty UDF. I needed to make a list just have distinct values for logging purposes so I wrote a little UDF. Here it is </p> <textarea class="coldfusion" name="code"> <!--- Creates a distinct list. @param List The list that needs to be made distinct. (required) @param delimiter The delimiter of list. (Optional) @return a distinct list made from the list provided. @author Matt Graf (spiraldev@gmail.com) @version 1, July 16, 2009 ---> <cffunction name="makeDistinctList" output="false" returntype="any" hint="I create a Distinct List."> <cfargument name="List" type="string" required="true" hint="I am the list that needs to be made distinct."> <cfargument name="delimiter" required="false" default="," hint="I am the delimiter for the list."> <cfscript> var newList = ""; var idx = 1; var curVal=''; for (idx;idx LTE ListLen(arguments.List,arguments.delimiter);idx=idx+1) { curVal=ListGetAt(arguments.List,idx,arguments.delimiter); if(NOT ListFindNoCase(newList,curVal,arguments.delimiter)){ newList = ListAppend(newList,curVal); } } return newList; </cfscript> </cffunction> </textarea> <p><b>Update</b><br> After reading <a href="http://www.iknowkungfoo.com/" target="_blank">Adrian J. Moreno</a> and doing some CFTimer testing I found that the code below night and day faster. </P> <textarea class="coldfusion" name="code"> <!--- Creates a distinct list. @param List The list that needs to be made distinct. (required) @param delimiter The delimiter of list. (Optional) @return a distinct list made from the list provided. @author Matt Graf (spiraldev@gmail.com) @version 1, July 16, 2009 ---> <cffunction name="makeDistinctList" output="false" returntype="any" hint="I create a Distinct List."> <cfargument name="List" type="string" required="true" hint="I am the list that needs to be made distinct."> <cfargument name="delimiter" required="false" default="," hint="I am the delimiter for the list."> <cfscript> var tempArr = listToArray( arguments.list ); var newList = createObject("java", "java.util.LinkedHashSet"); newList.init( tempArr ); return arrayToList( newList.toArray() ); </cfscript> </cffunction> </textarea> How To Design A Good API and Why it Matters by Google urn:uuid:7B3BE84E-D56B-AA5C-34006E5A9BD10A6C 2009-07-14T02:07:25Z 2009-07-14T02:07:00Z spiraldev <object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/aAb7hSCtvGw&hl=en&fs=1&color1=0x006699&color2=0x54abd6"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/aAb7hSCtvGw&hl=en&fs=1&color1=0x006699&color2=0x54abd6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object> Links or my reference urn:uuid:1DA3083A-D56B-AA5C-3354D007552855B2 2009-07-12T10:07:26Z 2009-07-12T12:07:00Z spiraldev <h2 class="title"><a href="http://cssglobe.com/post/4380/easy-tooltip--jquery-plugin" target="_blank">Easy Tooltip - jQuery plugin</a></h2> <p>http://jakeapp.com/</p> <p>http://xrefresh.binaryage.com/</p> <p><strong>UML</strong></p> <p>http://www.horstmann.com/violet/</p> <p>http://www.gliffy.com/</p> <p>Design patterns</p> <p>http://www.oodesign.com/</p> <p><a href="/blog/assets/content//designpatternscard.pdf">PDF Quick Reference </a></p> <p>I downloaded the original document from here http://www.mcdonaldland.info/2007/11/28/40/</p> A Full Featured CSS Framework: BlueTrip urn:uuid:1D9B4578-D56B-AA5C-34E0972BAE463C62 2009-06-26T10:06:00Z 2009-06-26T10:06:00Z spiraldev <p>I can across this really nice CSS framework.</p> <blockquote> <h3 class="thin">What Can <a href="http://bluetrip.org/" target="_blank">BlueTrip</a> Do For You?</h3> <p>BlueTrip gives you a sensible set of styles and a common way to build a website so that you can skip past the grunt work and get right to designing.</p> <p>Download the package, include the images and stylesheets in your site structure, and get going!</p> </blockquote> <p> </p> <p> <a href="http://www.bluetrip.org/example/index.html" target="_blank"><img src="/blog/assets/content//16551226556214typography.png" alt="" /></a> </p> <p><br /> <a href="http://www.bluetrip.org/example/grid.html" target="_blank"><img src="/blog/assets/content//60791226556213grid.png" alt="" width="540" height="200" /></a></p> <p> </p> <div class="span-5"> <h3 class="thin">Features List: </h3> <ul> <li> 24-column grid<br /></li> <li>Sensible typography styles</li> <li>Clean form styles</li> <li>A print stylesheet</li> <li>An empty starter stylesheet</li> <li>Sexy buttons</li> <li>Status message styles</li> </ul> <a href="http://bluetrip.org/demos/" target="_blank">Demos</a><br /> </div> <p> </p>