![]() |
![]() Spring Semester 2002 |
Fri Apr 26
Implement the program from the midterm exam, using either Java servlets
or JSP. Choose one or the other. Turn in a printed copy of your code in
person to Adrian. Post your code on-line in the protected
directory, and have the program available for testing on-line in Tomcat.
You can turn in your print-out either during your individual appointment
next week, or during the time scheduled for the final exam (Thu May 3,
7:15pm-9:15pm in LH102).
Tue Apr 23
Make
final appointment for next week (Apr 29-May 3)
here.
Final Exam is scheduled for May 2 between 7:15pm-9:15pm in LH102.
Date: Tue, 23 Apr 2002 13:31:51 -0500 (EST) From: Adrian German <dgerman@cs.indiana.edu> To: Undisclosed recipients: ; Subject: a348/a548 final update I posted a set of review notes yesterday. We will go over them in class today. You can use them as your project for the semester if you want, as described in the notes. I've printed enough for everybody - and I will distribute them tonight in class. If you can't come tonight just come and get one from me later. You need to make an appointment for next week, the script is at: burrowww.cs.indiana.edu:36000/cgi-bin/schedule and you can choose any of the open slots all of next week. In your time slot I will ask you a couple of questions about the project you chose, and about the final exam. The final exam will be a take home and I will describe it in class tonight. You can turn it when you come next week for your appointment, or in LH102 Thu May 2, 7:15-9:15pm. (That's when our final is scheduled). Turn in a print-out of your code. You will have to implement the program from midterm with servlets or JSP (graduate students - both). Let me know if you have any questions and concerns and/or if you have trouble using the sign-on script (as burrowww seems a bit slow right now). Thanks again and all the best. ... Adrian
Sat Apr 20
Date: Sat, 20 Apr 2002 12:27:38 -0500 (EST) From: Adrian GermanTo: Undisclosed recipients: ; Subject: A348/A548 Final Weeks Dear A348 Friends, The class is coming to an end. If you have late homework that you need to turn in it will be accepted for near-full credit if you put together all the missing pieces on a special page on your Apache web site for my review (and let me know about it) before next Sunday, Apr 28, at midnight. (Sun Apr 28 is when we observe Catch-up Day this semester). Grades for the two parts of the midterm exam will be posted in the evening. There will be an optional take-home midterm make-up that I will distribute on Thursday in class that we can discuss in class, and which needs to be turned in on or before the final exam, for full credit. The final exam will be on Thu May 2 7:15-9:15pm in class (LH102). The optional midterm make-up will be a good preparation for the final exam. If you decide to turn it in and if your score on it is higher than the original midterm, the higher score will be kept for your midterm grade. The final project is due the week of the final and you need to make an appointment with me and discuss it. I will send details of that soon, as it will involve your registering through a CGI script on the web, the script should be up within a day or two. Let me now briefly describe what you need to turn in for your semester group project. Option A. If you have been working on a project turn in what you have at the time of the appointment (programs, design documents, mock-ups, experiments, early drafts, etc). Option B. If you have not done much work on any group project of your own here's what you can do - write a detailed report on any of the projects that have been presented in class, and come prepared to discuss it with me. Topics you can choose from: a) the PHP shopping cart (Mar 21, Lab 10) b) the Javascript shopping cart (Mar 19) c) the Daytime applet/servlet communication (Lab Twelve) d) the Http chat application (as in Apr 2 notes) e) the triple chat application (as in Apr 9 notes) f) Java RMI (as in Apr 11 notes and What's New entry for Apr 4) g) Tomcat and server-side Java programming (Lab 11, 13) So if you don't have any project that you've been working on it's perfectly acceptable (and recommended) that you review one of the 7 projects listed above, prepare a tutorial or report on the topic you have chosen (up to 10 pages of text, diagrams, and possibly code) and bring it with you to the appointment that you will make. I will look at your report, ask you a few questions, and that will be your project for this semester. Feel free to work in groups but please turn in your own report. The report need not be too glitzy, it need not be spiffy, it only needs to be honest, direct, operational (i.e., meaningful,) and true. Handwritten is fine, and if it contains diagrams it is also perfectly acceptable if they are drawn by hand. I'm only interested in your complete/thorough understanding of the topic you have chosen to present/defend. The code presented in the class notes from the topic you have chosen for discussion should obviously be known and understood inside out. Let me know if I can be of help in any way. You could also choose the following topics, if you want, if none of the topics above seem attractive to you: h) Perl, CGI, CGI.pm, and DBI.pm i) Java and XML for business to business applications So to summarize here's what we have: 0. Catch-up Day falls on Sun Apr 28 this semester. 1. Grades will be updated tonight 2. Optional Take-home Midterm Make-Up becomes available Thu 4/25 and is due a week later at Final Exam time (it prepares you for the Final Exam, and counts towards your grade only if you do better in it than you did on the midterm) 3. Final Exam is on Thu May 2, 7:15-9:15pm in LH102. Written exam, open-book, open-notes, involves short answers or multiple-choice. 4. Project is due week of May 2, individual appointments will be made over the web throughout that week (Mon-Fri 8am-5pm) and will be about 10-15' in length per person. 5. List of topics for the project defense is listed above. If you have any questions or concerns please let me know. ... Adrian
Thu Apr 18
Wed Apr 17
import javax.servlet.*; import javax.servlet.http.*; import java.io.*; public class One extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType("text/html"); PrintWriter out = res.getWriter(); String one, two; String what = req.getParameter("picture"); if (what == null) { what = ""; } if (what.equals("one")) { one = "One"; } else { one = "<a href=\"/examples/servlet/One?picture=one\">One</a>"; } if (what.equals("two")) { two = "Two"; } else { two = "<a href=\"/examples/servlet/One?picture=two\">Two</a>"; } out.println("<html><head><title>Mamma mia!</title></head><body bgcolor=\"white\">" + "<table border><tr><td>" + one + "</td><td>" + two + "</td><td>Three</td><td>Four</td></tr>" + "<tr><td colspan=4 align=center>Picture</td></tr>" + "<tr><td colspan=4 align=center>Caption</td></tr>" + "</table></body></html>"); }This was for the portfolio, as a servlet, and you need a JSP version of it, too.
Now help for the calculator, as JSP.
<html><head><title>My calculator</title></head><body> <% Integer a = (Integer)session.getAttribute("acc"); if (a == null) { a = new Integer(0); } String argument = request.getParameter("arg"); if (argument == null) { argument = "0"; } int conv; try { conv = Integer.parseInt(argument); } catch(Exception e) { conv = 0; } a = new Integer(a.intValue() + conv); session.setAttribute("acc", a); %> <form> The accumulator is now: <%= a %> <p> <input type="text" name="arg"> <p> </form> </body></html>This is only the starting point, and you need a servlet version of it as well.
Tue Apr 16
Mon Apr 15
import java.rmi.registry.*; class One { public static void main(String[] args) { Registry a = null; try { a = LocateRegistry.getRegistry( Integer.parseInt(args[0]) //Registry.REGISTRY_PORT ); String[] u = a.list(); for (int i = 0; i < u.length; i++) { System.out.println(i + ": " + u[i]); } } catch (Exception e) { System.out.println(e); } System.out.println("Good-bye!"); } }
Thu Apr 11
For reference only (a few notes already existing):
Tue Apr 9
Homework assignments Five and Six (last) posted.
Lab Notes for this week posted.
Thu Apr 4
Two documents (one, two) about RMI.
Mon Apr 2
The notes are almost exact, except in a few places links need to be updated.
Sat Mar 30-31
server.xml.username
files have been generated, you can
pick up yours from
on (/u/dgerman/public/tomcats
burrowww.cs.indiana.edu
). You can now install Tomcat!
Fri Mar 29
server.xml
,
or wait until I generate them for you).
Thu Mar 28
A list of ports, as promised, will be posted tomorrow on the students and servers page.
Wed Mar 27
create table catboo ( isbn char(6), catid int unsigned, primary key (isbn, catid) )
Tue Mar 26
Thu Mar 21
Wed Mar 20
Midterm grades to follow soon.
Tue Mar 19
Here's the Javascript shopping cart we will describe this week.
Notes for this week are being posted.
Sat-Sun Mar 8-17
Tue Mar 5
Lecture Notes Eighteen, Lab Notes Nine posted.
Mon Mar 4
Sun Mar 3
Sat Mar 2
Fri Mar 1
Thu Feb 28
Date: Wed, 27 Feb 2002 16:09:32 -0500 (EST) From: Adrian German <dgerman@cs.indiana.edu> To: ac.csci.a348@cs.indiana.edu Subject: A348/A548 Midterm Exam< Lab Eight, posted, offers a complete solution to Lab Seven. This way everybody gets enough feedback on Lab Seven and will likely do well on it as well. Lab Seven is due this week in lab. The exam tomorrow will ask you to write a program like the one we develop in Lab Seven. Graduate students will get an extra question, as indicated on the Grading page. Studying Lab Seven will make sure you do well on the exam. The exam is open-book, open-notes. Having a solution posted for Lab Seven keeps the Thu and Fri sessions at the same level. Exam tomorrow is at 5:45 in LH102. Please review PHP, Perl, CGI (perhaps CGI.pm) and Lab Seven. Let me know if you have any questions. See you tomorrow. ... Adrian
Wed Feb 27
There won't be much SQL (if any) on the exam. Once the exam is behind
us I will bring all the notes up to date, including lab notes. My main
concern right now is to make sure we are all clear on what the exam's
covering: Unix, Apache, HTTP, Perl, CGI, CGI.pm
, PHP.
Tue Feb 26
Mon Feb 25
More about this in the lecture notes, tomorrow.
Sat-Sun Feb 23-24
Fri Feb 22
Thu Feb 21
Wed Feb 20
Tue Feb 19
Mon Feb 18
Sat-Sun Feb 16-17
Fri Feb 15
Thu Feb 14
Wed Feb 13
Some of the examples in Lab Five have been wiped out.
I will try to reactivate them, tomorrow night.
Tue Feb 12
Mon Feb 11
Sun Feb 10
Sat Feb 9
Fri Feb 8
burrowww.cs.indiana.edu% cat data.txt this is a file isn't it burrowww.cs.indiana.edu% cat one #!/usr/bin/perl open (AB, "data.txt"); open (BC, ">out.txt"); while ($line = <AB>) { print "***($line)***"; print BC $line; } close(AB); close(BC); burrowww.cs.indiana.edu% ./one ***(this )******(is a )******(file )******(isn't )******(it )***burrowww.cs.indiana.edu% diff out.txt data.txt burrowww.cs.indiana.edu%
Thu Feb 7
#!/usr/bin/perl &printTop; $me = $ENV{SCRIPT_NAME}; print qq{ <form method="GET" action="$me"> Type your username <input type="text" name="a" size=8> and password <input type="text" name="b" size=14"> then press <input type="submit" value="Proceed"> </form> }; &readParse; # %in is created, contains user input print "<table border cellpadding=6>"; foreach $key (keys %in) { print "<tr><td> $key <td>", $in{$key}, "\n"; } print "</table>"; &printBot; sub printTop { print "Content-type: text/html\n\n<html><body>"; } sub printBot { print "</body></html>"; } sub readParse { if ($ENV{REQUEST_METHOD} eq "GET") { $abc = $ENV{QUERY_STRING}; } elsif ($ENV{REQUEST_METHOD} eq "POST") { read(STDIN, $abc, $ENV{CONTENT_LENGTH}); } else { print "Method not supported." &printBot; exit; } $abc =~ s/\+/ /g; @pairs = split(/&/, $abc); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ s/%(..)/ chr(hex($1)) /ge; $in{$name} = $value; } }
Wed Feb 6
We will collect information from you through QuizSite.
Tue Feb 5
This week we completely design and implement a sample semester project.
Mon Feb 4
Sat-Sun Feb 2-3
The quizzes are not assigned homework but they will help with the midterm.
Fri Feb 1
Thu Jan 31
Wed Jan 30
Here's the book I will use for MySQL
:
Tue Jan 29
Two more labs from the past: Unix intro and a basic quiz.
Mon Jan 28
Sun Jan 27
Sat Jan 26
Fri Jan 25
Thu Jan 24
First, the second part (called two
).
#!/usr/bin/perl &printTop; # take care of the browser first (you are a CGI script!) $me = $ENV{"SCRIPT_NAME"}; # who am I? # now get the input from the user if ($ENV{"REQUEST_METHOD"} eq "GET") { # USPO letter vs. UPS package here! $showMe = $ENV{"QUERY_STRING"}; } else { # assume it's POST! read(STDIN, $showMe, $ENV{"CONTENT_LENGTH"}); } # now let's take things apart @pairs = split(/&/, $showMe); # we've opened the packet and now we read the message foreach $pair (@pairs) { # print $pair, "<p>"; # used only to debug ($name, $value) = split(/=/, $pair); # print "The value of $name is $value<p>"; # used only to debug $in{$name} = $value; } # now the %in hashtable contains what they sent us! foreach $key (keys %in) { # so let's look at it, verify it contains what it should. print "The value of ", $key, " is ", $in{$key}, "<p>"; } # this is also used only to debug print qq{ # the rest is only simply output ($showMe) <p> <form method=POST action="$me"> <table> <tr> <td> One: <td> <input type="text" name="one" size=14> <tr> <td> Two: <td> <input type="text" name="two" size=14> <tr> <td> Three: <td> <input type="text" name="three" size=14> <tr> <td> Four: <td> <input type="text" name="four" size=14> </table> When finished please <input type="submit" value=" Go for it!"> <p> </form> }; &printBot; # finish your HTML # the two procedures needed sub printTop { print "Content-type: text/html\n\n<html><body>"; } sub printBot{ print "</body></html>"; }# end of procedure, end of program(This program gets you started on Homework Two-Part One).
Then the first one below is easier, simpler, and corresponds to Homework Two-Part One.
#!/usr/bin/perl &printTop; $me = $ENV{"SCRIPT_NAME"}; print "<pre>"; foreach $key (keys %ENV) { if ($ENV{"QUERY_STRING"} eq $key) { # plain text it's what they asked for print "<font size=+3>$key</font>", ": ", $ENV{$key}, "\n"; } else { # link as before print "<a href=\"$me?$key\">$key</a>\n";#, ": ", $ENV{$key}, "\n"; } } print "</pre>"; &printBot; # and the helpers we always need sub printTop { print "Content-type: text/html\n\n<html><body>"; } sub printBot{ print "</body></html>"; }
Wed Jan 23
Tue Jan 22
#!/usr/bin/perl print "Content-type: text/html\n\n<html><body>"; $acc = 10; $input = $ENV{"QUERY_STRING"}; ($name, $value) = split(/=/, $input); $acc = $value + 1; print qq{ Your accumulator is: $acc <p> ($input) <form method=GET action=/cgi-bin/a2/two> <input type="hidden" name="acc" value="$acc"> <input type="submit" value="AddOne!"> </form> };
Mon Jan 21
#!/usr/bin/perl while ($x = <STDIN>) { ($com, $arg) = split(/ /, $x); print "You have typed: $x"; if ($com =~ /^bye/i) { print "Good-bye!\n"; exit; } elsif($com =~ /^add/i) { $acc += $arg; print "Acc is now $acc\n"; } elsif($com =~ /^sub/i) { $acc -= $arg; print "Acc is now $acc\n"; } else { print "Acc stays $acc\n"; } }
Sat-Sun Jan 19-20
Fri Jan 18
Thu Jan 17
ac.csci.a348
newsgroup from
here.
Wed Jan 16
Date: Wed, 16 Jan 2002 13:32:01 -0500 (EST) From: Adrian German <dgerman@cs.indiana.edu> To: Undisclosed recipients: ; Subject: a348/a548 distribution list Greetings, I have created a distribution list for A34/A548 and I plan to use it once in a while when I need to communicate something for which the web site would be too slow a medium. There is also a newsgroup for this class (ac.csci.a348) and I plan to check it daily. Should you have questions please e-mail us or come and see us or post to the newsgroup. The web site is now up to date with office hours and instructor assignments to labs. We have a new AI for Thu SE 045 where Fulya Erdinc is replacing Brian Keese. Fulya will be also be teaching with Chengxiu on Fridays in SB230. It is always good to work in groups for A348 since you can check things like file permissions and availability of files and get to know each other in anticipation of the project. Welcome to the distribution list. If I can be of any help please let me know. ... AdrianPlease let me know if you have not received the message.
Tue Jan 15
Mon Jan 14
Don't forget to move the file there, first (fromburrowww.cs.indiana.edu% chmod 711 ~ burrowww.cs.indiana.edu% chmod 711 ~/public burrowww.cs.indiana.edu% chmod 644 ~/public/whoa.tar.gz
lab1
).
Links to notes from previous semesters: Fall 2001, Spr 2001, Fall 2000, Fall 1999, Fall 1998.
The single most significant set of notes for this semester will be the one from Fall 2001.
Sun Jan 13
Here's where you can download it from (IUB Network ID required).
Sat Jan 12
Fri Jan 11
Thu Jan 10
A348/A548