Aicha enjoyed learning and was committed to doing well on everything. She would understand that we are continuing with 134A, which was a classthat she enjoyed a year ago.
The midterm is on Wednesday this week. Here are the Spring 2001 midterm and final examination. Sample solutions are not available currently. The midterm will count for 1/6 of your overall grade.
For the midterm and final, you may bring and use the following materials:
one PHP book and one MySQL book, your own personal hand-written notes,
documents handed out in class, and a printed copy of the published lecture
notes. You may not use any other materials.
What is the most fundamental difference between audio and visual interfaces? It may well be the difference between one dimension and two. Voice interfaces are unavoidably sequential, whereas a web user can jump around on a page, and absorb a lot of information simultaneously.
There are few universal principles for UI design, but here are some guidelines that are usually appropriate:
| [:alpha:]]+ | Greetings |
| [:alpha:]]* | Greetings |
| n[et]* | n in Greetings |
| n[et]+ | n in planet |
| G.*t | Greetings, planet Eart |
Leftmost, longest behavior means that to match the first string delimited by single quotes you must write the pattern '[^']*' This pattern explicitly says that quote characters are not allowed inside the match.
Note that the top priority for the match found is "leftmost."
"Longest" is only the second priority.
Avoid especially expressions that match multiple ways. For example do not write .*<big><b>.*</b></big>.* This is bad for several reasons.
$text = after("<big><b>",$text);
$title = before("</b></big>",$text);
When possible, use plain strings instead of regular expressions. The explode() function has the same effect as split(), but the delimiter is an ordinary string, not a regular expression. Therefore explode() is much more efficient.
For the new project and in general, it is important that you adopt a
well-organized and efficient approach for doing information extraction.
Do not just use regular expressions developed by trial and error.
One part of your report should be an explanation of your approach,
which should be as clear and simple as possible. In the report, describe
the capabilities and limitations of your strategy. Which changes
in the data sources could you handle, and which changes would break your
strategy?
If ereg() has a third argument that is an array variable, say$regs, and the pattern has parenthesized subpatterns, then the match to each subpattern will be stored in $regs[1], $regs[2], etc. $regs[0] will contain the whole match.
If ereg() finds any matches at all, then $regs is filled with exactly ten elements, even though more or fewer than ten parenthesized substrings may actually match. If no matches are found, then $regs is not altered.
For example, to convert from an ISO date to a U.S. style date:
if (ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $date, $regs)) {
echo "$regs[3].$regs[2].$regs[1]";}else { echo "Invalid date format: $date"; }
ereg_replace("[ \n\r\t]+", ",", trim($str));
$string=ereg_replace("([a-z])([A-Z])", "\\1xxx\\2" , "FieldNamePlus");
FieldxxxNamexxxPlus