Skip to content

Instantly share code, notes, and snippets.

Class Debug.Trace Extends %RegisteredObject
{
ClassMethod On(aGN As %String = "") As %Status [ ProcedureBlock = 0 ]
{
#define InvalidIO $io'=$p
if aGN="" set %TraceLog=$name(^CacheTemp.TraceLog)
else set %TraceLog=aGN
kill @%TraceLog
for i=1:1:$stack-1 {
@eduard93
eduard93 / cosJSON.isc
Created September 26, 2016 09:58 — forked from isc-bspead/cosJSON.isc
Macros for writing forward compatible JSON code in InterSystems Caché 2016.1
#include %occReference
#if $$$comClassDefined("%Library.Object")
#define jsonClassIsLatestVersion $classIsLatestVersion
//usage: obj.$$$jsonClassIsLatestVersion()
#define jsonExtends $extends
//usage: {}.$$$jsonExtends(classname)
#define jsonFromJSON $fromJSON
//usage: {}.$$$jsonFromJSON(string)
#define jsonGetIterator $getIterator
//usage: obj.$$$jsonGetIterator()
@eduard93
eduard93 / DumpHex.c
Created January 17, 2019 17:32 — forked from ccbrown/DumpHex.c
Compact C Hex Dump Function w/ASCII
#include <stdio.h>
char* DumpHex2(const void* data, size_t size) {
const int symbolSize = 100;
char* buffer = calloc(10*size, sizeof(char));
char* symbol = calloc(symbolSize, sizeof(char));
char ascii[17];
size_t i, j;
ascii[16] = '\0';
Class CodeGolf.Leet
{
ClassMethod Convert(a As %String) As %String
{
; your code here
Q ""
}
}