Home Page
PIC 40, Winter 1999
Programming for the Internet and Multimedia
Daily notes
- Wed 3/24: Revised information on continuation of UNIX accounts:
The UNIX Sun servers will be unavailable for a few days, starting
Thursay, 3/25. However, the accounts and their files will be
back up again at the beginning of the Spring Quarter, possibly
on different servers. On April 19, accounts for users who are
no longer in PIC classes will terminate.
- Tues 3/23: I'm still working on the homework grading.
- Tues 3/23: Please be aware that the contents of your directories
will be archived and removed over the break, because of the end of the
course. Be sure to make your own copies of anything you want to save,
preferably by the end of the week. [See update above.]
- Mon 3/22: In class I said that to call
&lock
twice
could cause the program to hang. However, it does not, because the
flock
function is smart enough to realize that it should
block out only other processes. (Each instance of running a program
counts as a separate process.) Even so, to call &lock
twice is not good programming practice.
- Sun 3/21: Review material for Diffie-Hellman, including a solution
to homework problem 8.2, is posted at the end of the Handouts, or
click here .
- Sat 3/20: The example of frames given in class has been posted.
The frameset and navbar files are in the handout directory
~/h
and the example can be viewed by the URL
http://www.math.ucla.edu/~baker/40/framex
(where the frameset file
is now index.html).
- Fri 3/19: One of you asks about colors and hex; yes, that's
part of what to know, and it's relevant for HTML.
- Thurs 3/18: One way to get test output when running a CGI
program is to open a file
test_out
for writing
and then print test data into it. This can be done even though
the standard output is used for making a virtual web page.
- Thurs 3/18: In Problem 8.1, remember that when you read a line from
the user_info file and split on a colon then the newline at the end is
not discarded. So use
chomp
.
- Wed 3/17: As mentioned in Lecture, there is no additional part
to Assignment #8.
- Wed 3/17: Problem 8.1 does not say what to do if the visitor has
registered before but gives an incorrect password. Ideally, the
visitor would get an error page saying to back up and try again,
but on this assignment to save time you can just print a "Location:...\n\n"
that takes the user back to the entrance page. (Also ideally there
would be some facility for the user to send email to have the password
be reset if the user has forgotten it.)
- Wed 3/17: In Problem 8.3, it's fine to write your scripts using
<> for input. Then in running your script you can give
the file name on the UNIX command line. (Thanks to I.D. for the question.)
- Tue 3/16: In Problem 8.1, notice that the checking asked for is
different from the checking for bad characters done in cgi_helper.
In cgi_helper the query string was checked; in 8.1, the
field values are to be checked, for characters that are not
appropriate for a name or an email address, etc. (Thanks to J.G. for
the question.)
- Tue 3/16: In Problem 8.1, Ami has a good suggestion: Do it
like the count program, where
lock
is called before
reading the user info file the first time and unlock
is not called until the program is through appending new information
to the file--or if the program determines that the id is a duplicate.
- Thu 3/11: There's some problem trying to center a table
with style sheets. I'll look into it. [Later:] Rather than using
float
, the proper thing to do is to enclose the table or
other object between < DIV ALIGN=CENTER>
and later
the closing </DIV>
. A style is not used.
- Thu 3/11: Ami points out that the
lock
subroutine
described on Handout S conflicts with the -T
restraints, because
it uses $0
. Please fix that simply by removing -T
. [Later: May not be necessary.] [Later: Seems there's no problem.]
- Thu 3/11: For setting the color of text, use the property
color
. The background color of all or part of
the page can be controlled with the property background-color
.
- Wed 3/10: As mentioned in lecture, if you lost points on Midterm #2
because of printing an undefined string, please hand your exam back
in for regrading.
- Sun 3/7: See Handout T (posted) for Lab #7.
- Sun 3/7: Midterms should be back Tuesday.
- Fri 2/26: A number of people are reporting network problems with
BOL and NT. Therefore the due time for the assignment will have to
be extended. Let's say Monday evening at 10:30 p.m.
- Fri 2/26: One of you has discovered that @ does not get
hex-encoded in the query string. Therefore this should be added to
the list of acceptable characters. Thanks for this report.
- Wed 2/24: Ami points out that in Problems 6.3 and 6.4 there is the
issue of what happens if the user fills in the form with text that
involves <, for example, which is part of HTML controls.
For this assignment, just ignore such possibilities.
- Fri 2/19: Do try an online store web site such as www.amazon.com .
Look up some things and try the shopping cart. You can even go to secure
mode, while stopping short of giving personal information.
- Fri 2/19: Handout P tests out OK.
- Wed 2/17: Comments on Handout O: (1) It's OK to have different
checkboxes with the same name as long as you specify different values.
(2) For radio buttons, if you don't specify one as "CHECKED" then the
first button will be the default. Some value is always returned, unlike
a checkbox.
- Wed 2/17: Ami will explain one item not covered at the end of today's
lecture, substitutions with
s/.../.../ge
- Tues 2/16: For BOL Gold users (= Bruin OnLine via Earthlink),
updated information is in
Bruin Gold info .
- Mon 2/15: Ami points out a misprint in Handout M: The URL of
the sample form is missing
~baker
. It is
http://www.math.ucla.edu/~baker/40/sample_form.html
.
- Mon 2/15: Office hours Wed 2/17 will be 2:00-3:00.
- Thurs 2/11: Several people report having trouble
submitting from hermosa but not from laguna.
The programmers will look at this Friday. Meanwhile, you can
try either of these alternatives: (a) Try submitting from laguna.
Either login to laguna directly, or on hermosa type
the command laguna and after you have finished on laguna
type exit . (b) Because of these problems, anyone who wishes
can hand in the assignment as late as 10:30 p.m. next Tuesday without checking
with me first. Just submit for problems x.1 through x.4 instead of 4.1
through 4.4 .
- Thurs 2/11: It is reported that the -T switch doesn't
work on laguna . If you're affected, just leave it out.
It is also said that on some machines it is necessary to say
require './cgi_helper' with the dot slash, but I didn't find
that to be the case myself. (The dot refers to the directory you're in.)
- Wed 2/10: The programmers have updated the submit program to
be Y2K compliant and for other reasons. If you notice any problems using
submit , let me know.
- Wed 2/10: The h directory link on hermosa disappeared for
some reason, but the programmers have now restored it.
- Tue 2/9: Handout K, Problem 2 suggested including a line
defined($title) || $title = ...
. Here it's necessary either
to use or instead of ||
or else to put
parens around the second half; this is the usual problem of ||
binding too tightly.
- Tue 2/9: A link to an explanation of binary and hexadecimal has been
added under "links" (above).
- Sun 2/7: The complete Homework 4 has been posted (Handout K).
- Thurs 2/4: Information on graded homework has been emailed to your
PIC computer accounts. For those of you who have set mail forwarding,
you should have received it. If you have not set mail forwarding, then
you need to check PIC email for it. For people who submitted homework
by email in the first place, that will be handled separately.
- Thurs 2/4: Next week's homework assignment will be given out
tomorrow (Friday) and will be due the next Friday. [2/5 a.m.: Only
the first problem is ready, already posted.]
- Thurs 2/4: There is a scheduled power outage over Saturday evening,
which will mean no computer access overnight.
- Tues 2/2: Some people have had trouble displaying HTML because
they changed permissions on their home directory or their
public_html directory. Both of these need to be
world-readable and world-executable. You set permissions this
way on public_html in Assignment #1; leave them that
way. (Recall that for a directory, being "executable" means
pass-through permission, i.e., being able to get to files inside
it.)
- Tues 2/2: On the graded quiz, a check mark on a problem does mean
"correct". A check mark at the top means it has been recorded that you
took the quiz.
- Tues 2/2: Ami points out that in Lecture 4-M, open should
have been used with parentheses: open(FH,"< myfile") || die "...";
The reason is that || binds more tightly than the comma, which
spoils the sense of it for Perl. Alternatively, you can put
or instead of || , since or binds more
weakly than comma (i.e., has lower precedence).
- Sun 1/31: Some people are having trouble using telnet to various
PIC hosts. Try hermosa.pic.ucla.edu , which seems to be
working.
- Sun 1/31: Instead of changing h/raw_data , which has a
missing field for test purposes, I have added a second version
h/raw_data_ok , in which the missing field has been put back.
[2/1: permission problem has been fixed]
- Sat 1/30: As mentioned below (1/28) CGI scripts can have
permission bits 700 . If you have set more permissions
in make_perl , that's OK, though.
- Sat 1/30: In the h/raw_data file, the last group
was missing a field on purpose. That confused some people,
so I'll put the field back Sunday a.m. Instead, make your own
copy of the file and modify it to be defective in various ways
to test your program.
- Fri 1/29: Misprint in Handout I: For HTML comments, there should be
an exclamation point: <!-- --> . This has been
corrected in the on-line version.
- Thurs 1/28: To see the most current version of this
home page, click on the "reload" button of your browser.
Otherwise you may be seeing a older copy that the browser has
cached.
- Thurs 1/28: Also in the handout directory is an HTML "template" file,
template.html . Copy it to your own directory, personalize it
by changing the fake email address to your own (in two places), and then
copy it each time you need to make a new HTML file.
- Thurs 1/28: Ami points out that CGI scripts don't have to be
executable by all, just by the user.
- Thurs 1/28: For Problem 3.3, some data you can try it on is in
the handout directory in the file h/raw_data .
- Wed 1/27: For the example from today's lecture, made even simpler,
see the notes for today .
- Sun 1/24: If you want new lines in HTML output, you can have your
program print <br> which means "break".
HTML doesn't pay attention to ordinary newlines.
- Sat 1/23: As announced, the quiz will be Thursday, not Tuesday.
Contents will be discussed in class on Monday.
- Sat 1/23: Just to make sure everyone understands--To split
$_
on white space, use split ' ';
(one space between quotes) or equivalently, simply
split; which is treated specially and returns just the
list of nonblank fields. Any other choice of splitting pattern
will return an extra first field consisting of an empty string
if the first field is empty. This makes sense when you consider
that splitting a roster line starting
:BAKER,
KIRBY:baker@math.ucla.edu using the pattern : ought
to give an empty first field (no ID number). So if you split
using the pattern /\s+/ , then a data line starting with
white space will give an extra field (of 0 length) at the
beginning.
- Thurs 1/21: It's fine to use while(<>) , but don't use
while(@v) .
- Wed 1/20: In the dice program, because we are running an older version
of Perl, it's necessary to add a command srand; at the beginning
to ensure that the random numbers are different on each run.
- Sat 1/16: Reportedly, "submit" has been giving an error message about
unrecognized user id's, even when a submission is successful. This bug is
probably due to the fact that the system for user id's has been changed
since the "submit" program was originally written. If "checksubmit" shows
your submission, then it's fine.
- Sat 1/16: To view your web pages, you need to use "pic" in place of
math: http://www.pic.ucla.edu/~lee/test.html if the user is "lee".
(Thanks to Ami for pointing this out.)
- Fri 1/15: Ami has a good point; he writes: In E-2, last line, I'm not sure that it is clear that lists that are literal
can't be used some places (like a shift, etc).
- Tues 1/12: On p. 2 of Handout B, don't do cd .., which leads
to the wrong directory since h is a symbolic link. Instead, just
do cd, which goes to your home directory. Also, more h
should have been more wds .
- Tues 1/12: Still some problem with the accounts. To compensate,
the homework will be due Tuesday, Jan. 19 at 10:30 p.m. , but
it's a short assignment in any case.
- Mon 1/11: There is some bug in the program that posts handouts, leading
to a few strange lines. It will be fixed later. [Later: fixed. But please
let me know if you notice glitches on handouts.]
- Mon 1/11: Account problems were traced to one whole section of people
having been omitted; that is supposedly fixed for Tuesday.
- Mon 1/11: On handout D, the reference to h/ex.1 should be to
h/wds instead.
- Mon 1/11: All people on the waitlist have been enrolled now, so accounts
should be created automatically for them Tuesday.
- Mon 1/11: There was a problem in setting up some of the accounts
today.
There have been 8187 visitors to this page since
counting began.
Email: baker@math.ucla.edu