Agenda
Reminder the girls: Coding is about trial & error. Don't be afraid to mess up, because you can't. The more you experiment and mess up, the more you'll learn.
- Review h1, h2, h3, img, a, br
- Tag order matters
- Parents & Children
- Indentation
| import urllib2 | |
| from BeautifulSoup import BeautifulSoup | |
| class Terminals(): | |
| def __init__(self): | |
| self.terminals = {} | |
| self.airports = ["jfk", "ewr", "lga"] | |
| self.getAllTerminals() | |
| def getAllTerminals(self): |
| @classmethod | |
| def get_matches_for_status_matched(klass, ride_doc): | |
| ride=[] | |
| # first ensure status is matched | |
| if ride_doc.get(Ride.A_STATUS)==2: | |
| # get the match ride and user info | |
| match_ride_id = ride_doc.get(Ride.A_MATCH_ID) | |
| # instachallenge | |
| # http://instagram-engineering.tumblr.com/post/12651721845/instagram-engineering-challenge-the-unshredder | |
| from PIL import image | |
| PIXEL_DIFF_CONSTANT = 2 | |
| IMAGE_HEIGHT = 369 | |
| IMAGE_WIDTH = 640 | |
| SHRED_WIDTH = 32 | |
| PIXEL_IN_COL_TO_SAMPLE= [2,29,40,210,123,122,111,123,190,304,504] # Automate |
| from PIL import Image | |
| PIXEL_DIFF_CONSTANT = 2 | |
| IMAGE_HEIGHT = 359 | |
| IMAGE_WIDTH = 640 | |
| SHRED_WIDTH = 32 | |
| PIXEL_IN_COL_TO_SAMPLE = [2,29,40,210,123,122,111,123,190,304] # Automate | |
| NUMBER_OF_COLUMNS = IMAGE_WIDTH/SHRED_WIDTH | |
| FILE = "TokyoPanoramaShredded.png" |
| def fs_parse_response(response, yelp_results): | |
| results = {} | |
| results["body"] = [] | |
| results["has_ordered_results"] = True | |
| try: | |
| r = response["response"] | |
| groups = r["groups"] | |
| groups = groups[0] | |
| items = groups["items"] | |
| for item in items: |
| def fs_parse_response(response, yelp_results): | |
| results = {} | |
| results["body"] = [] | |
| results["has_ordered_results"] = True | |
| try: | |
| r = response["response"] | |
| groups = r["groups"] | |
| groups = groups[0] | |
| items = groups["items"] | |
| for item in items: |
| # Top level attributes | |
| PLACE_ID_A = 'place_id' | |
| FS_ID_A = 'fs_id' | |
| YELP_ID_A = 'yelp_id' | |
| PHONE_A = 'phone' | |
| NAME_A = 'name' | |
| LOCATION_A = 'loc' # dict, see sub attributes below | |
| REVIEW_A = 'review' # single incoming review; a dict, see sub attributes below | |
| ALL_REVIEWS_A = 'all_reviews' # list of raw reviews | |
| RECOS_A = 'recos' # dict of processed reviews |
| Failures: | |
| 1) Javascript tracker | |
| When clients install javascript on their site, it should send us events | |
| sends a page event for the current session | |
| Failure/Error: wait_until { @session = mongo.sessions.find_one } | |
| Capybara::TimeoutError: | |
| timed out | |
| # ./spec/acceptance/javascript_tracker_spec.rb:14:in `find_session' | |
| # ./spec/acceptance/javascript_tracker_spec.rb:26:in `block (2 levels) in <top (required)>' |
| Finished in 732.73 seconds | |
| 602 examples, 16 failures, 3 pending | |
| Failed examples: | |
| rspec ./spec/acceptance/email_layouts_spec.rb:12 # Email layouts | |
| Allow users to manage and use their email layouts for their emails | |
| Can create a new layout | |
| rspec ./spec/acceptance/logs_spec.rb:20 # Logs | |
| Clients should be able to see a stream of events they are tracking |