We try to keep our books accurate, but sometimes mistakes creep
in. This page lists the errors submitted by our astute readers.
If you've found a new error, please
submit it.
The latest version of the book is P10.0,
released over 2 years ago.
If you've bought a PDF of the book and would like to upgrade
it to this version (for free), visit your
home page.
| PDF |
Paper |
Description |
Found in |
Fixed in |
| xx |
|
#26910: "and in particular covers" should be "and, in particular, covers"--Rich Morin
|
P10.0
31-Jan-07
|
|
| 0 |
|
#29761: Dears Dave and Andy
Follows some considerations about your extensible and complex book "Programming Ruby: The Pragmatic Programmer's Guide".
1) The chapter you call "Built-in Classes and Methods", that refer built-in classes and modules, perhaps must be called "Built-in Classes and Modules".
2) At the same chapter, section Classes, sub-section Array, and method "<=>", I had difficult to understand some aspects of the comparison. The difficulty refer to the priority of the conflict between lexicographic and array length; when we have a array anterior (<) but with more length (>). Here I transcript the text of the book that, with minor modifications, help you to understand my difficulty:
"<=> arr <=> anOtherArray -> -1, 0, +1
Comparison---Returns an integer -1, 0, or +1 if this array is less than, equal to, or greater than anOtherArray. Each object in each array is compared (using <=>). If any value isn't equal, then that inequality is the return value.
If all the values found are equal, then the return is based on a comparison of the array lengths. In case of conflict between the aspects lexicographical and length, has priority the lexicographical one. Thus, two arrays are ``equal'' according to Array#<=> if and only if they have the same length and the value of each element is equal to the value of the corresponding element in the other array.
If the arrays are different, the first one being lexicographically anterior (<) but with its array length more than the other (>), the comparison returns less.
[ "a", "a", "c" ] <=> [ "a", "b", "c" ] » -1
[ 1, 2, 3, 4, 5, 6 ] <=> [ 1, 2 ] » 1
["a", "a", "c", "d"] <=> ["a", "b", "c"] » -1
["a", "a", "c", "d"] <=> ["a", "b", "c"] » -1
"
The last example was tested with Ruby.
--Wellington F. Silva #29761: Dears Dave and Andy
Follows some considerations about your extensible and complex book "Programming Ruby: The Pragmatic Programmer's Guide" ...more...
|
P10.0
08-Oct-07
|
|
| 2 |
|
#26909: "Linux distributions, and Mac" should be "Linux distributions and Mac"--Rich Morin
|
P10.0
31-Jan-07
|
|
|
7 |
#27122: TO load a file in irb, you reference "code/rdoc/fib_example.rb" . This file and the directory structure does not exist in the example code..--Scott Derrick
|
P10.0
03-Mar-07
|
|
| 8 |
|
#26911: "In particular you might" should be "In particular, you might"--Rich Morin
|
P10.0
31-Jan-07
|
|
| 10 |
|
#26914: "In Ruby, you--Rich Morin
|
P10.0
31-Jan-07
|
|
| 10 |
|
#26915: "for example, the name of the song" should be "for example, the name of a song"--Rich Morin
|
P10.0
31-Jan-07
|
|
| 10 |
|
#26916: "These instance methods in turn have" should be "These instance methods, in turn, have"--Rich Morin
|
P10.0
31-Jan-07
|
|
| 12 |
|
#26917: "The following lines are both equivalent." should be "The following lines are equivalent."--Rich Morin
|
P10.0
31-Jan-07
|
|
| 12 |
|
#26918: "In this case it--Rich Morin
|
P10.0
31-Jan-07
|
|
| 14 |
|
#26913: In the second paragraph, the wording isn't really strong enough. Ruby _enforces_ these conventions. "should all start" should be "must all start", etc.--Rich Morin #26913: In the second paragraph, the wording isn't really strong enough. Ruby _enforces_ these conventions. "should all start" should be "must all st ...more...
|
P10.0
31-Jan-07
|
|
| 22 |
|
#26912: "you--Rich Morin
|
P10.0
31-Jan-07
|
|
|
26 |
#29389: Please change:
song.inspect
to
puts song.inspect
It is probably obvious to an experienced person, but not the person that is reading your book.
Thanks --twscannell@hotmail.com #29389: Please change:
song.inspect
to
puts song.inspect
It is probably obvious to an experienced person, but not the person that is reading y ...more...
|
P10.0
06-Aug-07
|
|
| 28 |
|
#26919: "in the real world objects often" should be "in the real world, objects often"--Rich Morin
|
P10.0
31-Jan-07
|
|
| 28 |
|
#26920: "We--Rich Morin
|
P10.0
31-Jan-07
|
|
| 29 |
|
#26921: "In Ruby you do that" should be "In Ruby, you do that"--Rich Morin
|
P10.0
31-Jan-07
|
|
|
31 |
#29609: This errata is in the section titled "Objects and Attributes". On the top of p. 31, the book says:
"In this example, we named the accessor methods name, artist, and duration. The corresponding instance variables, @name, @artist, and @duration,
will be created automatically."
After asking about that statement on the ruby-forum, it seems to be the general consensus that the statement is false. Here is an example, which I think proves the statement is false:
class Song
attr_reader :name, :artist, :duration
end
song = Song.new
puts song.name
puts song.artist
puts song.duration
vars = song.instance_variables
puts "Here are the instance vars: --->#{vars}<----"
--output:--
nil
nil
nil
Here are the instance vars: ---><----
--7stud #29609: This errata is in the section titled "Objects and Attributes". On the top of p. 31, the book says:
"In this example, we named the accesso ...more...
|
P10.0
02-Sep-07
|
|
|
31 |
#29613: Here is an example that led me to an erroneous conclusion about whether attr_reader creates the instance variables:
class Song
attr_reader :name, :artist, :duration
end
song = Song.new
puts song.name
puts song.fake
--output:--
nil
r3test.rb:7: undefined method `fake' for #<Song:0x256fc> (NoMethodError)
Since there is clearly a difference between the output for the instance variable @name and the instance variable @fake, I thought attr_reader must have created the instance variable @name (as well as @artist and @duration). I thought attr_reader created @name and by default set its value to nil. Likewise, I thought that since attr_reader had not created the instance variable @fake, trying to read its value produced the error.
However, it was explained to me that song.name is a method call to the method: name(), which attr_reader created, and name() is defined to return the instance @name. Since @name doesn't exist, name() returns nil. Likewise, song.fake is a method call to fake(). Since attr_reader did not create a method called fake(), song.fake produced a NoMethodError.
--7stud #29613: Here is an example that led me to an erroneous conclusion about whether attr_reader creates the instance variables:
class Song
attr_r ...more...
|
P10.0
03-Sep-07
|
|
| 41 |
|
#26922: "the end position, and the three-period" should be "the end position; the three-period"--Rich Morin
|
P10.0
31-Jan-07
|
|
|
46 |
#29133: Third line before last: "suggests a dequeue", I believe "deque" is intended.--Wing
|
P10.0
25-May-07
|
|
| 48 |
|
#29299: In the code for the 'find' method of class Array, the word 'size' should be '@size', I believe, since size is presumably an instance variable of the Array class.--Michael Vanier #29299: In the code for the 'find' method of class Array, the word 'size' should be '@size', I believe, since size is presumably an instance variable ...more...
|
P10.0
03-Jul-07
|
|
|
66 |
#29612: In the example at the the top of p. 66, the variable song_file is undefined. It looks like the first line of the example should be something like:
song_file = File.open("songdata.txt")--7stud #29612: In the example at the the top of p. 66, the variable song_file is undefined. It looks like the first line of the example should be something ...more...
|
P10.0
03-Sep-07
|
|
| 66 |
|
#28352: "Similarly, the patterns \b and \B match word boundaries and nonword boundaries, respectively" would be clearer as "Similarly, the patterns \b and \B match word boundaries and word non-boundaries,
respectively"--Karl #28352: "Similarly, the patterns \b and \B match word boundaries and nonword boundaries, respectively" would be clearer as "Similarly, the patterns \b ...more...
|
P10.0
05-Apr-07
|
|
|
67 |
#29614: In the example on the bottom of page 67, there is this line:
include Comparable
The include statement was not covered earlier in the book, and there is no explanation of what it does after the example.
Suggestion: explain it or don't use it.--7stud #29614: In the example on the bottom of page 67, there is this line:
include Comparable
The include statement was not covered earlier in the boo ...more...
|
P10.0
03-Sep-07
|
|
|
69 |
#26194: in ruby 1.8.5 =~ does not automatically convert a string on the right side to a regular expression.
|
P9.0
09-Oct-06
|
|
|
69 |
#28608: In the code for function show_regexp, the statements
"#{$`}<<#{$&}>>#${$'}" and "no match" should be preceded by
"puts", otherwise no output is produced.--Phillip Ngan #28608: In the code for function show_regexp, the statements
"#{$`}<<#{$&}>>#${$'}" and "no match" should be preceded by
"puts", otherwise no output ...more...
|
P6.0
16-Apr-07
|
|
|
70 |
#28216: The last sentence in the second paragraph under the section Anchors, in parentheses.
in the book:
... string ends with a \n, it which case ...
I think it is intended to be:
... string ends with a \n, in which case ...
By the way, thank you so much for the great book!! I am learning a lot from this.--sudo #28216: The last sentence in the second paragraph under the section Anchors, in parentheses.
in the book:
... string ends with a \n, it which case ...more...
|
P10.0
31-Mar-07
|
|
|
74 |
#29295: The second last paragraph says "Whoever created it entered all the artists' names in lowercase.", and then goes on to explain how to make them mixed case. But the part of the file that we've been shown on page 63 doesn't show the artist names in lowercase.--Steve #29295: The second last paragraph says "Whoever created it entered all the artists' names in lowercase.", and then goes on to explain how to make them ...more...
|
P10.0
01-Jul-07
|
|
|
75 |
#29366: ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]
context 'The obvious thing is to write str.gsum(/\\/, '\\\\')
This actually DOES work. The eight '\' are not needed.--Jim Simpson #29366: ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]
context 'The obvious thing is to write str.gsum(/\\/, '\\\\')
This actually DOES wor ...more...
|
P10.0
25-Jul-07
|
|
|
96 |
#29640: On p. 96, there is an example that starts with this line:
words[key] ||= [ ]
...
and the text says:
"The first line is equivalent to words[key] = words[key] || [ ]."
That seems obvious--unfortunately it's not true. Here is an example:
h = Hash.new(5)
h["a"] ||= 10
p h #{}
h["a"] = h["a"] || 10
p h #{"a"=>5}
Apparently in Ruby, the statement:
x ||= y
is equivalent to:
x = y unless x
Here is an example:
h = Hash.new(5)
h["a"] ||= 10
p h #{}
h["a"] = 10 unless h["a"]
p h #{}
--7stud #29640: On p. 96, there is an example that starts with this line:
words[key] ||= [ ]
...
and the text says:
"The first line is equivalent ...more...
|
P10.0
08-Sep-07
|
|
| 104 |
|
#27026: The fact that empty rescue rescues StandardErrors should be more emphasized - a separate paragraph or a side box or at least bold font. It seems that many people overlook this pretty important sentence.--Jano Svitok #27026: The fact that empty rescue rescues StandardErrors should be more emphasized - a separate paragraph or a side box or at least bold font. It see ...more...
|
P1.0
23-Feb-07
|
|
|
105 |
#28898: The do-it-yourself until loop throws a LocalJumpError from the break statement. It can be changed to a return statement.--Wing
|
P10.0
02-May-07
|
|
|
109 |
#28899: When the raise statement (with no parameters) is called, the exception is rethrown. Can we say a few words about the type of the error? I believe it is RuntimeError.--Wing #28899: When the raise statement (with no parameters) is called, the exception is rethrown. Can we say a few words about the type of the error? I beli ...more...
|
P10.0
02-May-07
|
|
| 114 |
|
#26904: "sum, when applied to strings it" should be "sum; when applied to strings, it"--Rich Morin
|
P10.0
31-Jan-07
|
|
|
119 |
#29647: On p. 118-119 is this passage:
If this made you think of class methods, your next thought may well be "what happens if I define instance methods within a module?" Good question. A module can't have instances, because a module isn't a class[Ok, no module instance methods]. However, you can include a module in a class definition. When this happens, all the module's instance methods are suddenly available as methods in the class as well. [Whoa! A module's instance methods?]
I propose this change:
If this made you think of class methods, your next thought may well be "what happens if I define instance methods within a module?" Good question. You can define instance methods in a module, but they are not like instance methods in a class. Since a module is not a class, you cannot create instances of a module and use them to call the module's instance methods.
However, you can include a module within a class definition. When this happens, all the modules instance methods are suddenly available as methods in the class as well.
--7stud #29647: On p. 118-119 is this passage:
If this made you think of class methods, your next thought may well be "what happens if I define instance me ...more...
|
P10.0
10-Sep-07
|
|
|
119 |
#28900: Need to update the code given in the website (not in the book): it still uses id instead of object_id.--Wing
|
P10.0
02-May-07
|
|
|
120 |
#26290: The 6th line from the bottom of the page reads, "class supports things such as map, include?, and find_all?". The name of the third method should be "find_all", not "find_all?".--Earl Fong #26290: The 6th line from the bottom of the page reads, "class supports things such as map, include?, and find_all?". The name of the third method sho ...more...
|
P9.0
17-Oct-06
|
|
|
120 |
#29394: The code near the top of the page is missing the line:
attr_reader :duration
--twscannell@hotmail.com
|
P10.0
09-Aug-07
|
|
| 130 |
|
#29679: At the top of page the following code appears:
count = 0
threads = []
10.times do |i|
threads[i] = Thread.new do
sleep(rand(0.1))
Thread.current["mycount"] = count
count += 1
end
end
threads.each {|t| t.join; print t["mycount"], ", " }
puts "count = #{count}"
Since rand(0.1) is the same as rand, "rand(0.1)" should be replaced with either "rand" or "0.1 * rand", whichever was actually intended. This error was detected by someone other than me and posted on ruby-talk ML -- I just thought I should post it here because nobody else has.
--Morton Goldberg #29679: At the top of page the following code appears:
count = 0
threads = []
10.times do |i|
threads[i] = Thread.new do
sleep(ran ...more...
|
P10.0
19-Sep-07
|
|
|
131 |
#29677: p. 129: Reading and Writing Files -- The are no descriptions or examples showing how to write to a file in this section. So I find the title of the section baffling.
In addition, the intro to the chapter says:
"In this chapter, we'll be concentrating on class IO and its most commonly used subclass File."
"IO" stands for Input/Output. Yet, there isn't a single example in the whole chapter showing how to write to a File, i.e. the Output half of Input/Output.
The acknowledgments at the beginning of the book tout the excellent work done by swarms of volunteer reviewers. Here's a suggestion, next time give your book to someone who has never heard of Ruby before. Then give their comments 100 times the weight of anyone else's.
In case anyone might ever need to *write* to a file using Ruby, here are some examples:
File.open("aaa.txt", "w") do |file|
file.print("hello\n", "world\n", "goodbye\n")
end
#'w': erases existing file or creates new file
File.open("bbb.txt", "w") do |file|
file.puts("hello", "world", "goodbye")
end
#puts automatically adds a new line to
#each argument.
File.open("bbb.txt", "a") do |file| #'a' for append
count = file.write("hi\nmars\nout\n")
puts "The number of bytes written to the file was: #{count}."
end
#'a': appends to the end of the file, i.e. does not
#erase file.
--7stud #29677: p. 129: Reading and Writing Files -- The are no descriptions or examples showing how to write to a file in this section. So I find the title ...more...
|
P10.0
19-Sep-07
|
|
|
143 |
#29348: Table 11.1 purports to demonstrate a race condition this will occur when either thread runs before the previously active thread has a chance to "store val back into @count" resulting in a lost update to count. The table erroneously shows suspensions after the update to count has occurred which will not affect @count.--bob #29348: Table 11.1 purports to demonstrate a race condition this will occur when either thread runs before the previously active thread has a chance t ...more...
|
P10.0
22-Jul-07
|
|
|
146 |
#36769: Chapter 11, “Threads and Processes”, contains a section “Condition Variables”. The book gives a code example that uses a condition variable. However, other than a vague two-sentence description in the book (“A condition variable is a controlled way of communicating an event [or a condition] between two threads. One thread can wait on the condition, and the other can signal it.”), condition variables are not described in the main part of the book, in the reference part of the book, or even in the ri documentation. The closest one can get is by executing ri commands on some of the unexplained commands in the code sample (“ri new_cond”, “ri signal”). “ri new_cond” only obtains a “FIXME” notice, while “ri signal” tells you that you could look at a number of “signal” commands, including “ConditionVariable#signal” and “MonitorMixin::ConditionVariable#signal”. These produce fairly cryptic descriptions as well, though they do at least tell you that ConditionVariable is a genuine class (a fact that should be mentioned in the book).
If a subject is important enough to be discussed in the main part of the book, then it should be documented thoroughly where it is brought up, as well as in the reference part of the book and in the ri documentation. Otherwise, it derails the reader, who should be allowed to focus on the subject matter.
Note that the posted errata contain the following note, which is in accord with my perception: ”#29349: It’s not clear what the condition variable is in the code example.—bob”--Alan Frankel #36769: Chapter 11, “Threads and Processes”, contains a section “Condition Variables”. The book gives a code example that uses a condition variable. H ...more...
|
P10.0
01-Jan-09
|
|
|
146 |
#29349: It's not clear what the condition variable is in the code example.--bob
|
P10.0
22-Jul-07
|
|
|
149 |
#29680: On the bottom of p. 149 is this text and example:
"For instance, we may want to kick off a long-running external sort.
exec('sort testfile> output.txt') if fork.nil?
#The sort is now running in the child process
#carry on processing in the main program
#then wait for the sort to finish
Process.wait
The call to Kernel.fork returns a process ID in the parent, and nil in the child, so the child process will perform the Kernel.exec call and run sort."
How many lines of code got chopped off the top of that example? The call to Kernel.fork? Where is that?
Also, where does the if statement modifier: if fork.nil? come from. The list of classes/modules starting on p. 427, doesn't reveal a class/module named 'fork', so fork.nil? isn't a class/module method call, which means that fork must be a variable in the code that refers to some object. What object? A variable named 'fork' doesn't appear anywhere in the code.
(Dave says: that statement modifier _is_ the call to kernel.fork--you've answered your own question :)
--7stud #29680: On the bottom of p. 149 is this text and example:
"For instance, we may want to kick off a long-running external sort.
exec('sort testfile ...more...
|
P10.0
20-Sep-07
|
|
|
153 |
#29736: Unit Testing, chap 12: This omitted fact caused me hours of frustration and testing until I discovered how things work. Suppose you have a simple program that prompts the user for some information like this:
my_prog.rb
----------
def get_name(msg)
print msg
gets
end
def get_scores(msg)
print msg
gets
end
name = get_name("Name: ")
scores = get_scores("scores: ")
#do something with
#user info...
Then having just read about unit testing in pickaxe2, you decide to create a unit test for your program to test the get_scores method, and this is what you come up with:
my_test.rb
---------
require "test/unit"
require "my_prog.rb"
class TestFuncs < Test::Unit::TestCase
def test_get_scores
input = get_scores("scores: ")
assert_instance_of(Array, input)
end
end
However, if you run that unit test, the method get_name will execute--even though the unit test does not attempt to execute the get_name method.
Apparently, when you run a unit test on a program, any code in the program that is not inside a class definition or a top level method definition will execute before the unit test executes.
One solution is to just comment out any code that is outside of any class or method definitions. Another solution is to surround any code that is not in a class or a method definition with the block:
if __FILE__ == $0
..
..
end
So the program would look like this:
my_prog.rb
----------
def get_name(msg)
print msg
gets
end
def get_scores(msg)
print msg
gets
end
if __FILE__ == $0
name = get_name("Name: ")
scores = get_scores("scores: ")
end
__FILE__ is the name of the file containing the __FILE__ statement, which in this case is my_prog.rb And $0 is the name of the file you entered on the command line to execute with ruby, i.e.:
ruby my_test.rb
The net effect is that when you run the program directly, e.g.
ruby my_prog.rb
the code in the if block will execute. However, if the file is require'ed into another program, and that other program is executed, e.g.
ruby my_test.rb
the code in the if block won't execute. Suggestion: please mention something about this in the next edition.
--7stud #29736: Unit Testing, chap 12: This omitted fact caused me hours of frustration and testing until I discovered how things work. Suppose you have a s ...more...
|
P10.0
02-Oct-07
|
|
|
156 |
#29729: p. 156, example at top of page: The output shows the test failing, but there is no description of what was entered to get the test to fail. I tried specifying an empty data file on the command line, a file with two words in it, and a file that doesn't exist. Still the test succeeded. Then I omitted specifying a data file name on the command line, and instead I entered ^D for end-of-file when the program was running. Still the test succeeded.
Finally, I specified a file on the command line, and then I inserted the statement:
ARGF.read
before the line:
assert_not_nil(ARGF.read, "Read next...")
and that caused the test to fail. I also tried that modified code without specifying a file on the command line and entering ^D when the program was running, but the test succeeded, which I don't understand.
I asked about this on the ruby-forum, and no one knew how to make the test fail.
--7stud #29729: p. 156, example at top of page: The output shows the test failing, but there is no description of what was entered to get the test to fail. ...more...
|
P10.0
01-Oct-07
|
|
|
160 |
#29737: p. 160, "Where to put Tests", middle of the page: The text says, "A better solution is to run the tests from the directory containing the library being tested." On the previous page is a diagram of the directory structure:
roman/ (note: there is a missing slash after roman)
-----lib/
--------roman.rb
-----test/
--------test_roman.rb
I think a literal reading of that quoted sentence means that you should run your tests from the roman directory. However, it turns out that the book is using the term "library" to refer to roman.rb--not the lib directory. That couldn't be anymore confusing.
To clear things up: one way to run the test program from the command line is to first cd to the lib directory. Then use the command:
/lib% ruby ../test/test_roman.rb
The current directory is always included by default in the search path used by require and include. test.roman.rb has a require statement that says:
require roman.rb
One place ruby will look for roman.rb is in the current directory, and since the current directory is /lib, ruby will be able to find roman.rb.
The whole purpose of this whole section is a little tricky to understand. If I've got it right: when program A is required into program B, the path of a require statement in program A will be relative to program B's directory. If program A has a require statement like this:
require "fileX"
then fileX is in the directory containing A. If program B then require's program A into program B, and program B is in another directory, then ruby will search B's directory for fileX. Since fileX is not in B's directory, that will cause an error.
--7stud #29737: p. 160, "Where to put Tests", middle of the page: The text says, "A better solution is to run the tests from the directory containing the lib ...more...
|
P10.0
02-Oct-07
|
|
|
163 |
#29962: The first time I tried to use the debugger was in 186 and I am seeing something different than in v2 of the book on page 163. Or perhaps I am doing something wrong.
In the book it appears that when you run with the debugger option, such as this
ruby.exe -r debug t.rbyou end up with the debugger looking at the source file (e.g., t.rb).
However, when I run it I end up in some Ruby module:
ruby.exe -r debug t.rb
C:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb:10:require ‘rubygems’
(rdb:1) l
[5, 14] in C:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb 5 # All rights reserved. 6 # See LICENSE.txt for permissions. 7 #++ 8 9
=> 10 require ‘rubygems’
The work-around seems pretty simple: set a breakpoint in your own file and type C, as below.
I thought you might want to know, in order to update the book.
(rdb:1) b t.rb:3
Set breakpoint 1 at t.rb:3
(rdb:1) c
Breakpoint 1, toplevel at t.rb:3
--Wes Rishel #29962: The first time I tried to use the debugger was in 186 and I am seeing something different than in v2 of the book on page 163. Or perhaps I am ...more...
|
P10.0
08-Dec-07
|
|
|
167 |
#36807: The book gives the following guideline:
"Within a class definition, Ruby will parse setter= as an assignment to a local variable, not as a method call. User the form self.setter= to indicate the method call."
There are two confusing things about this. The first is that "setter" is a placeholder, not an actual word. Perhaps it should be written in italics.
The second is that a simpler, more intuitive, and more common approach is not mentioned: using "@" rather than "self." on the left-hand side to indicate that an instance variable is being referred to. This approach should be mentioned in the text and also in the code:
class Incorrect
attr_accessor :one, :two, :three
def initialize
one = 1 # incorrect - sets local variable
self.two = 2 # correct - sets instance variable
@three = 3 # also correct - sets instance variable
end
end--Alan Frankel #36807: The book gives the following guideline:
"Within a class definition, Ruby will parse setter= as an assignment to a local variable, not as a ...more...
|
P10.0
02-Jan-09
|
|
|
168 |
#36806: In the example illustrating "Watch out for precedence issues...", the complexity of the code (which contains several branches that are not executed) obscures the point being made. It probably also makes sense to execute the "puts" statements right after setting the corresponding variables.
Something like this might be better:
def one(arg)
"block given to 'one' returns #{yield}"
end
def two(arg)
"block given to 'two' returns #{yield}"
end
# Version with braces
result1 = one two {
"three"
}
puts "With braces, result = #{result1}"
# Version with do/end
result2 = one two do
"three"
end
puts "With do/end, result = #{result2}"
--Alan Frankel #36806: In the example illustrating "Watch out for precedence issues...", the complexity of the code (which contains several branches that are not exe ...more...
|
P10.0
02-Jan-09
|
|
|
173 |
#26439: Table 13.1 - second section (the one about disp):
disp[lay] expr - Display value of nnn every time debugger gets control.
should probably be:
disp[lay] expr - Display value of expr every time debugger gets control.--E. Ilden #26439: Table 13.1 - second section (the one about disp):
disp[lay] expr - Display value of nnn every time debugger gets control.
should probabl ...more...
|
P9.0
31-Oct-06
|
|
|
191 |
#26524: The output of the sample invocation `ri "String.each"' is missing the braces in the syntax synopsis. This can look confusing to first-timers (that I was when I first read this section).--Joachim Kuebart #26524: The output of the sample invocation `ri "String.each"' is missing the braces in the syntax synopsis. This can look confusing to first-timers ( ...more...
|
B8.0
09-Nov-06
|
|
|
192 |
#30478: Third line of first paragraph in section "Interactive Configuration":
... to change your prompt back to DEFAULT, you ...
should be
... to change your prompt to SIMPLE, you ...
Or change the code snippet below.--Felix Siegrist #30478: Third line of first paragraph in section "Interactive Configuration":
... to change your prompt back to DEFAULT, you ...
should be
... to c ...more...
|
P6.0
16-Jan-08
|
|
| 193 |
|
#26905: "Both the following are" should be "Both of the following are". It might also be nice to close the sentence with a colon.--Rich Morin
|
P10.0
31-Jan-07
|
|
| 196 |
|
#26923: "return +nil+, otherwise return" should be "return +nil+; otherwise, return" (twice) Similarly, "use it, otherwise accumulate" should be "use it; otherwise, accumulate"--Rich Morin #26923: "return +nil+, otherwise return" should be "return +nil+; otherwise, return" (twice) Similarly, "use it, otherwise accumulate" should be "use ...more...
|
P10.0
31-Jan-07
|
|
|
202 |
#30479: In the first line of the rdoc comment after the first paragraph, replace "though" with "through".--Felix Siegrist
|
P6.0
16-Jan-08
|
|
|
216 |
#29754: p. 216, Installing Ruby Gems: the two commands at the top of the page read:
% cd rubygems-0.7.0
% ruby install.rb
However, according to the rubygems README file, which after I unpacked the files was in the directory
rubygems-0.9.4/
(0.9.4 is the current version number), the command to install rubygems is:
ruby setup.rb
Since there there was no file called install.rb in the directory rubygems-0.9.4/ and there was a file called setup.rb in the rubygems-0.9.4/ directory, I went with the command in README:
$ ruby setup.rb
However, I got an error mid way through the install:
...
...
mkdir -p /usr/bin/
install gem /usr/bin/
setup.rb:633:in `initialize': Permission denied - /usr/bin/gem (Errno::EACCES)
from setup.rb:633:in `open'
from setup.rb:633:in `install'
from setup.rb:1377:in `install_files'
from setup.rb:1376:in `each'
from setup.rb:1376:in `install_files'
from setup.rb:1346:in `install_dir_bin'
from setup.rb:1532:in `__send__'
from setup.rb:1532:in `traverse'
... 6 levels...
from setup.rb:1000:in `exec_install'
from setup.rb:814:in `invoke'
from setup.rb:773:in `invoke'
from setup.rb:1578
So, I reran the command like this:
$ sudo ruby setup.rb
password: <I entered my password>
and everything installed fine.
--7stud #29754: p. 216, Installing Ruby Gems: the two commands at the top of the page read:
% cd rubygems-0.7.0
% ruby install.rb
However, according to ...more...
|
P10.0
07-Oct-07
|
|
|
217 |
#29759: p. 217, The command at the top of the page is:
% gem install -r rake
But, when entered that command, first I got this:
$ gem install -r rake
Bulk updating Gem source index for: <link here>
ERROR: While executing gem ... (Gem::GemNotFoundException)
Could not find rake (> 0) in any repository
So I tried the command again, and I got:
$ gem install -r rake
Bulk updating Gem source index for: <link here>
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /usr/lib/ruby/gems/1.8/cache/rake-0.7.3.gem
The command I needed to use was:
$ sudo gem install -r rake
Password: <I entered my password here>
Bulk updating Gem source index for: <link here>
Successfully installed rake-0.7.3
Installing ri documentation for rake-0.7.3...
Installing RDoc documentation for rake-0.7.3...
--7stud #29759: p. 217, The command at the top of the page is:
% gem install -r rake
But, when entered that command, first I got this:
$ gem install ...more...
|
P10.0
07-Oct-07
|
|
|
222 |
#29776: p. 222: The text says:
"As of RubyGems 0.8.0, requiring rubygems.rb will install an overloaded version fo Ruby's require method. Having loaded the RubyGems framework, you could say:
require 'bluecloth' "
Ok, so according to the text there are two prerequisites to using that require statement:
1) Installation of RubyGems 0.8.0 or higher
2) Requiring rubygems.rb, i.e. the statement:
require 'rubygems'
So, if you have RubyGems 0.8.0 installed, then you have to write:
require 'rubygems'
require 'bluecloth'
How does that free your program from RubyGems-specific code?
After the explanation of the first example on the page, the rest of the section should be deleted since it is completely non-sensical.
--7stud #29776: p. 222: The text says:
"As of RubyGems 0.8.0, requiring rubygems.rb will install an overloaded version fo Ruby's require method. Having lo ...more...
|
P10.0
21-Oct-07
|
|
|
224 |
#28911: Since I was checking the gems directory, I found that all the doc/ directories in gems/ are all named with the singular form, not the plural form docs/. The book uses the plural form. Again is there a standard?--Wing #28911: Since I was checking the gems directory, I found that all the doc/ directories in gems/ are all named with the singular form, not the plural f ...more...
|
P10.0
04-May-07
|
|
|
235 |
#36866: Two examples of a CGI script are given, where the only difference is that the second inserts a header. But this is obscured by the fact that this difference is listed as a parenthetical remark, and is not followed by a colon linking it to the following script. To avoid confusion, this paragraph:
"Put this script in a CGI directory, mark it as executable, and you'll be able to access it via your browser. (If your Web server doesn't automatically add headers, you'll need to add the response header yourself.)"
should be rewritten as follows:
"Put this script in a CGI directory, mark it as executable, and you'll be able to access it via your browser. If your Web server doesn't automatically add headers, you'll need to add the response header yourself as follows:"
--Alan Frankel #36866: Two examples of a CGI script are given, where the only difference is that the second inserts a header. But this is obscured by the fact that t ...more...
|
P10.0
04-Jan-09
|
|
| 237 |
|
#26906: "reformated" should be "reformatted"--Rich Morin
|
P10.0
31-Jan-07
|
|
|
251 |
#26874: The Google SOAP API seems no longer available for new users. Google says:
<CITE>
As of December 5, 2006, we are no longer issuing new API keys for the SOAP Search API. Developers with existing SOAP Search API keys will not be affected.
Depending on your application, the AJAX Search API may be a better choice for you instead. It tends to be better suited for search-based web applications and supports additional features like Video, News, Maps, and Blog search results.
For developers who are already using the SOAP Search API, we've kept the documentation live on this site.
</CITE>
Thanks for the great book!--Remi #26874: The Google SOAP API seems no longer available for new users. Google says:
<CITE>
As of December 5, 2006, we are no longer issuing new API ke ...more...
|
P6.0
23-Jan-07
|
|
|
257 |
#30480: Last paragraph: "Accessing mycheck.value will return ..." should be "Accessing checked.value will return ...". --Felix Siegrist
|
P6.0
16-Jan-08
|
|
| 292 |
|
#29635: Running the test ruby script for the my_test extension fails on OSX with:
1) Error:
test_test(TestTest):
NameError: uninitialized constant TestTest::MyTest
method test_test in my_test.rb at line 7
Seems it cannot find the MyTest class even though the extension loaded with require 'my_test'
--Sean Wolfe #29635: Running the test ruby script for the my_test extension fails on OSX with:
1) Error:
test_test(TestTest):
NameError: uninitialized constan ...more...
|
P10.0
07-Sep-07
|
|
|
298 |
#30477: --with-name-lib=directory
Reads: "Add directory/lib to the link command"
Should read: "Add directory to the link command"
Similar error applies to
--with-name-include=directory--Matt Wallis #30477: --with-name-lib=directory
Reads: "Add directory/lib to the link command"
Should read: "Add directory to the link command"
Similar err ...more...
|
P6.0
16-Jan-08
|
|
|
309 |
#26761: The documented signature of rb_apply is incorrect - in fact it has no argc argument.--Jeremy Henty
|
P1.0
17-Dec-06
|
|
| 324 |
|
#29975: Table 22.4 does not list the assignment operator ^=--Morton Goldberg
|
P10.0
10-Dec-07
|
|
|
327 |
#29639: /a.*b.*a/ of course doesn't take exponential time but quadratic time.
--David Ongaro
|
P10.0
08-Sep-07
|
|
|
328 |
#30481: 3rd paragraph of section "Names", 1st and 2nd line: replace "a though z" and "A though Z" with "a through z" and "A through Z".--Felix Siegrist
|
P6.0
16-Jan-08
|
|
| 336 |
|
#26907: "When used as an rvalue, element reference" should be "When used as an rvalue, an element reference"--Rich Morin
|
P10.0
31-Jan-07
|
|
|
336 |
#29760: I'm currently using your "Programming Ruby" as a reference while learning Ruby and especially Rails. I'm highly enjoying the book.
I did encounter one pain point, though: Symbols.
The concept of ruby symbols is used practically everywhere in RoR, so I very soon started looking through my Ruby books for some kind of explanation for the : that seemed to pop up everywhere. The explanation given on p336 in the 2nd edition (9th printing, if this makes a difference), did not leave me much less confused. I hope you'll consider elaborating the section a bit. Googling for "Ruby symbols" gave me the impression that I'm not the first programmer moving into Ruby to have struggled with the concept, but did lead me to some articles that cleared it up a bit more.
Hope you can use the above suggestion in some future revision of the book.--Henrik #29760: I'm currently using your "Programming Ruby" as a reference while learning Ruby and especially Rails. I'm highly enjoying the book.
I did en ...more...
|
P10.0
08-Oct-07
|
|
|
340 |
#25968: I believe there is a rule missing in the "Parallel Assignment" section. The last sentence on p. 91 states, "If an assignment has just one lvalue and multiple rvalues, the rvalues are converted to an array and assigned to the lvalue." This seems to contradict (or at least) modify rule 5 on p. 340.--Brian Adkins odjfs2001@yahoo.com #25968: I believe there is a rule missing in the "Parallel Assignment" section. The last sentence on p. 91 states, "If an assignment has just one lval ...more...
|
P7.0
21-Sep-06
|
|
|
342 |
#25969: I think some clarification of "Ranges in Boolean Expressions" is in order :) The last sentence in the first paragraph doesn't agree with the last two sentences in the second paragraph. Also, in the first example, I would expect the slot for 18 to be nil since expr2 evaluates to true which should cause a transition to unset according to the text.--Brian Adkins odjfs2001 at yahoo dot com #25969: I think some clarification of "Ranges in Boolean Expressions" is in order :) The last sentence in the first paragraph doesn't agree with the l ...more...
|
P7.0
21-Sep-06
|
|
| 344 |
|
#26908: "LocalJumpError or ThreadError depending on" should be "LocalJumpError or ThreadError, depending on"--Rich Morin
|
P10.0
31-Jan-07
|
|
|
352 |
#29738: p. 352, Aliases: At the top of the page, the first two lines say:
"When a method is aliased, the new name refers to a copy of the original method's body. If the method is subsequently redefined, the aliased name will still invoke the original implementation."
If that were true, then aliasing a name wouldn't do anything: the new name would be a copy of the original method's body and the aliased name would "still invoke the original implementation." As a result, you would have two names that invoke identical methods.
The second line should read: "If the method is subsequently redefined, the new name will invoke the original implementation." For proof, see the example under the text.--7stud #29738: p. 352, Aliases: At the top of the page, the first two lines say:
"When a method is aliased, the new name refers to a copy of the original ...more...
|
P10.0
02-Oct-07
|
|
|
357 |
#36872: The code sample on page 357 could be improved in two ways: (1) The sample could demonstrate more aspects of the description at the top of the page. For instance, there should be "yield" statements that pass parameters as well as "yield" statements that don't. (2) The sample could include more printed output to clarify what is going on. Currently, there is no output for any of the statements within the "Holder" class.--Alan Frankel #36872: The code sample on page 357 could be improved in two ways: (1) The sample could demonstrate more aspects of the description at the top of the ...more...
|
P10.0
04-Jan-09
|
|
|
358 |
#29256: last line: "is no longer valid"--Wing
|
P10.0
22-Jun-07
|
|
|
360 |
#29258: Fourth line under the header "Raising Exceptions":
"raise thing [, string [stack trace]]" should be
"raise thing [, string [, stack trace]]"--Wing
|
P10.0
22-Jun-07
|
|
|
373 |
#30482: Section "to_ary -> Array", first line: "... convert an object ..." --Felix Siegrist
|
P6.0
16-Jan-08
|
|
|
373 |
#30483: Section "to_hash -> Hash", first line: "(The only known use is the second parameter to Hash#replace.)" should be "(The only known use is the parameter to Hash#replace.)", since Hash#replace has no second parameter.--Felix Siegrist #30483: Section "to_hash -> Hash", first line: "(The only known use is the second parameter to Hash#replace.)" should be "(The only known use is the p ...more...
|
P6.0
16-Jan-08
|
|
|
375 |
#36875: The final lines of the code sample may be poorly chosen as a means to illustrate the points made in the following paragraph.
The end of the code sample, followed by the final paragraph, runs as follows:
:::
iv = Roman.new(4)
xi = Roman.new(11)
3 * iv --> 12
1.1 * xi --> 12.1
Of course, class Roman as implemented doesn't know how to do addition itself: you couldn't have written "xi + 3" in the previous example, as Roman doesn't have a "plus" method. And that's probably as it should be. But let's go wild and implement addition for Roman numbers.
:::
But that paragraph confuses the issue by bringing up addition whereas the code sample used multiplication. The important point that the paragraph is probably intended to make is that the order is important.
Here are a rewritten code sample and paragraph that make the point more effectively:
:::
iv = Roman.new(4)
xi = Roman.new(11)
3 * iv --> 12
1.1 * xi --> 12.1
3 + iv --> 7
1.1 + xi --> 12.1
iv * 3 --> error
xi * 1.1 --> error
iv + 3 --> error
xi + 1.1 --> error
Of course, class Roman as implemented doesn't know how to do multiplication or addition itself: you couldn't have written "xi + 3" in the previous example, as Roman doesn't have a "plus" method. And that's probably as it should be. But let's go wild and implement addition for Roman numbers.
:::--Alan Frankel #36875: The final lines of the code sample may be poorly chosen as a means to illustrate the points made in the following paragraph.
The end of the ...more...
|
P10.0
04-Jan-09
|
|
|
376 |
#26809: In the ex0629.rb and ex0629.rb program listings this line should read:
if Fixnum === other && (other + @value) <= MAX_ROMAN
Otherwise, an miss-by-one (less) condition occurs not allowing the result of the +(other) method to include MAX_ROMAN.
Thanks for your great book!
P.S. couldn't find the book version in my printed copy -- sorry.
--Adrian Mugnolo #26809: In the ex0629.rb and ex0629.rb program listings this line should read:
if Fixnum === other && (other + @value) <= MAX_ROMAN
Otherwise, a ...more...
|
P10.0
05-Jan-07
|
|
|
381 |
#29259: In Figure 24.2, shouldn't be there an arrow linking klass of Class Object to the box of Class Object'?--Wing
|
P10.0
22-Jun-07
|
|
| 392 |
|
#26931: In the table under "Runtime Callbacks", "Module#extend_object" should be "Module#extended".--Rich Morin
|
P10.0
03-Feb-07
|
|
|
393 |
#29911: Regarding:
"At the top-level, we're executing code in the context of some
predefined object. When we define methods, we're actually creating
(private) instance methods for the class Object."
The implication is that the second sentence somehow follows from the
first. But it doesn't. In the context of the first sentence, the
behavior in the second sentence is magical.--Greg Weeks #29911: Regarding:
"At the top-level, we're executing code in the context of some
predefined object. When we define methods, we're actually c ...more...
|
P10.0
20-Nov-07
|
|
| 395 |
|
#29392: The page link in "See Kernel.require on page 507 for an example." actually leads to page 495 -- the first page for Kernel.--Steven Lumos
|
P10.0
08-Aug-07
|
|
|
398 |
#26525: Under the $SAFE table, second sentence should read: "...or if it _is_ run under mod_ruby...", the "is" is missing.--Joachim Kuebart
|
B8.0
09-Nov-06
|
|
|
456 |
#29386: the description of Enumerable#inject. the text: "The first form let's you supply an initial value for memo. The second form uses the first element of the collection as the initial value (and skips that element while iterating).
the reverse is true from the examples printed. i.e. the second form supplies the initial value...--Louis Juska #29386: the description of Enumerable#inject. the text: "The first form let's you supply an initial value for memo. The second form uses the first ele ...more...
|
P10.0
05-Aug-07
|
|
|
463 |
#34613: Under Exception#success? :
"Returns true is the exit status if nil or zero."
should read
"Returns true if the exit status is nil or zero."--Celso Frazao
|
P10.0
23-Sep-08
|
|
|
468 |
#30484: fnmatch, second line: "Because fnmatch in implemented..." should be "Because fnmatch is implemented...".--Felix Siegrist
|
P6.0
16-Jan-08
|
|
|
485 |
#30485: divmod: remove one "on".--Felix Siegrist
|
P6.0
16-Jan-08
|
|
|
487 |
#30486: Class constants, in the comment of MAX_EXP and MIN_EXP: replace "FLT_RADIX" with "RADIX".--Felix Siegrist
|
P6.0
16-Jan-08
|
|
| 495 |
|
#29692: In the library reference, in the Kernel module section, it says that Kernel module instance methods are listed in the Object class page, and instead in thid Kernel module page are listed only Kernel module methods as for example the method "puts" among others.... The fact is that "puts" (and other moethods listed here) isn't a module method, it is a private module instance method.--Skyblaze #29692: In the library reference, in the Kernel module section, it says that Kernel module instance methods are listed in the Object class page, and i ...more...
|
P10.0
23-Sep-07
|
|
|
499 |
#30487: to_hash: "See page 373." (not 372)--Felix Siegrist
|
P6.0
16-Jan-08
|
|
|
499 |
#26538: Both to_a and to_s show the following statement:
h = { "c" => 300, "a" => 100, "d" => 400, "c" => 300 }
I believe one of the "c" => 300 key value pairs is redundant. It's not technically an error, but somewhat nonsensical.--Brian Adkins #26538: Both to_a and to_s show the following statement:
h = { "c" => 300, "a" => 100, "d" => 400, "c" => 300 }
I believe one of the "c" => 300 ...more...
|
P7.0
11-Nov-06
|
|
|
516 |
#29913: "The Kernel module is included by class Object, so its methods are
available in every Ruby object." Here, "methods" should read "instance
methods". It is not clear why Kernel class methods can be called
without a receiver. It may be magical.
--Greg Weeks #29913: "The Kernel module is included by class Object, so its methods are
available in every Ruby object." Here, "methods" should read "instance
m ...more...
|
P10.0
20-Nov-07
|
|
| 521 |
542 |
#26313: The Math.sqrt function does not raise an "ArgError" (or an ArgumentError, if that's what you meant) if 'numeric' is less than 0. On both Linux and Windows it raises Errno::EDOM.
-Dan--Daniel Berger #26313: The Math.sqrt function does not raise an "ArgError" (or an ArgumentError, if that's what you meant) if 'numeric' is less than 0. On both Linu ...more...
|
P10.0
19-Oct-06
|
|
|
546 |
#30488: Instance methods, "<, <=, >, >=", 3rd line: "... all operators return false." should be "... all operators return nil."--Felix Siegrist
|
P6.0
16-Jan-08
|
|
| 547 |
|
#29207: Under 'clone', I think it would be helpful to mention that cloned objects retain singleton methods while duped objects do not. For example,
class Snark
def beware
"Snarks are dangerous"
end
end
boojum = Snark.new
def boojum.beware
"Boojums are even more dangerous"
end
boojum.beware # => "Boojums are even more dangerous"
boojum.dup.beware # => "Snarks are dangerous"
boojum.clone.beware # => "Boojums are even more dangerous"
And maybe a cross-reference from 'dup'?
--Morton Goldberg #29207: Under 'clone', I think it would be helpful to mention that cloned objects retain singleton methods while duped objects do not. For example,
...more...
|
P10.0
10-Jun-07
|
|
|
551 |
#30490: Module#module_eval: the first sample call is "mod.class_eval(...)" instead of "mod.module_eval(...)".--Felix Siegrist
|
P6.0
16-Jan-08
|
|
|
608 |
#26803: Perhaps it's just a one-time printing error, but at the top of the page, the small "1.8" sidenote is printed right over the word "Match", instead of in the left margin.--Tonya #26803: Perhaps it's just a one-time printing error, but at the top of the page, the small "1.8" sidenote is printed right over the word "Match", inst ...more...
|
P10.0
03-Jan-07
|
|
|
609 |
#29441: You state in the documentation for the []= method 'the Regexp and String forms will silently ignore the assignment [if the value is out of range].' But they both raise an IndexError if there's no match.
Furthermore theres no '~' method for Strings.
(Either in 1.8.2 or 1.8.5)
#29441: You state in the documentation for the []= method 'the Regexp and String forms will silently ignore the assignment [if the value is out of ran ...more...
|
P10.0
17-Aug-07
|
|
|
613 |
#29820: gsub() documentation on p.613: Above the description is the syntax:
str.gsub(pattern, replacement) --string
str.gsub( pattern ){|match| block} ---> string
In the description is this passage:
"...the sequences \1, \2, and so on may be used to interpolate successive groups in the match."
I wonder who can make any sense of that statement. 'match' is the block syntax's parameter, which the description is not even referring to, so mentioning 'match' is confusing.
The sentence should say something like:
"...the sequences \1, \2, and so on may be used in <i>replacement</i> to refer to the actual matches to parenthesized groups."
Or, simply:
"...the sequences \1, \2, etc. may be used in <i>replacement</i>.
(The sequences 1\, \2, etc. are described on p. 75 for any trying to figure out what they mean.)
Also, it's worth highlighting that double quotes surrounding the replacement string prevent the sequences \1, \2, etc. from working. Instead, you have to use single quotes around the replacement string to get the sequences \1, \2, etc. to work. Since I'm told it that is a very common error, it should be in the docs that you need to use SINGLE QUOTES.
--7stud #29820: gsub() documentation on p.613: Above the description is the syntax:
str.gsub(pattern, replacement) --string
str.gsub( pattern ){|match| b ...more...
|
P10.0
02-Nov-07
|
|
|
619 |
#29325: The documentation for str.squeeze shows it returns
-> squeezed_tring
I assume this should be
-> squeezed_string--Daniel Machera
|
P10.0
16-Jul-07
|
|
|
622 |
#30491: String#to_sym: the sample call is “<i>str</i>.to_s” instead of “<i>str</i>.to_sym”.--Felix Siegrist
|
P6.0
16-Jan-08
|
|
|
640 |
#30492: ThreadGroup, first paragraph, second line: "... will remove it from the its current group." should be "... will remove it from its current group."--Felix Siegrist
|
P6.0
16-Jan-08
|
|
|
671 |
#28957: $ARGV should be ARGV.--Wing
|
P10.0
08-May-07
|
|
|
673 |
#29287: The second paragraph says: "ERB breaks its input text into checks of regular text and program fragments." Perhaps "chunks" makes more sense then "checks".--Steve #29287: The second paragraph says: "ERB breaks its input text into checks of regular text and program fragments." Perhaps "chunks" makes more sense t ...more...
|
P10.0
30-Jun-07
|
|
|
675 |
#30502: Near the bottom of the page:
users.join(", ") should be users=users.join(", ")
groups.join(", ") should be groups=groups.join(", ")
My book's copyright page says "Eleventh Printing, October 2007"
"Version: 2007-9-13"--Wayne Kovsky #30502: Near the bottom of the page:
users.join(", ") should be users=users.join(", ")
groups.join(", ") should be groups=groups.join(", ")
My bo ...more...
|
P10.0
16-Jan-08
|
|
|
689 |
#30493: Library jcode, second paragraph, second line: "\343\210\202" should be "\342\210\202".--Felix Siegrist
|
P6.0
16-Jan-08
|
|
|
695 |
#30494: Library Monitor, second paragraph, second line: "and as a extension" -> "and as an extension".--Felix Siegrist
|
P6.0
16-Jan-08
|
|
|
712 |
#30495: --no-switch: "Defines a option..." -> "Defines an option...".--Felix Siegrist
|
P6.0
16-Jan-08
|
|
|
713 |
#30496: Library ParseDate, second line: if the time zone is included in the returned array, it's not just "an array of Fixnum values", but "an array of Fixnum and String values".--Felix Siegrist #30496: Library ParseDate, second line: if the time zone is included in the returned array, it's not just "an array of Fixnum values", but "an array o ...more...
|
P6.0
16-Jan-08
|
|
|
718 |
#29789: In the 3rd sentence, "wrapper than profiles" should be "wrapper that profiles".--Brian Adkins
|
P7.0
24-Oct-07
|
|
|
725 |
#30497: Library REXML, in the demo.xml: "Bignums store arbitraty-sized integers." should be "Bignums store arbitrary-sized integers."--Felix Siegrist
|
P6.0
16-Jan-08
|
|
|
726 |
#30498: 18th line of the sample code: "# and write it out with a XML declaration at the front" should be "# and write it out with an XML declaration at the front".--Felix Siegrist #30498: 18th line of the sample code: "# and write it out with a XML declaration at the front" should be "# and write it out with an XML declaration a ...more...
|
P6.0
16-Jan-08
|
|
| 732 |
|
#26867: The first example of a weakref doesn't cause an exception. The text suggests that this is being demonstrated, but even the "produces" output shown has no exception. It seems that strings aren't being garbage collected at this time. Substituting Object.new for "fol de rol" in the 2nd line produces the expected exception after the gc runs.--Stonewall Ballard #26867: The first example of a weakref doesn't cause an exception. The text suggests that this is being demonstrated, but even the "produces" output s ...more...
|
P10.0
20-Jan-07
|
|
| 735 |
|
#29947: In the library reference for WIN32OLE, the first example (Open Internet Explorer...) omits the necessary "require 'win32ole'" line.--Rick Ford
|
P10.0
05-Dec-07
|
|
|
759 |
#29402: The Zlib module does not support zip-format compressed files. To read those one has to use the rubyzip gem.--Nascif Abousalh-Neto
|
P1.0
13-Aug-07
|
|
| 762 |
|
#26674: The bookmarks section of the PDF no longer contains a link to the Index. What happened to it? Can you put it back? The last thing I see is "Part V, Appendixes". Adobe Reader 7.08, Windows XP.--Daniel Berger #26674: The bookmarks section of the PDF no longer contains a link to the Index. What happened to it? Can you put it back? The last thing I see is ...more...
|
P10.0
29-Nov-06
|
|
|
768 |
#30499: Socket#pack_sockaddr_un: there's a typo in the sample call (Socket.pack_sockaddr_in instead of Socket.pack_sockaddr_un).--Felix Siegrist
|
P6.0
16-Jan-08
|
|
|
769 |
#30500: Socket#unpack_sockaddr_in: wrong sample call (Socket.pack_sockaddr_in instead of Socket.unpack_sockaddr_in).
--Felix Siegrist
|
P6.0
16-Jan-08
|
|
|
769 |
#30501: Socket#unpack_sockaddr_un: wrong sample call (Socket.pack_sockaddr_in instead of Socket.unpack_sockaddr_un).
--Felix Siegrist
|
P10.0
16-Jan-08
|
|
|
769 |
#29557: The code listing for unpack_sockaddr_un on page 769 in the Second Edition is incorrect. It is a copy of the unpack_sockadd_in code listing. The explanation is OK.--Michael #29557: The code listing for unpack_sockaddr_un on page 769 in the Second Edition is incorrect. It is a copy of the unpack_sockadd_in code listing. Th ...more...
|
P2.0
21-Aug-07
|
|
|
790 |
#26684: It would be nice if there was an index entry for ? that referenced pp. 319-320 where using ? to obtain the integer value of an ASCII character is described.
I went to the index after viewing the sample on p. 550 that used that technique and didn't find anything in the index.
--Brian Adkins #26684: It would be nice if there was an index entry for ? that referenced pp. 319-320 where using ? to obtain the integer value of an ASCII character ...more...
|
P7.0
29-Nov-06
|
|
| 863 |
|
#32686: This may have been mentioned before, but the TOC no longer contains a link to the index in the PDF version. It would be great if it could have a link, not just to the start of the index, but to each letter in the index. This would make it much faster to skip to the portion of the book that contains what you're looking for. For an example, see the TOC in the Agile Web Development with Rails book.--Jason M. Kusar #32686: This may have been mentioned before, but the TOC no longer contains a link to the index in the PDF version. It would be great if it could hav ...more...
|
P10.0
08-Jul-08
|
|