semmypurewal / learningwebappdev Goto Github PK
View Code? Open in Web Editor NEWExamples from the book "Learning Web Application Development".
Home Page: http://learningwebappdev.com
Examples from the book "Learning Web Application Development".
Home Page: http://learningwebappdev.com
Page number of error:
193
Location on the page:
Last paragraph
Detailed description of error:
The last sentence states: "Let's start by creating a new directory in our app directory called Express. Create a server.js file that looks like this:"
However, on the top of the previous page (192), it says the same thing: "Let's start by creating a new directory inside the app directory and call it Express." So, if we followed the directions, we would have already created that directory. The only difference would be that we will be changing the server.js file as it is on pages 192-193 to the how it is on page 194.
eBook, pdf, chapter 3, p.91 figure 3-24 is slightly incorrect.
"And on the right side of the footer, you’ll need to create a subleft/-right layout to style the sitemap."
...
"When we finish with this section, we’ll have something that looks like Figure 3-24."
But the image in figure 3-24 doesn't have the sitemap styled correctly. It's still shown as a single column, not the 2 column layout that it should be.
I think the nav should be:
<nav>
<ul>
<li><a href='#'>home</a></li>
<li><a href='#'>FAQ</a></li>
<li><a href='#'>support</a></li>
</ul>
</nav>
Since it is a list
When I drafted the book, I was careful to use gender-neutral pronouns (i.e. preferring "they" to "him" or "her", for example).
That was changed during the editing process as per O'Reilly's policy. So the print and ebook versions now alternate male and female pronouns:
http://chimera.labs.oreilly.com/books/1230000000969/ch02.html#miscellaneous
This will be corrected in a future ebook update.
The else-if ends without adding the content to the DOM.
This was also caught by David Boles.
That seems to be left out of the chapter 5 examples.
Also, on page 199 the code:
'if (tweet.indexOf("awesome") > -1)’
should be:
'if (tweet.text.indexOf("awesome") > -1)’
This was reported by David Boles.
p. 223:
cards.push( { "rank":rank, "suit":"clubs" } )
-Shouldn't this be clubs.push...?
p. 228:
Cards.forEach(function (card) {
-Doesn't "Cards" need to be lowercase?
p. 228:
"change all of the cards that have the suit spades to hearts"
-The code seems to do the converse (hearts -> spades)
p. 264, figure 9-1:
I think the HTTP response arrow (from the computer to the controller) is pointing the wrong way.
eBook, pdf, Chapter 2, p.49
"More Practice and Further Reading
I’ve left a few open issues with Amazeriffic. I encourage you to fix them and get them working as well as you can. Remember, if you’re having trouble you can see the finished HTML on our GitHub page."
I followed along with the html as the chapter progressed, creating the index.html file. Then saw the above statement about there being a few issues left open and I have to admit that I can't find them, so i checked chapter2/Amazeriffic/index.html here on the github page but it looks exactly the same as the code in the chapter. Actually the file here on github is missing that alt attribute for the image.
So I think the code example in the eBook is missing the 'issues' or the finished index.html file is currently missing from github.
It is confusing me a bit as I thought I'd understood the chapter until I couldn't spot the issues.
In Chapter 7, the "Interacting with Redis in Our Code" and "Initializing the Counts from the Redis Store" code snippets declare a "redisClient" variable, but use a variable named "client" for the call to redid.createClient().
I've been having a few problems getting the Amazeriffic project to work on the server. On page 205, do we add the code to the inside of the main function in app.js, the $(document).ready, or just the very end of app.js? I'm also confused about the app.get("todos.json"), because I thought we changed it to todos.OLD.json on the previous page. But then I'm not quite sure why we have both toDos = {}; and also the link to "todos.json" in app.get(). Is toDos = {} supposed to be an array that contains our objects?
Also, do we cd down into /Amazeriffic/client/javascripts when we run "vagrant $ node app.js" in Terminal?
Sorry for so many questions! I think there are just a 1 or 2 explanatory sentences that I'm missing in order to get it all working. Thanks!
For the errata: eBook, pdf, Chapter 2, page 50.
The Memorization step "9. Commit the style.css changes to your Git repository.", seems a chapter too early as you haven't got to css yet.
Page number of error:
191
Location on the page:
2nd Paragraph, last sentence
Detailed description of error:
"The req.writeHead function creates the HTTP header that sets the attributes of the response, and the res.end function completes the response by adding "Hello World.""
In the example (and the code in server.js), it says res.writeHead, not req.writeHead.
Page 225, code block in the middle of the page.
var aces = db.cards.find( { "rank" : "aces" } ); <-- should be "rank" : "ace", otherwise it doesn't find it, since the aces are listed as "rank" : "ace" in the objects we created.
In the first example of adding an if statement to test for keyCode 13, the example is
if (keyCode === 13) which generates an uncaught reference error.
Should be as follows
if (event.keyCode === 13)
Any look up of a chapter section then sets the "Furthest Read" pointer to the end of the book. Usually "Furthest Read" is the location you were last at before going to look something up in the TOC. For example, a previous section you wish to review.
Please have future editions move the TOC to the front. Kinda like has been standard in publishing for centuries.
Via Ken Hommel:
"var $new_comment" appears twice, first as a variable declaration, second line of the snippet, and again inside the nested block where it's used -- but also as a declaration ("var" occurs in both places).
As it is now one types their text, clicks the button and the text disappears.
A check of Newest shows the item added to the list.
Be nice to diplay " added to your ToDo list." Maybe even fading out.
My attempts to implement this functionality have been stymied by (it seems) scope issues. A var newItem gets unset before the content display.
The CloudFoundry free trial has moved from cloudfoundry.com to run.pivotal.io.
This was reported by Michael Hennessy and Steve Fickas.
The line:
app.get("todos.json", ...)
should read:
app.get("/todos.json", ...)
I was looking at the .append() documentation and I see that it accepts multiple arguments e.g. $("body").append($div1, $div2);
I was just wondering why on line 48 you use the append method twice (https://github.com/semmypurewal/LearningWebAppDev/blob/master/Chapter4/Amazeriffic/javascripts/app.js) to add to elements.
It seems like adding additional arguments to the single .append() function is the neater option. What is the reasoning behind how you've done it?
Thanks.
I can't get the function show of the UserController to work in a correct manner. It loads a bare HTML-file, but none of the formatting and the scripts. The issue seems to be that the CSS and JavaScript files are requested from localhost:3000/users instead of localhost:3000 directly.
My function looks like this (as detailed in the book):
UsersController.show = function (req, res) {
var name = req.params.name;
User.find({"username": name}, function (err, user) {
if (err) {
console.log(err);
res.send(500,err);
} else if (user.length !== 0) {
res.sendfile("./client/todo.html");
} else {
res.send(404);
}
});
};
Where book == Kindle edition at location 1013.
Page number of error:
113
Location on the page:
2nd block of example code
Detailed description of error:
"var
The argument passed to main
has an extra "s" at the end.
Currently reads var main = function (toDoObjectss)
.
Page number of error:
202-203
Location on the page:
code blocks
Detailed description of error:
The code throughout pages 202-203 refers to counts.json, but I don't think we ever created this file up to this point in the book. I tried to get the code at the top of 202 to work, but using node app, tweetCounts = require("./tweet_counter.js"), and app.get("/counts.json"...) all seemed like bits of the code that I couldn't reconcile. Were we supposed to come up with this on our own, or is there an explanation missing? Either way, I think a sentence or two to clear this up would benefit the reader.
via Gilbert Desport:
I have a question regarding the JavaScript For loop example in Chapter 4 "Interactivity" (page 136). I couldn't get this to work as expected - it highlights the last(3rd) tab regardless of the tab clicked. Would I be correct in thinking this may be because the variable used when building the function (tabnumber) will always be set to 3 at runtime (and accessed via JavaScript closure) i.e. it will reference the last iterated value?
Also from Gilbert Desport.
There is a typo in the code example on page 135 as follows:
$(".tabs a:nth-child(3)").on("click", function () {
$(".tabs span").removeClass("active");
$(".tabs a:nth-child(2) span").addClass("active"); // <----typo: should be 3
$("main .content").empty();
return false;
});
I've left a few possible errata on http://www.oreilly.com/catalog/errataunconfirmed.csp?isbn=0636920030621 if you want to take a look. I didn't know if I should post them there or here. Thank you!
Near the top of page 177, the closing curly brace after the displayMessage(0);
call ( just before $(document).ready(main);
) should have a semicolon after it.
Missing part of the second comment after "// create the"
Asynchronous is misspelled as "Asynchrnonous".
All other references to that point are comment-input
There is no span defined in previous examples
Making the change as described in title enable the hover.
Location 2445 in Kindle version
This is leftover from a previous iteration of the code. It's corrected in the Github example. It should be
$button = $("<button>").text("+");
This was caught by David Boles.
Page number of error:
194
Location on the page:
Second block of code, 3rd line
Detailed description of error:
Missing an ending parenthesis:
from
app.use(express.static(__dirname + "/client");
to
app.use(express.static(__dirname + "/client"));
Page number of error:
45
Location on the page:
2nd paragraph
Detailed description of error:
The second paragraph ("Add index.html and follow up ...") seems to be a recap of the immediately preceding steps. Is it meant as a summary? If so the language should be adjusted to make this clear.
It looks more like a portion of outline which was expanded upon and should have been deleted.
In the Mongo command line Java Script exercise,
"var clubs = []"
should be
"var cards = []"
or
later
"cards.push (...)"
should be
"clubs.push (...)"
reported by Ken Hommel:
Why are there two definitions for the function "organizeByTags", one inside of main() and one before it? They have different function signatures; does JavaScript support polymorphism?
If the first version of this function is #1 and the second version is #2, then #1 has a formal parameter and #2 does not. I don't know JavaScript; I would expect that the call to "organizeByTags(toDoObjects)" (in main()) would cause the interpreter to call #1, because the function signatures match. It doesn't, it calls #2. I'm guessing that this is a result of scoping, and polymorphism either doesn't exist in JavaScript or doesn't work the way I expect.
In short, I think the first definition of organizeByTags is just an error, and should be omitted.
Subject says it all.
learningwebappdev.com does resolve
Via Ken Hommel:
The block that demonstrates refactoring the code for activating each tab omits the line from the previous version for clearing the main content ("$("main .content").empty();").
This line reappears on p. 137.
Not sure why it's not there yet!
Page number of error:
219, 221
Location on the page:
function(stream) in code blocks
Detailed description of error:
I believe the if statement shouldn't have the = in >=.
"if (tweet.text.indexOf("awesome") >= -1)"
This executes the if statement when we found awesome and when we didn't as well. The code back in chapter 6 does not have the =, too.
Page number of error:
200
Location on the page:
if statement in large code block
Detailed description of error:
The code "as is" on page 200 produces an error. Since tweet is an object, we can't use tweet.indexOf. I got it to work by replacing it with tweet.text.indexOf, which is hinted at on page 199 under "Using the indexOf function to find words."
Error: pg 50:
Says: Commit the style.css changes to your Git repository
Should be Commit the index.html changes to your Git repository, yes?
In trying to obtain the JSON from the Flickr URL provided, the Chrome console shows this error:
XMLHttpRequest cannot load http://api.flickr.com/services/feeds/photos_public.gne?tags=dogs&format=json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8888' is therefore not allowed access.
The Chrome fix detailed on page 156 ("Overcoming Browser Security Restrictions") only applies to JSON files on the same server. I'm using Mac OS X 10.9 (Mavericks), running the page through MAMP.
Apologies if this is my error and doesn't belong on the Issues tracker.
Hi,
For the errata: eBook, pdf, Chapter 1, page 19. 'Figure 1-12. A Git repository with four commits', is showing the 'Figure 2-5. A tree representation of the preceding DOM' diagram.
Page number of error:
68
Location on the page:
CSS example
Detailed description of error:
To avoid an horizontal scroll bar under "
In chapter 5, I have implemented the map() function on the toDoObjects data, and copied over the old code from Chapter 4, example 3. However, nothing is appearing on the page where the list previously generated.
I created a Gist with my code here: https://gist.github.com/abahler/10684720.
Page number of error:
116
Location on the page:
Figure 4-7 at the top of the page
Detailed description of error:
Figure 4-6 and Figure 4-7 have the same caption, but the caption no longer applies to Figure 4-7.
"The DOM, with an unconnected subtree that represents a ul element."
The subtree is now connected though, not unconnected, so if it followed the same pattern as the figure in which the p element was added, it might say:
"The DOM, after the ul subtree is added to main."
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.