Saramic (2) [Avatar] Offline
#1
I have attempted to "follow along" with the code in the book and write my own code to get the most out of the book and look at getting an overview of python and Django. I have run into a lot of smallish problems, some typo like, others whole missing sections of code or no description in the book of what to expect. This has had a positive side effect in that through some of my trouble shooting I have actually managed to learn more about the system. Overall I think it detracts from the book. I also feel there are a lot of code blocks that make the book a chore to read and understand the code blocks, I end up skimming over them, maybe as I have a reasonably good understanding of things like evidenceCollector via javascript calls. In more details:

  • inconsistent naming of capitalised PRS vs lowercase. This is used in various places and as I am on mac this breaks things as on all *nix systems

  • problem with chapter2 git repo, evidenceCollector/urls.py regex, will not work with the ^ character so

  • url(r'^(?P<contentid>
    should be
    url(r'(?P<contentid>...

  • Django deprecation warning is not a good sign when running server

  • RemovedInDjango110Warning: django.conf.urls.patterns() is deprecated and will be removed in Django 1.10. Update your urlpatterns to be a list of django.conf.urls.url() instances instead

  • on page 89 (MEAPv4 up to ch5 PDF) you mention "we better cheat a bit and add all the view methods bindings..." into analutics/urls.py unfortunately if those methods do not exist in analytics/views.py this will break and not let you hit the API which is the next step. These method bindings need to be commented out or you need the full alaytics/views.py file in place with all the methods.

  • On analytics/urls.py you have views.event_count in there but this is not even in the Git repo so it will not work and must be removed

  • related to above you have some imports missing from analytics/views.py, again to make the call in the next section to work http://.../analytics/api/get_statistics?date=2015-05-30 you need the following which is in Git but not if you code along with the book

  • from datetime import datetime
    import time 
    import json

  • also missing from the book text around analytics/models.py (MEAPv4 PDF pp84) is

  • created = models.DateTimeField()

  • no mention in book of javascript calls to call the methods created

  • update_statistics();
    drawChart();
    etc...

  • Not sure about the use of //#A for reference points, especially as some end up being in HTML that show up in the page, no biggie but annoying

  • typo in code, need myChart._xPixel in MEAPv4 PDF pp94

  • attr("x", myChart.xPixels()

  • there is a problem with the ingestion and the date calculation in analytics/views.py method def get_statistics. If you ingest the data the same day you run this code, the end_date will be set to midnight that morning, which means that it will not return any data! As a minimum I would probably set it to end of day or use calendar months

  • use of http://moviegeek.com:8000 would only work if someone changed their hosts file but I don't believe that is mentioned in the book


  • I generally found that as much as I typed, I needed to in the end cut and paste the code from Git to work out what else was missing, not the best result. As already mentioned there is a lot of code to wade through. My current thinking is that I would prefer an overview of the key concepts and require people to use the code from Git to get it completely going. Although I like the use of lots of libraries like jquery, bootstrap, d3, dimple etc. I am not sure in the value of printing the CSS for template/dashboard.html. The CSS should really not be inlined so just knowing that it comes from a file would probably be enough. Overall, good work, keep it up.
    Kim Falk (20) [Avatar] Offline
    #2
    Thank you a lot for the list.

    I will take care that everything you mention will be updated in the next version of the MEAP. There is a lot of code, and we are considering taking more of it out, and requiring that parts of it will be downloaded instead.

    Please keep them coming.