So was the previous book, but in both case there's a separate, more liberal license for the code samples. Code samples in a programming book are a tricky case: when you're reading a programming book that has code samples, in a sense the
whole purpose is for you to be able to write more code later on, for the rest of your life in fact, that's "substantially similar" to the code samples in the book. Which means that, under US law anyway, it's copyright infringement, unless the similarity is limited to purely functional aspects of the code, a fact of which you may have to persuade a nontechnical jury.
This has been used by the authors of the Numerical Recipes series for decades to extort royalties from programmers who learned about numerical algorithms from their books.
The explanatory text is not subject to the same problem; you read the explanatory text in order to understand the code, not in order to be able to write more explanatory text substantially similar to what is in the book.