Thursday 8/7/2008. 60 points.
http://www.cs.nyu.edu/courses/summer08/G22.3033-002/
These are example solutions. Please keep in mind that often, there is not just one correct solution to a question. If you come up with different answers, then it may be that both your answers and these answers here are correct. Of course, these answers here may also contain mistakes. If you spot a mistake, please let me know so I can correct it.
apple1, _weight
1apple, weight=
[A-Za-z_][A-Za-z0-9_]*
$_ENV, $_GET, $_POST,
$_COOKIE, $_SESSION).
3-a(1) context provider: operator .
3-a(2) conversion context: scalar (string)
3-a(3) converted value: "rl"
3-a(4) end result: "perl"
3-b(1) context provider: function sqrt
3-b(2) conversion context: scalar (number)
3-b(3) converted value: 4
3-b(4) end result: 2
["quiz1.html", "quiz1.pdf", "quiz2.html", "quiz2.pdf"]
for $n (@numbers) { for $e (@extensions) { push @quizzes, "quiz$n.$e" } }
editor is expected. For example:
http://www.cs.nyu.edu/~hirzel/editor_poll.php?editor=<script>alert("boo!")</script>.
You selected”, the code should be:
<?php echo htmlentities($_GET['editor']) ?>.
5
Vector.
Vector.prototype.
Vector.
Vector.prototype.
Vector, with the newly created object as
this.