Overall, the midterm scores averaged 36.7 out of 50 maximum points, with a standard deviation of 5.72 points. The midterms are available for return; please see a TA about getting your midterm back. The grades are also available on Gradesource.
When writing regular expressions, it is very easy to make subtle mistakes, therefore it is especially important to be careful. It is also important to make your regular expression "as simple as possible, but no simpler" (Einstein). Some students lost points for having overly complex regular expressions when a much simpler one would suffice.
Part A: a correct answer is "^(\([0-9]{3}\) |[0-9]{3}( |-))?[0-9]{3}-[0-9]{4}$"
Common mistakes and point values:
Part B: a correct answer is "^\$[0-9]{1,3}(,[0-9]{3})*(\.[0-9]{2})?$"
Common mistakes and point values:
Part A:
Part C:
The answer we were looking for was that one should make sure that the
server is "warmed-up", so that performance of cached data is being evaluated.
Partial credit was given to other reasons such as server load, and network
anomalies.
Each of the five parts was scored roughly like this:
As usage volume increases, Design A will scale better with respect to
network and CPU resources because it doesn't have to retrieve and parse
documents from other servers on every request. But as the amount of data
increases, Design B will scale better with respect to storage requirements.
Part B:
With Design A a new presentation medium need only cull information from
the database where it already resides in a structured form; the existing
retrieval engine can continue to operate as usual. With Design B, to reuse
the retrieval and extraction requires making this code modular and interfacing
it to multiple front-ends for different presentation media. This modularity
is certainly possible, but it would need to be considered at the outset
in Design B, whereas in Design A it comes with the territory.
Part C:
Design B relays users' requests to other servers, making them subject
to analysis by third parties at those servers or on the network in between.
Design A avoids this theoretical vulnerability, but is still subject to
analysis of incoming requests. Both designs are vulnerable to compromise
in the security of the Web server itself. Database server compromise is
unlikely to yield users' private information; the problem only mentions
storing in the database content retrieved from other Web sites.
Parts D and E:
Design A will give faster responses since local database queries generally have less latency than remote requests, and since data extraction is done ahead of time. Also, since the response will not depend upon remote servers, Design A will be more consistent and reliable when those servers are down or under heavy load. Furthermore, Design A could keep archived data even if it disappears from the sources, and it could draw statistics from the database.
A response from Design B will have more up-to-date information since it is retrieved from the source on the spot. It could also allow users, at request time, to specify sources the designers didn't think of.
Following are reasonable answers:
Part A:
Each tier in a dynamic Web site is a hardware/software component that communicates with the adjacent tiers, usually over a network. Typically, the three tiers are:
Part B:
Yes, this system has a three-tier architecture:
Part C:
Session IDs can be embedded in the path part of URLs. Note that
a GET variable is a form variable, so answers about GET variables
lost points.
Part D:
Yes, sessions make sense for VoiceXML applications. A session maintains state on the server across multiple requests by the same user. The user of a voice application might want to register her zipcode, language preferences, etc. as state to be maintained across multiple telephone calls to the application.
This question is about whether sessions make sense, i.e. whether they are desirable and logical. Something can make sense even though it is hard to implement. Sessions for voice applications are easy to implement with caller-id. They are hard to implement when caller-id is unavailable, but that doesn't mean they don't make sense.
Note that sessions are not relevant during a single script execution.
To keep track of information during a single telephone call, sessions are
not necessary.