start | find | index | login or register | edit
q-notes
by earl, 6563 days ago
[[see also k-notes]]

- http://kx.com/q/d/k.txt

unset:.[`.;();_;]
mset:.[;();:;]'

shape:{if[0>@x; :!0]; (#x),,/s@!0+1=#?s:.z.s'x} / by roger

lpad:{(-y)$x}
rpad:{y$x}

- http://q.o.potam.us/?p=pcre / Lloy Zusman's PCRE lib for q

attributes

"kdb+ does not automatically add hash tables to dicts. `u#.. builds a hash table. hash tables are currently maintained
on append [..] but not on delete." (arthur)

--

"`s#dict (incl. keyed tables) marks the dict to behave as step function."

q)d:1 2 3f!10 20 30
q)d 1.5
0N
q)(`s#d) 1.5
10

--

attribute code values (K->u):

`s - 1
`u - 2
`p - 3
`g - 5

dots

.z.s -- function self reference

c interface

- http://kx.com/q/c/
- http://kx.com/q/c/readme.txt
- http://kx.com/q/c/c/k.h

views

created by v::a+b (same syntax used in lambdas for global variable assignment).

q)a:til 10
q)b:neg til 10
q)c::a+b
q)d::count c
q)c
0 0 0 0 0 0 0 0 0 0
q)d
10
q)b:til 10
q)c
0 2 4 6 8 10 12 14 16 18

views` or \b lists all defined views:

q)views`
`s#`c`d
q)\b
`s#`c`d
powered by vanilla
echo earlZstrainYat|tr ZY @.
earl.strain.at • esa3 • online for 8692 days • c'est un vanilla site