Skip navigation

Category Archives: Semester 3

Unlike INFS1200, this course was more about being a database administrator than a designer. The first two questions to this assignment were about database design just to test that we still remember how to do it. The last three questions focused on writing PL/SQL (this was done for Oracle) to analyse usage of the database including users, queries, and indexes.

Talk about a deceptively simple assignment. Two parts: implement 'immediate files' and 'encryption'. There were times when a single line of code took hours to research. The lecture content was basically: there exists a VFS and data is stored in blocks. I walked the Linux source tree* down from the open and write system calls through the VFS layer to the block device driver to understand this stuff and it was a lot of fun.

*Linux source (file systems)

By far, the most interesting and most fun assignment I've ever had. The lectures consisted of just about zero information about how to go about this so there was a fair bit of research to do. We had to implement a linux device driver interface to an encryption 'coprocessor'. The driver performs a XOR-based stream cipher since we didn't have special encryption hardware. I decided to make full use of the Linux kernel linked list* and circular buffer* APIs.

*linked list
*circ_buf

To learn about thread scheduling we had to modify the Pth* scheduler to implement fairness across all threads in a single process using a lottery mechanism. The policy to ensure fairness is "fair share with priorities" as described in the design specification. If I were to do this again, I would not use malloc and friends -- they are way too slow for hundreds of tickets.

*Pth

As a warm-up exercise for this class, we had to implement 'ls', 'cp', and 'rm -rf' as built-in commands to a custom shell using direct system calls instead of the C-library. The 'ls' command needed to print its result in a specific way and the 'cp' command wasn't supposed to deal with multiple files or directories.

The "mine environmental management system" I worked on in a team of 6. We came from various backgrounds and three of us were the core programmers (I was one of them). I was the one who chose to use the AppFuse* framework so I had to learn to use it and help the others get acquainted. We wrote most of the documentation together but I worked alone on the System and User manuals so I've linked to them directly here. We didn't win best overall project but I thought we were close.

*AppFuse

The full application and most documentation can be downloaded from the subversion repository

We had to incrementally optimize an algorithm for finding the median k-mer of a DNA sequence. Pseudo-code was given for a naive implementation so I first implemented that. Then, I added the branch-and-bound mechanism which significantly sped things up. Then, I implemented the trie to store k-mers which allowed me to optimize the algorithm to search promising k-mers first which sped things up slightly more. I was worried before submitting because my computer at home was slow and didn't pass tests as quickly as others but when I did it in the lab, it was 3x faster (in a class on algorithms where we talk about big-O, it annoyed me that they gave an absolute time for what we should shoot for). Ended up with 19/20 so I did it mostly right.

This was an easy assignment since I had already written a linked-list in C the semester before and was working through CLRS at the time. The array-based data structures were partially written for us and we needed to fix them to pass the given tests and ensure they will pass any other relevant tests thrown at them. The link-based data structures had to be implemented from scratch, only the interfaces were given.

Follow

Get every new post delivered to your Inbox.