Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sure, kdb+ would probably be worth every penny even at $100k/year when it's the right tool for the job. I gather it's genuinely the best in-memory database for computing arrays of varying rank.

But a lot of the use cases these other tools are good for are small tasks every now and then. I feel kdb+ is in a different category.



Anecdote: I frequently use kdb+ for small tasks. For me, its in the "all-purpose" category. The limitations are only in the ability I have to use it.

For example, removing nonconsecutive, duplicate lines from a file, such as a CSV file:

   exec echo "k).Q.fs[l:0::\`:$1];l:?:l;\`:$1 0:l"|exec q >&2;
where Q.fs is a function in a script thats bundled with the interpreter; the chunk size for reading the file into memory is adjustable by editing the function.


You can make it simpler:

    l:0;.Q.fs[{if[x~l;:];-1 l::x}each]`:input
or if you have memory:

    -1 distinct read0`:input
...or if you want to use k:

    -1@?0:`:input


Stupid question: With -1, how would I suppress the return value? Use a function?

   k)a:{-1@?0:`:input;};a[]


It's not a stupid question.

    ;
What this does is return generic-null :: which .Q.s doesn't print.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: