Your name: Starting Date and time: Ending Date and time: Statement. I attest that the work on this exam is completely my own and that the exam was completed in good faith and following the ground rules that are described herein. Sign (or type) your name: Essay Questions (50 points total) Answer the first two questions and one of the last three. Provide thoughtful, thorough, well-reasoned and well-written answers. You may use the assigned reading materials for these questions. 1. (20 point) Yochai Benkler and Helen Nissenbaum talk about the virtues of commons-based peer production. (a) Briefly define commons-based peer production (CBPP) and then choose one example of a product that was produced by CPBB and one example of a product that was not produced by CPBB and (b) describe how they differ and (c) describe how one or the other promotes (or fails to promote) virtue. 2. (15 points) What is the difference between Richard Stallman's concept of free software and the Open Source Institute's concept of open source software. What is the significance of this distinction and what effect, if any, has it had on the development of the open source movement? (15 points) Choose one of the following questions. 3. SVN is an open source version control system. a) Describe the main functions that a version control system supports, and b) discuss the role and importance of SVN and/or other version control systems in the FOSS development process. 4. Drew Endy is synthetic biologist who argues that an open-source approach is important for the continuing development of his field. Describe the main issues in this area and how an open source approach would help advance this scientific field. 5. What impact has the broader open source movement had on society in general? Has it made any difference in how people think or interact? Has it had a positive or negative effect on how "traditional" technology companies operate? Has it led to any changes that show promise for a more open society? PHP Questions (50 points total). You may use the textbook for these questions. You may NOT use the computer to test your answers. That is, you must figure out the answers by using logic, arithmetic, and your understanding of PHP. 1. (10 points) What would be output (displayed on the web page) by the following PHP scripts? That is, you should assume that the output the script generates is being sent to a web page as part of an HTML document. a. $sports = array("baseball", "basketball", "football", "golf", "soccer", "tennis"); $m = 1; $n = 16 % 2; echo "My favorite sports are $sports[$m] and $sports[$n]
"; b. $sports = array("baseball", "basketball", "football", "golf", "soccer", "tennis"); foreach($sports as $key => $value) { print "$key -> $value
"; } 2. (5 points) Write a PHP loop that will print a countdown. That is, it should print: 5, 4, 3, 2, 1, BLASTOFF> 3. (5 points) Define an associative array named $widgets that represents the following price list: doohickey 10.50 whatchamacallit 19.99 thingamajig 5.99 whatsit 2.99 4. (5 point) Complete the following PHP script, which is supposed to print out a table of the widgets stored in the array you defined in the previous question. Your code should use PHP loop. WidgetPrice"; // Your code would go here echo ""; ?> 5. (5 points) The following PHP code segment will display an HTML form and handle certain input from the user. Describe what it would display when it is first loaded into a web page. Then describe what it would display if the user typed 'Exam" and pressed the submit button. '); } else { echo "The search string is: $search"; } ?> 6. (10 points) Revise the code in the previous section so that displays a name input form with the appropriate prompts. It should contain two input text fields, one named "first" and the other named "last", and a submit button. After the user enters her first and last name, it should display "Hi !" where strings in angle brackets are replaced by the user's names. 7. (10 points) Suppose you have a MySQL database named "cpsc110" that contains a table named "members" that has a row for each member of the course and that each row has two columns named "name" and "email", corresponding to the student's name and email address. And suppose your PHP program has successfully opened a connection, represented as $connection, to your database. a. Describe in general what the following query would do and what the variable $result would contain if the query is successful. if (!($result = @ mysql_query ("SELECT * FROM cpsc110", $connection))) showerror(); b. Suppose we want to use the result of the query in part (a) to display an HTML table containing the class members. Modify the following code segment so that it will perform that task correctly: NameEmail Address"; while ($row = @ mysql_fetch_array($result)) { // Display one row of the table getting the data from the query result } echo ""; ?>