60-100 INDIVIDUAL ASSIGNMENT #3 (Fall 2007)

advertisement
60-100 INDIVIDUAL ASSIGNMENT #4 (Fall 2012)
(Hand-in a typed copy of your sample.html file, and demonstrate your web page(s) on Thursday
11th or Friday 12th October.
The first part of this assignment shows you how to create a web page that has some client/server
functionality and which allows the user to type some text into a box which is then sent to a
remote program which is in your Computer Science server directory which processes the input
and returns a result which is displayed in the web browser.
PART I
You do not need to have your own web server, because the CS compute servers have a web
server which includes files that are located in users’ directories. Therefore, if you create the
appropriate directory, put the right files into that directory, and set the appropriate read
permissions, then you can achieve all of the above.
Rather than starting from scratch, the best way to achieve the above is to copy a set of files from
a directory which Dr. Frost has created, and then modify those files to create your own web page.
If you are used to creating Unix directories etc., you can follow the PART I instructions at the
following URL http://cs.uwindsor.ca/~richard/60_100/indiv_assignments/my_app.html
If you do not have much experience with Unix or web pages, you can use the instructions
below:
1. Begin by creating a file called public_html at the top level of your home directory if
one does not already exist. This can be done by loging onto a CS server in the Java lab (or
by using SSH) and opening a command window. Then type the command: mkdir
public_html
2. Set the permission for the new directory so that others can execute it when accessing it
through the web. To do this type the following at the Unix command line when you are in
your top directory:
chmod
a+rx
public_html
3. Move into the your public_html directory by typing cd public_html
Then copy a folder (directory) from Dr Frost's directory using the following command:
cp -r ~richard/public_html/my_app
my_app
This will create a directory called my_app (in your public_html directory) with files
in it, including the source file for this web page "my_app.htm"
4. Change the file permissions so that all files in your my_app directory can be read and
executed by others through the web. One way to do this is to go into your my_app
directory and then issue the following Unix command:
chmod
a+rx
*
(if you want to create the file at home and upload using SSH then you can change
permission by clicking on each file, choosing properties and then checking all of the
boxes for read (left hand side) and execute (right hand side).
5. Now go into your my_app directory and go through all of the files (except the
my_app.xml file) and change all instances of “richard” to your University of
Windsor userid. Make sure that you do not miss any. NOTE that if you use SSH you
must make sure that you add cgi and jsgf to the transfer mode settings as you did for
the m extension for Miranda files. If you do not do this, the files will be corrupted when
you drag them over to the server through the SSH file transfer window. Ask one of the
Graduate Assistants to help if you get stuck.
6. Now you can test your web page by opening any web browser on any computer, and
directing the browser to the following page: (note the ~)
http://cs.uwindsor.ca/~your_user_id/my_app/my_app.htm
(Note the ~) where your_user_id is your own user login name. Notice that
my_app/my_app.htm takes you to your my_app directory and then executes your
my_app.htm file.
7. Try typing hello into the box and clicking on the send to interpreter button.
8. Change the contents of the my_app.htm file to contain your own information. Maybe
add a link to a Wikipedia page of your own interest. Refresh your browser to see the new
contents of your web page.
9. Change the Miranda program file my_app.m
different answers to inputs such as hello etc.
so that the “interpreter” program gives
PART II (Difficult – try your best)
Follow the instruction in PART II of the following web page to add a speech interface to your
web application:
http://cs.uwindsor.ca/~richard/60_100/indiv_assignments/my_app.html
Download