Top Posts
Categories
- KDB (6)
- Pricing (4)
- Q (17)
- Q Idioms (3)
- Regression (3)
- Regular Expressions (3)
- Time Series (1)
-
Join 18 other subscribers
Archives
Tag Cloud
Blog Stats
- 73,304 hits
Category Archives: KDB
N Queens : all possible solutions in q/kdb+
I have written the code to generate all possible solutions for the N Queens problem. I have used backtracking approach, which allows me to generate all the solutions. Whenever, a solution is found I print it and then backtrack to … Continue reading
Regular Expressions in q/KDB+
The verb like is used for matching regular expressions in q/KDB+. Usage : X like Y. Reserved characters for pattern matching in q : a) “?” matches a character b) “*” matches a sequence of characters c) “[]” is used … Continue reading
Shorter Code to Generate all Permutations of a string in q/KDB+
My new Solution : perm:{[s] $[(count s)=1;s;raze {(first x),/:perm 1_x}each (rotate[1]\)s]} My old Solution : perm:{[s] $[(count s)=1;s;[p:(rotate[1]\)s;raze((string first each p),/:’perm each 1_/:p)]]} Variant of my old Solution : perm:{[s] $[(count s)=1;s;[p:(rotate[1]\)s;raze((string first each p),/:’.z.s each 1_/:p)]]} The .z.s function … Continue reading
Publication on KDB
Its a lazy sunday morning and the first time I felt that high temperatures are coming back to the city. Winter is over. Perfect time, not to go out of home, cozily sit in your room and do some random … Continue reading
Bond Vauation – Present Value Approach in Q/KDB+
Let, c denote the cash flow, t denote the time frame, d denote the discount rate, pv denote the present value of the cash flows, M the face value then PV = (c/d + c/d^2 + … + c/d^n) + … Continue reading
Matrix operations in Q/KDB+
1) Find the maximum element of each column in matrix m. max m 2) Find the minimum element of each row of a matrix m. min each x. 3) Test for symetric matrix m~flip m 4) Test for anti-symetric matrix … Continue reading
Posted in KDB, Q
Leave a comment