Spoiler warning. Day 5 offered a chance to have some fun at the kdb+
console. Parsing the input: i:flip -1 1 1*0 -1 -1+(6#" I";"
")0:(1+r?"")_r:read0`05.txt // instructions s:trim flip
reverse((-1+r?"")#r)[;1+4*til 9] // stacks The solution is to ite...
Here is a utility function I wrote to allow multi-line pasting into the
kdb+ console. I find this very helpful when debugging or stepping
through code, as I can copy in chunks of code, rather than line by line.
I keep it in my q.q file. I'd seen this...
Always room for improvement. There is no need to pass the number of open
lambdas between each iteration when that can be easily checked during
each iteration. Now there is no need to pass a 2 item list, we can just
converge on the input string itself...
I'm not sure what your complete data set looks like - but using a best
guess, I get an expected result. q)tt:(DT:`timestamp$2012.12.31
2013.01.02 2013.01.03 2013.01.04 2013.01.07 2013.01.08 2013.01.09
2013.01.10 2013.01.11 2013.01.14;O:1405.22 1426...