|
[ This content is protected and may not be shared, uploaded, or distributed. ]
(Please also check out PA2 FAQ.) Lab 5 has four parts:
Part A (lab5a) - INI file parser (useful for PA2):Typically, a networking server can be configured to run with various parameters. It can be very cumbersome to specify these parameters using commandline arguments. Instead, a configuration file is typically used to specify these parameters. On Windows, there is file format known as the Windows INI File Format that can be used for such a purpose. We will use configuration files in a restricted form of this format for many labs and programming assignments in this class (starting with this lab and PA2). In this part of the lab exercise, you will write a simple parser to extract information out of such a configuration file. Part B (lab5b) - logging (useful for PA2):In PA2, you will need to log information into either a log file or cout. You should use the same code to write log information into either a lot file or cout. This part of the lab shows you a way to do that. Part C (lab5c) - hash file content with MD5 (useful for PA2):Some students are not used to read from a binary file or writing binary data. The purpose of this lab exercise is to get comfortable with read/writing binary data. We will also learn how to create a "MD5 hash/checksum" of a "stream" of binary data. A sender can append a "MD5 hash" of a stream of data after the data is sent. The receive can compute the "MD5 hash" of the received data and compare it against the "MD5 hash" at the end of the data stream to see if some bits/bytes in the data have been accidentically modified/dropped. This is quite often done in the Internet as part of the process of "message authentication" (although a secret "key" is usually added to the mix). Part D (lab5d) - text-based animation (useful for PA2):This part has no coding (although you have to modify the "Makefile" you used in Part C of this lab). Please do the following:
The above specificiation has quite a lot of details! So, pseudo-code for the code you need to write is not provided.
Below is the grading breakdown:
Please keep in mind that even though lab grading is "light", it doesn't mean that you can just put anything into your submission! It's still your responsibility to make sure that the files in your submission contains information that's relevant to the tests you were supposed to run. Use the "more" command to view your script/log files to make sure that they contain the right information. If a file has the wrong stuff in it, you should delete it and create the file again and verify. If most of the stuff in your script/log files are wrong and you did not notice it, we will most likely have to take points off.
To submit your work, you must first tar all the files you want to submit into a tarball and
gzip it to create a gzipped tarfile named "lab5.tar.gz".
Then you upload "lab5.tar.gz" to our Bistro submission server.
Change into the "lab5" directory you have created above and enter the following command to create your submission file "lab5.tar.gz" (if you don't have any ".h" files, don't include "*.h*" at the end):
tar cvzf lab5.tar.gz lab5*.script Makefile *.c* *.h*
ls -l lab5.tar.gz
The last command shows you how big the created "lab5.tar.gz" file is.
If "lab5.tar.gz" is larger than 1MB in size, the submission server will not accept it.
If you use an IDE, the IDE may put your source code in subdirectories. In that case, you need to modify the commands above so that you include ALL the necessary source files and subdirectories (and don't include any binary files) ane make sure that your code can be compiled without the IDE since the grader is not allowed to use an IDE to compile your code. You should read the output of the above commands carefully to make sure that "lab5.tar.gz" is created properly. If you don't understand the output of the above commands, you need to learn how to read it! It's your responsibility to ensure that "lab5.tar.gz" is created properly. To check the content of "lab5.tar.gz", you can use the following command:
tar tvf lab5.tar.gz
Please read the output of the above command carefully to see what files were included in "lab5.tar.gz"
and what are their file sizes and make sure that they make sense.
Please enter your USC e-mail address and your submission PIN below. Then click on the Browse button and locate and select your submission file (i.e., "lab5.tar.gz"). Then click on the Upload button to submit your "lab5.tar.gz". (Be careful what you click! Do NOT submit the wrong file!) If you see an error message, please read the dialogbox carefully and fix what needs to be fixed and repeat the procedure. If you don't know your submission PIN, please visit this web site to have your PIN e-mailed to your USC e-mail address. When this web page was last loaded, the time at the submission server at merlot.usc.edu was 27Nov2025-18:59:34. Reload this web page to see the current time on merlot.usc.edu. If the command is executed successfully and if everything checks out, a ticket will be issued to you to let you know "what" and "when" your submission made it to the Bistro server. The next web page you see would display such a ticket and the ticket should look like the sample shown in the submission web page (of course, the actual text would be different, but the format should be similar). Make sure you follow the Verify Your Ticket instructions to verify the SHA1 hash of your submission to make sure what you did not accidentally submit the wrong file. Also, an e-mail (showing the ticket) will be sent to your USC e-mail address. Please read the ticket carefully to know exactly "what" and "when" your submission made it to the Bistro server. If there are problems, please contact the instructor. It is extreme important that you also verify your submission after you have submitted "lab5.tar.gz" electronically to make sure that every you have submitted is everything you wanted us to grade. If you don't verify your submission and you ended up submit the wrong files, please understand that due to our fairness policy, there's absolutely nothing we can do.
Finally, please be familiar with the Electronic Submission Guidelines
and information on the bsubmit web page.
|