Notes for Class Sessions

Week 01, Day 1: First Flight

Week 01, Day 2: Guided Bugfix

Week 02, Day 1: Matching, Sorting, and Seeking

Week 02, Day 2: Introduction to HTML5

Week 03, Day 1: Managing, Hitting, and Chaining

  • Chaining

    • Revisit,
      • Diner Dash
      • Insaniquarium
      • Tetris
      • Scrabble
  • Hitting
    • Whac-a-mole vs Wii Tennis

Week 03, Day 2

Class was cancelled for the STEM/CSI hackathon!

Week 04, Day 1

  • Welcome back from break.
  • Homeworks due. How’d it go?
  • Game Pitches

  • <audio> tags
  • WebWorkers
  • CoffeeScript
    • Online interpreter
    • Observations
      • Python style whitespacing
      • Ruby styled lightweight syntax
      • Concise function declarations
      • JSLint approved
      • Class based inheritance
      • Comprehensions!
    • Hangman

Week 04, Day 2 - Paper prototypes

  • Paper prototypes

Week 05, Day 1 - Settling on projects

  • Paper prototypes revisited.
  • Decide on top three projects.
  • Votes -
    • How many per team?
      • 2 teams of 6
      • 3 teams of 4
      • 4 teams of 3
    • Which games? Vote on the clipboard site.
      • Rabenvald - Robocode++
      • kaeedo - Eco
      • PhilMoc - Haunted House
      • JaceTwice - Arrangamajig
      • Crystick - Gold Rush
      • LakeEffect - Helicopter Race
      • trose/decause - FOSS
      • Lo-Rin - Dragonfire + Maths
      • rossdylan - Pip3z!!1
      • Qalthos - Myst
      • Chips545 - Moar LaZ0rs
  • Homework - Rubric assigned.

Week 05, Day 2 - Openshift

Week 06, the Valley of the Shadow of Openshift

:(

Week 07, Day 1: TurboGears

Setting up your environment (on typhon.csh.rit.edu):

$ virtualenv ~/myenv
$ source ~/myenv/bin/activate
$ pip install tg.devtools Pylons==1.0 WebOb==1.0.8
$ paster quickstart roflapp

# Yes you prefer mako templates
# Yes you need authentication

$ cd roflapp
At present, the current release of TurboGears doesn’t know it, but it needs
  • Pylons==1.0
  • WebOb==1.0.8
$ python setup.py develop
$ paster setup-app development.ini

Since we’re on a shared machine typhon.csh.rit.edu, we’ll need to pick different ports to serve our respective roflapps on. Edit development.ini accordingly.

Once you’ve made your edits, serve your app with:

$ paster serve --reload development.ini

Understanding Modern Web Frameworks

It’s all about MVC – model, view, controller. Modern frameworks separate your code out into these three distinct, yet interdependant chunks.

  • model (rolfapp/model/*.py) - contains all the database-related code
  • view (roflapp/template/*.mak and roflapp/public/*) - contains all the presentation-related code, html markup, css, javascript, etc.
  • controller (roflapp/controllers/*.py) - all the control-logic (or business logic). Who can access what urls? Validation of data? Did you win an iPad?

If you look inside roflapp you’ll see these directories and a few other secondary ones.

  1. Add roflapp/public/testing123.html and browse to /testing123.html.
  2. Edit roflapp/templates/index.html and browse to /.
  3. Edit roflapp/controllers/root.py. Edit the def index(..) method to return a random number. Display it in the template.
  4. Look at roflapp/model/. Edit roflapp/controllers/root.py to return the number of users.
  5. Throw an exception.
  6. Use tg.flash().

Week 07, Day 2: More TurboGears - AJAX - Back to the Cloud - Facebook

  1. Edit roflapp/controllers/root.py.

    1.1) Add one method that JSON returns info about users. 1.2) Add another method that JSON returns {‘success’: True} but adds a new user

  2. Add roflapp/public/javascript/rofl.javascript.

    1.1) Add one function that given JSON, updates the DOM. 1.2) Add one function that queries the /query_users URL. 1.3) Add one function that POSTs to create a random user. 1.4) Add $(document).ready(..) to kick it all off.

Facebook, if we have time

  1. Look at hanginwit-threebean for the example. In particular, check out auth-fb.coffee.

Week 08, Day 2: Facebook Auth

External docs for Facebook:

Modifications to your openshift app:

Week 09, Day 1

Presentations!