Marks are out!
There will be a series of assignments. We may not be able to assign absolute points for each as they come, but we will try to do this as soon as possible. Grades will be based on these and possibly a viva at the end of the semester. Although IITB does not implement it, an honor code should be in place informally.
There will be no deadline set by the instructor for individual assignments. The final deadline for all assignments will be 2000-11-30. No points will be given for any submission beyond that date. The class and TAs can negotiate deadlines for each assignment as convenient.
This assignment is designed to make you familiar with HTML, PHP3, and stylesheets (CSS). Your design should have:
Your script should be invoked as
./bdiff dir1 dir2Given two directories dir1 and dir2, your script should diff the directories recursively. Directory and file paths found under dir1 but not under dir2 (or vice versa) should be printed as
and changes in files should be detected using cksum and printed as<d dir1/foo34/bar5 >f dir2/bar7/swlab.ppt
dir1/bar7/p329.tex != dir2/bar7/p329.tex
Make your script incremental. It is now run periodically as
./tdiff dirand prints out changes since it was last invoked. To do this your script must save some state to the file /tmp/tdiff.<yourRollNumber>; make the size of this state as small as possible.
Many freeware or shareware sites have a series of forms to fill in to get to the download page, and the downloadable files are not accessible directly; instead they are served upon GETting or POSTing a final form. For large downloads that might timeout, this can be frustrating.
Write a Perl script proxy.pl which acts as a HTTP/FTP proxy between the browser and the upstream connection and records the form filling session and saves it to a named file in any suitable format of your choice. This script is invoked as
if you want to run the local proxy on port 3000. Then you set your browser's proxy to localhost:3000.proxy.pl replay.txt 3000
A second script download.pl then reads a named replay file and replays what is necessary to get the downloadable file(s). When possible, download.pl should fetch only the remaining portion of the downloadable file(s). Additional options involving monitoring progress, timeouts and retries are encouraged.
We will release later a list of 2--3 sites with download specs for testing your scripts.
Study carefully last year's samples: sample.tex, sample.bib, and the output sample.ps. The next assignment handin must be typeset using LaTeX.
Write a discrete event simulator using ANSI C++ classes to make your code simple and small. The scenario being simulated is a bank where customers arrive according to a Poisson process. There is one queue and a number of counters. The customer at the head of the queue is assigned to a free counter uniformly at random. Service time at each counter is exponentially distributed.
Your goal is to implement the simulator in as few lines of (your) C++ code as possible, make it efficient, and experiment with various combination of parameter values (arrival rate, number of queues, service time) and plot average queue length, average waiting time, fraction of time that the queue was bigger than a set threshold, etc.
Your C++ program should output the tables to be plotted in tab- or space- delimited text files. These tables are to be converted to graphs and charts in EPS format using Jgraph or Gnuplot or Excel. Additional pictures may be drawn using Xfig or Powerpoint. The EPS files are to be included in a very short report together with all formulae and pseudocode; typeset this report in LaTeX and turn in the PS file.
Translate the above code to Java and instead of producing EPS graphs and charts, show a direct visual representation of the events in the system as the simulation progresses. Make it an applet so the TAs can visit the page and see the simulation. (Customers and tellers are 5x5 squares.) The TAs should be able to set arrival and service rates using sliders.
In another version, the TAs will fill out an HTML form with the arrival and service rates and submit the form. This should run a servlet which will send back a suitable applet page to do the above.
Check your event simulation code into a version control system. Now change it so that customers who arrive at a queue longer then some given threshold simply leave. Once this code is working check it into the version control system. Give your partner access to the version control data.
Check out the source given to you by your partner. Modify it to have two queues. Arriving customers join the shorter queue (if at all) but do not change queues thereafter. Queues are served alternately. When this version works, check it in and return the code to your partner.
Finally undo only the first change above, i.e., customers always join the shorter queue no matter how long it is. Check in and turn in all files and directories needed to recreate all the revisions of the code.
There are two banks each represented by a relational database with only one table
Write a JDBC application which asks for an ACCOUNT.name at a source bank, an ACCOUNT.name at a destination bank, and an amount. The application then opens two separate java.sql.Connection-s to the two bank databases and attempts the transfer. Insert sleep statements after every statement in your code so that the TAs can kill the application between any two statements, say by pressing control-C. No matter what happens, money should never be created or lost, balance can never become negative, and the program should give an indication of whether it succeeded or failed. You can use Oracle or DB2.ACCOUNT(name, balance).
Note: With a single database and Connection this would be trivial. With multiple databases which may not support a two-phase commit at the JDBC API level, more care may be needed. It is fine to produce a solution specific to this application and/or to use additional tables. Do not use OS locks, files, or devices outside the RDBMS.
Adapt your C++ source and makefiles so that it compiles on both Linux and Windows NT4 without modification. This assignment has been canceled because we cannot provide Windows PCs to each person in the current class.