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
when there is an educational dimension, i.e., when the moreexperienced users are helping the novices improve theirskills.CompressionWhen storing in<strong>for</strong>mation in digital <strong>for</strong>m, it is often possiblereduce the amount of space required by exploiting regularpatterns in the data. For example, documents written inEnglish frequently contain "the". A compression systemmight notice this fact and represent the complete word "the"(24 bits) with a shorter code. A picture containing yourfriend's face plus a lot of blue sky could be compressed ifthe upper region were described as "a lot of blue sky". Allpopular Web image, video, and sound <strong>for</strong>mats incorporatecompression.Content RepositoryInstead of having one SQL table <strong>for</strong> every different kind ofcontent on a site, e.g., articles, comments, news, questions,answers, it is possible to define a single content repositorytable that is flexible enough to store all of these in oneplace. This approach to data modeling makes it simpler toper<strong>for</strong>m queries such as "show me all the new stuff sinceyesterday" or "show me all the content contributed by User#37". With a content repository it is also easier to programand en<strong>for</strong>ce consistent site-wide policies regardingapproval, editing, and administration of content.CookieThe Cookie protocol allows a Web application toconveniently maintain a "session" with a particular user. TheWeb server sends the client a "magic cookie" (piece ofin<strong>for</strong>mation) that the client is required to return onsubsequent requests. The original specification is athttp://home.netscape.com/newsref/std/cookie_spec.html.Data ModelA data model is the structure in which a computer programstores persistent in<strong>for</strong>mation. In a relational database, datamodels are built from tables. Within a table, in<strong>for</strong>mation isstored in homogeneous columns, e.g., a column namedregistration_date would contain in<strong>for</strong>mation only of typedate. A data model is interesting because it shows whatkinds of in<strong>for</strong>mation a computer application can process. Forexample, if there is no place in the data model <strong>for</strong> theprogram to store the IP address from which content wasposted, the publisher will never be able to automaticallydelete all content that came from the IP address of aspammer.DNSHints: you'll want to deliver your script and any template file, ifapplicable, with a MIME type of "text/plain". This way the receivingbrowser won't try to render the HTML source. Some Web browsersare super aggressive and try to render anything that looks like HTML,even if it comes through without the text/html MIME type. Analternative approach that works with such browsers is to quote all ofyour HTML by replacing < with <, > with >, and & with &,then wrap source code in a tag.Exercise 4: Servers that query <strong>for</strong>eign serversUsing the Web browser running on your local machine, visit the URLhttp://philip.greenspun.com/WealthClock. Read the discussion of thisprogram in Chapter 10 of Philip and Alex's Guide to Web Publishing.Drawing upon that program as a model, build a new Web applicationthat takes the ISBN of a book from a <strong>for</strong>m and queries several onlinebookstores to find price and stock in<strong>for</strong>mation. The results should bedisplayed in an HTML table (price and in stock/out of stock at eachstore). Make your service available at /basics/books (the entry <strong>for</strong>m)and /basics/books-2 (the results page).We suggest querying barnesandnoble.com andwww.1bookstreet.com. Your program should be robust to timeouts,errors at the <strong>for</strong>eign sites, and network problems. In other words, inno situation should your user ever get a "Server Error 500" page. Toensure this you'll have to learn about exception handling in yourchosen language. In Java, <strong>for</strong> example, you'll want to use try andcatch. Test your program with the following ISBNs: 0062514792,0140260404, 0679762906, 1588750019.Try adding more bookstores, but you may have trouble getting themto work. For example, amazon.com and wordsworth.com tend torespond with a 302 redirect if the client doesn't give them a sessionID in the query.Extra credit: Which of the preceding books states that "The obviousmathematical breakthrough would be development of an easy way tofactor large prime numbers"?Exercise 5: Talking to the RDBMSIt turns out that it takes less time to learn the basics of SQL than itdoes to figure out how to deliver an SQL command to your RDBMS.These instructions are <strong>for</strong> Oracle. Refer to your supplement if you'reusing another RDBMS.31633
- Page 1 and 2: SoftwareEngineering forInternetAppl
- Page 3 and 4: Signature: ________________________
- Page 5 and 6: end-users. We use every opportunity
- Page 7 and 8: • availability of magnet content
- Page 9 and 10: • we want to see if a student is
- Page 11 and 12: you supply English-language queries
- Page 13 and 14: What to do during lecturesWe try to
- Page 15 and 16: The one-term cram courseWhen teachi
- Page 17 and 18: 332• spend a term learning how to
- Page 19 and 20: Once we've taught students how to b
- Page 21 and 22: has permission to perform each task
- Page 23 and 24: UDDIUnixcustomer's credit card. If
- Page 25 and 26: thousands of concurrent users. This
- Page 27 and 28: OraclePerlnamed XYZ" without the pr
- Page 29 and 30: LDAPLinuxbits per color, a vastly s
- Page 31: FilterFirewallFlat-fileGIF318functi
- Page 35 and 36: system. The authors of the core pro
- Page 37 and 38: Sign-OffsTry to schedule comprehens
- Page 39 and 40: scheduling goals that both you and
- Page 41 and 42: Client Tenure In Job (new, mid-term
- Page 43 and 44: ReferencesEngagement ManagementSQL*
- Page 45 and 46: Decision-makers often bring senior
- Page 47 and 48: presentation to a panel of outsider
- Page 49 and 50: 300always been written by programme
- Page 51 and 52: 17.3 Professionalism in the Softwar
- Page 53 and 54: Try to make sure that your audience
- Page 55 and 56: Chapter 17WriteupIf I am not for my
- Page 57 and 58: Suppose that an RDBMS failure were
- Page 59 and 60: analysis programs analyzing standar
- Page 61 and 62: at 9 hours 11 minutes 59 seconds pa
- Page 63 and 64: found" will result in an access log
- Page 65 and 66: 15.18 Time and MotionThe team shoul
- Page 67 and 68: select 227, 891, 'algorithm', curre
- Page 69 and 70: create table km_object_views (objec
- Page 71 and 72: • object-create• object-display
- Page 73 and 74: The trees chapter of SQL for Web Ne
- Page 75 and 76: );274-- ordering within a form, low
- Page 77 and 78: and start the high-level document f
- Page 79 and 80: Example Ontology 2: FlyingWe want a
- Page 81 and 82: systems. What would a knowledge man
- Page 83 and 84:
spreadsheet". Other users can comme
- Page 85 and 86:
Chapter 15Metadata (and Automatic C
- Page 87 and 88:
{site url}{site description}en-usCo
- Page 89 and 90:
drawing on the intermodule API that
- Page 91 and 92:
At this point you have something of
- Page 93 and 94:
• description• URL for a photo
- Page 95 and 96:
Here's a raw SOAP request/response
- Page 97 and 98:
Chapter 14Distributed Computing wit
- Page 99 and 100:
conduct programmer job interviews h
- Page 101 and 102:
Most admin pages can be excluded fr
- Page 103 and 104:
content that should distinguish one
- Page 105 and 106:
Chapter 13Planning ReduxA lot has c
- Page 107 and 108:
the Internet-specific problem of no
- Page 109 and 110:
wouldn't see these dirty tricks unl
- Page 111 and 112:
12.8 Exercise 4: Big BrotherGeneral
- Page 113 and 114:
than one call to contains in the sa
- Page 115 and 116:
A third argument against the split
- Page 117 and 118:
way 1 1/16One might argue that this
- Page 119 and 120:
absquatulate 612bedizen 36, 9211cry
- Page 121 and 122:
What if the user typed multiple wor
- Page 123 and 124:
Chapter 12S E A R C HRecall from th
- Page 125 and 126:
long as it is much easier to remove
- Page 127 and 128:
features that are helpful? What fea
- Page 129 and 130:
made it in 1938)? Upon reflection,
- Page 131 and 132:
environment, we identify users by t
- Page 133 and 134:
those updates by no more than 1 min
- Page 135 and 136:
Balancer and mod_backhand, a load b
- Page 137 and 138:
translation had elapsed--the site w
- Page 139 and 140:
It seems reasonable to expect that
- Page 141 and 142:
11.1.5 Transport-Layer EncryptionWh
- Page 143 and 144:
such as ticket bookings would colla
- Page 145 and 146:
give their site a unique look and f
- Page 147 and 148:
It isn't challenging to throw hardw
- Page 149 and 150:
Chapter 11Scaling GracefullyLet's l
- Page 151 and 152:
10.15 Beyond VoiceXML: Conversation
- Page 153 and 154:
Consider that if you're authenticat
- Page 155 and 156:
In this example, we:194• ask the
- Page 157 and 158:
As in any XML document, every openi
- Page 159 and 160:
(http://www.voicegenie.com). These
- Page 161 and 162:
Chapter 10Voice (VoiceXML)questions
- Page 163 and 164:
9.15 MoreStandards information:•
- Page 165 and 166:
9.14 The FutureIn most countries th
- Page 167 and 168:
9.10 Exercise 7: Build a Pulse Page
- Page 169 and 170:
9.6 Keypad HyperlinksLet's look at
- Page 171 and 172:
text/xml,application/xml,applicatio
- Page 173 and 174:
Protocol (IP) routing, a standard H