Week/Date | Lecture contents | Assignment |
---|---|---|
JUL-23 | Course intro
|
|
JUL-30 |
|
|
AUG-06 |
|
|
AUG-13 |
|
|
AUG-20 | (SI) Building tools
|
|
AUG-27 | More programming skills
|
|
SEP-03 | (SI) Typesetting scientific documents using LaTeX | |
SEP-10 | (SI) Preparing presentations using SliTeX and PowerPoint | Mid-semester exams (no homework) |
SEP-17 |
|
Writing macros in TeX and LaTeX |
SEP-24 |
|
|
SEP-29 | Guest lecture by Prof. Joshi about Object-oriented programming | |
OCT-01 | Postponed owing to Query Optimization Workshop | |
OCT-05 17:30 | Java language basics | |
OCT-08 | Java UI, AWT, JFC/Swing, JDBC | |
OCT-15 15:00 |
|
Small Java homework |
OCT-22 | Hand out LaTeX and Java homeworks. | |
OCT-29 | Project status due | |
THE-END | Class project viva/demo | Project report to be typeset in LaTeX and BibTeX |
Simple UNIX commands (read man pages)
- Logging in (rlogin, telnet)Directory commands (cd, pwd, ls, !, ., .., mkdir, rmdir)
- File manipulation (cp, mv, rm, chmod, chown, ln, ln -s)
- File comparison (diff, split, join)
- File display (less, more, cat)
- Printing (lpq, lpr, lprm, lpstat)
- Miscellaneous (echo, date, exec, yes)
- Disk usage (du, df, quota)
Editors (follow links below)
Homepage
Your homepage assignment is due AUG-06. Here are detailed instructions. You can either use a text editor like vi, vim or emacs directly, or use a WYSIWYG editor such as Netscape Composer. Do not crowd your page with too many images! Make sure you have used the following features:
- Three different font sizes
- Three different font types
- Should have atleast three links
- Link to the department homepage
- Two other links of your choice
- Should have atleast two images
- Should have a title
- Should use listing tags like OL, UL, DL
- Create a CGI form. Process the form at the server end using (a) a C program executable and (b) a (bash) shell script.
- Create a table, e.g., that has your timetable for every working day of the week
Samples available!
Check out the GET and POST examples and follow these to create your own. In your case, the form should have a text field to enter a machine name and a user name. Using this, your CGI script should finger the user at the machine and send back the response to the client browser.Do NOT run your own HTTP servers any more. Rony has created a server on port 5901 of Everest. You place your CGI files in /pkgs/apache/otherserver/cgi-bin/<your_user_name> and enable +x on your CGI files, and point to them from HTML files on Surya (see my examples).
Shell scripts
- Write a shell script (any shell of your choice) to exchange the names of the two arguments (called argv in C/C++ languages). They can refer to files or directories.
- Write a shell script to search the given directory recursively and print only those files which have executable permission for all users.
These are due Friday 20th August. Submission instructions will be sent out by me or a TA soon.
The ::= symbol means "may be composed of," the curly braces mean "zero or more occurrences of" and the vertical bar means "either-or." Use a recursive descent parser. (You don't really need to know what that is, but use the Web to search for details if you like.)
If the script is invoked without arguments it should go into interactive
mode, otherwise it should evaluate the expressions passed in the arguments
and exit.
dir1/diary.html dir2/diary1.html dir2/sub5/notes.txt
dir1/sub3/expenses.txt dir1/sub5/sub6/exp.doc |
Note there can be more than two files reported per line. Extra
credit: make this fast.
NNTP-to-SMTP: Write a Perl script that will run as a demon. It is invoked with a list of newsgroup names. Every 24 hours (use a shorter interval for testing) it will wake up and check the newsgroups for new articles with subject lines that match a given regular expression. If such articles are found it will mail the article to a given email address. |
HTTP-to-NNTP: Write a Perl script to watch a specific URL, polling it periodically to see if it has changed. (If the page provides an "Expires" MIME header field, you should use that to schedule the next poll.) If the page has changed, the script should post it to the specified newsgroup. |
public class Main {
protected Other b = null; protected Inner e = null; public Main() { b = new Other(); e = new Inner(); } static public class Inner { public int a = 5; } } |
public class Other {
public Main.Inner c = new Main.Inner(); public Inner d = new Inner(); } class Inner { public double pi = 3.141592653589; } |
As mentioned in class, there is a "parallel" version of make called pmake, which tries to process tasks that do not depend on each other concurrently. As you know from the class, a makefile specifies a workflow dependency as a directed acyclic graph (DAG).
The input to your Perl script will be a directory with a few files in it, and a makefile. The makefile will specify one final target, which will be related to some of the files in the directory using usual rules. To make the target, it will be in general necessary for make to run programs that will create additional files in the directory.
Assume all files and dependencies are restricted to the given directory.
One of the things pmake/make has to do is to compute the subpart of the task DAG that needs to be remade. Use suitable flags with make on Linux, together with a Perl script, to compute the effective task DAG. To clarify further, the effective DAG could be much smaller than the DAG expressed through the makefile, because some intermediate targets are already up-to-date.
Using the UNIX time command, you can estimate how much time each task takes. Based on the DAG and the times estimated for each node, report two things:
Extra credit: submit a one-page write-up giving an algorithm to find the width of the DAG, namely, the largest set of nodes/tasks which can be executed concurrently. You don't have to code up the algorithm.
If you find Perl intolerable for this homework feel free to use C/C++.
\bold{Ready\par Steady\par Go}.TeX has another macro construct called \let. If you say:
Question: Why are there (at least) these two distinct mechanisms to define macros? Is there a significant difference between \let\a=\b and \def\a{\b}?
Question: Suppose you want \bf to print italics and \it to print boldface, for whatever reason. How would you do it?
TeX defines macros for looping constructs as follows:
\loop <loop-condition> <loop-body> \repeatQuestion: Using \loop...\repeat, write a macro called \punishment which, when invoked as
\punishment{I will not take part in trivia quizzes.}{100}will print the first argument once per line as many times as the second argument. To help you, here is some information on creating and manipulating counters and conditions in TeX.
\newcount\n %creates a new counterQuestion: Write a macro \primes which has one argument #1 and will print the first #1 prime numbers.
\n=1 %sets \n to 1
\advance\n by-2 %new value is -1
\newif\ifabc %creates a new condition called abc
\abctrue %sets abc to true
\ifabc \textbf{Now!} \else \emph{Never!} \fi % uses abc
\abcfalse %sets abc to false
As discussed in class, LaTeX uses the .aux file and multiple passes
to connect up references and citations with suitable numbers and labels.
LaTeX emits a warning if it cannot resolve all references correctly in
the current pass, or it has room to suspect that one or more of its label
resolutions is incorrect. For example, the following LaTeX source has a
forward label reference, and will not resolve in the first pass.
\documentclass{article}
\begin{document} \section{Introduction} \label{intro}
\section{Conclusion} \label{concl}
\end{document} |
If you view the .dvi file after one pass, it will have question marks where reference numbers are supposed to be. If you run LaTeX a second time, all labels will be replaced by correct numbers, and LaTeX won't complain any more.
Question: Write and invoke a macro \dupelatex which will prevent LaTeX from ever correctly cross-referencing your submission .tex file, no matter how many times it is run. (There is good reason why LaTeX does not automatically reinvoke itself even though all references are not resolved properly.) Your source may either leave unresolved labels (question marks) or incorrectly resolved labels (wrong numbering). We prefer that you produce the second problem.
Please typeset all your answers in one LaTeX source file and submit that. This homework is due Monday 27 Sept. If LaTeX throws up an error you won't get any points.
General suggestion: On your Linux machine, search for .tex, .cls, and .sty files using the UNIX find command in /usr/share and /usr/lib. Use these to learn from example.