This page does not represent the most current semester of this course; it is present merely as an archive.
In the real world, it is uncommon to be able to write code and then walk away from it. This PA is a set of modifications to make to your finished product from PA02.
The testing team has created a set of test cases they use to see if your code works properly. These tests will be automatically re-run every day sometime between 2pm and 3pm, and will check your most recent submission when they run. Per typical quality assurance practices, they will neither tell you their specific test cases nor promise not to add additional tests without warning. This withheld information should help you avoid over-fitting your code to their specific tests.
Your code should pass every test they have1. If you cannot pass every test by the deadline, add a description of what your code cannot do to the README
.
Note that if you submitted a file you don’t want, there is currently no way to remove it. However, you can upload an empty file with the same name to remove it from what happens.
Code reviews will occur after PA03 closes. To prepare for these
Ensure there are no warnings2 when compiling. To put this another way, adding -Wall -Werror
to your Makefile
’s CFLAGS
should not prevent compilation.
Use the following style:
{
on the previous line and }
on a line by itself(
if and only if it is preceded by a control construct (e.g., if (
but translate(
)++
or --
unless part of an expression that uses the return value (such as a[i++]
). Replacing with either prefix ++
or += 1
is OK.#define
constantstypedef
such that each type name uses a single identifier (e.g., no unsigned char
except as part of a typedef
).Use variable names that indicate the meaning of the contents of the variable; function names that indicate the purpose of the function; etc.
Have a readable code organization; as rough (not strict) guidelines,
switch
with simple code in the case
s.Have in-code documentation inside a comment beginning /**
or ///
immediately before each non-trivial function. Ensure all non-documentation comments use //
or /*
instead.
Prepare your code for delivery. In particular,
Adjust your Makefile
to have, as its default target, libmlpt.a
, a library with exported symbols including the three defined in mlpt.h
and not including main
.
A typical command might look like
The default (what happens if you just type make
) is the first target in the Makefile.
To use a library file like this, you’d add to your LDFLAGS two flags:
-L.
means “look for library files in the current directory”-lmlpt
means “look for library files libmlpt.a
or libmplt.so
”Write a README
explaining (at a minimum)
config.h
, with some guidance on how to pick values for that file.posix_memalign
, which cannot work without virtual memory already being in place.You are encouraged to add additional detail, such as
Include a LICENSE
file with the license agreement under which you provide your code to us. This should be based on an existing family of license agreements, and must be one that requires attribution so that if some future student obtains your code it is illegal for them to submit it, or a significant subset of it, as their own.
If anyone or any resource helped your implementation, include an ACKNOWLEDGEMENTS
file acknowledging those people and/or resources.
Include a file named licenses.txt
in which you list at least three licenses you considered; a short (sentence or two) summary of what they seemed to say; and why you chose to or not to use each as your license.
Your review should include at least three licenses, including
All should be software licenses; this excludes licenses such as the various CC licenses for creative works, the SIL Open Font License, operating system licenses, etc.
Your boss sent you an email:
I made the mistake of telling someone there was no de-allocate available and now we’re supposed to “see about adding it.” I tried to say this was harder than it sounded, but wasn’t able to convince them on the spot…
See if you can add some kind of de-allocate interface. If so, add it to
mlpt.h
and document how it is used. If, as I suspect, it is trickier than it sounds, include some explanation of what complicates it to theREADME
instead of implementing it.Sorry about this.
If you want to understand the real world a bit better, you might also try writing a manual page. These are written in a language known as “roff”; to see an example of what this looks like, try running
to see the roff source of the manual page man 3p poll
. I don’t personally know anyone who writes roff by hand; generally it is output from a source-code processing tool like doxygen
3 or a converter like pandoc
4 from an easier-to-write format like markdown or reStrucuredText.
Including man page page_allocate.3.gz
and translate.3.gz
in your submission will earn you kudos. To test that these work properly,
create a directory man3
(i.e., mkdir man3
)
gzip the roff
file and move it to man3/term_to_look_up.3.gz
(e.g., gzip translate.roff; mv translate.roff.gz man3/translate.3.gz
) – note that some authoring tools may do some of this for you
use the -M
flag with man
pointing to the parent directory of man3
(i.e., man -M. 3 translate
)
We recognize this will be harder for some than for others based on how far you started from this goal; to avoid double-jeopardy, we’ll award some of these points for improvement if your PA02 was not awarded full credit.↩
…because you resolved the warnings, not because you disabled them with warning-ignoring #pragma
s or the like. ↩
which is installed on department machines; see man doxygen
for more.↩
a very old version (1.3) is installed on the department servers without man support; visit https://pandoc.org/ to get a copy yourself.↩