All the assignments are simple enough to fit a single (flat)
directory, so your TAR (or ZIP) file should not contain directories.
You should include a Makefile or a README file or both. If you use
non-standard libraries make sure to include them in your package and
indicate the appropriate environment settings (e.g.,
CLASSPATH
or LD_LIBRARY_PATH
) in your README
or Makefile. Unless explicitly specified, everything should work in a
clean environment.
Create a chatroom system composed of a server component and a client component. Each user participates in a chatroom conversation with other users by connecting his/her client component to the chatroom server. The communication between a client and the server is implemented through a TCP/IP socket.
The chatroom client works within a normal terminal shell. It reads user's input, line by line, and sends each line of text to the chatroom server. The client also reads lines from the server and prints them on the terminal. The client reads and prints messages from the server asynchronously, that is, independently of user's input.
The chatroom server accepts connections from clients. Multiple clients can be connected to the server at the same time. The server reads lines of text coming from each client's connection and forwards them to every other client. The server forwards client messages as they come in. This means that if a client, say client A, sends a message, the server should not block waiting for another client (B) to produce text before forwarding A's message.
select()
can be used from the C/C++ language to
select input from multiple sources. See the select
manual page.
java.lang.Thread
class.
Create an application httpfetch
that retrieves documents
accessible through HTTP. httpfetch
takes a list of URLs
as parameters, possibly with some selection parameters and an HTTP
proxy address. httpfetch
downloads and saves into the
current working directory every document that matches the selection
criteria. The selection parameters specify a maximum length and/or a
specific MIME type. If no selection parameters are specified,
httpfetch
downloads the documents associated with every
URL passed to it. The syntax of command-line parameters is as follows
(parameters in square brackets are optional):
httpfetch [-proxy URL] [-maxlen num] [-type type] URL [URL ...]
-proxy
URL httpfetch
uses
URL as its HTTP proxy for every HTTP request.
-maxlen
numhttpfetch
downloads only those documents whose Content-Length
is
less than or equal to num.
-type
typehttpfetch
downloads only those documents with a Content-Type
of
type.
Any error reply must be reported to the user. It is not required that
httpfetch
be able to handle the full HTTP protocol. In
particular, it is not necessary that httpfetch
handle
redirection replies (status 3xx). Replies that are not handled or
unknown replies must be reported to the user just like error replies.
httpfetch
is meant to access documents through HTTP
only, therefore it does not need to understand any URL schema other
than http:
. In other words, you don't have to parse
mailto:
, ftp:
or other classes of URLs.
Create a DTD specification for an XML database of musical compact discs. The database consists of album entries. Each album consists of one or more CDs. An album has attributes including author, performer, title, publisher, year, total playing time, etc. Each CD has a set of tracks, each one carrying information such as title, author, performer, playing time, etc. When a track doesn't specify an author or a performer, that track implicitly inherits their values from the album specification. Some tracks may be further divided into movements. The DTD must be sufficiently expressive to model the CDs of this informally structured list.
Rewrite the information contained in the list using the XML format that you
defined (this can be done by hand) and create a program
xmlcd
to read and query such XML
data. xmlcd
. The syntax for xmlcd
is:
xmlcd [-author name] fileIf you do not specify the
-author
option,
xmlcd
reads file and prints its content in some
reasonable plain-text format (see list). If -author
name is specified, then xmlcd
prints only the
tracks authored by name.
Create a virtual auction system using Siena. The virtual auction works very much like a real auction in which sellers present items, with a description and possibly with a starting price, and buyers make their bids. There is no arbiter in this auction, therefore it is the responsibility of sellers to decide when to close the deal and start the monetary transaction with the buyer. Buyers can limit the validity of their bids by specifying a time-out.
The system consists of a seller
program and a
buyer
program. Sellers use the seller
program to:
buyer
program to:
seller = "Joe" item = "s21kj-77-1" category = "music/instruments/guitars" maker = "Paul Reed Smith" model = "Custom" color = "tan" top = "maple" body = "mahogany" year = 1991 conditions = "excellent" price = 3200a buyer might then express interest in something like this:
category = "music/instruments/guitars" maker = "Fender" model = "Telecaster" year < 1970 price < 1500after receiving and evaluating some notifications, the buyer might make an offer like this:
buyer = "Foo" seller = "Joe" item = "314159265" offer = 2150 expires = "Mar 1 2000"at any time, the seller might decide to close the deal on an item with any one of the bidders. To do that, the seller contacts the buyer and sends out an announcement that that item is not available any longer:
seller = "Joe" item = "314159265" closedIt is not required that every communication occur through Siena. For example, in closing the deal, buyers and sellers might exchange e-mail or simply use the telephone. For the purposes of this assignment, we will assume that when the seller closes the auction, the process is finished as far as Siena is concerned.