cancel
Showing results for 
Search instead for 
Did you mean: 

A+ <-> Q cheat-sheet

TT
New Contributor
Hi there,I am an A+ developer, and I am exploring kdb+.I see many similarities (not surprisingly!), so I was wondering ifthere is already an A+ <-> Q cheat sheet around...If not, is there a wiki somewhere where I can start one?Thanks
1 REPLY 1

Qurious
New Contributor

You might like to do something similar to the
following for A+ -> q.

I don't know A+, I have only started with q.

Q is also my first attempt to learn a
complete programming language.

To assist my understanding of both q & k, I
have constructed a "Proglish-q-k !Dictionary"
for all the q built-in functions.

Proglish is just something I dreamt up. It is
a fifteen character non-whitepace descriptor,
which kind of fuses programmers dot.notation
and sms-text syntax. (i.e programmers.english)

It's a bit like Twitter.div.10.

It is meant to remind me of what each function
does. Provided that I can also remember that
Ivl means interval, and f0N means null filled.
While fn means function and agg means
aggregation and so on.

The !Dictionary format is Proglish->q->k across
the page.

Here are a couple of examples, listed down the
page:

----

Proglish) lwr->upper-case

q)upper

k){$[(@y)in 11 -11h;`$.z.s[x]@$y;x y]}["\000\001\
002\003\004\005\006\007\010\t\n\013\014\r\016\
017\020\021\022\023\024\025\026\027\030\031\032\
033\034\035\ 036\037 !\"#$%&'()*+,-./0123456789:
;<=>@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_
`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~\177\200\
201\202\203\204\205\206\207\210\211\212\213\214\
215\215\217\220\221\222\223\224\225\226\227\230\
231\232\233\234\235\236\237\240\241\242\243\244\
245\246\247\250\251\252\253\254\255\256\257\260\
261\262\263\264\265\266\267\270\271\272\273\274\
275\276\277\300\301\302\303\304\305\306\307\310\
311\312\313\314\315\316\317\320\321\322\323\324\
325\326\327\330\331\332\333\334\335\336\337\340\
341\342\343\344\345\346\347\350\351\352\353\354\
355\356\357\360\361\362\363\364\365\366\367\370\
371\372\373\374\375\376\377"]

-----

Proglish) Ivl.agg.fn.cols

q)wj

k){[w;f;y;z]e:+1_z;z:*z;i:(z[*f]?y[*f])|/:0 1+((f#z)
bin@[f#y;*|f;:;]@)'w;y,'+f!+{[e;d;a;b]e@'d@\:a+!
b-a}[*e;z f:*|e]/'+i}

-----

Proglish) join.of.col.f0N

q)uj

k){$[()~x;y;98h=@x;x,(!+:.Q.ff[x;y])#.Q.ff[y;x];
(a,b,c)!+.[x;i;:;((x:+uj[. x;d c:&~c]). i:(!+d;i
j)).Q.fl'.+(d:. y)j:&c:(#a))i:(a:!x)?b:!y]]}

-----

I built it as a personal reference. Presently
it consists of eight .pdf pages of 'courier new'.

It is not something I want to distribute, due
to the possibility of offending other peoples
copyright.

I also thought it might demonstrate my enthusiasm
for q and show recruiters that I have a very basic
understanding of the built-in functions in the q language.

Regards,

Q.