1. table.html <head> <style> table { border: solid 2 black; border-collapse: collapse; } th { background-color: orange; color: blue; text-align:center; } td { text-align: center; padding: 10px; vertical-align: top; } </style> </head> <table border="1" frame="none" rules="all"> <tr><th>person</th><th>beast</th></tr> <tr><td><img src="bvz.gif" width="140px"><p>Brad Vander Zanden</td><td><img src="quetzalc.gif" width="200px"><p>Quetzalc</td></tr> <tr><td colspan="2" align="center"><img src="mammoth.gif" width="200px"><p>Wooly Mammoth</td></tr> </table>
  2. layout.css #banner { font-weight: bold; font-size: 150% width: 100%; padding: 20px; border: solid 2px black; margin-bottom: 20px; } #leftbar { width: 180px; float: left; background-color: orange; } #rightbar { width: 20%; float: right; background-color: orange; } #main { margin-left: 180px; margin-right: 20%; padding-left: 10px; padding-right: 10px; }
  3. format.css pre { background-color: rgb(212, 212, 212); border: dashed 2px black; color: blue; padding: 10px; } body { background-color: pink; } p.quote { margin-left: 30px; margin-right: 30px; } p.quote strong { font-family: Arial,Sans-serif; color: orange; } span.def { font-style: italic; color: red; font-size: 12px; } ol ul { list-style-type: square; } ol ul li { text-indent: -20px; padding-left: 20px; }
    1. radio
    2. hidden
    3. menu
    4. checkbox
    5. textbox or textarea
    6. password box
    7. submit

    1. help.perl: The $ is required to ensure that help! ends the string. if ($ARGV[0] =~ /\shelp!$/) { print "yes\n"; } else { print "no\n"; }
    2. alpha_num.perl: The ^ and $ ensure that the word both begins and ends the string. if ($ARGV[0] =~ /^[a-zA-Z]+\d+$/) { print "yes\n"; } else { print "no\n"; }

    3. replace.perl: The parenthesis group captures the tag name and the optional / covers the case where the tag is a closing tag. I did not care about the case where the tag had attributes. $ARGV[0] =~ s/<(\/?\w+)>/#*\1*#/g; print "$ARGV[0]\n";

  4. tail.perl: open(FILE, $ARGV[0]); @lines = <FILE>; print (@lines[-10..-1]); # works even if there are fewer than 10 lines
  5. max.perl sub find_max { my ($a, $b) = @_; my ($i, $c); # assign the larger array to $b if (@$b < @$a) { ($b, $a) = @_; } # assign the larger array to @c @c = @$b; # replace the smaller elements in c with the larger elements from a for ($i = 0; $i < @$a; $i++) { if ($$a[$i] gt $c[$i]) { $c[$i] = $$a[$i]; } } return @c; } while (($word = shift(@ARGV)) ne "#") { push(@x, $word); } while (defined(($word = shift(@ARGV)))) { push(@y, $word); } @z = find_max(\@x, \@y); print "@z\n";