Computer Systems: A Programmer's Perspective (3rd Edition)
3rd Edition
ISBN: 9780134092669
Author: Bryant, Randal E. Bryant, David R. O'Hallaron, David R., Randal E.; O'Hallaron, Bryant/O'hallaron
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 11, Problem 11.10HW
A.
Program Plan Intro
IP addresses:
- The IP address denotes an unsigned integer that is 32-bit.
- The IP addresses is been stored by network programs in IP address structure.
- The addresses present in IP address structure are stored in network byte order.
- An unsigned 32-bit integer is transformed from host byte order to network byte order by “htonl” function.
- An unsigned 32-bit integer is transformed from network byte order host byte order by “ntohl” function.
- The IP address is presented to humans in a form known as “dotted-decimal” notation.
- Each byte is been represented by its corresponding decimal value and is separated by a period from other bytes.
Passing
- The arguments for “GET” requests are passed in the URI.
- The character “?” separates filename from the arguments.
- The character “&” separates each argument.
- The arguments do not allow spaces in it.
Server passes arguments to child:
- The server calls “fork” to create a child process and calls “execve” to run program in child’s context once it receives a request.
- The child process sets CGI environment variable values.
- The “adder” program can reference it at run time using “getenv” function of Linux.
Output is sent by child:
- The dynamic content of a CGI program is to be sent to standard output.
- A CGI program sends dynamic content to standard output.
- It uses “dup2” function for redirecting standard output to connected descriptor associated with client.
- The result written to standard output by CGI program, it goes directly to client.
B.
Program Plan Intro
IP addresses:
- The IP address denotes an unsigned integer that is 32-bit.
- The IP addresses is been stored by network programs in IP address structure.
- The addresses present in IP address structure are stored in network byte order.
- An unsigned 32-bit integer is converted from host byte order to network byte order by “htonl” function.
- An unsigned 32-bit integer is converted from network byte order host byte order by “ntohl” function.
- The IP address is presented to humans in a form known as “dotted-decimal” notation.
- Each byte is been represented by its corresponding decimal value and is separated by a period from other bytes.
Passing program arguments to server:
- The arguments for “GET” requests are passed in the URI.
- The character “?” separates filename from the arguments.
- The character “&” separates each argument.
- The arguments do not allow spaces in it.
Server passes arguments to child:
- The server calls “fork” to create a child process and calls “execve” to run program in child’s context once it receives a request.
- The child process sets CGI environment variable values.
- The “adder” program can reference it at run time using “getenv” function of Linux.
Output is sent by child:
- The dynamic content of a CGI program is to be sent to standard output.
- A CGI program sends dynamic content to standard output.
- It uses “dup2” function for redirecting standard output to connected descriptor associated with client.
- The result written to standard output by CGI program, it goes directly to client.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
We need to create an HTML and CSS page with the following requirements. Thank you in advance !
... has a method attribute with the value of "post" and an action attribute with the value of "/pets"
... has an single-line text input with and id of "name", a name of "pet_name", and with an associated label that reads "Name".
... has a drop-down with an id of "type", a name of "pet_type", an associated label that reads "Type", with only the options "Cat", "Dog", "Hamster", "Other", "Zebra".
... has a multi-line text input with and id of "bio", a name of "pet_bio", and an associated label that reads "Biography"
... has an email input with id of "owner-email", a name of "pet_owner_email", and with an associated label that reads "Owner's Email"
... has a button that reads "Create new pet" with type "submit" and id "new-pet-submit-button"
... has a button reads "Reset" with type "reset"
... is 600px wide when the screen is greater than or equal to 600px wide
... uses grid layout to layout…
Perform form validation in JavaScript for client form given below. Write all the code in one function according to given fields and call it on form submission. Design the html form with its input objects. Use name attribute for first three fields and id attribute for last two fields to access the form objects
Perform form validation in JavaScript for client form given below. Write all the code in one function according to given fields and call it on form submission. Design the html form with its input objects. Use name attribute for first three fields and id attribute for last two fields to access the form objects
Chapter 11 Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
Ch. 11.3 - Prob. 11.1PPCh. 11.3 - Prob. 11.2PPCh. 11.3 - Practice Problem 11.3 (solution page 967) Write a...Ch. 11.4 - Prob. 11.4PPCh. 11.5 - Prob. 11.5PPCh. 11 - Prob. 11.6HWCh. 11 - Prob. 11.7HWCh. 11 - Prob. 11.8HWCh. 11 - Modify TINY SO that when it serves static content,...Ch. 11 - Prob. 11.10HW
Knowledge Booster
Similar questions
- Write a JavaScript code with the following three different conditions: Create the HTML document containing an <img> element with id="myImage" for any images you want. Use the HTML DOM to get the element with id="myImage". Write a JavaScript function to change the JavaScript src attribute of <img> element from " pet.gif" to " cat.jpg" when clicking on a button. Note: Students can use any gif and jpg files according to their choice.arrow_forwardPerform form validation in JavaScript for client form given below. Write all the code in one function according to given fields and call it on form submission. Design the html form with its input objects. Use name attribute for first three fields and id attribute for last two fields to access the form objects.arrow_forwardUse JavaScript to display the following information: The current date and time in the following format: Day, Date Month Year (Hours:Minutes), such as Wednesday, 26 August 2020 (8:50). Use the following colours for different date and time components: Day in red, Date in green, Month in yellow, Year in blue, Hours and Minutes in brown. The URL of the page. The user agent information of the web browser used to display the page. The number of forms and links in the page (for testing purpose, please include a few forms and hyper-text references in the page).arrow_forward
- Perform form validation in JavaScript for client form given below. Write all the code in one function according to given fields and call it on form submission. Design the html form with its input objects. Use name attribute for first three fields and id attribute for last two fields to access the form objects. Name: Required Email: Required. Must be a valid email. Password: Required and must be of length 7 to 12. Country: (Pleese select a country) v Required. Must select a country. ZIP Code: Required. Must be nurþeric only. Submitarrow_forwardOpen the HTML and JavaScript files provided as start up files (index.html and navigation.js). Then, run the application and notice that when you click on a link in the sidebar, the page is scrolled so the information for the speaker associated with that link is displayed. In other words, this application works even if JavaScript is disabled. In the JavaScript file, add an event handler for the ready event method. Then, within the function for that event handler, add jQuery code that hides the heading and article for all but the first speaker. Add an event handler for the click event of the <a> elements in the sidebar. Then, within the function for that event handler, add jQuery code that hides all the speaker information, gets the value of the href attribute of the link that was clicked, and then uses that value to display the heading and article for the speaker associated with that link.arrow_forwardPerform form validation in JavaScript for client form given below. Write all the code in one function according to given fields and call it on form submission. Design the html form with its input objects. Use name attribute for first three fields and id attribute for last two fields to accessthe form objects. Name: Required Email: Required. Must be a valid email. Password: Required and must be of length 7 to 12. Country: (Please select a country) v Required. Must select a country. ZIP Code: Required. Must be nurmeric only. Submitarrow_forward
- Perform form validation in JavaScript for client form given below. Write all the code in one function according to given fields and call it on form submission. Design the html form with its input objects. Use name attribute for first three fields and id attribute for last two fields to access the form objects.arrow_forwardOne of JavaScript’s most useful purposes is validating online forms. This means that, the data entered in the fields must be valid. For example, that no fields are blank and that the data is in the right format. As a web programmer, design a simple HTML form with three (3) fields; Name, Phone, and Email, create a database using a . Write a JavaScript code to validate the form before submission to the database.(share Code and screen shots)arrow_forwardNot same as already posted.arrow_forward
- A student report this problem when using HTML and JavaScript "On the assignment with preloaded images, I had to rewrite the example from the book. I had a problem with the syntax for linking the source file to the <form> element. I solved the problem by using this syntax document images img3.src = (source of file)." What kind of error is it? What rules were applied, and which should have been applied earlier?arrow_forwardImagine that the HTML file for your web page project includes a div element with the id value “cupcake” and you are writing a function to display and rearrange some images within that element. What JavaScript statement would you place in the blank to move the last image within the ccFrostingelement to the beginning of the line and shift the other images one position toward the end? let frostingFiles = ["pinkFr.jpg", "blueFr.jpg", "chocFr.jpg"] let frostingCount = frostingFiles.length; function frostCupcake() { let cupCake = document.getElementById("cupcake"); let ccFrosting = document.createElement("div"); cupCake.appendChild(ccFrosting); ccFrosting.id = "ccFrosting"; for (let i = 0; i < frostingCount; i++) { let image = document.createElement("img"); image.src = frostingFiles[i]; ccFrosting.appendChild(image); } function shuffleBack() { _____ } } a. ccFrosting.appendChild(ccFrosting.firstElementChild); b.…arrow_forwardWhat is a disadvantage of using the classic submit button, as opposed to Javascript, for submitting an HTML form?: * A) Most browsers have already been fully tested against submitting HTML forms. B) The classic submit button will not work if Javascript is disabled. C) You cannot submit the data to multiple action pages with multiple targets. D) The GET method has no limit for classic submit.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education