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
ROUTINE clock | |
#; https://stackoverflow.com/questions/4151554/need-mumps-sample-code | |
Q N R,Q,C,D,E,W,B,G,H,S,T,U,V,F,L,P,N,J,A S N=$G(N),Q='N,F=Q+Q,P=F+F,W=$L($T(Q)) | |
S W=$E(W,Q),S='N_+N,W=W-F*S,L=$G(L),R=$C(Q_F_P),R(F)=$C(F+Q_F),R(P)=$C(W-F) W # | |
S T=$E($T(Q+F),F,W\S)_$C(W+S+F) X T S B=$P(T,$C(P_P),F),C=B\(W*W),D=B-(C*W*W)\W | |
F G=S-Q:F:S+F+Q S E=B-(C*W*W+(D*W)),H=$E($T(Q),G),@H=$S(@H<S:'Q,Q:N)_@H,T=C_D_E | |
F A=Q:Q:W\S S J=$E(T,A),C(F)=$S(J>(F+Q)&(J<(S-F)):Q,Q:+N),C(P)=$S(J#F:Q,Q:+N) D | |
.S C(Q)=$S(J<(S-F):+N,Q:Q),C(F+Q)=$S(J>Q&(J<(S-F))&(J'=(P+'L))&(J'=(P)):Q,Q:+N) | |
.S H('L)=L F S H(N?.E)=$O(C(H('$G(N)))) Q:H('+L)=L S F(A,H('L))=C(H(W[(W\S))) | |
F U=Q:Q:P W !,R F V=Q:Q:P+F W $S(F(V,U):'Q,Q:$C(P_(W\S))) W:'(V#F) $C('N_F_F+F) |
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
/// Studio Template:<br> | |
/// Create a new Cache JavaScript Routine. | |
Class %CJS.RoutineWizard Extends %ZEN.Template.studioTemplate [ StorageStrategy = "" ] | |
{ | |
Parameter TEMPLATENAME = "Cache JavaScript"; | |
Parameter TEMPLATETITLE = "Cache JavaScript"; | |
Parameter TEMPLATEDESCRIPTION = "Create a new Cache JavaScript routine."; |
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
#!/bin/bash | |
NAME=$1 | |
CONTAINER=`docker container ls -q -f "name=$NAME"` | |
if [ -z $CONTAINER ] | |
then | |
echo "Docker container with name $NAME not found" | |
exit 1 | |
fi |
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
Class Utils.Global Extends %RegisteredObject | |
{ | |
/// Анализ размера глобала, с анализом размера его подузлов, на указанную вложенность | |
/// все необходимые параметры будут запршены при запуске | |
ClassMethod GlobalSize() [ PublicList = (big, DatabaseBlockSize, blksiz, cc, Bytes, Count, gls, lev) ] | |
{ | |
set $ztrap="err" | |
set dir=$$selectdb() | |
do { |
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
#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() |
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
#include %occInclude | |
kill | |
set host="chat.freenode.net" | |
set port="6667" | |
set sock=##class(%IO.Socket).%New() | |
set linepat=##class(%Regex.Matcher).%New("^\:([^\!\ ]+)\![^\ ]+\ (.+)$") | |
set privmsg=##class(%Regex.Matcher).%New("^PRIVMSG #([^\ ]+) \:(.+)") | |
set action=##class(%Regex.Matcher).%New("!(?:bot|BOT) (.+)") | |
try { |
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
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 { |
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
#!/bin/bash | |
# bash completions for InterSystems ccontrol | |
_instances() | |
{ | |
if [ $# == 0 ] || [ $1 == "all" ]; then | |
echo $(ccontrol qlist | cut -d'^' -f1 | tr '\n' ' ') | |
else | |
echo $(ccontrol qlist | grep "\^$1\," | cut -d'^' -f1 | tr '\n' ' ') | |
fi |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<Export generator="Cache" version="25" zv="Cache for UNIX (SUSE Linux Enterprise Server for x86-64) 2014.1 (Build 608U)" ts="2014-05-19 00:22:31"> | |
<Class name="%CJS.RoutineWizard"> | |
<Description><![CDATA[ | |
Studio Template:<br> | |
Create a new Cache JavaScript Routine.]]></Description> | |
<StorageStrategy/> | |
<Super>%ZEN.Template.studioTemplate</Super> | |
<TimeChanged>63325,86382.045933</TimeChanged> | |
<TimeCreated>63325,65834.566957</TimeCreated> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<Export generator="Cache" version="25"> | |
<Class name="%CDEV.JSON.Base"> | |
<Abstract>1</Abstract> | |
<Super>%Library.RegisteredObject</Super> | |
<TimeCreated>63290,83008.228357</TimeCreated> | |
<Method name="%WriteJSON"> | |
</Method> |
NewerOlder