IMPORTANT NOTE: There is now a second edition of this book, you can find source code here
Source for first edition of my book!