Processing Book Errata

This is a list compiled for MIT Press to make corrections to future
printings of Processing: A Programming Handbook for Visual Designers 
and Artists by Casey Reas and Ben Fry. We put tremendous energy into 
producing an error-free book, but some errors remained. We're trying to 
remove more with each printing of the book. If you find errors, please 
let us know. (There are instructions at the bottom of this file.)


// // // // // // // // // // // // // // // // // // // // // //


Compiled 17 October 2007


- p. 6 - Dumb quote
The word "others's" in the last line on the page: 
- the apostrophe should be a smart quote.
- should the last "s" be removed (notice the word "students'" above)?


- p. 7 - Mispelling
In the last paragraph, should be "five years since the origin of", not "the origin on"


- p. 53 - Error in comment for 5-03.
The first line of the comment for 5-03 should start, "The test expressions"


- p. 100 - CMYK vs. Gray
The left diagram should be only printed using a screen of K, not all colors.


- p. 112 - Incorrect word
Toward the bottom, "The x and y parameters set the position of the
upper-left corner.", not the "lower-left corner"


- p. 170 - Line wrapping and italic
In the footnote, wrap "For" to the next line. The last word of the last
sentence (the fi ligature) should be italic.


- p. 207 - Code Error
In 23-05, the 13th line should be:
float iy = height - mouseY; // Inverse Y


- p. 223 - Extra space
In the forth line, it looks like there's an extra space here: ", and"


- p. 224 - Incorrect comment
The comment for code 25-01 should read, "// Draw a line while any key is
pressed"


- p. 231 - Typo
'and the white circle follows the mouse' should be 'and the black circle
follows the mouse'


- p. 397 - Diagrams missing type, rasterized type
Both diagrams on the page rendered incorrectly. The top one is missing the
type for the Apple Class. The type in the bottom diagram is rastered, not
vector as it should be.


- p. 451 - draw() not all bold
In code 41-16, the draw() should be entirely bold, the "d" is currently not.


- p. 528 - Type cut off in top figure
The type in the top figure is truncated, the crop box need to be pulled
down. The "y" in y-axis is missing the descender.


- p. 536 - Code to Mono
In Example 7, the specular() function name should be in the mono font.


- p. 656 - Figures
The figures didn't seem to output correctly. Look at the center of the
servo, the type in the chip, and the dc motor.


// // // // // // // // // // // // // // // // // // // // // //


Compiled 8 November 2007


- p. 707
Lieberman, Zachary listed as "512-512" when should be "511-512"


- p. 710
Tarbell, Jared listed as "155-156" when should be "154-159"


- p. 81 - Description of map()
"Similar to the norm function, the low1 and low2 ..." Should be:
"Similar to the norm function, the low1 and high1 ...." 


// // // // // // // // // // // // // // // // // // // // // //


Compiled 26 March 2008


- p. 118
angles in math are positive counterclockwise and negative clockwise. The
sine of an angle of PI/2 is +1, of 3*PI/2 is -1. In the book (see picture)
the sine of PI/2 is -1 (wrong!) and of 3*PI/2 is +1 (wrong!). These
mistakes are made in all trigonometrical views dealing with sine and
cosine. Please check all trigonometric functions in the book.
The calulations of sine and cosine in processing are correct, the mistakes
are only in the book.


- p. 105
"I noticed on Page 105 under syntax introduced: that string.startsWidth and
string.endsWidth should be updated to be String.startsWith and
String.endsWith.

- http://dev.processing.org/bugs/show_bug.cgi?id=741


// // // // // // // // // // // // // // // // // // // // // //


Compiled 2 April 2008


- p. 105
Under syntax introduced: string.startsWidth and string.endsWidth should be 
updated to be String.startsWith and String.endsWith


- p. 118
The diagram needs to be replaced with the attached diagram. "14-Math-3-SineGrid-update.ai"
The diagram is flipped over the y-axis.


- p. 309

Example 33-17

String[] trees = { "ash", "oak" };
append(trees, "maple"); // INCORRECT! Does not change the array
println(trees); // Prints [0] "ash",  [1] "oak"
println();
trees = append(trees, "maple"); // Add "maple" to the end
println(trees); // Prints [0] "ash",  [1] "oak", [2] "maple"
println();
// Add "beech" to the end of the trees array, and creates a new
// array to store the change
String[] moretrees = append(trees, "beech");
// Prints [0] "ash", [1] "oak", [2] "maple", [3] "beech"
println(moretrees);


Example 33-18

String[] trees = { "lychee", "coconut", "fig"};
trees = shorten(trees); // Remove the last element from the array
println(trees); // Prints [0] "lychee", [1] "coconut"
println();
trees = shorten(trees); // Remove the last element from the array
println(trees); // Prints [0] "lychee"


- p. 310

Example 33-20

String[] north = { "OH", "IN", "MI" };
String[] south = { "GA", "FL", "NC" };
arraycopy(north, south); // Copy from north array to south array
println(south); // Prints [0] "OH", [1] "IN", [3] "MI"
println();
String[] east = { "MA", "NY", "RI" };
String[] west = new String[east.length]; // Create a new array
arraycopy(east, west); // Copy from east array to west array
println(west); // Prints [0] "MA", [1] "NY", [2] "RI"


