This file contains hidden or 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
<cfset q = queryNew("id")> | |
<cfloop from=1 to=5 index="index"> | |
<cfset queryAddRow(q)> | |
<cfset querySetCell(q, "id", index)> | |
</cfloop> | |
<cfdump var="#arrayLen(q["id"])#"><!--- this shows 5 ---> | |
<cfdump var="#arrayAvg(q["id"])#"><!--- this shows 3 ---> | |
<cfdump var="#arraySum(q["id"])#"><!--- this shows 15 ---> | |
<cfdump var="#q["id"][4]#"><!--- this shows 4 ---> |
This file contains hidden or 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
<cfscript> | |
function foo(a=1,b=2) { | |
writeoutput(hash(serializeJSON(arguments)) & "<br>"); | |
} | |
foo(1, 2); | |
foo(a=1, b=2); | |
foo(b=2, a=1); | |
foo(b=2); | |
foo(a=1); |
This file contains hidden or 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
<cfscript> | |
function foo(a=1,b=2) cachedwithin="#createTimeSpan(0, 0, 0, 10)#" { | |
writeoutput(getTickCount() & " " & hash(serializeJSON(arguments)) & "<br>"); | |
sleep(10); | |
} | |
foo(1, 2); | |
foo(a=1, b=2); | |
foo(b=2, a=1); | |
foo(b=2); |
This file contains hidden or 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
<cfscript> | |
foo = "{ts '2015-01-09 15:15:39'}"; | |
writeDump(isDate(foo)); // true | |
writeDump(DateFormat(foo, "yyyy-mm-dd")); // 2015-01-09 | |
writeDump(LSDateFormat(foo, "yyyy-mm-dd")); // error | |
</cfscript> |
This file contains hidden or 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
<cfscript> | |
LSDateTime = createObject("java", "java.time.LocalDateTime"); | |
Zone = createObject("java", "java.time.ZoneId"); | |
writeDump("localTime: " & LSDateTime.now().toString()); | |
writeDump("London Time:] " & LSDateTime.now(Zone.of("Europe/London")).toString()); | |
writeDump("Kolkata Time:] " & LSDateTime.now(Zone.of("Asia/Kolkata")).toString()); |
This file contains hidden or 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
component extends="testbox.system.BaseSpec" { | |
function beforeAll() { | |
variables.foo = true; | |
variables.moo = 1; | |
} | |
function run() { | |
describe("test callback", function() { | |
var isEven = function(i) { |
This file contains hidden or 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
// ORMSettings: flushatrequestend = false, automanagesession = false | |
// No errors, just obj.myprop not populate to db: | |
obj = cacheget(tag); | |
entityMerge(obj); | |
transaction { | |
obj.myprop = 'example'; | |
} |
This file contains hidden or 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
<cfscript> | |
function operatorTest(a, b) { | |
var result = { | |
"#a# || #b#": a || b, | |
"#a# && #b#": a && b, | |
"#a# XOR #b#": a XOR b, | |
"#a# IMP #b#": a IMP b, | |
"#a# ? #b# : false": a ? b : true, | |
"#a# EQV #b#": a EQV b, | |
"#a# == #b#": a == b |
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.provider "virtualbox" do |vb| | |
vb.gui = false |
This file contains hidden or 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
<cfsetting showDebugOutput="false" enablecfoutputonly="true" requesttimeout="36000"> | |
<cfparam name="url.reporter" default="simple"> | |
<cfparam name="url.directory" default="unittests"> | |
<cfparam name="url.recurse" default="true"> | |
<cfparam name="url.labels" default=""> | |
<cfparam name="url.bundles" default=""> | |
<cfparam name="url.reportpath" default="#GetDirectoryFromPath(getCurrentTemplatePath())#"> | |
<cfparam name="url.propertiesFilename" default="TEST.properties"> | |
<cfparam name="url.propertiesSummary" default="false"> |