├── doit ├── texts ├── dotj.txt ├── save.txt ├── lic.txt ├── kill.txt ├── attributes.txt ├── debug.txt ├── envvar.txt ├── temporal.txt ├── iterator.txt ├── internal.txt ├── operator.txt ├── define.txt ├── keyword.txt ├── doth.txt ├── dotz.txt ├── cmdline.txt ├── syscmd.txt ├── dotq.txt ├── data.txt └── errors.txt ├── makehelp.q ├── README.md └── help.q /doit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ~/q/m64/q makehelp.q texts help.q 4 | cp help.q ~/q 5 | -------------------------------------------------------------------------------- /texts/dotj.txt: -------------------------------------------------------------------------------- 1 | .j namespace: JSON 2 | .j.j serialize .j.k deserialize 3 | .j.jd seralize infinity -------------------------------------------------------------------------------- /texts/save.txt: -------------------------------------------------------------------------------- 1 | save/load tables 2 | tables can be written as a single file or spread across a directory, e.g. 3 | `:trade set x / write as single file 4 | `:trade/ set x / write across a directory 5 | trade:get`:trade / read 6 | trade:get`:trade/ / map columns on demand 7 | 8 | tables splayed across a directory must be fully enumerated (no varchar) and not keyed. -------------------------------------------------------------------------------- /texts/lic.txt: -------------------------------------------------------------------------------- 1 | licenses - kdb+ license files 2 | The locations for the license file k4.lic are: 3 | the q directory 4 | the directory pointed to by the env var QHOME 5 | the directory pointed to by the env var QLIC 6 | 7 | license errors, see help`errors 8 | 9 | licadmin@kx.com deals with license questions 10 | failover@kx.com can provide a temporary emergency license -------------------------------------------------------------------------------- /texts/kill.txt: -------------------------------------------------------------------------------- 1 | kill - killing a q session 2 | If the q session is responsive and listening on a port, you can try connecting 3 | to it via ipc and calling "exit 0". 4 | 5 | kill -9 pid results in an ungraceful exit, and should be used as a last resort. 6 | If kdb+ is responsive, send it SIGTERM, e.g. kill pid 7 | If it is not responsive, send SIGINT, then SIGTERM. 8 | If that doesn't work, and you really have to, then kill -9 pid. 9 | 10 | the pid of a q process is .z.i -------------------------------------------------------------------------------- /texts/attributes.txt: -------------------------------------------------------------------------------- 1 | data attributes 2 | example overhead 3 | `s#2 2 3 sorted 0 4 | `u#2 4 5 unique 16*u 5 | `p#2 2 1 parted (4*u;16*u;4*u+1) 6 | `g#2 1 2 grouped (4*u;16*u;4*u+1;4*n) 7 | 8 | The byte overheads use n(number of elements) and u(number of uniques) 9 | `u is for unique lists. 10 | `p and `g are for lists with a lot of repetition. 11 | 12 | `s#, `u# and `g# are preserved on append in memory (if possible) 13 | only `s# is preserved on append to disk -------------------------------------------------------------------------------- /texts/debug.txt: -------------------------------------------------------------------------------- 1 | debug - debugger commands 2 | :. return from debug mode 3 | ` browse the stack frame above 4 | . browse the stack frame below 5 | 'str throw str from the innermost stack frame 6 | .z.ex .z.ey (set in the debugger) the failing primitive and its arglist, if available 7 | .Q.bt[] print current stack trace (list of stack frames) 8 | .Q.sbt[x] format a stack trace (stringify back trace) 9 | .Q.trp[f;x;g] like @(trap), but g's second argument is a stack trace: g[error symbol;stack trace] -------------------------------------------------------------------------------- /texts/envvar.txt: -------------------------------------------------------------------------------- 1 | envvar - environment variables 2 | var---default---use------------------------------------------------- 3 | QHOME $HOME/q folder searched for q.k and unqualified script names 4 | QLIC $QHOME folder searched for k4.lic license file 5 | QINIT q.q additional file loaded after q.k has initialised 6 | 7 | LINES supplied by OS, used to set \c 8 | COLUMNS \c $LINES $COLUMNS 9 | make sure LINES and COLUMNS are exported. In bash: 10 | export LINES COLUMNS 11 | before starting q 12 | 13 | getenv`VARNAME 14 | `VARNAME setenv "NEWVALUE" -------------------------------------------------------------------------------- /texts/temporal.txt: -------------------------------------------------------------------------------- 1 | temporal - date & time casts 2 | `timestamp$x ~ 2009.11.05D20:39:35.614334000 ~ "p"$x ~ x.timestamp 3 | `datetime$x ~ 2009.11.05T20:39:35.614 ~ "z"$x ~ x.datetime 4 | `year$x ~ 2009 ~ x.year 5 | `month$x ~ 2009.11m ~ "m"$x ~ x.month 6 | `mm$`date$x ~ 11 ~ x.mm 7 | `week$x ~ 2009.11.02 ~ x.week 8 | `date$x ~ 2009.11.05 ~ "d"$x ~ x.date 9 | `dd$x ~ 5 ~ x.dd 10 | `hh$x ~ 20 ~ x.hh 11 | `minute$x ~ 20:39 ~ "u"$x ~ x.minute 12 | `mm$`time$x ~ 39 ~ x.mm 13 | `uu$x ~ 39 ~ x.uu 14 | `second$x ~ 20:39:35 ~ "v"$x ~ x.second 15 | `ss$x ~ 35 ~ x.ss 16 | `time$x ~ 20:39:35.614 ~ "t"$x ~ x.time 17 | `timespan$x ~ 0D20:39:35.614334000 ~ "n"$x ~ x.timespan -------------------------------------------------------------------------------- /texts/iterator.txt: -------------------------------------------------------------------------------- 1 | iterators (formerly adverbs) 2 | map iterators 3 | ' Each v1 each x x v2'y v3[x;y;z] 4 | /: Each Right x v2/:y 5 | \: Each Left x v2\:y 6 | ': Each Parallel v1 peach x 7 | ': Each Prior v2 prior y 8 | ' Case int'[x;y;z...] 9 | accumulating iterators 10 | \ Scan v1 scan x Converge, Do, While 11 | / Over x v2/y v3/[x;y;z] MapReduce 12 | \ Scan x v2\y v3\[x;y;z] Fold 13 | / Over v1 over x Converge, Do, While -------------------------------------------------------------------------------- /texts/internal.txt: -------------------------------------------------------------------------------- 1 | negative bang - -n!x - internal system calls 2 | -4!x tokens Replaced: 3 | -8!x to bytes -1! hsym 4 | -9!x from bytes -2! attr 5 | -10!x type enum -3! .Q.s1 6 | -11! streaming execute -5! parse 7 | -14!x quote escape -6! eval 8 | -16!x ref count -7! hcount 9 | -17!x flip endian-ess -12! .Q.host 10 | -18!x compress byte -13! .Q.addr 11 | -19! compress file -15! md5 12 | -21!x compression stats -20! .Q.gc 13 | -22!x uncompressed length -24! reval 14 | -23!x memory map -29! .j.k 15 | -25!x async broadcast -31! .j.jd 16 | -26!x SSL 17 | -27!(x;y) format 18 | -30!x deferred response 19 | -33!x SHA-1 hash 20 | -120!x domain -------------------------------------------------------------------------------- /texts/operator.txt: -------------------------------------------------------------------------------- 1 | operators (functions) 2 | @ Apply/At $ Cond ! Dict ? Find 3 | . Index/At Cast Enkey Roll, Deal 4 | Trap Tok Unkey Enum Extend 5 | Amend Enumerate Enumeration Select 6 | Pad Flip Splayed Exec 7 | mmu Display Simple Exec 8 | Internal Vector Conditional 9 | Update 10 | Delete 11 | 12 | + Add - Subtract * Multiply % Divide 13 | 14 | = Equals < Less Than > Greater Than ~ Match 15 | <> Not Equals <= Up To >= At Least 16 | | Greater, OR & Lesser, AND 17 | 18 | # Take _ Cut, Drop ^ Fill , Join -------------------------------------------------------------------------------- /texts/define.txt: -------------------------------------------------------------------------------- 1 | assign, define, control and debug 2 | Dyad------------D-Amend---------Monad-----------M-amend------ 3 | v:y .[`v;();:;y] 4 | v+:y .[`v;();+;y] v-: .[`v;();-:] 5 | v[i]+:y .[`v;,i;+;y] v[i]-: .[`v;,i;-:] 6 | v[i;j]+:y .[`v;(i;j);+;y] v[i;j]-: .[`v;(i;j);-:] 7 | 8 | @[v;i;d;y] is .[v;,i;d;y] @[v;i;m] is .[v;,i;m] 9 | 10 | {[a;b;c] ...} function definition 11 | x y z default parameters 12 | d:... local variable 13 | d::.. global variable 14 | 15 | control(debug: ctrl-c stop) 16 | $[c;t;f] conditional 17 | ?[c;t;f] boolean conditional 18 | if[c; ... ] 19 | do[n; ... ] 20 | while[c; ...] 21 | / ... comment 22 | : ... return(resume) 23 | ' ... signal 24 | 25 | trap signals with .[f;(x;y;z);v] and @[f;x;v] 26 | or .[f;(x;y;z);g] and @[f;x;g] 27 | where v is the value to be returned on error 28 | or g is a monadic function called with error text -------------------------------------------------------------------------------- /texts/keyword.txt: -------------------------------------------------------------------------------- 1 | keywords (functions) 2 | A abs acos aj aj0 ajf ajf0 all and any asc asin asof atan attr avg avgs 3 | B bin binr 4 | C ceiling cols cor cos count cov cross csv cut 5 | D delete deltas desc dev differ distinct div do dsave 6 | E each ej ema enlist eval except exec exit exp 7 | F fby fills first fkeys flip floor 8 | G get getenv group gtime 9 | H hclose hcount hdel hopen hsym 10 | I iasc idesc if ij ijf in insert inter inv 11 | K key keys 12 | L last like lj ljf load log lower lsq ltime ltrim 13 | M mavg max maxs mcount md5 mdev med meta min mins mmax mmin mmu mod msum 14 | N neg next not null 15 | O or over 16 | P parse peach pj prd prds prev prior 17 | R rand rank ratios raze read0 read1 reciprocal reval reverse rload rotate rsave rtrim 18 | S save scan scov sdev select set setenv show signum sin sqrt ss ssr string sublist sum sums sv svar system 19 | T tables tan til trim type 20 | U uj ujf ungroup union update upper upsert 21 | V value var view views vs 22 | W wavg where while within wj wj1 wsum 23 | X xasc xbar xcol xcols xdesc xexp xgroup xkey xlog xprev xrank -------------------------------------------------------------------------------- /texts/doth.txt: -------------------------------------------------------------------------------- 1 | .h namespace: markup 2 | .h.br linebreak .h.hu URI escape 3 | .h.c0 web color .h.hug URI map 4 | .h.c1 web color .h.hy HTTP response 5 | .h.cd CSV from data .h.iso8601 ISO timestamp 6 | .h.code code after Tab .h.jx table 7 | .h.ed Excel from data .h.logo Kx logo 8 | .h.edsn Excel from tables .h.nbr no break 9 | .h.fram frame .h.pre pre 10 | .h.ha anchor .h.sa style 11 | .h.hb anchor target .h.sb style 12 | .h.hc escape lt .h.sc URI-safe 13 | .h.he HTTP 400 .h.td TSV 14 | .h.hn HTTP error .h.text paragraphs 15 | .h.hp HTTP response .h.tx filetypes 16 | .h.hr horizontal rule .h.ty MIME types 17 | .h.ht Marqdown to HTML .h.uh URI unescape 18 | .h.hta start tag .h.val value 19 | .h.htac element .h.xd XML 20 | .h.htc element .h.xmp XMP 21 | .h.html document .h.xs XML escape 22 | .h.http hyperlinks .h.xt JSON -------------------------------------------------------------------------------- /texts/dotz.txt: -------------------------------------------------------------------------------- 1 | .z namespace: system information and callbacks 2 | System information Callbacks 3 | .z.a IP address .z.ac HTTP auth from cookie 4 | .z.b dependencies .z.bm msg validator 5 | .z.c cores .z.exit action on exit 6 | .z.D/d date shortcuts .z.pc close 7 | .z.e TLS connection status .z.pd peach handles 8 | .z.ex failed primitive .z pg get 9 | .z.ey arg to failed primitive .z.ph HTTP get 10 | .z.f file .z.pi input 11 | .z.h host .z.po open 12 | .z.i PID .z.pp HTTP post 13 | .z.K version .z.pq qcon 14 | .z.k release date .z.ps set 15 | .z.l license .z.pw validate user 16 | .z.N/n local/UTC timespan .z.ts timer 17 | .z.o OS version .z.vs value set 18 | .z.P/p local/UTC timestamp .z.wc WebSocket close 19 | .z.pm HTTP options .z.wo WebSocket open 20 | .z.q quiet mode .z.ws WebSocket 21 | .z.s self 22 | .z.T/t time shortcuts 23 | .z.u user ID 24 | .z.W/w handles/handle 25 | .z.X/x raw/parsed command line 26 | .z.Z/z local/UTC datetime 27 | .z.zd zip defaults -------------------------------------------------------------------------------- /makehelp.q: -------------------------------------------------------------------------------- 1 | / create a helpfile from a directory of *.txt files 2 | t:-1"kdb+makehelp 0.02 2006.08.17" 3 | o:.Q.opt .z.x;if[2>count .Q.x;-2">q ",(string .z.f)," SRCDIR SAVEFILE";exit 1] 4 | SRC:.z.x 0;SAVEFILE:hsym`$.z.x 1 5 | F:key hsym`$SRC;F:asc F where(lower F)like "*.txt" 6 | if[not count F; -1"? no *.txt files found in <",SRC,">"; exit 1] 7 | t:@[hdel;SAVEFILE;{}] 8 | \c 9999 9999 9 | SAVEH:neg hopen SAVEFILE 10 | t:SAVEH"/ help.q ",string .z.z;t:SAVEH"\\d .help";t:SAVEH"DIR:TXT:()!()" 11 | t:SAVEH"display:{if[not 10h=abs type x;x:string x];$[1=count i:where(key DIR)like x,\"*\";-1 each TXT[(key DIR)[i]];show DIR];}" 12 | t:SAVEH"fetch:{if[not 10h=abs type x;x:string x];$[1=count i:where(key DIR)like x,\"*\";1_raze\"\\n\",'TXT[(key DIR)[first i]];DIR]}" 13 | helptext:{txt:read0 hsym`$SRC,"/",string x; 14 | SAVEH"TXT,:(enlist`",(name:lower string` sv -1_` vs x),")!enlist("; 15 | {SAVEH" ",(-3!x),";"}each 1_-1_ txt; 16 | {SAVEH" ",-3!x}last txt;SAVEH" )"; 17 | SAVEH"DIR,:(enlist`",name,")!enlist`$",-3!first txt; 18 | } 19 | t:helptext each F 20 | t:SAVEH".q.help:.help.display" 21 | t:-1"* helpfile <",(1_ string SAVEFILE),"> built from *.txt files in <",SRC,">" 22 | \\ 23 | format of a help textfile is: 24 | one line description of help 25 | help texts (make sure no trailing empty lines) 26 | filename (without .txt) is key for the help 27 | -------------------------------------------------------------------------------- /texts/cmdline.txt: -------------------------------------------------------------------------------- 1 | command line parameters 2 | q [f] [-b] [-c r c] [-C r c] [-g 0|1] [-l] [-L][-o N] [-p N] [-P N] [-q] 3 | [-r :H:P] [-s N] [-t N] [-T N] [-u|U F] [-w N] [-W N] [-z 0|1] 4 | 5 | f load script (*.q, *.k, *.s), file or directory 6 | 7 | -b block client write access 8 | -c r c console maxRows maxCols 9 | -C r c http display maxRows maxCols 10 | -e [0|1|2] disable|enable|display error trap clients 11 | -g [0|1] disable|enable immediate garbage collect, default 0 12 | -l log updates to filesystem 13 | -L as -l, but sync logging 14 | -o N offset hours (from GMT: affects .z.Z/T/P/N), default 0 15 | -p N port kdbc(/jdbc/odbc) http(html xml txt csv) 16 | -p -N port multithreaded kdbc 17 | -P N printdigits, default 7, 0=>all 18 | -q quiet, no startup banner text 19 | -r :H:P replicate from :host:port 20 | -s N slaves for parallel execution 21 | -S N set random seed 22 | -t N timer milliseconds, default 0 (=> none) 23 | -T N timeout seconds(applies to all client queries), default 0 (=> none) 24 | -u F usr:pwd file, no access above start directory 25 | -u [0|1] enable|disable system escapes 26 | -U F as -u, but no file restrictions 27 | -w N workspace MB limit (default: 2*RAM) 28 | -W N week offset, default 2, 0=>saturday 29 | -z [0|1] "D" uses 0:mm/dd/yyyy or 1:dd/mm/yyyy, default 0 -------------------------------------------------------------------------------- /texts/syscmd.txt: -------------------------------------------------------------------------------- 1 | system commands 2 | \1 filename redirect stdout 3 | \2 filename redirect stderr 4 | \a [n] tables [namespace] 5 | \b views (see also .z.b) 6 | \B invalid/pending dependencies 7 | \c [23 79] console height,width 8 | \C [36 2000] browser height,width 9 | \d [n] q namespace/directory [go to] 10 | \e [0|1|2] error trap clients 0=off|1=on|2=display 11 | \f [n] functions [namespace] 12 | \g [0|1] garbage collection mode 13 | \l [f] load script (or dir:files splays parts scripts) 14 | \l . (re)load data only, ignore any scripts 15 | \o [N] offset from gmt 16 | \p [i] port (0 turns off) 17 | \P [7] print digits(0-all) 18 | \r replication master 19 | \r old new unix mv 20 | \s number of slaves (query only) 21 | \S [-314159] random seed 22 | \t [i] timer [x] milliseconds (1st fire after delay) 23 | \t expr time for expression 24 | \ts expr time and space for expression 25 | \T [i] timeout [x] seconds 26 | \u reload the user:pswd file specified with -u 27 | \v [n] variables [namespace] 28 | \w workspace (bytes allocated; available bytes in heap; max heap so far; 29 | max bytes available; mapped bytes; physical memory) 30 | (max bytes set by -w, 0 => unlimited) - see .Q.w[] 31 | \w 0 count symbols defined, symbol space used (bytes) 32 | \W [2] week offset(sat..fri) 33 | \x .z.p? expunge .z.zd or .z.p? value (ie reset to default) 34 | \z [0|1] "D"$ uses mm/dd/yyyy (0) or dd/mm/yyyy (1) 35 | \cd [d] O/S directory [go to] 36 | \_ is readonly (cmdline -b) 37 | \_ f.q create runtime script f.q_ from f.q (or f.k_ from f.k) 38 | \[other] O/S execute 39 | \\ exit 40 | \ (escape suspension, or switch language mode) 41 | ctrl-c (stop) 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Online help for kdb+ 2 | ==================== 3 | 4 | Updated for V2.0 of the [Reference](https://code.kx.com/v2/ref/) (2019.03.07) 5 | 6 | 7 | Install 8 | ------- 9 | 10 | 1. Copy `help.q` into `$QHOME` folder. 11 | 2. ``q)\l help.q`` 12 | 13 | 14 | Use 15 | --- 16 | 17 | ```txt 18 | q)help ` 19 | attributes| data attributes 20 | cmdline | command line parameters 21 | data | data types 22 | debug | debug - debugger commands 23 | define | assign, define, control and debug 24 | doth | .h namespace 25 | dotj | .j namespace 26 | dotq | .Q namespace 27 | dotz | .z namespace 28 | envvar | envvar - environment variables 29 | errors | error messages 30 | internal | negative bang - -n!x - internal system calls 31 | iterator | iterators/operators 32 | keyword | keywords/functions 33 | kill | kill - killing a q session 34 | lic | licenses - kdb+ license files 35 | operator | operators/functions 36 | save | save/load tables 37 | syscmd | system commands 38 | temporal | temporal - date & time casts 39 | q) 40 | q)help `operator 41 | @ Apply/At $ Cond ! Dict ? Find 42 | . Index/At Cast Enkey Roll, Deal 43 | Trap Tok Unkey Enum Extend 44 | Amend Enumerate Enumeration Select 45 | Pad Flip Splayed Exec 46 | mmu Display Simple Exec 47 | Internal Vector Conditional 48 | Update 49 | Delete 50 | 51 | + Add - Subtract * Multiply % Divide 52 | 53 | = Equals < Less Than > Greater Than ~ Match 54 | <> Not Equals <= Up To >= At Least 55 | | Greater, OR & Lesser, AND 56 | 57 | # Take _ Cut, Drop ^ Fill , Join 58 | q) 59 | ``` 60 | 61 | 62 | Customise 63 | --------- 64 | 65 | See `makehelp.q` and `texts/` to roll your own on-line help. 66 | 67 | 68 | Contact 69 | ------- 70 | 71 | This is a project of the [Kx Librarian](mailto:librarian@kx.com). 72 | 73 | > A librarian’s job is to put information where people can find it. 74 | -------------------------------------------------------------------------------- /texts/dotq.txt: -------------------------------------------------------------------------------- 1 | .Q namespace: utilities 2 | General Datatype 3 | .Q.a lowercase alphabet .Q.btoa b64 encode 4 | .Q.A uppercase alphabet .Q.j10 encode binhex 5 | .Q.addmonths .Q.j12 encode base64 6 | .Q.bt backtrace .Q.M long infinity 7 | .Q.dd join symbols .Q.ty type 8 | .Q.def .Q.x10 decode binhex 9 | .Q.f format .Q.x12 decode base64 10 | .Q.fc parallel on cut 11 | .Q.ff append columns Database 12 | .Q.fmt format .Q.chk fill HDB 13 | .Q.ft apply simple .Q.dpft save table 14 | .Q.fu apply unique .Q.dpfts save table with sym 15 | .Q.gc garbage collect .Q.dsftg load process save 16 | .Q.id sanitize .Q.en enumerate varchar cols 17 | .Q.qt is table .Q.ens enumerate against domain 18 | .Q.res keywords .Q.fk foreign key 19 | .Q.s plain text .Q.hdpf save tables 20 | .Q.s1 string representation .Q.qt is table 21 | .Q.sbt string backtrace .Q.qp is partitioned 22 | .Q.sha1 SHA-1 encode 23 | .Q.trp extend trap Partitioned database state 24 | .Q.ts time and space .Q.bv build vp 25 | .Q.u date based .Q.cn count partitioned table 26 | .Q.V table to dict .Q.D partitions 27 | .Q.v value .Q.ind partitioned index 28 | .Q.view subview .Q.MAP maps partitions 29 | .Q.par locate partition 30 | Environment .Q.PD partition locations 31 | .Q.k version .Q.pd modified partition locns 32 | .Q.opt command parameters .Q.pf partition field 33 | .Q.res k words .Q.pn partition counts 34 | .Q.w memory stats .Q.qp is partitioned 35 | .Q.x non-command parameters .Q.pt partitioned tables 36 | .Q.PV partition values 37 | IPC .Q.pv modified partition values 38 | .Q.addr IP address .Q.vp missing partitions 39 | .Q.fps streaming algorithm 40 | .Q.fs streaming algorithm Segmented database state 41 | .Q.fsn streaming algorithm .Q.D partitions 42 | .Q.hg HTTP get .Q.P segments 43 | .Q.host hostname .Q.u date based 44 | .Q.hp HTTP post 45 | .Q.l load 46 | 47 | File I/O 48 | .Q.Cf create empty nested char file 49 | .Q.Xf create file -------------------------------------------------------------------------------- /texts/data.txt: -------------------------------------------------------------------------------- 1 | data types 2 | n-----c----name-------sz----literal------------null-----inf-----SQL--------Java-------.Net 3 | 0 * list 4 | 1 b boolean 1 0b Boolean boolean 5 | 2 g guid 16 0Ng UUID GUID 6 | 4 x byte 1 0x00 Byte byte 7 | 5 h short 2 0h 0Nh 0Wh smallint Short int16 8 | 6 i int 4 0i 0Ni 0Wi int Integer int32 9 | 7 j long 8 0j or 0 0Nj 0Wj bigint Long int64 10 | or 0N or 0W 11 | 8 e real 4 0e 0Ne 0We real Float single 12 | 9 f float 8 0.0 or 0f 0n 0w float Double double 13 | 14 | 11 s symbol ` ` varchar String string 15 | 12 p timestamp 8 `dateDtimespan 0Np 0Wp Timestamp DateTime (RW) 16 | 13 m month 4 2000.01m 0Nm 17 | 14 d date 4 2000.01.01 0Nd 0Wd date Date 18 | 15 z datetime 8 dateTtime 0Nz 0wz timestamp Timestamp DateTime (RO) 19 | 16 n timespan 8 00:00:00.000000000 0Nn 0Wn Timespan TimeSpan 20 | 17 u minute 4 00:00 0Nu 0Wu 21 | 18 v second 4 00:00:00 0Nv 0Nv 22 | 19 t time 4 00:00:00.000 0Nt 0Wt time Time TimeSpan 23 | 20-76 enums 24 | 77 anymap 25 | 78-96 77+t – mapped list of lists of type t 26 | 97 nested sym enum 27 | 98 table 28 | 99 dictionary 29 | 100 lambda 30 | 101 unary primitive 31 | 102 operator 32 | 103 iterator 33 | 104 projection 34 | 105 composition 35 | 106 f' 36 | 107 f/ 37 | 108 f\ 38 | 109 f': 39 | 110 f/: 40 | 111 f\: 41 | 112 dynamic load 42 | 43 | n: short int returned by type and used for casting, e.g. 9h$3 44 | c: character used lower-case for casting and upper-case for Load CSV 45 | sz: size in bytes 46 | inf: infinity (no math on temporal types); 0Wh is 32767h 47 | RO: read only; RW: read-write 48 | 49 | Cast:`char$data `CHAR$string 50 | 51 | The int, float, char and symbol literal nulls are: 0N 0n " " `. 52 | The rest use type extensions, e.g. 0Nd. No null for boolean or byte. 53 | 0Wd 0Wz 0Wt placeholder infinite dates/times/datetimes (no math) 54 | 55 | dict:`a`b!.. table:([]x:..;y:..) or +`x`y!.. 56 | date.(datetime dd mm month timestamp uu week year) / .z.d 57 | datetime.(date dd hh minute mm month second ss time timespan timestamp uu week year) / .z.z 58 | time.(hh minute mm second ss timespan uu) milliseconds=time mod 1000 / .z.t 59 | timespan.(hh minute mm second ss time uu) / .z.n 60 | timestamp.(date datetime dd hh minute mm month second ss time timespan uu week year) / .z.p -------------------------------------------------------------------------------- /texts/errors.txt: -------------------------------------------------------------------------------- 1 | error messages 2 | Runtime errors 3 | error------------example------------------------------explanation---------------------------------------------------------- 4 | access Attempt to read files above directory, run system commands or failed usr/pwd 5 | accp Tried to accept an incoming TCP/IP connection but failed to do so 6 | adict d[::]:x Blocked assignment ('nyi) 7 | arch `:test set til 100 Attempt to load file of wrong endian format 8 | -17!`:test 9 | assign cos:12 Attempt to redefine a reserved word 10 | badtail Incomplete transaction at end of file, get good (count;length) with -11!(-2;`:file) 11 | can't Only commercially licensed kdb+ instances can encrypt code in a script 12 | cast s:`a`b; c:`s$`a`e Value not in enumeration 13 | con qcon client is not supported when kdb+ is in multithreaded input mode 14 | cond Even number of arguments to $ 15 | conn Too many connections (1022 max) 16 | Could not -26! found SSL/TLS not enabled 17 | initialize ssl 18 | d8 The log had a partial transaction at the end but q couldn't truncate the file 19 | domain til -1 Out of domain 20 | elim ((-58?`3) set \:(),`a)$`a Too many enumerations (max: 57) 21 | enable slave \s 4 Command line enabled processes for parallel processing 22 | threads via cmd 23 | line -s only 24 | failed to load Started kdb+ with -E 1 or -E 2 but without SSL/TLS enabled 25 | TLS certificates 26 | from select price trade Badly formed select statement 27 | glim `g# limit (99 prior to V3.2, now unlimited 28 | hop Request to hopen a handle fails; includes message from OS 29 | hwr Handle write error, can't write inside a peach 30 | IJS "D= \001 "0: "0=hello \0011=world " Key type is not I, J, or S. 31 | insert t:([k:0 1]a:2 3);`t insert(0;3) Attempt to insert a record with an existing key into a keyed table 32 | length ()+til 1 Incompatible lengths 33 | 34 | limit 0W#2 Tried to generate a list longer than 2e9 or serialized object is >1TB (2GB until V3.4), or 'type if trying to serialize a nested object which has > 2 billion elements, or parse errors 35 | loop a::a Dependency loop 36 | mismatch ([]a:til 4),([]b:til 3) Columns that can't be aligned for R,R or K,K 37 | Mlim Too many nested columns in splayed tables. (Prior to V3.0, limited to 999; from V3.0, 251; from V3.3, 65530) 38 | mq Multi-threading not allowed 39 | name too long Filepath ≥100 chars (until V3.6 2018.09.26) 40 | noamend t:([]a:1 2 3) Cannot change global state from within an amend 41 | n:`a`b`c 42 | update b:{`n?`d;:`n?`d}[] 43 | from `t 44 | no append to V2: Cannot append to zipped enum (from V3.0) 45 | zipped enums .z.zd:17 2 6 46 | `:sym?`a`b 47 | V3: 48 | `:sym?`c 49 | no `g# {`g#x}peach 2#enlist 0 1 A thread other than the main q thread has attempted to add a group attribute to a vector. Seen with peach+slave threads or multithreaded input queue 50 | noupdate {a::x}peach 0 1 Updates blocked by the -b cmd line arg, or reval code or a thread other than the main thread has attempted to update a global variable when in peach+slave threads or multithreaded input queue. Update not allowed when using -ve port number. 51 | nosocket Can only open or use sockets in main thread. 52 | nyi "a "like "** " Not yet implemented: probably makes sense, but not defined nor implemented 53 | os \foo bar Operating-system error or license error 54 | par Unsupported operation on a partitioned table or component thereof 55 | parse Invalid syntax 56 | part Something wrong with the partitions in the HDB 57 | path too long (`$ ": ",1000# "a ") set 1 2 3 File path ≥255 chars (100 before V3.6 2018.09.26) 58 | pl peach can't handle parallel lambdas (V2.3 only) 59 | pwuid OS is missing libraries for getpwuid. Most likely 32-bit app on 64-bit OS 60 | Q7 nyi op on file nested array 61 | rank +[2;3;4] Invalid rank 62 | rb Encountered a problem while doing a blocking read 63 | restricted 0 "2+3 " in a kdb+ process which was started with -b cmd line. Also for a kdb+ process using the username:password authentication file, or the -b cmd line option, \x cannot be used to reset handlers to their default. e.g. \x .z.pg 64 | s-fail `s#3 2 Invalid attempt to set sorted attribute. Also encountered with `s#enums when loading a database ( \l db) and enum target is not already loaded. 65 | splay nyi op on splayed table 66 | stack {.z.s[]}[] Ran out of stack space 67 | step d:`s#`a`b!1 2;`d upsert `c`d!3 4 Attempt to upsert a step dictionary in place 68 | stop User interrupt (Ctrl-c) or time limit (-T) 69 | stype '42 Invalid type used for Signal 70 | sys {system "ls "}peach 0 1 Using system call from thread other than main thread 71 | threadview Trying to calc a view in a thread other than main thread 72 | timeout Request to hopen a handle fails on a timeout; includes message from OS 73 | TLS not enabled Received a TLS connection request, but kdb+ not started with -E 1 or -E 2 74 | too many syms Kdb+ currently allows for ~1.4B interned symbols in the pool and will exit with this error when this threshold is reached 75 | trunc The log had a partial transaction at the end but q couldn't truncate the file 76 | type til 2.2 Wrong type. Also see 'limit 77 | type/attr error Direct update on disk for this type or attribute is not allowed 78 | amending file 79 | u-fail `u#2 2 Invalid attempt to set 'unique' attribute 80 | unmappable t:([]sym:`a`b;a:(();())) When saving partitioned data each column must be mappable. () and ( " "; " "; " ") are OK 81 | .Q.dpft[`:thdb;.z.d;`sym;`t] 82 | upd Function upd is undefined (sometimes encountered during -11!`:logfile) or license error 83 | utf8 The websocket requires that text is UTF-8 encoded 84 | value No value 85 | vd1 Attempted multithread update 86 | view Trying to re-assign a view to something else 87 | wsfull 999999999#0j malloc failed, ran out of swap (or addressability on 32-bit), or hit -w limit 88 | wsm 010b wsum 010b Alias for nyi for wsum prior to V3.2 89 | XXX delete x from system "d ";x Value error (XXX undefined) 90 | 91 | System errors (from file ops and IPC) 92 | error------------example------------------------------explanation---------------------------------------------------------- 93 | XXX:YYY XXX is from kdb+, YYY from the OS 94 | 95 | Parse errors (on execute or load) 96 | error------------example------------------------------explanation---------------------------------------------------------- 97 | [({])} " "hello Open ([{ or " 98 | branch a: "1; ",65024# "0; " A branch (if;do;while;$[.;.;.]) more than 65025 byte codes away (255 before V3.6 2017.09.26) 99 | value "{if[ ",a, "]} " 100 | char value " \000 " Invalid character 101 | globals a: "::a "sv string til 111; Too many global variables 102 | value "{a ",a, "::0} " 103 | limit a: "; "sv string 2+til 241; Too many constants, or limit error 104 | value "{ ",a, "} " 105 | locals a: ":a "sv string til 111; Too many local variables 106 | value "{a ",a, ":0} " 107 | params f:{[a;b;c;d;e;f;g;h;e]} Too many parameters (8 max) 108 | 109 | License errors (on launch) 110 | error------explanation---------------------------------------------------------- 111 | cores The license is for fewer cores than available 112 | cpu The license is for fewer CPUs than available 113 | exp License expiry date is prior to system date 114 | host The hostname reported by the OS does not match the hostname or hostname-pattern in the license 115 | k4.lic k4.lic file not found 116 | os Wrong OS or operating-system error (if runtime error) 117 | srv Client-only license in server mode 118 | upd Version of kdb+ more recent than update date, or function upd undefined 119 | user Unlicenced user 120 | wha System date is prior to kdb+ version date 121 | q) -------------------------------------------------------------------------------- /help.q: -------------------------------------------------------------------------------- 1 | / help.q 2019.12.21T18:01:50.981 2 | \d .help 3 | DIR:TXT:()!() 4 | display:{if[not 10h=abs type x;x:string x];$[1=count i:where(key DIR)like x,"*";-1 each TXT[(key DIR)[i]];show DIR];} 5 | fetch:{if[not 10h=abs type x;x:string x];$[1=count i:where(key DIR)like x,"*";1_raze"\n",'TXT[(key DIR)[first i]];DIR]} 6 | TXT,:(enlist`attributes)!enlist( 7 | "example overhead "; 8 | "`s#2 2 3 sorted 0 "; 9 | "`u#2 4 5 unique 16*u "; 10 | "`p#2 2 1 parted (4*u;16*u;4*u+1) "; 11 | "`g#2 1 2 grouped (4*u;16*u;4*u+1;4*n)"; 12 | ""; 13 | "The byte overheads use n(number of elements) and u(number of uniques)"; 14 | "`u is for unique lists."; 15 | "`p and `g are for lists with a lot of repetition."; 16 | ""; 17 | "`s#, `u# and `g# are preserved on append in memory (if possible)"; 18 | "only `s# is preserved on append to disk" 19 | ) 20 | DIR,:(enlist`attributes)!enlist`$"data attributes" 21 | TXT,:(enlist`cmdline)!enlist( 22 | "q [f] [-b] [-c r c] [-C r c] [-g 0|1] [-l] [-L][-o N] [-p N] [-P N] [-q]"; 23 | " [-r :H:P] [-s N] [-t N] [-T N] [-u|U F] [-w N] [-W N] [-z 0|1]"; 24 | ""; 25 | "f load script (*.q, *.k, *.s), file or directory"; 26 | ""; 27 | "-b block client write access "; 28 | "-c r c console maxRows maxCols"; 29 | "-C r c http display maxRows maxCols "; 30 | "-e [0|1|2] disable|enable|display error trap clients"; 31 | "-g [0|1] disable|enable immediate garbage collect, default 0"; 32 | "-l log updates to filesystem "; 33 | "-L as -l, but sync logging"; 34 | "-o N offset hours (from GMT: affects .z.Z/T/P/N), default 0"; 35 | "-p N port kdbc(/jdbc/odbc) http(html xml txt csv)"; 36 | "-p -N port multithreaded kdbc"; 37 | "-P N printdigits, default 7, 0=>all"; 38 | "-q quiet, no startup banner text"; 39 | "-r :H:P replicate from :host:port "; 40 | "-s N slaves for parallel execution"; 41 | "-S N set random seed"; 42 | "-t N timer milliseconds, default 0 (=> none)"; 43 | "-T N timeout seconds(applies to all client queries), default 0 (=> none)"; 44 | "-u F usr:pwd file, no access above start directory"; 45 | "-u [0|1] enable|disable system escapes"; 46 | "-U F as -u, but no file restrictions"; 47 | "-w N workspace MB limit (default: 2*RAM)"; 48 | "-W N week offset, default 2, 0=>saturday"; 49 | "-z [0|1] \"D\" uses 0:mm/dd/yyyy or 1:dd/mm/yyyy, default 0" 50 | ) 51 | DIR,:(enlist`cmdline)!enlist`$"command line parameters" 52 | TXT,:(enlist`data)!enlist( 53 | "n-----c----name-------sz----literal------------null-----inf-----SQL--------Java-------.Net"; 54 | "0 * list"; 55 | "1 b boolean 1 0b Boolean boolean"; 56 | "2 g guid 16 0Ng UUID GUID"; 57 | "4 x byte 1 0x00 Byte byte"; 58 | "5 h short 2 0h 0Nh 0Wh smallint Short int16"; 59 | "6 i int 4 0i 0Ni 0Wi int Integer int32"; 60 | "7 j long 8 0j or 0 0Nj 0Wj bigint Long int64"; 61 | " or 0N or 0W"; 62 | "8 e real 4 0e 0Ne 0We real Float single"; 63 | "9 f float 8 0.0 or 0f 0n 0w float Double double"; 64 | ""; 65 | "11 s symbol ` ` varchar String string"; 66 | "12 p timestamp 8 `dateDtimespan 0Np 0Wp Timestamp DateTime (RW)"; 67 | "13 m month 4 2000.01m 0Nm"; 68 | "14 d date 4 2000.01.01 0Nd 0Wd date Date"; 69 | "15 z datetime 8 dateTtime 0Nz 0wz timestamp Timestamp DateTime (RO)"; 70 | "16 n timespan 8 00:00:00.000000000 0Nn 0Wn Timespan TimeSpan"; 71 | "17 u minute 4 00:00 0Nu 0Wu"; 72 | "18 v second 4 00:00:00 0Nv 0Nv"; 73 | "19 t time 4 00:00:00.000 0Nt 0Wt time Time TimeSpan"; 74 | "20-76 enums"; 75 | "77 anymap"; 76 | "78-96 77+t \342\200\223 mapped list of lists of type t"; 77 | "97 nested sym enum"; 78 | "98 table"; 79 | "99 dictionary"; 80 | "100 lambda"; 81 | "101 unary primitive"; 82 | "102 operator"; 83 | "103 iterator"; 84 | "104 projection"; 85 | "105 composition"; 86 | "106 f'"; 87 | "107 f/"; 88 | "108 f\\"; 89 | "109 f':"; 90 | "110 f/:"; 91 | "111 f\\:"; 92 | "112 dynamic load"; 93 | ""; 94 | "n: short int returned by type and used for casting, e.g. 9h$3"; 95 | "c: character used lower-case for casting and upper-case for Load CSV"; 96 | "sz: size in bytes"; 97 | "inf: infinity (no math on temporal types); 0Wh is 32767h"; 98 | "RO: read only; RW: read-write"; 99 | ""; 100 | "Cast:`char$data `CHAR$string"; 101 | ""; 102 | "The int, float, char and symbol literal nulls are: 0N 0n \" \" `."; 103 | "The rest use type extensions, e.g. 0Nd. No null for boolean or byte."; 104 | "0Wd 0Wz 0Wt placeholder infinite dates/times/datetimes (no math)"; 105 | ""; 106 | "dict:`a`b!.. table:([]x:..;y:..) or +`x`y!.."; 107 | "date.(datetime dd mm month timestamp uu week year) / .z.d"; 108 | "datetime.(date dd hh minute mm month second ss time timespan timestamp uu week year) / .z.z"; 109 | "time.(hh minute mm second ss timespan uu) milliseconds=time mod 1000 / .z.t"; 110 | "timespan.(hh minute mm second ss time uu) / .z.n"; 111 | "timestamp.(date datetime dd hh minute mm month second ss time timespan uu week year) / .z.p" 112 | ) 113 | DIR,:(enlist`data)!enlist`$"data types" 114 | TXT,:(enlist`debug)!enlist( 115 | " :. return from debug mode "; 116 | " ` browse the stack frame above"; 117 | " . browse the stack frame below"; 118 | " 'str throw str from the innermost stack frame"; 119 | " .z.ex .z.ey (set in the debugger) the failing primitive and its arglist, if available"; 120 | ".Q.bt[] print current stack trace (list of stack frames)"; 121 | ".Q.sbt[x] format a stack trace (stringify back trace)"; 122 | ".Q.trp[f;x;g] like @(trap), but g's second argument is a stack trace: g[error symbol;stack trace]" 123 | ) 124 | DIR,:(enlist`debug)!enlist`$"debug - debugger commands" 125 | TXT,:(enlist`define)!enlist( 126 | "Dyad------------D-Amend---------Monad-----------M-amend------"; 127 | "v:y .[`v;();:;y]"; 128 | "v+:y .[`v;();+;y] v-: .[`v;();-:]"; 129 | "v[i]+:y .[`v;,i;+;y] v[i]-: .[`v;,i;-:]"; 130 | "v[i;j]+:y .[`v;(i;j);+;y] v[i;j]-: .[`v;(i;j);-:]"; 131 | ""; 132 | "@[v;i;d;y] is .[v;,i;d;y] @[v;i;m] is .[v;,i;m]"; 133 | ""; 134 | "{[a;b;c] ...} function definition"; 135 | " x y z default parameters"; 136 | " d:... local variable"; 137 | " d::.. global variable "; 138 | ""; 139 | "control(debug: ctrl-c stop)"; 140 | " $[c;t;f] conditional"; 141 | " ?[c;t;f] boolean conditional"; 142 | " if[c; ... ]"; 143 | " do[n; ... ]"; 144 | " while[c; ...]"; 145 | " / ... comment"; 146 | " : ... return(resume)"; 147 | " ' ... signal"; 148 | ""; 149 | "trap signals with .[f;(x;y;z);v] and @[f;x;v]"; 150 | "or .[f;(x;y;z);g] and @[f;x;g] "; 151 | "where v is the value to be returned on error "; 152 | "or g is a monadic function called with error text" 153 | ) 154 | DIR,:(enlist`define)!enlist`$"assign, define, control and debug" 155 | TXT,:(enlist`doth)!enlist( 156 | ".h.br linebreak .h.hu URI escape"; 157 | ".h.c0 web color .h.hug URI map"; 158 | ".h.c1 web color .h.hy HTTP response"; 159 | ".h.cd CSV from data .h.iso8601 ISO timestamp"; 160 | ".h.code code after Tab .h.jx table"; 161 | ".h.ed Excel from data .h.logo Kx logo"; 162 | ".h.edsn Excel from tables .h.nbr no break"; 163 | ".h.fram frame .h.pre pre"; 164 | ".h.ha anchor .h.sa style"; 165 | ".h.hb anchor target .h.sb style"; 166 | ".h.hc escape lt .h.sc URI-safe"; 167 | ".h.he HTTP 400 .h.td TSV"; 168 | ".h.hn HTTP error .h.text paragraphs"; 169 | ".h.hp HTTP response .h.tx filetypes"; 170 | ".h.hr horizontal rule .h.ty MIME types"; 171 | ".h.ht Marqdown to HTML .h.uh URI unescape"; 172 | ".h.hta start tag .h.val value"; 173 | ".h.htac element .h.xd XML"; 174 | ".h.htc element .h.xmp XMP"; 175 | ".h.html document .h.xs XML escape"; 176 | ".h.http hyperlinks .h.xt JSON" 177 | ) 178 | DIR,:(enlist`doth)!enlist`$".h namespace: markup" 179 | TXT,:(enlist`dotj)!enlist( 180 | ".j.j serialize .j.k deserialize"; 181 | ".j.jd seralize infinity" 182 | ) 183 | DIR,:(enlist`dotj)!enlist`$".j namespace: JSON" 184 | TXT,:(enlist`dotq)!enlist( 185 | "General Datatype"; 186 | " .Q.a lowercase alphabet .Q.btoa b64 encode"; 187 | " .Q.A uppercase alphabet .Q.j10 encode binhex"; 188 | " .Q.addmonths .Q.j12 encode base64"; 189 | " .Q.bt backtrace .Q.M long infinity"; 190 | " .Q.dd join symbols .Q.ty type"; 191 | " .Q.def .Q.x10 decode binhex"; 192 | " .Q.f format .Q.x12 decode base64"; 193 | " .Q.fc parallel on cut "; 194 | " .Q.ff append columns Database"; 195 | " .Q.fmt format .Q.chk fill HDB"; 196 | " .Q.ft apply simple .Q.dpft save table"; 197 | " .Q.fu apply unique .Q.dpfts save table with sym"; 198 | " .Q.gc garbage collect .Q.dsftg load process save"; 199 | " .Q.id sanitize .Q.en enumerate varchar cols"; 200 | " .Q.qt is table .Q.ens enumerate against domain "; 201 | " .Q.res keywords .Q.fk foreign key"; 202 | " .Q.s plain text .Q.hdpf save tables"; 203 | " .Q.s1 string representation .Q.qt is table"; 204 | " .Q.sbt string backtrace .Q.qp is partitioned"; 205 | " .Q.sha1 SHA-1 encode "; 206 | " .Q.trp extend trap Partitioned database state"; 207 | " .Q.ts time and space .Q.bv build vp"; 208 | " .Q.u date based .Q.cn count partitioned table"; 209 | " .Q.V table to dict .Q.D partitions"; 210 | " .Q.v value .Q.ind partitioned index"; 211 | " .Q.view subview .Q.MAP maps partitions"; 212 | " .Q.par locate partition"; 213 | "Environment .Q.PD partition locations"; 214 | " .Q.k version .Q.pd modified partition locns"; 215 | " .Q.opt command parameters .Q.pf partition field"; 216 | " .Q.res k words .Q.pn partition counts"; 217 | " .Q.w memory stats .Q.qp is partitioned"; 218 | " .Q.x non-command parameters .Q.pt partitioned tables"; 219 | " .Q.PV partition values"; 220 | "IPC .Q.pv modified partition values"; 221 | " .Q.addr IP address .Q.vp missing partitions"; 222 | " .Q.fps streaming algorithm "; 223 | " .Q.fs streaming algorithm Segmented database state"; 224 | " .Q.fsn streaming algorithm .Q.D partitions"; 225 | " .Q.hg HTTP get .Q.P segments"; 226 | " .Q.host hostname .Q.u date based"; 227 | " .Q.hp HTTP post "; 228 | " .Q.l load "; 229 | ""; 230 | " File I/O"; 231 | " .Q.Cf create empty nested char file"; 232 | " .Q.Xf create file" 233 | ) 234 | DIR,:(enlist`dotq)!enlist`$".Q namespace: utilities" 235 | TXT,:(enlist`dotz)!enlist( 236 | "System information Callbacks"; 237 | " .z.a IP address .z.ac HTTP auth from cookie"; 238 | " .z.b dependencies .z.bm msg validator"; 239 | " .z.c cores .z.exit action on exit"; 240 | " .z.D/d date shortcuts .z.pc close"; 241 | " .z.e TLS connection status .z.pd peach handles"; 242 | " .z.ex failed primitive .z pg get"; 243 | " .z.ey arg to failed primitive .z.ph HTTP get"; 244 | " .z.f file .z.pi input"; 245 | " .z.h host .z.po open"; 246 | " .z.i PID .z.pp HTTP post"; 247 | " .z.K version .z.pq qcon"; 248 | " .z.k release date .z.ps set"; 249 | " .z.l license .z.pw validate user"; 250 | " .z.N/n local/UTC timespan .z.ts timer"; 251 | " .z.o OS version .z.vs value set"; 252 | " .z.P/p local/UTC timestamp .z.wc WebSocket close"; 253 | " .z.pm HTTP options .z.wo WebSocket open"; 254 | " .z.q quiet mode .z.ws WebSocket"; 255 | " .z.s self"; 256 | " .z.T/t time shortcuts"; 257 | " .z.u user ID"; 258 | " .z.W/w handles/handle"; 259 | " .z.X/x raw/parsed command line "; 260 | " .z.Z/z local/UTC datetime"; 261 | " .z.zd zip defaults" 262 | ) 263 | DIR,:(enlist`dotz)!enlist`$".z namespace: system information and callbacks" 264 | TXT,:(enlist`envvar)!enlist( 265 | "var---default---use-------------------------------------------------"; 266 | "QHOME $HOME/q folder searched for q.k and unqualified script names"; 267 | "QLIC $QHOME folder searched for k4.lic license file "; 268 | "QINIT q.q additional file loaded after q.k has initialised"; 269 | ""; 270 | "LINES supplied by OS, used to set \\c"; 271 | "COLUMNS \\c $LINES $COLUMNS"; 272 | "make sure LINES and COLUMNS are exported. In bash:"; 273 | "export LINES COLUMNS"; 274 | "before starting q"; 275 | ""; 276 | "getenv`VARNAME"; 277 | "`VARNAME setenv \"NEWVALUE\"" 278 | ) 279 | DIR,:(enlist`envvar)!enlist`$"envvar - environment variables " 280 | TXT,:(enlist`errors)!enlist( 281 | "Runtime errors"; 282 | "error------------example------------------------------explanation----------------------------------------------------------"; 283 | "access Attempt to read files above directory, run system commands or failed usr/pwd"; 284 | "accp Tried to accept an incoming TCP/IP connection but failed to do so"; 285 | "adict d[::]:x Blocked assignment ('nyi)"; 286 | "arch `:test set til 100 Attempt to load file of wrong endian format"; 287 | " -17!`:test"; 288 | "assign cos:12 Attempt to redefine a reserved word"; 289 | "badtail Incomplete transaction at end of file, get good (count;length) with -11!(-2;`:file)"; 290 | "can't Only commercially licensed kdb+ instances can encrypt code in a script"; 291 | "cast s:`a`b; c:`s$`a`e Value not in enumeration"; 292 | "con qcon client is not supported when kdb+ is in multithreaded input mode"; 293 | "cond Even number of arguments to $"; 294 | "conn Too many connections (1022 max)"; 295 | "Could not -26! found SSL/TLS not enabled"; 296 | "initialize ssl"; 297 | "d8 The log had a partial transaction at the end but q couldn't truncate the file"; 298 | "domain til -1 Out of domain"; 299 | "elim ((-58?`3) set \\:(),`a)$`a Too many enumerations (max: 57)"; 300 | "enable slave \\s 4 Command line enabled processes for parallel processing"; 301 | "threads via cmd"; 302 | "line -s only"; 303 | "failed to load Started kdb+ with -E 1 or -E 2 but without SSL/TLS enabled"; 304 | "TLS certificates"; 305 | "from select price trade Badly formed select statement"; 306 | "glim `g# limit (99 prior to V3.2, now unlimited"; 307 | "hop Request to hopen a handle fails; includes message from OS"; 308 | "hwr Handle write error, can't write inside a peach"; 309 | "IJS \"D= \\001 \"0: \"0=hello \\0011=world \" Key type is not I, J, or S."; 310 | "insert t:([k:0 1]a:2 3);`t insert(0;3) Attempt to insert a record with an existing key into a keyed table"; 311 | "length ()+til 1 Incompatible lengths"; 312 | ""; 313 | "limit 0W#2 Tried to generate a list longer than 2e9 or serialized object is >1TB (2GB until V3.4), or 'type if trying to serialize a nested object which has > 2 billion elements, or parse errors"; 314 | "loop a::a Dependency loop"; 315 | "mismatch ([]a:til 4),([]b:til 3) Columns that can't be aligned for R,R or K,K"; 316 | "Mlim Too many nested columns in splayed tables. (Prior to V3.0, limited to 999; from V3.0, 251; from V3.3, 65530)"; 317 | "mq Multi-threading not allowed"; 318 | "name too long Filepath \342\211\245100 chars (until V3.6 2018.09.26)"; 319 | "noamend t:([]a:1 2 3) Cannot change global state from within an amend"; 320 | " n:`a`b`c"; 321 | " update b:{`n?`d;:`n?`d}[]"; 322 | " from `t"; 323 | "no append to V2: Cannot append to zipped enum (from V3.0)"; 324 | "zipped enums .z.zd:17 2 6"; 325 | " `:sym?`a`b"; 326 | " V3:"; 327 | " `:sym?`c"; 328 | "no `g# {`g#x}peach 2#enlist 0 1 A thread other than the main q thread has attempted to add a group attribute to a vector. Seen with peach+slave threads or multithreaded input queue"; 329 | "noupdate {a::x}peach 0 1 Updates blocked by the -b cmd line arg, or reval code or a thread other than the main thread has attempted to update a global variable when in peach+slave threads or multithreaded input queue. Update not allowed when using -ve port number."; 330 | "nosocket Can only open or use sockets in main thread."; 331 | "nyi \"a \"like \"** \" Not yet implemented: probably makes sense, but not defined nor implemented"; 332 | "os \\foo bar Operating-system error or license error"; 333 | "par Unsupported operation on a partitioned table or component thereof"; 334 | "parse Invalid syntax"; 335 | "part Something wrong with the partitions in the HDB"; 336 | "path too long (`$ \": \",1000# \"a \") set 1 2 3 File path \342\211\245255 chars (100 before V3.6 2018.09.26)"; 337 | "pl peach can't handle parallel lambdas (V2.3 only)"; 338 | "pwuid OS is missing libraries for getpwuid. Most likely 32-bit app on 64-bit OS"; 339 | "Q7 nyi op on file nested array"; 340 | "rank +[2;3;4] Invalid rank"; 341 | "rb Encountered a problem while doing a blocking read"; 342 | "restricted 0 \"2+3 \" in a kdb+ process which was started with -b cmd line. Also for a kdb+ process using the username:password authentication file, or the -b cmd line option, \\x cannot be used to reset handlers to their default. e.g. \\x .z.pg"; 343 | "s-fail `s#3 2 Invalid attempt to set sorted attribute. Also encountered with `s#enums when loading a database ( \\l db) and enum target is not already loaded."; 344 | "splay nyi op on splayed table"; 345 | "stack {.z.s[]}[] Ran out of stack space"; 346 | "step d:`s#`a`b!1 2;`d upsert `c`d!3 4 Attempt to upsert a step dictionary in place"; 347 | "stop User interrupt (Ctrl-c) or time limit (-T)"; 348 | "stype '42 Invalid type used for Signal"; 349 | "sys {system \"ls \"}peach 0 1 Using system call from thread other than main thread"; 350 | "threadview Trying to calc a view in a thread other than main thread"; 351 | "timeout Request to hopen a handle fails on a timeout; includes message from OS"; 352 | "TLS not enabled Received a TLS connection request, but kdb+ not started with -E 1 or -E 2"; 353 | "too many syms Kdb+ currently allows for ~1.4B interned symbols in the pool and will exit with this error when this threshold is reached"; 354 | "trunc The log had a partial transaction at the end but q couldn't truncate the file"; 355 | "type til 2.2 Wrong type. Also see 'limit"; 356 | "type/attr error Direct update on disk for this type or attribute is not allowed"; 357 | "amending file"; 358 | "u-fail `u#2 2 Invalid attempt to set 'unique' attribute"; 359 | "unmappable t:([]sym:`a`b;a:(();())) When saving partitioned data each column must be mappable. () and ( \" \"; \" \"; \" \") are OK"; 360 | " .Q.dpft[`:thdb;.z.d;`sym;`t]"; 361 | "upd Function upd is undefined (sometimes encountered during -11!`:logfile) or license error"; 362 | "utf8 The websocket requires that text is UTF-8 encoded"; 363 | "value No value"; 364 | "vd1 Attempted multithread update"; 365 | "view Trying to re-assign a view to something else"; 366 | "wsfull 999999999#0j malloc failed, ran out of swap (or addressability on 32-bit), or hit -w limit"; 367 | "wsm 010b wsum 010b Alias for nyi for wsum prior to V3.2"; 368 | "XXX delete x from system \"d \";x Value error (XXX undefined)"; 369 | ""; 370 | "System errors (from file ops and IPC)"; 371 | "error------------example------------------------------explanation----------------------------------------------------------"; 372 | "XXX:YYY XXX is from kdb+, YYY from the OS"; 373 | ""; 374 | "Parse errors (on execute or load)"; 375 | "error------------example------------------------------explanation----------------------------------------------------------"; 376 | "[({])} \" \"hello Open ([{ or \""; 377 | "branch a: \"1; \",65024# \"0; \" A branch (if;do;while;$[.;.;.]) more than 65025 byte codes away (255 before V3.6 2017.09.26)"; 378 | " value \"{if[ \",a, \"]} \""; 379 | "char value \" \\000 \" Invalid character"; 380 | "globals a: \"::a \"sv string til 111; Too many global variables"; 381 | " value \"{a \",a, \"::0} \""; 382 | "limit a: \"; \"sv string 2+til 241; Too many constants, or limit error"; 383 | " value \"{ \",a, \"} \""; 384 | "locals a: \":a \"sv string til 111; Too many local variables"; 385 | " value \"{a \",a, \":0} \""; 386 | "params f:{[a;b;c;d;e;f;g;h;e]} Too many parameters (8 max)"; 387 | ""; 388 | "License errors (on launch)"; 389 | "error------explanation----------------------------------------------------------"; 390 | "cores The license is for fewer cores than available"; 391 | "cpu The license is for fewer CPUs than available"; 392 | "exp License expiry date is prior to system date"; 393 | "host The hostname reported by the OS does not match the hostname or hostname-pattern in the license"; 394 | "k4.lic k4.lic file not found"; 395 | "os Wrong OS or operating-system error (if runtime error)"; 396 | "srv Client-only license in server mode"; 397 | "upd Version of kdb+ more recent than update date, or function upd undefined"; 398 | "user Unlicenced user"; 399 | "wha System date is prior to kdb+ version date"; 400 | "q)" 401 | ) 402 | DIR,:(enlist`errors)!enlist`$"error messages" 403 | TXT,:(enlist`internal)!enlist( 404 | "-4!x tokens Replaced:"; 405 | "-8!x to bytes -1! hsym"; 406 | "-9!x from bytes -2! attr"; 407 | "-10!x type enum -3! .Q.s1"; 408 | "-11! streaming execute -5! parse"; 409 | "-14!x quote escape -6! eval"; 410 | "-16!x ref count -7! hcount"; 411 | "-17!x flip endian-ess -12! .Q.host"; 412 | "-18!x compress byte -13! .Q.addr"; 413 | "-19! compress file -15! md5"; 414 | "-21!x compression stats -20! .Q.gc"; 415 | "-22!x uncompressed length -24! reval"; 416 | "-23!x memory map -29! .j.k"; 417 | "-25!x async broadcast -31! .j.jd"; 418 | "-26!x SSL"; 419 | "-27!(x;y) format"; 420 | "-30!x deferred response"; 421 | "-33!x SHA-1 hash"; 422 | "-120!x domain" 423 | ) 424 | DIR,:(enlist`internal)!enlist`$"negative bang - -n!x - internal system calls" 425 | TXT,:(enlist`iterator)!enlist( 426 | "map iterators"; 427 | "' Each v1 each x x v2'y v3[x;y;z]"; 428 | "/: Each Right x v2/:y"; 429 | "\\: Each Left x v2\\:y"; 430 | "': Each Parallel v1 peach x"; 431 | "': Each Prior v2 prior y"; 432 | "' Case int'[x;y;z...]"; 433 | "accumulating iterators"; 434 | "\\ Scan v1 scan x Converge, Do, While"; 435 | "/ Over x v2/y v3/[x;y;z] MapReduce"; 436 | "\\ Scan x v2\\y v3\\[x;y;z] Fold"; 437 | "/ Over v1 over x Converge, Do, While" 438 | ) 439 | DIR,:(enlist`iterator)!enlist`$"iterators (formerly adverbs)" 440 | TXT,:(enlist`keyword)!enlist( 441 | "A\t abs acos aj aj0 ajf ajf0 all and any asc asin asof atan attr avg avgs"; 442 | "B\t bin binr"; 443 | "C\t ceiling cols cor cos count cov cross csv cut"; 444 | "D\t delete deltas desc dev differ distinct div do dsave"; 445 | "E\t each ej ema enlist eval except exec exit exp"; 446 | "F\t fby fills first fkeys flip floor"; 447 | "G\t get getenv group gtime"; 448 | "H\t hclose hcount hdel hopen hsym"; 449 | "I\t iasc idesc if ij ijf in insert inter inv"; 450 | "K\t key keys"; 451 | "L\t last like lj ljf load log lower lsq ltime ltrim"; 452 | "M\t mavg max maxs mcount md5 mdev med meta min mins mmax mmin mmu mod msum"; 453 | "N\t neg next not null"; 454 | "O\t or over"; 455 | "P\t parse peach pj prd prds prev prior"; 456 | "R\t rand rank ratios raze read0 read1 reciprocal reval reverse rload rotate rsave rtrim"; 457 | "S\t save scan scov sdev select set setenv show signum sin sqrt ss ssr string sublist sum sums sv svar system"; 458 | "T\t tables tan til trim type"; 459 | "U\t uj ujf ungroup union update upper upsert"; 460 | "V\t value var view views vs"; 461 | "W\t wavg where while within wj wj1 wsum"; 462 | "X\t xasc xbar xcol xcols xdesc xexp xgroup xkey xlog xprev xrank" 463 | ) 464 | DIR,:(enlist`keyword)!enlist`$"keywords (functions)" 465 | TXT,:(enlist`kill)!enlist( 466 | "If the q session is responsive and listening on a port, you can try connecting "; 467 | "to it via ipc and calling \"exit 0\"."; 468 | ""; 469 | "kill -9 pid results in an ungraceful exit, and should be used as a last resort."; 470 | "If kdb+ is responsive, send it SIGTERM, e.g. kill pid"; 471 | "If it is not responsive, send SIGINT, then SIGTERM."; 472 | "If that doesn't work, and you really have to, then kill -9 pid."; 473 | ""; 474 | "the pid of a q process is .z.i " 475 | ) 476 | DIR,:(enlist`kill)!enlist`$"kill - killing a q session" 477 | TXT,:(enlist`lic)!enlist( 478 | "The locations for the license file k4.lic are:"; 479 | " the q directory "; 480 | " the directory pointed to by the env var QHOME"; 481 | " the directory pointed to by the env var QLIC"; 482 | ""; 483 | "license errors, see help`errors"; 484 | ""; 485 | "licadmin@kx.com deals with license questions"; 486 | "failover@kx.com can provide a temporary emergency license " 487 | ) 488 | DIR,:(enlist`lic)!enlist`$"licenses - kdb+ license files " 489 | TXT,:(enlist`operator)!enlist( 490 | "@ Apply/At $ Cond ! Dict ? Find"; 491 | ". Index/At Cast Enkey Roll, Deal"; 492 | " Trap Tok Unkey Enum Extend"; 493 | " Amend Enumerate Enumeration Select"; 494 | " Pad Flip Splayed Exec"; 495 | " mmu Display Simple Exec"; 496 | " Internal Vector Conditional"; 497 | " Update"; 498 | " Delete"; 499 | ""; 500 | "+ Add - Subtract * Multiply % Divide"; 501 | ""; 502 | "= Equals < Less Than > Greater Than ~ Match"; 503 | "<> Not Equals <= Up To >= At Least"; 504 | "| Greater, OR & Lesser, AND"; 505 | ""; 506 | "# Take _ Cut, Drop ^ Fill , Join" 507 | ) 508 | DIR,:(enlist`operator)!enlist`$"operators (functions)" 509 | TXT,:(enlist`save)!enlist( 510 | "tables can be written as a single file or spread across a directory, e.g."; 511 | "`:trade set x / write as single file "; 512 | "`:trade/ set x / write across a directory "; 513 | "trade:get`:trade / read "; 514 | "trade:get`:trade/ / map columns on demand"; 515 | ""; 516 | "tables splayed across a directory must be fully enumerated (no varchar) and not keyed." 517 | ) 518 | DIR,:(enlist`save)!enlist`$"save/load tables" 519 | TXT,:(enlist`syscmd)!enlist( 520 | "\\1 filename redirect stdout"; 521 | "\\2 filename redirect stderr"; 522 | "\\a [n] tables [namespace]"; 523 | "\\b views (see also .z.b)"; 524 | "\\B invalid/pending dependencies"; 525 | "\\c [23 79] console height,width"; 526 | "\\C [36 2000] browser height,width"; 527 | "\\d [n] q namespace/directory [go to]"; 528 | "\\e [0|1|2] error trap clients 0=off|1=on|2=display"; 529 | "\\f [n] functions [namespace]"; 530 | "\\g [0|1] garbage collection mode "; 531 | "\\l [f] load script (or dir:files splays parts scripts)"; 532 | "\\l . (re)load data only, ignore any scripts "; 533 | "\\o [N] offset from gmt"; 534 | "\\p [i] port (0 turns off)"; 535 | "\\P [7] print digits(0-all)"; 536 | "\\r replication master"; 537 | "\\r old new unix mv "; 538 | "\\s number of slaves (query only) "; 539 | "\\S [-314159] random seed"; 540 | "\\t [i] timer [x] milliseconds (1st fire after delay)"; 541 | "\\t expr time for expression "; 542 | "\\ts expr time and space for expression"; 543 | "\\T [i] timeout [x] seconds "; 544 | "\\u reload the user:pswd file specified with -u"; 545 | "\\v [n] variables [namespace]"; 546 | "\\w workspace (bytes allocated; available bytes in heap; max heap so far;"; 547 | " max bytes available; mapped bytes; physical memory)"; 548 | " (max bytes set by -w, 0 => unlimited) - see .Q.w[]"; 549 | "\\w 0 count symbols defined, symbol space used (bytes)"; 550 | "\\W [2] week offset(sat..fri)"; 551 | "\\x .z.p? expunge .z.zd or .z.p? value (ie reset to default)"; 552 | "\\z [0|1] \"D\"$ uses mm/dd/yyyy (0) or dd/mm/yyyy (1)"; 553 | "\\cd [d] O/S directory [go to]"; 554 | "\\_ is readonly (cmdline -b)"; 555 | "\\_ f.q create runtime script f.q_ from f.q (or f.k_ from f.k) "; 556 | "\\[other] O/S execute"; 557 | "\\\\ exit"; 558 | "\\ (escape suspension, or switch language mode)"; 559 | "ctrl-c (stop)" 560 | ) 561 | DIR,:(enlist`syscmd)!enlist`$"system commands" 562 | TXT,:(enlist`temporal)!enlist( 563 | "`timestamp$x ~ 2009.11.05D20:39:35.614334000 ~ \"p\"$x ~ x.timestamp"; 564 | "`datetime$x ~ 2009.11.05T20:39:35.614 ~ \"z\"$x ~ x.datetime"; 565 | "`year$x ~ 2009 ~ x.year"; 566 | "`month$x ~ 2009.11m ~ \"m\"$x ~ x.month"; 567 | "`mm$`date$x ~ 11 ~ x.mm"; 568 | "`week$x ~ 2009.11.02 ~ x.week"; 569 | "`date$x ~ 2009.11.05 ~ \"d\"$x ~ x.date"; 570 | "`dd$x ~ 5 ~ x.dd"; 571 | "`hh$x ~ 20 ~ x.hh"; 572 | "`minute$x ~ 20:39 ~ \"u\"$x ~ x.minute"; 573 | "`mm$`time$x ~ 39 ~ x.mm"; 574 | "`uu$x ~ 39 ~ x.uu"; 575 | "`second$x ~ 20:39:35 ~ \"v\"$x ~ x.second"; 576 | "`ss$x ~ 35 ~ x.ss"; 577 | "`time$x ~ 20:39:35.614 ~ \"t\"$x ~ x.time"; 578 | "`timespan$x ~ 0D20:39:35.614334000 ~ \"n\"$x ~ x.timespan" 579 | ) 580 | DIR,:(enlist`temporal)!enlist`$"temporal - date & time casts" 581 | .q.help:.help.display 582 | --------------------------------------------------------------------------------