// // // // // // // // // // // // // // // // // // // // // //


Compiled 28 August 2008


x p. 81
On the fifth line from the bottom of p. 81, the word "number's" needs an 
apostrophe to replace the foot mark before the 's'.


x p. 203
In code 22-10, the 13th line should read:
  drawCircle(63, 85, n); 


- p. 309

Example 33-17 and 33-18 were not typeset correctly when they were fixed in
the last round of corrections. Please follow the exact line breaks below:

Example 33-17:

String[] trees = { "ash", "oak" };
append(trees, "maple"); // INCORRECT! Does not change the array
println(trees); // Prints [0] "ash",  [1] "oak"
println();
trees = append(trees, "maple"); // Add "maple" to the end
println(trees); // Prints [0] "ash",  [1] "oak", [2] "maple"
println();
// Add "beech" to the end of the trees array, and creates a new
// array to store the change
String[] moretrees = append(trees, "beech");
// Prints [0] "ash", [1] "oak", [2] "maple", [3] "beech"
println(moretrees);


Example 33-18:

String[] trees = { "lychee", "coconut", "fig"};
trees = shorten(trees); // Remove the last element from the array
println(trees); // Prints [0] "lychee", [1] "coconut"
println();
trees = shorten(trees); // Remove the last element from the array
println(trees); // Prints [0] "lychee"


x p. 322
Code 35-03 uses the set() syntax, which has not yet been introduced.
Instead, use image(img, x, y) in place of the set() function on lines 5, 6:
replace "set(18, 0, slice)" with "image(slice, 18, 0);"
replace "set(50, 0, slice)" with "image(slice, 50, 0);"


- p. 397
Gray type in the Apple class box is too light.


x p. 536
In Example 7, there's a needless line break after "relation" in Example 7. 
This needs to be carefully fixed. It moves up the text one line, so please 
be careful that the figure on page 537 still relates to the text line above. 
Make sure the top line of text from page 538 doesn't wrap onto 537.


// // // // // // // // // // // // // // // // // // // // // //


Compiled 22 April 2010

x p. 459
Code 48-10 has an error on line 15 (this is the 7th line on page 459.) 
The line should read:
  if (pressed == true) {
  	
Because "pressed" is the name of the boolean field in the super-class
on page 439 that this class extension refers to. 

x p. 459
Code 48-09 has an error on line 16. The line should read:
  icon.update();

Because the update() method in the super-class
on page 439 takes no parameters. 


x p. 460
Code 48-10 has an error on line 11. The line should read:
  if (pressed == true) {
  	
Because "pressed" is the name of the boolean field in the super-class
on page 439 that this class extension refers to. 

Back cover:
In Casey's bio line, "an associate professor" should be "a professor"
and "Design | Media Arts" should be "Design Media Arts"


// // // // // // // // // // // // // // // // // // // // // //


Compiled 8 January 2014

- p. 76
Two of the Bezier figures need to be updated, from left to right and top to bottom, they are the 6th and 7th. 
" 
On the 6th diagram the control line from (V1, C1) to C2 should not be
present, there should be a line from (C3, V2) to C2 instead. Also the line
from (C3, V2) to C4 should be replaced with a line from V3 to C4.
On the 7th diagram the line from (C3, V2) to C4 should not be present,
there should be a line from (C1, V1, V3) to C4 instead.
"

- p. 117
The first line of the third paragraph has two "be", one should be removed:
"The numerical value of PI is a constant thought to be be infinitely long...

- p. 135
In code 16-06, the comment "// Draws at (20, 30)" should be:
// Draws at (20, 10)

- p. 139
In the first line on the page the "transform()" should be changed to "translate()"

- p. 191
In the inset, smaller type that defines the variables, the two "float" declarations should be "int"... in the top group, it should be "int size" and in the bottom group it should be "int leafSize"

- p. 203
The line of code in the draw() of 22-10 should read:
  drawCircle(x, y, n);

- p. 322
The last 2 lines of code 35-03 should change to:
image(slice, 18, 0);
image(slice, 50, 0);

- p. 344
Line 13 in Code 38-13 should read:
    imageColors[y*img.width + x] = img.get(x, y);

- p. 467
Comment in code 49-02 should be "Southeast", currently missing "h"

- p. 501
"Mark Hansen", not "Marc Hansen"

- p. 670
In line 3 of the exponents demonstration at the top, the exponents should be 
4, 3, 2, 1, 0. They are currently 5, 4, 2, 1, 0

- p. 675
Line 5 in code E-05 should read:
    pixels[y*width + x] = color(102);
Line 1 in code E-06 (the comment) should read:
// Replaces the multiplication y*width with an addition 


 
// // // // // // // // // // // // // // // // // // // // // //

// // // // // // // // // // // // // // // // // // // // // //


If you find a bug (error) in Processing: A Programming Handbook for Visual 
Designers and Artists by Casey Reas and Ben Fry, please let us know so we 
can fix it! We worked extremely hard to get rid of them, but we know 
some are still there.
 
Please report all bugs to the Issues database:
https://github.com/processing/processing/issues?state=open

Please title the issue report with "Handbook p. 123", so we can find them.






















