Despite my best efforts to create the book with zero errors, readers have pointed out a few bugs. The Kindle version has all corrections and is available for re-download. Recent versions of the printed book have them as well. Please report any new errata to Nick Psaris.
- Foreword
- Preface
- Chapter 1 Introduction
- Chapter 2 Getting Started
- Chapter 3 Generating Data
- Chapter 4 Functions
- Chapter 5 Code Organization
- Chapter 6 A Random Walk
- Chapter 7 Building a Table
- Chapter 8 Large Tables
- Chapter 9 Trades and Quotes
- Chapter 10 CEP Engine Components
- Chapter 11 Running a CEP Engine
- Chapter 12 Security
- Chapter 13 Debugging
- Chapter 14 Q-SQL
- Chapter 15 Big Data
- Chapter 16 Remotely Accessing Data
- Chapter 17 Advanced Techniques
- Selected Web Resources
- List of Terms
- Appendix A
-
p. 2, 1.1 Why Kdb+?, The third sentence of the fourth paragraph should read: When the results of a vector operation are then used as the inputs of the next operation, all the data stored in the CPU’s memory cache can be accessed immediately without needing to search in the slower/larger caches or even the slowest and largest memory store located on the motherboard.
Posted 2017.07.18. David Z. Han — Fixed in the 4th printing
-
p. 9, 2.1 Installing KDB+, Running q, The fifth sentence should read: *4*()core indicates that kdb+ is capable of seeing 4 cores on my machine.
Posted 2015.05.03. Danila Deliya — Fixed in the 3rd printing
-
p. 12, 2.2 Basics, File Handles, The fifth sentence should begin: In the case of file handles …
Posted 2018.01.03. Mihail Temelkov — Fixed in the 4th printing
-
p. 17, 2.3 Syntax Rules, Parentheses, The first sentence should read: Parentheses can also be used to enforce operator precedence.
Posted 2015.05.03. Danila Deliya — Fixed in the 3rd printing
-
p. 40, 4.1 12 Uniforms, Cut, The last sentence should read: We then see the cut operator which converts the one dimensional list into a matrix with 12 rows and x elements per row.
Posted 2023.09.19. Jamal Mulla — Fixed in the 6th printing
-
p. 44, 4.2 Box Muller, Reshape, should read: The second line of the .stat.bm function uses the "#" operator …
Posted 2015.03.27. Julien Quentin Tran — Fixed in the 2nd printing
-
p. 44, 4.2 Box Muller, Reshape, The second sentence should read: The basic form of the take operator "#" takes …
Posted 2015.03.27. Julien Quentin Tran — Fixed in the 4th printing
-
p. 44, 4.2 Box Muller, Reshape, The footnote should read: k does not require semicolons …
Posted 2015.11.17. Gerard A. Verdone — Fixed in the 4th printing
-
p. 45, 4.2 Box Muller, Reshape, The first sentence should start: For the special case where one of the dimensions is null, …
Posted 2016.01.10. David Z. Han
-
p. 46, 4.2 Box Muller, Loading Code, The last sentence should conclude: we now move to a slower generator of normal random variables that only requires a single uniform variable as input.
Posted 2015.05.03. Danila Deliya — Fixed in the 3rd printing
-
p. 47, 4.3 Beasley-Springer-Moro, Horner’s Method, The first sentence should begin: The fifth line …
Posted 2015.05.03. Danila Deliya — Fixed in the 3rd printing
-
p. 49, 4.3 Beasley-Springer-Moro, Over, The second listing should multiply by .1:
q)0 (.9)\.1*til 5 0 0.1 0.29 0.561 0.9049
Posted 2015.08.01. Anonymous — Fixed in the 4th printing
-
p. 53, 5.1 Libraries, Identity vs Equality, The second sentence should read: For atoms, the match operator and the equality operator "=" have the same behavior.
Posted 2015.03.27. Julien Quentin Tran — Fixed in the 2nd printing
-
p. 57, 5.3 Directories, The first sentence should read: The root namespace and all its children are designed for data.
Posted 2015.11.17. Gerard A. Verdone — Fixed in the 4th printing
-
p. 65, 6.1 Geometric Brownian Motion, Uniform Functions, The definition of fills should read: Each null element is replaced with the last prior non-null value.
Posted 2021.12.09. Simon Shanks — Fixed in the 5th printing
-
p. 71, 6.3 Path Generation, Dot Apply, The second sentence in the second-to-last paragraph should begin: It then calls the right operand.
Posted 2023.09.19. Jamal Mulla — Fixed in the 6th printing
-
p. 116, 9.3 Trades, Delaying a Time Series, The second paragraph should begin: The prev operator is similar to the next operator …
Posted 2015.05.13. Danila Deliya — Fixed in the 3rd printing
-
p. 119, 9.3 Trades, Grouping, The second listing should not have the extra:
q)o
Posted 2015.03.27. Julien Quentin Tran — Fixed in the 2nd printing
-
p. 125, 10.1 Timer Events, Nulls and Infinities, The third sentence of the last paragraph should end: perhaps the most appropriate trade price would be the last known trade price.
Posted 2015.05.13. Danila Deliya — Fixed in the 3rd printing
-
p. 128, 10.1 Timer Events, While, The implementation of the .timer.run function should read:
run:{[t;i;tm] j:t i; t:.[t;();_;i]; r:value (f:j `func),ltime tm; if[not null r;t:merge[t;(j `name;f;tm+r)]]; t}
Posted 2023.11.17. Paul Delaney — Unpublished
-
p. 129, 10.1 Timer Events, Drop, The first sentence on the page should be: The second line of the function indexes into the table to find the job j.
Posted 2015.05.13. Danila Deliya — Fixed in the 3rd printing
-
p. 129, 10.1 Timer Events, Drop, The fourth paragraph should also refer to the j dictionary.
Posted 2015.05.13. Danila Deliya — Fixed in the 3rd printing
-
p. 132, 10.2 Logging, Logging Library, The second sentence of the third paragraph in the section should begin: In this case, the monadic function
(1024
)
* …Posted 2015.05.13. Danila Deliya — Fixed in the 3rd printing
-
p. 132, 10.2 Logging, Logging Library, The final listing should be labeled .log.hdr.
Posted 2015.04.04. Lam Hin Yan — Fixed in the 2nd printing
-
p. 135, 10.3 Command Line Options, Configuration, The first new paragraph should mention five parameters: Our CEP server will require five parameters: a file path to load reference data, a time to run the end of day processing, a directory to save the market data, a debug flag, and a log level to control how much logging is displayed.
Posted 2015.04.04. Lam Hin Yan — Fixed in the 3rd printing
-
p. 135, 10.3 Command Line Options, Configuration, The second paragraph should mention five parameters as well: The table now has one empty row, and five options.
Posted 2015.04.04. Lam Hin Yan — Fixed in the 3rd printing
-
p. 135,10.3 Command Line Options, Parsing User Command Line Arguments, The last paragraph should begin: The second line of the function …
Posted 2015.05.13. Danila Deliya — Fixed in the 3rd printing
-
p. 172, 14.1 Syntax, Dot Notation, The last sentence should end: it is safer to always use explicit casting instead of using
dot
notation.Posted 2015.05.13. Danila Deliya — Fixed in the 3rd printing
-
p. 177, 14.1 Syntax, Exec by, The third paragraph should begin: This works because calling first …
Posted 2015.05.13. Danila Deliya — Fixed in the 3rd printing
-
p. 181, 14.2 Pivot Tables, Building a Pivot Table, The second sentence of the first paragraph should begin: Our dataset has a price …
Posted 2015.05.13. Danila Deliya — Fixed in the 3rd printing
-
p. 184, 14.2 Pivot Tables, Writing a Pivot Function, The implementation of .util.pivot should read:
pivot:{[t] u:`$string asc distinct last f:flip key t; pf:{x#(`$string y)!z}; p:?[t;();g!g:-1_ k;(pf;`u;last k:key f;last key flip value t)]; p}
Posted 2015.03.26. Nick Psaris — Fixed in the 2nd printing
-
p. 194, 14.4 Joining Datasets, Asof joins, The third sentence of the first paragraph should begin: In fact, the asof join aj operator …
Posted 2015.05.13. Danila Deliya — Fixed in the 3rd printing
-
p. 195, 14.4 Joining Datasets, Asof Joins, The ending of the third paragraph, fourth and fifth paragraph should read: But the values in the temporal column will differ between the left and right operands. There are two ways to obtain the time values from the right operand. The first is to use the aj0 operator, which has the same syntax as the aj operator but returns the time from the right operand. The second way to obtain the same information is to add a copy of the time column to the right operand before performing the join. This second method has the advantage of removing any doubt as to what the time in the table refers to.
Posted 2024.11.17. Alexander Unterrainer — Fixed in the 6th printing
-
p. 198, 14.4 Joining Datasets, Asof joins, The first sentence should read: Looking forward in time is generally a bad practice when attempting to reproduce a realistic simulation of historical events.
Posted 2015.05.13. Danila Deliya — Fixed in the 3rd printing
-
p. 209, 15.1 Partitioning By Column, The sym File, The second listing should begin with the following command:
q)prices`id
Posted 2015.05.13. Danila Deliya — Fixed in the 3rd printing
-
p. 211, 15.2 Partitioning By Row, Virtual Column, The section should begin: Each table in our qdb database starts with a date column. But where did this column come from?
Posted 2015.05.13. Danila Deliya — Fixed in the 3rd printing
-
p. 218, 15.4 Compressing Tables, Compressing by Default, The last sentence should read: To clear the compression configuration we can use the
\x
system command and .z.zd will be cleared.Posted 2015.05.13. Danila Deliya — Fixed in the 3rd printing
-
p. 221, 15.5 Mapped Data, Remote File Systems, The last sentence of the first paragaph should end: it is conceivable that compressing the data can actually increase the performance of reading data from our kdb+ database.
Posted 2015.05.17. Danila Deliya — Fixed in the 3rd printing
-
p. 224, 15.6 Grid Computing, Slave Layout, The last sentence should begin: The next chapter discusses …
Posted 2015.05.17. Danila Deliya — Fixed in the 3rd printing
-
p. 227, 16.1 Q to Q, Subscriptions, The first sentence should read: Asynchronous messages are often used to send messages as fast as possible …
Posted 2015.04.04. Lam Hin Yan — Fixed in the 2nd printing
-
p. 237, 17.1 Profiling Q Functions, Instrumenting Functions, The second sentence of the paragraph after the definition of .prof.instr should begin: The third line of the function …
Posted 2015.05.17. Danila Deliya — Fixed in the 3rd printing
-
p. 239, 17.1 Profiling Q Functions, Traversing the Directory Tree, The second sentence of the first paragraph should read: So we can exclude q, Q, h, j, o, and prof from the list of directories to inspect.
Posted 2015.05.17. Danila Deliya — Fixed in the 3rd printing
-
p. 245, 17.2 Derivative Pricing, Monte Carlo Simulation, The implementation of the .deriv.mc function should read:
mc:{[S;s;r;t;pf;n] z:.stat.bm n?/:count[t]#1f; f:S*prds .stat.gbm[s;r;deltas[first t;t]] z; v:pf[f]*exp neg r*last t; v}
Posted 2022.02.05. Nick Psaris — Unpublished
-
p. 251, 17.2 Derivative Pricing, Path Dependent Payoffs, The first sentence should read: The Up and Out option is worth less.
Posted 2015.05.17. Danila Deliya — Fixed in the 3rd printing
-
p. 252, 17.2 Derivative Pricing, Black-Scholes-Merton, The implementation of the .deriv.bsm. function should read:
bsm:{[S;k;r;t;c;s] x:(log[S%k]+rt:r*t)%ssrt:s*srt:sqrt t; d1:ssrt+d2:x-.5*ssrt; n1:m*.stat.cnorm d1*m:-1 1f c; n2:m*.stat.cnorm d2*m; p:(S*n1)-n2*pvk:k*pv:exp neg rt; g:(n1p:exp[-.5*d1*d1]%sqrt 2f*acos -1f)%S*ssrt; v:srt*Sn1p:S*n1p; th:neg (r*pvk*n2)+Sn1p*s*.5%srt; rho:pvk*t*n2; d:`price`delta`gamma`vega`theta`rho; d!:(p;n1;g;v;th;rho); if[0h<type p;d:flip d]; d}
Posted 2020.12.17. Matthew Balkanloo — Fixed in the 5th printing
-
p. 254, 17.2 Derivative Pricing, Brawn vs Brain, The first sentence of the first paragraph should begin: For example, if we assign a projection of .deriv.bsm to f …
Posted 2015.05.17. Danila Deliya — Fixed in the 3rd printing
-
p. 258, 17.3 Histograms, Grouping Data, The second sentence of the fourth paragraph should begin: The operator assumes, but does not enforce, that our list of bins …
Posted 2015.05.17. Danila Deliya — Fixed in the 3rd printing
-
p. 261, 17.3 Histograms, Alternate Bin Algorithms, The first sentence should read: But the sturges method does not handle skewed data well.
Posted 2015.05.17. Danila Deliya — Fixed in the 3rd printing
-
p. 262, 17.3 Histograms, Alternate Bin Algorithms, The second footnote should begin: Freedman, David; Diaconis, P. (1981). …
Posted 2015.05.17. Danila Deliya — Fixed in the 3rd printing
-
p. 267, Kx Systems Links, The description of [20] Kdb+ IPC protocol should end: Sample deserialization implementations can be found in the Kx Connectivity Resources repository http://kx.com/q/c/.
Posted 2015.05.17. Danila Deliya — Fixed in the 3rd printing
-
p. 271, Projection, The last sentence should read: Monadic functions can not be projected, as the function will be instantly called.
Posted 2015.05.17. Danila Deliya — Fixed in the 3rd printing