================================================================= Assignment #11 - O/S review, HTML, HTTP, Web pages ================================================================= - Ian! D. Allen - idallen@idallen.ca - www.idallen.com Available online: Tuesday April 13, 2010 Upload due date in the Blackboard Assignment Area: Upload "assignment11.txt" before 13:00 (1 pm) on Tuesday April 13, 2010. Do *not* use the DigitalDropbox to submit your answers. Answers will be posted shortly after the due date/time. Submission method: Upload via the "Assignments" CST8281_Assignment_11 upload. Use the file name given above. Upload only one single file of plain text, not HTML, not MSWord, not RTF. No fonts, no word-processing. Plain text only. Did I mention that the format is plain text (Notepad)? Due to bugs in Blackboard, you can only submit your Assignment to me *once*. After that, you cannot submit any more times. If you need to re-submit it, you have to email me to ask me to clear your previous submission. Do *not* use EMail or the DigitalDropbox to submit your answers. Answers will be posted after the due date/time so that you can check your answers before coming to labs and ask questions about the answers in the labs. Please check your answers (and my answers!). I go over each assignment in the lab if there are questions about the answers. No questions means no review - I'll presume you know the material. Questions similar to ones on these assignments will appear on your tests and exams. Not all assignments will be marked. See the Week 1 Notes for details. ============================================================================== Edit this file and answer the following questions underneath each question, showing how you obtained each answer, if appropriate. Upload the file containing the answers before the due date. Some of the answers below may require reading the URL links published in the weekly notes. ============================================================================== Make sure you can log in to the Course Linux Server before you begin. The command-line commands referenced in this lab should be executed in your own account on the Course Linux Server. ============================================================================== *** Review *** 0. What is the date and room location of your CST8281 Final Exam? 1. Write the simplest IF statement (simplify the Boolean logic) for the following programming problem specification: "Call the add routine unless: the cost is less than zero or the colour is 'blue'." 2. Write the simplest IF statement (simplify the Boolean logic) for the following programming problem specification: "In Elbonia, you lose (cannot renew) your driving license if your age is over 50 or you have more than 23 demerit points. Call the renew() function if this is not true. (Write a simplified IF statement that calls renew() if you are allowed to renew.)" *** Operating Systems Review (CST8202) *** CLS = "Course Linux Server" 3. What is the absolute pathname of your CLS home directory? 4. Use "ls -lid" to display the permissions on the above directory and paste the full output here: 5. What is the absolute pathname of the CLS directory containing your Assignment 10 "mypage.html" file? 6. On the CLS, what is the absolute pathname of the directory containing a copy of all the CST8281 course Notes files? (This information is the appropriate file under the Class Notes on the course home page.) 7. On the CLS, what is the absolute pathname of the 210_file_transfer.txt file in the preceding CST8281 course Notes directory? 8. How would you use shell file patterns (sometimes called "glob" patterns) and the "grep" command on the CLS to find out which Week Notes files contain the string "PuTTY"? (Reminder: grep pattern matches are exact and case-sensitive unless you use the grep option that turns off case sensitivity.) 9. Give the absolute pathname on the CLS of the file referenced by the following URL: http://cst8281.idallen.ca:8080/~abcd0001/one/two.jpg 10. Give two URLs, one private (Algonquin-only) and one public (works on the Internet) for the following pathname on the CLS: ~alleni99/public_html/test/image.png 11. You are using FTP or SFTP on a Windows computer. Your current Windows directory is C:\Temp and you connect to the CLS. Give the "put" command that will copy a local file "foo.txt" from the "Vmware" directory on your "D:" drive to the CLS so that the following URL will display the contents of that file. Note the new file name: http://cst8281.idallen.ca:8080/~abcd0001/tmp/bar.txt 12. You are in the directory ~abcd0001/public_html/a10 on the CLS. You want to move a file named "foo.txt" from the abcd0001 home directory into the directory ~abcd0001/public_html/tmp using the shortest possible relative path names. What command do you use? 13. Create the directory "public_html/a11" under your CLS home directory. (Do not include the quote marks. The 11 is the number eleven.) Use "ls -lid" with the above pathname to show the permissions of the directory and paste the full output here: 14. Redirect the output of the Unix "who" command into the file "who.txt" in the above "a11" directory. (Do not include the quote marks.) Verify that you can see the contents of the who.txt file using a web browser (e.g. Firefox) using the appropriate URL. 15. Use "ls -liac" on the "a11" directory to show the permissions of the directory and all the files inside it. Paste the output here: 16. Turn off execute permission for "others" on the "a11" directory. a) What command turns off execute permission for "others"? b) Use "ls -liac" to generate a listing showing the new permissions of the "a11" directory and all its contents and paste the output here: b) Can you still use "cat" or "less" to view the who.txt file? c) Can you still view the who.txt file via URL in the web browser? d) Turn on execute permissions on the "a11" directory. What command did you use to do this? e) Use "ls -liac" to generate a listing showing the restored permissions of the "a11" directory and its contents and paste it here: f) Can you still view the who.txt file in the web browser? *** The Web *** 17. Describe what is the World Wide Web? 18. What is the difference between HTTP and HTML? 19. Describe the type of content gets stored in the disk files that are served up by a Web server? 20. What protocol is used to send Web pages across the Internet? 21. Describe how your Web browser acts to fetch and display a Web page. 22. True/False: Line breaks in HTML appear as line breaks in your Web page. 23. What is the URL of the W3C web page validator service? 24. To what does the name "Apache" refer in the Web? (What is "Apache"?) 25. True/False: Every opening HTML tag has a corresponding closing tag. 26. True/False: A valid Web page could be a single line of text. 27. Give three examples of HTML tags that have no closing tag: 28. What is an HTML "element"? 29. What tag pair are mandatory inside the section? 30. Which heading usually prints larger,

or

? 31. How do you write a comment in HTML? 32. True/False: You can nest HTML comments inside HTML comments. 33. True/False: This is a valid comment: <-- Hello World! --> 34. True/False: This is a valid comment: <-- See -- Saw --> 35. True/False: This is a valid comment: 36. True/False: This is a valid comment: 37. True/False: This is a valid comment: 38. True/False: The major attribute of the tag is "http=" followed by a relative or absolute file or URL address. 39. True/False: the address used in the attribute on an tag must match the text displayed in the browser for that attribute. 40. What is the syntax for an EMail address used in an link? 41. True/False: When using the tag, the attribute that points to the image itself is named "image=". 42. Write an tag that references the image file "foo.png" stored in the parent directory (not in the current directory). The image size is 800x600 pixels and shows a Linux penguin dancing. 43. Write here, from memory, the smallest valid Web page that displays "Hello World!", including all the mandatory tags. You can omit the details on the DOCTYPE header line (don't memorize it). -- | Ian! D. Allen - idallen@idallen.ca - Ottawa, Ontario, Canada | Home Page: http://idallen.com/ Contact Improv: http://contactimprov.ca/ | College professor (Free/Libre GNU+Linux) at: http://teaching.idallen.com/ | Defend digital freedom: http://eff.org/ and have fun: http://fools.ca/