2019.02.21 15:58

여러개의 PDF 를 merge 하여 출력

<cfdocument name="aaa" format="pdf">
abcd
</cfdocument>

<cfpdf action="merge" name="abc">
<cfpdfparam source="aaa">
<cfpdfparam source="#expandPath("/testPDF4.pdf")#">
<cfpdfparam source="#expandPath("/testPDF11.pdf")#">
</cfpdf>
<cfcontent type="application/pdf" variable="#ToBinary( abc )#" reset="true">


Trackback 0 Comment 0
2018.09.12 10:16

DateTime format 변경

SELECT FORMAT(GETDATE(), 'MM/dd/yyyy HH\:mm\:ss');
SELECT FORMAT(SYSDATETIME(), 'MM/dd/yyyy HH\:mm\:ss');
SELECT FORMAT(CAST('2018-09-12 11:22:33' AS DATETIME2), 'MM/dd/yyyy HH\:mm\:ss');


Trackback 0 Comment 0
2018.07.18 10:25

쓰레드 관련

쓰레드가 실행중인 페이지 목록
<!--- Create the thread object --->
<cfobject type="JAVA" action="Create" name="thread" class="java.lang.Thread">

<!--- Get all stack traces from the thread object --->
<cfset stackTrace = thread.getAllStackTraces()>

<!--- Convert the entrySet into an array --->
<cfset stackArray = stackTrace.entrySet().toArray()>

<cfoutput>
<!--- Loop over the entrySet array --->
<cfloop from="1" to="#ArrayLen(stackArray)#" index="sIndex">
<!--- Get the current thread values --->
<cfset thisThread = stackArray[sIndex].getValue()>
<!--- Loop over current thread values --->
<cfloop from="1" to="#ArrayLen(thisThread)#" index="tIndex">
<!--- Get the filename for this thread --->
<cfset thisThreadFile = thisThread[tIndex].getFileName()>
<!--- If the file name contains .cfm output it --->
<cfif isDefined("thisThreadFile") AND (thisThreadFile CONTAINS ".cfm" OR thisThreadFile CONTAINS ".cfc")>
#thisThreadFile#<br>
</cfif>
</cfloop>
</cfloop>
</cfoutput>


Coldfusion admin tool을 사용한 쓰레드 목록 및 쓰레드 중지
<cfscript>
function getActiveThreadsRunning(adminPassword) hint="Get all active threads running currently" {
var threadArrray = arrayNew(1);

//Creating Admin Object
var adminObject = createobject("component","cfide.adminapi.administrator");

//Creating Server Monitoring Object
var monitorObject = createobject("component","cfide.adminapi.servermonitoring");

//Login to Admin API
adminObject.login(arguments.adminPassword);

//Get all Active Thread info
threadArrray = monitorObject.getAllActiveCFThreads();

//log out from the admin API login
adminObject.logout();

return threadArrray;
}

function killActiveThread(adminPassword, threadName) hint="Kill specified thread which are running" {
//Creating Admin Object
var adminObject = createobject("component","cfide.adminapi.administrator");

//Creating Serbver Monitoring Object
var monitorObject = createobject("component","cfide.adminapi.servermonitoring");

//Login to Admin API
adminObject.login(arguments.adminPassword);

//kill thread now by calling abortCFThread. It accepts thread name
var killedThread = monitorObject.abortCFThread(arguments.threadName);

//logout from admin API
adminObject.logout();

// return true/false based on response.
return killedThread;
}
</cfscript>


Trackback 0 Comment 0
2018.07.16 09:28

엘리먼트 역순으로 each하기 (element reverse order)

$($('selector').get().reverse()).each(function() {
    //내용
});
Trackback 0 Comment 0