Due (Problem Set): Tuesday, September 20, 2016, 11:59 pm

Due (Programming Assignment): Tuesday, September 27, 2016, 11:59 pm

Tasks

Problems:

  1. Chapter 1, Homework Problems and Quetions - R16 and R22
  2. Chapter 1, Problems - P18
  3. Chapter 1, Problems - P22, P25 , and P28

Programming assignment:

Write a simple program that takes a URL of a webpage as an input (entering it as a command line parameter is fine), reads the page content, measure the time it took to load, and prints the first few lines of the returned page together with the time it took.

The following snapshot shows the testing results of the program on gloin. It prints out the first few lines of the webpage of gmail and the time it took to load the page.

In this assignment, it is not necessary to handle errors (e.g. wrong URL). Your program does not have to print real/user/system time, only real time is required.

 [yingli@gloin ~]$ ./p1 http://www.gmail.com

 <!DOCTYPE html>
 <html lang="en">
 	<head>
 	<meta charset="utf-8">

 real 0.40 
 user 0.02 
 sys 0.01
 [yingli@gloin ~]$

Make the solution as simple as possible. You can use any programming language, platform, or development environment. You are expected to use the libraries of any programming language in this assignment (e.g. python urllib). I used a shell script in the above example with just one line of code.

Extensions

  1. Use different approaches to implement the programming assignment.
  2. Implement the programming assignment on a different platform.
  3. Do some interesting experiments with your program (e.g. measure the average loading times of different web pages). Explain the purposes of your experiments, the experiment setup, and your findings.

Submission

Please follow the submission instructions to turn in your work.

© 2016 Ying Li. Page last modified: .