77 points · by panic · 8y ago · 14 comments
KDB+ adds a lot of important features for handling time-series, websockets, web programming and generally scaling up to a distributed system where you could connected different nodes to form a message bus or add your own micro-services framework on top. You can't do that yet with any of the open-source APL and APL-like frameworks I've seen.
There really is nothing out there like KDB that comes close for realtime manipulation and storage of ultra fast time series data.
Would Jd (https://code.jsoftware.com/wiki/Jd/Index) be adequate here?
> Non-commercial use is free.
Do you mean that not only the DB has to be open source, but it also should be free-as-in-beer?
cat 1.txt
http://example.net/?p=
https://www.example.com/?page=
...
For a given URL prefix in the file 1.txt, print URLs for pages 25-35. Desired URL prefix is on line 100 of the file. cat 1.sh
#!/bin/sh
l=$(exec head -$2|exec tail -1);
n=$3;while true;do
test $n -le $4||break;
echo $l$n;
n=$((n+1));
done;
1.sh 1.txt 100 25 35 cat 1.k
g:{_getenv x};
u:0:g "u";
l:0$g "l";
b:0$g "b";
e:0$g "e";
`0:{,/$u[l],x}'b _!e;
u=1.txt l=99 b=25 e=36 k 1I admit that this is the first time I see APL code.
You've answered your own question.
It's only "incomprehensible" if you're not familiar with it.
After you've studied it it is very powerful and very succinct.
The article even gives an example:
Just consider the extract !'\:/:. The !
operator means rotation in this context.
If used as n!v it rotates the vector v by
n. But we do not directly use the
operator like that, we modify it using
the adverb ', which generally denotes a f
unctional map. Now we can do something
like n!'m to rotate each row vector in
the matrix m, that is each element of the
vector of vectors m, by n, or more
generally we can say something like v!'m
to rotate each row m[i] in the matrix m
by the corresponding element of v[i].
A good analogy I would give is the equally "cryptic" to the uninitiated, but equally fast and powerful, to those that mastered them, vi(m) text manipulation commands -- which also use a very similar concept of modifiers and targets and so on.Conway's Game of Life in some 50 characters of APL.
...and once you learn it, it feels as natural as any other language.