- table.html
person | beast |
Brad Vander Zanden | Quetzalc |
Wooly Mammoth |
- 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;
}
- 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;
}
-
- radio
- hidden
- menu
- checkbox
- textbox or textarea
- password box
- submit
-
- help.perl: The $ is required to ensure that help! ends the string.
if ($ARGV[0] =~ /\shelp!$/) {
print "yes\n";
}
else {
print "no\n";
}
- 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";
}
- 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";
- tail.perl:
open(FILE, $ARGV[0]);
@lines = ;
print (@lines[-10..-1]); # works even if there are fewer than 10 lines
- 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";