cse 115
play

CSE 115 Introduction to Computer Science I Road map Exam return - PowerPoint PPT Presentation

CSE 115 Introduction to Computer Science I Road map Exam return Review Algorithms Linear vs Binary Search Selection vs Merge Sort Defining Custom Sorts Empirical Demo Exam Return When your name is called, come down straight away


  1. CSE 115 Introduction to Computer Science I

  2. Road map ▶︎ Exam return ◀ Review Algorithms Linear vs Binary Search Selection vs Merge Sort Defining Custom Sorts Empirical Demo

  3. Exam Return When your name is called, come down straight away to pick up your exam. If you arrive late or miss your name, wait until the end. DO NOT COME DOWN UNLESS YOUR NAME IS CALLED.

  4. Road map Exam return ▶︎ Review ◀ Algorithms Linear vs Binary Search Selection vs Merge Sort Defining Custom Sorts Empirical Demo

  5. Music Rating App User The Internet Server Browser HTTP Request for path "/" Navigates to @bottle.route("/") # return static file: the app's URL # index.html index.html HTTP Request for path downloaded "/myCode" @bottle.route("/myCode.js") # return static file: # myCode.js myCode.js downloaded AJAX HTTP GET Request for path "/songs" @bottle.route('/songs') JSON formatted songs # call get_songs() in the and ratings # ratings.py file -Convert to HTML and set as the innerHTML of the songs div

  6. Music Rating App User The Internet Server User enters a AJAX HTTP POST Request for path new song and "/add_song" clicks button @bottle.route('/add_song') # -read the new song # -call add_song from the JSON formatted songs # ratings.py file # -the song is appended to and ratings # songs.csv -Convert to HTML and set as the innerHTML of the songs div AJAX HTTP POST User clicks a Request for path rating button "/rate_song" @bottle.route('/rate_song') # -call rate_song from the JSON formatted songs # ratings.py file and ratings # -the rating is appended to -Convert to HTML and # ratings.csv set as the innerHTML of the songs div Handle POST requests until the user leaves the site

  7. Music Rating App - Expansions Prevent Multiple Ratings • Users can rate the same songs as many times as they can click (or write a program to spam ratings) • Discussion: How would we prevent this? Update Titles and Artists • If the user to add a song uses the wrong title/artist, it cannot be updated later • Could make it so any user can edit these fields Reviews • Add reviews to the ratings so users can share their opinions instead of just numbers

  8. Music Rating App - Expansions Style • Add star ratings instead of displaying all ratings for each song • Add color and CSS Sorting (module 4 foreshadow) • Sort the songs based on average rating, artist, or number of ratings Security (module 4 foreshadow) • This site is not secure! • Vulnerable to HTML/JavaScript injection • No encryption of HTTP requests • Preventing multiple ratings without compromising privacy

  9. Road map Exam return Review ▶︎ Algorithms ◀ Linear vs Binary Search Selection vs Merge Sort Defining Custom Sorts Empirical Demo

  10. Algorithms An algorithm is "a set of rules for solving a problem in a finite number of steps" https://www.dictionary.com/browse/algorithm

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend