The code examples for this book, which are available from http://oreilly.com/catalog/9780596518776/, come in two forms. One is a set of examples, organized by chapter, with each example numbered and named. These examples are referenced from the relevant chapter. The other form is a dump of all the code from the book, in the order it was presented in the book. That can be helpful if you need a line that didn’t make it into the final example, or if you want to cut and paste pieces as you walk through the examples. Hopefully, the code will help you learn.
So far, the code examples for this electronic version of the book have stayed in sync with the code examples for the print book, updated for errata.
This book is here to help you get your job done. In general, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission.
We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “Learning Rails by Simon St.Laurent and Edd Dumbill. Copyright 2009 Simon St.Laurent and Edd Dumbill, 978-0-596-51877-6.”
If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at email@example.com.