Thursday, February 28, 2019

CS75 Lecture #7 Project2

CS75 Lecture #7 Project2

Project 2 The BART


Goals

• Introduce you to Ajax.
• Introduce you to third.party APIs.


Recommended Reading

• http://www.w3schools.com/dom/
• http://www.w3schools.com/js/
• http://www.w3schools.com/ajax/
• http://www.bart.gov/schedules/developers/etas.aspx
• http://api.bart.gov/docs/overview/
• http://code.google.com/apis/maps/documentation/javascript/


Implementation. 

Your mission for this project is to implement The Bart, a mashup that allows users to visualize BART routes on a Google Map and also click stations to see when the next trains depart (or arrive .  The overall design and aesthetics of this site are ultimately up to you, but we require that your site meet some requirements.  All other details are left to your own creativity and interpretation


Technical Requirements.


  •   You’re welcome to develop your site on any computer using any IDE or text editor, even without using the CS50 Appliance, but you must ultimately ensure that it works within the CS50 Appliance at a URL of http://project2/ when installed in /home/jharvard/vhosts/project2/.
  •   Only files that should be web.accessible should live in project2/html/; everything else should live in project2/ or some other  subdirectory therein.
  •   Your site must use version 3 of the Google Maps JavaScript API.
  •   It suffices to use only the Real BART API 
    • (http://api.bart.gov/docs/overview/ , but you are welcome to use the Simple ETA Feed 
    • (http://www.bart.gov/schedules/developers/etas.aspx  and/or the GTFS feed 
    • (http://www.bart.gov/dev/schedules/google_transit.zip .
  •   You should cache locally (on disk or in a MySQL database  data that does not change every minute (e.g., routes and their stations .  Your mashup should only query the BART API or (Simple ETA Feed  for real.time departure (or arrival  times.  
  •   Your markup language should be valid (or “tentatively” valid  HTML5, as per http://validator.w3.org/, unless some feature of your site requires otherwise (for the sake of some browser ; explain in HTML comments any intentional invalidities.  Your HTML should also be as pretty.printed as possible.  Your CSS need not be valid.
  •   Any JavaScript or PHP code that you write must be extensively commented and be as pretty.printed as possible
  • You may use a WYSIWYG editor to generate HTML and/or CSS that you would like to use in your site.
  •   If you integrate third.party CSS or JavaScript libraries into your project, cite their origin with comments.
  •   If you incorporate or adapt snippets of code from the Web into your project (e.g., examples from php.net , cite the code’s origins with PHP comments.
  •   If you incorporate images from the Web into your project, cite the images’ with HTML comments.
  •   Your website must appear and behave the same on the latest versions of at least two of these browsers:
    •   Chrome
    •   Firefox
    •   Internet Explorer
    •   Opera
    •   Safari


CS75 Lecture #7 Part-2 AJAX, jQuery

CS75 Lecture #7 Part-2 AJAX, jQuery





Video Run Time: 2:01:01

Course Web Site by CS75.tv
Course Sillabus (Opens in a PDF)

Lecture Slides for Lecture 7 (Opens in a PDF)
Lecture 7 Source Codes
Lecture 7 Source Codes in PDF

Javascript to process HTTP XML DOM 



Lecture 0: HTTP
Lecture 1: PHP
Lecture 2: PHP, Continued
Lecture 3: MVC, XML
Lecture 4: SQL
Lecture 5: SQL, Continued
Lecture 6: JavaScript
Lecture 8: Security
Lecture 9: Scalability















Wednesday, February 27, 2019

CS75 Lecture 6 Javascript Part-2

CS75 Lecture 6 Javascript Part-2

Video: Lecture 6 Javascript. (Youtube link to open in a new window)

Video Run Time: 1:50:31






Course Web Site by CS75.tv
Course Sillabus (Opens in a PDF)
Course Sections Lead By TA
Course Projects
The course's own website is at www.cs75.net.
Google Discussion Group


Lecture 0: HTTP
Lecture 1: PHP
Lecture 2: PHP, Continued
Lecture 3: MVC, XML
Lecture 4: SQL
Lecture 5: SQL, Continued
Lecture 7: Ajax
Lecture 8: Security
Lecture 9: Scalability

























Wednesday, February 20, 2019

CS75 Lecture #5 Project1

CS75 Lecture #5 Project1


Project1: C$75 Finance

Recommended Reading


  • http://www.investopedia.com/university/stocks/ 
  • http://www.php-editors.com/articles/sql_phpmyadmin.php
  • http://www.w3schools.com/sql/
  • http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html
  • http://dev.mysql.com/books/mysqlpress/mysql-tutorial/ch10.html

Implementation

Your mission for this project is to implement C$75 Finance, a website that allows users to manage portfolios of stocks. The overall design and aesthetics of this site are ultimately up to you, but we require that your site meet some requirements. All other details are left to your own creativity and interpretation.

Feature Requirements

  1. Your site must require that a user log in with a username and password in order to see or do anything (except, obviously, log in or register). 
  2. £ Your site must allow a user to register for an account. A user’s username must be a syntactically valid email address.2 A user’s password must be at least six characters, and it cannot be entirely alphabetic or entirely numeric. Upon registering, a user should receive a free gift: $10,000 in cash.
  3.  £ Your site must allow a user to get a quote (i.e., look up its “Last Trade” price) for a stock by providing its symbol. 
  4. £ Your site must allow a user to buy shares of a stock by providing its symbol; your site must allow a user to buy more shares of a stock that he or she already owns. A user may not buy fractions of shares. 
  5. £ Your site must allow a user to sell shares of a stock that he or she already owns; for simplicity, you may require that a user sell all or none rather than some. A user may not sell fractions of shares. 
  6. £ Your site must allow a user to check the current value of his or her portfolio (i.e., his or her cash plus his or her stocks’ value based on its “Last Trade” price). 
  7. £ Your site must perform client-side validation, where possible, of user input related to a buy or a sell. For instance, if some text field must contain a non-negative integer (e.g., number of shares to buy or sell), you must reject attempts to submit invalid input (as by admonishing the user with an alert) or prevent them from typing anything non-numeric at all. 
  8. £ On any page designed to take user input, you should give focus (via JavaScript) to the first field requiring the user’s attention (e.g., the username field on your login page). 
  9. £ Your site must perform rigorous server-side error-checking. Under no circumstances should we be able to crash your site or induce unreasonable behavior. Letting us sell more shares than we own is not, shall we say, reasonable. We will bang on your code and try to find faults; do not let us succeed.

Technical Requirements. 

  1. £ You’re welcome to develop your site on any computer using any IDE or text editor, even without using the CS50 Appliance, but you must ultimately ensure that it works within the CS50 Appliance at a URL of http://project1/ when installed in /home/jharvard/vhosts/project1/. 
  2. £ Only files that should be web-accessible should live in project1/html/; everything else should live in project1/ or some (other) subdirectory therein. 
  3. £ You must store users’ data in a MySQL database (which you can create within the CS50 Appliance via phpMyAdmin). 
  4. £ You must use PHP’s PDO library to talk to MySQL (not PHP’s mysql_ functions). See http://www.phpro.org/tutorials/Introduction-to-PHP-PDO.html for reference. 
  5. £ Your site must pull its real-time data (prices, etc.) from Yahoo! Finance by parsing its CSVs; you may find http://us3.php.net/fgetcsv of interest. 
  6. £ Your database tables must have constraints and indexes defined where appropriate. 
  7. £ You must avoid race conditions by using SQL transactions or locks. 
  8. £ You should avoid inefficiencies and redundancies in your database tables (e.g., by keeping them in third normal form). 
  9. £ You should avoid redundant HTML; factor out markup common to multiple pages using PHP functions or “templates” (i.e., PHP files that you require in others). 
  10. £ Your markup language should be valid (or “tentatively” valid) HTML5, as per http://validator.w3.org/, unless some feature of your site requires otherwise (for the sake of some browser); explain in HTML comments any intentional invalidities. Your HTML should also be as pretty-printed as possible. Your CSS need not be valid. 
  11. £ Your PHP must be extensively commented and be as pretty-printed as possible. 
  12. £ You may use a WYSIWYG editor to generate HTML and/or CSS that you would like to use in your site. 
  13. £ If you integrate third-party CSS or JavaScript libraries into your project, cite their origin with comments. 
  14. £ If you incorporate or adapt snippets of PHP code from the Web into your project (e.g., examples from php.net), cite the code’s origins with comments. Computer Science S-75: Building Dynamic Websites Harvard Summer School Summer 2012 6 < 7 
  15. £ If you incorporate images from the Web into your project, cite the images’ with comments. 
  16. £ Your website must appear and behave the same on the latest versions of at least two of these browsers: £ Chrome £ Firefox £ Internet Explorer £ Opera £ Safari
==================================






Tuesday, February 19, 2019

Lecture 5 Section - Part2 PDO implemented in MVC

Lecture 5 Section is meant to go over the design detail of Project 1.

Lecture 5 Section - Part2  provides detailed accounts of implementing the PHP code with PDO with the MVC concept.

おそらく、このコースで3人いるTAのなかで、
もっとも分かりやすく説明しています。
シスアドミンとしての実務経験の長い人だからでしょうか。




Course Web Site by CS75.tv
Course Sillabus (Opens in a PDF)

Course Sections Lead By TA
Course Projects
The course's own website is at www.cs75.net.
Google Discussion Group
PHP Manual


Lecture 0: HTTP
Lecture 1: PHP
Lecture 2: PHP, Continued
Lecture 3: MVC, XML
Lecture 4: SQL
Lecture 6: JavaScript
Lecture 7: Ajax
Lecture 8: Security
Lecture 9: Scalability
============================================

htaccess-guide - how-to-use-htaccess


arry_push() function explained in detail here

RUN a sample code from the following directory location;
file:///C:/xampp/htdocs/scripts/example_array_push.php

But the execution URL has to be localhost as shown below;
http://localhost/scripts/example_array_push.php



===========================================
Course Web Site by CS75.tv
Course Sillabus (Opens in a PDF)
CS75: Building Dynamic Websites by Harvard OpenCourseWare with Great Instructor David J. Malan






























MIT 6.00 コンピュータサイエンスとプログラミング秋期講座第2回

  MIT 6.00 コンピュータサイエンスとプログラミング秋期講座第2回 オープンコースウエア 大学名:MIT 講座名:6.00 Introduction to Computer Science and Programming Download course material ...