DB2 - WS 2015/16 - Assignment 2 (Slotted Page) ============================================== 1) Download the file 'assignment2.zip' and unpack it. 2) Rename nnnnnnn_2.py to matrikel_2.py, such that if your matrikel number is 1234567 the file is named 1234567_2.py ATTENTION: Please stick to the naming convention because your assignments are fetched, processed, and verified automatically. If the file name is incorrect we may miss your assignment. 3) Study the implementation of the slotted page. Our implementation reads the tuples from the input file, and inserts them into a slotted page. We only imitate the slotted page and reduce the problem to maintaining the correct values in the header fields. Input: A text file with tuples represented as strings. Each line in the file consists of one tuple. Output: Details of the slotted page header's fields. Each line consists of a single field's details as a pair of the form 'size:value', where size is the field's size (in bits) and value is the field's value. We assume the following order of the fields: number of entries in the slotted page, pointer to the free space, size of the first tuple, pointer to the first tuple, size of the second tuple, pointer to the second tuple, and so on. Example output for two tuples: 9:2 9:490 9:10 9:502 9:11 9:491 4) Word addressing: Our implementation uses byte addressing and a dense header. The task is to implement word addressing by filling in the body of the method word_scheme. 5) Free space check: Our implementation doesn't verify if the input tuples fit in the slotted page. The task is to add a check constraint which will verify for each processed tuple if it fits in the remaining free space. If not, a message of the following form should be printed to the standard output: 'Tuple 40 does not fit. Exiting!' if 40 is the line number in the input file containing the first tuple that does not fit (line numbers start at 0). You can use sys.exit(0) to exit the program. 6) Submit your solution by sending an email to dbabgabe@cosy.sbg.ac.at with a title DB2:matrikel_2 (for example, if you matrikel number is 1234567 the title should be: DB2:1234567_2) and an attachment matrikel_2.py ATTENTION: The filename and the email title are important. You may fail if you do not stick to the format. If you do not have python installed on your machine, the machines in the computer lab room and the sshstud machine have it installed. You may execute the code with the input by calling cat input2.txt | python nnnnnnn_2.py {byte|word} > output.txt