Homework Questions

    Due: September 28, 2010

  1. What services compose a typical wiki? [For bonus points, what functionality would each of these services provide?]
  2. What does this response header mean? Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Explain in words. (No we didn't cover this in class, that's why there's the internet.) See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
  3. What is HTTP code 418? How did it come about?
  4. Due: October 12, 2010

  5. Take helloworld.py and add the line import pdb; pdb.set_trace() before you return the response. Now run the application and hit it with a web browser (should be at http://127.0.0.1:8080 as paste will tell you). You request will stall when you hit your pdb statement.
  6. Look at the code for paste.wsgilib.dump_environ. Get it running in a WSGI server. What does it do? How would you write this with webob?
  7. Compare a web framework from http://k0s.org/mozilla/craft/python.html#frameworks-vs-services with one or more other python web frameworks there or elsewhere on the web. When would you want to use one? When would you want to use another? What are the advantages and disadvantages of each?
  8. Draw a diagram of webob_view. Don't feel confined to use any particular format, just explain what it is/does with a picture. Points for creativity.
  9. How does webob_view work? Explain with words.
  10. Unassigned:

  11. Let's say you were developing a service that would take pictures of words and try to translate them to text. You are given an input, the parts of the word that are guessed. For instance: you have the string ex??pl? for "example".
    1. What would your function look like in terms of input and output (what it would get and what it would return). In python, please.
    2. What data would you need available to be able to write such a function? What other data would be useful?
    3. Assuming you have available whatever data you choose, write a function that guesses (or, better, computes various probabilities) given a single-word string with unknown values, as above. [Yes, this is a hard problem. The exercise is more pointed to, what approximations can you make so that you can solve it!]
    4. Assuming you had such a service working reliably, what "practical" problems could you put it to?
  12. Compare the genshi templating system with one or more other XML/HTML templating systems. Which one do you like best? Why?
  13. What is "wrong" with the commenting middleware from http://pythonpaste.org/webob/comment-example.html? How could it be improved?
  14. Describe the architecture of clwapp. What security concerns are there when deploying it?