This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfquery name="qryTest" datasource="dsnCommon"> | |
SELECT 0 AS col1, 0 AS col2 | |
</cfquery> | |
<cfquery name="qqTest" dbtype="query"> | |
SELECT (col1 / col2) AS col3 | |
FROM qryTest | |
</cfquery> | |
<cfdump var="#qqTest#"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfcomponent name="utilities" output="false" hint="I provide various utility functionality"> | |
<cffunction name="init" access="public" returntype="any" output="false" hint="Initializes the Service"> | |
<cfreturn this /> | |
</cffunction> | |
<cffunction name="isNullFormat" access="remote" returntype="any" output="false" hint="I return whether something is null"> | |
<cfargument name="input" type="any" required="true" /> | |
<cfset var inputdatatype = ""> | |
<cftry> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
GETDATE() AS this_date_time | |
, CONVERT(VARCHAR, GETDATE(), 101) AS this_date | |
, RIGHT(CONVERT(VARCHAR, GETDATE(), 100),7) AS this_time | |
, ( CONVERT(VARCHAR, GETDATE(), 101) + ' ' + RIGHT(CONVERT(VARCHAR, GETDATE(), 100),7) ) AS this_date_time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @AlphaNumChars varchar(50) | |
SET @AlphaNumChars = 'a,1,m,s' | |
SELECT * | |
FROM INFORMATION_SCHEMA.TABLES | |
WHERE CHARINDEX(LEFT(TABLE_NAME,1),@AlphaNumChars) > 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @InvalidList varchar(50) | |
DECLARE @ValidList varchar(50) | |
SET @InvalidList = 'Item1-Item2-Item3' | |
SET @ValidList = 'Item1 > Item2 > Item3' | |
SELECT | |
CASE | |
WHEN CHARINDEX('>',@InvalidList) = 0 THEN @InvalidList | |
ELSE LTRIM(RTRIM(REPLACE(SUBSTRING(@InvalidList,1,CHARINDEX('>',@InvalidList)),'>',''))) | |
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Data Error Message Sandbox</title> | |
<script type="text/javascript"> | |
function checkForm() { | |
var myformelement = document.getElementById('myformelement'); | |
var usermessage = document.getElementById('usermessage'); | |
if (myformelement.value == "") { | |
try { | |
alert(myformelement.dataset.errorMessage); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfparam name="url.scope" default=""> | |
<cfhttp url="http://#cgi.http_host#/sandbox/receiver.cfm?scope=#url.scope#" method="post" resolveurl="no"> | |
<cfhttpparam type="header" name="Content-Type" value="application/x-www-form-urlencoded" /> | |
</cfhttp> | |
<cfdump var="#cfhttp#"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfchart format="png" chartwidth="270" xaxistitle="Visits last 7 Days" show3d="no" foregroundcolor="##333333" showborder="no" fontbold="yes" tipStyle="none" url="" showLegend="true"> | |
<cfchartseries type="line" query="chartData" itemcolumn="dateRange" valuecolumn="FLASHvisits" datalabelstyle="none" seriesLabel="FloorPlan"> | |
<cfif chartData.showVTS><cfchartseries type="line" query="chartData" itemcolumn="dateRange" valuecolumn="VTSvisits" seriesColor="blue" datalabelstyle="none" seriesLabel="IDS"></cfif> | |
<cfif chartData.showMobile><cfchartseries type="line" query="chartData" itemcolumn="dateRange" valuecolumn="MOBILEvisits" seriesColor="red" datalabelstyle="none" seriesLabel="Mobile"></cfif> | |
</cfchart> | |
<!--- | |
The line that the stack trace says it's erroring on is: | |
<cfif chartData.showMobile><cfchartseries type="line" query="chartData" itemcolumn="dateRange" valuecolumn="MOBILEvisits" seriesColor="red" datalabelstyle="none" seriesLabel="Mobile"></cfif> | |
---> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cffunction name="validateDemo" access="public" returntype="any" output="false"> | |
<cfargument name="fname" type="string" required="true"> | |
<cfargument name="lname" type="string" required="true"> | |
<cfargument name="email" type="string" required="true"> | |
<cfargument name="throwerror" type="boolean" required="false" default="false"> | |
<cfset var local = {}> | |
<cftry> | |
<cfset local.responseobject = new Response()> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
$.ajax({ | |
url: '/sandbox/Demo.cfc', // this can be found at https://gist.github.com/wellercs/5327556 | |
data: { | |
method: 'validateDemo', | |
fname: "John", | |
lname: "Doe", | |
email: "bademail", |
OlderNewer