13.07.2015 Views

Software Engineering for Internet Applications - Student Community

Software Engineering for Internet Applications - Student Community

Software Engineering for Internet Applications - Student Community

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

communicated to you. With some execution environments it may bepossible to have the error message and stack backtrace presented toyou in the browser window when the error occurs. If you canconfigure your server thusly you'll find that debugging goes muchfaster this semester. If not, make sure that you know how to quicklydisplay the latest errors (on a Unix machine you'd use the command"tail -f error.log" in a shell or "M-x revert-buffer" in an Emacs editorvisiting the error log).Just be<strong>for</strong>e the code that generates the divide-by-zero error, add aline of code to write the following message into the error log: "Aboutto divide by zero". Request http://yourhostname.com/basics/my-firstprogramfrom a browser again and then visit the error log to verifythat your "About to divide by zero" statement precedes the actualerror.Exercise 3: Processing FormsVisit http://www.photo.net/making-photographs/lens and look at thefocal length calculator under "Exactly how long a lens do you need?"Make this service work on your server. Note that this will involve (1)learning a bit about HTML <strong>for</strong>ms, (2) following the "view the sourcecode" link on the results page at photo.net and pulling themathematical <strong>for</strong>mula out of the program there, (3) parking a static.html file containing the <strong>for</strong>m on your server at /basics/lens-calculator,and (4) parking a program to process the <strong>for</strong>m at /basics/lenscalculator-2.[Note the naming convention above. When possible this semesterwe'd like you to adhere to the idea that a script that processes a <strong>for</strong>mat "foobar" is found at "foobar-2". If there is a pipeline of steps that auser must follow, we like to see them at "foobar", "foobar-2", "foobar-3", etc.]Exercise 3a: Add a View Source LinkA big part of our work this semester is looking at other folks' sourcecode. We do this so that we can examine alternative approaches tothe same problem. You can facilitate this by adding a "view source"link to the bottom of the page that you just made. A user who clickson this link ought to be served a file showing all of the source codebehind the page in question but not including procedures shared withother pages on the site.32The Domain Name System translates human-readablehostnames, e.g., www.google.com, into machine-readableand network-routable IP addresses, e.g., 216.239.57.100.DNS is a distributed application in that there is no singlecomputer that holds translations <strong>for</strong> all possible hostnames.A domain registrar, e.g., www.register.com, records that thedomain servers <strong>for</strong> the google.com domain are at particularIP addresses. A user's local name server will query thename servers <strong>for</strong> google.com to find the translation <strong>for</strong> thehostname www.google.com. Note that there is nothingmagic about "www"; it is merely a conventional name <strong>for</strong> acomputer that runs a Web server. The procedure <strong>for</strong>translating a hostname such as froogle.google.com is thesame as that applied <strong>for</strong> www.. Round robin DNS was anearly load balancing technique in which multiple computersat different IP addresses were configured to serve anapplication; browsers asking the DNS servers to translatethe site's hostname would get different answers dependingon when they asked, thus spreading out the users amongthe multiple computers hosting the application.DTDDocument Type Definition. The specification of an XMLdocument's schema, including its elements, attributes, anddata structure. DTDs are used <strong>for</strong> validating that an XMLdocument is well-<strong>for</strong>med. You can also share a DTD withyour collaborators in order to agree upon the structure ofXML documents that will be exchanged.Dynamic SiteA dynamic site is one that is able to collect in<strong>for</strong>mation fromUser A, serve it back to Users B and C immediately, andhide it from User D because the server knows that User Disn't interested in this kind of content. Dynamic sites aretypically built on top of relational database managementsystems because these programs make it easy to organizecontent submitted by hundreds of concurrent users. Anexample of a simple dynamic site would be a classified adsystem.EmacsWorld's most powerful text editor, written by RichardStallman (RMS) in 1976 <strong>for</strong> the Incompatible TimesharingSystem (ITS) on the PDP-10s at MIT. Emacs has beensubsequently ported to virtually every kind of computerhardware and operating system between 1976 and thepresent (including the Macintosh, Windows 95/NT, andevery flavor of Unix). Good programmers tend to spend theirentire working lives in Emacs, which is capable of317

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!