For class, read: http://ivory.idyll.org/blog/software-quality-death-spiral.html
Quiz and discussion.
Roadmap for next few weeks.
Week 4: forms - submitting basic user input data to the web server; HTML.
Week 5: WSGI - building a fully functional Web server component; templating.
Week 6: More interesting Web apps; header processing & cookies.
Structure of HTTP, revisited. See presentation.
Payload of request, abstractly
Payload of response, abstractly
String whacking.
Read Strings and Lists and try to solve these problems generically, using only those string manipulation commands:
Pick out the 3rd value, e.g.
f("a,b,c,d,e,f") == "c"Extract everything after the 4th comma in a string, e.g.
f("a,b,c,d,e,f,g") == "e,f,g"Return the fourth and fifth lines of a multiline string, e.g.
f("a\nb\nc\nd\ne\nf\n") = ["d", "e"]Pick out the third and fourth values, removing leading underscores, e.g.:
f("_a,_b,_c,_d,_e,_f") = ["d", "e"]
See also String Methods, and Strings: Part I, Part II, and Part III.
Testing.
Create a new directory & download two files to arctic by doing:
mkdir cse491-day5
cd cse491-day5
wget https://github.com/ged-lab/msu-cse491-2013/raw/master/day5.py
wget https://github.com/ged-lab/msu-cse491-2013/raw/master/tests_day5.py
Activate your virtualenv:
source ~/cse491.env/bin/activate.csh
and then run nosetests:
nosetests
You should see 8 errors from the code in ‘day5.py’. Fix the code in ‘day5.py’ so that the tests all pass!
Solutions here: https://github.com/ged-lab/msu-cse491-2013/blob/master/day5-solved.py
This file can be edited directly through the Web. Anyone can update and fix errors in this document with few clicks -- no downloads needed.
For an introduction to the documentation format please see the reST primer.