11.2 2018


  • The test will be from 8:30 to 9:30 on 12th April (IVLE folder will closes at 9:30)

  • This is an open universe test.

  • This, however, does not mean you can copy and paste from any person or any source.

  • You can discuss and share your ideas to help each other. However, in the end, you need to submit Python code that you developed.

  • Please insert comments to give a clear idea as to what you are doing. I.e. what you are trying to do and why.

  • For this test:

    • Simple solutions are preferred over more complicated ones.
    • Readable code is preferred over efficient code.

    Grading Criteria

    The following scheme will be used to grade your solution.

    Component Weight(%) Comment
    Starting strategy 20 This is your plan, before you start.
    Implementation (In Python) 30 This is the strategy you actually implemented. Correct syntax.
    Simplicity of strategy 15
    Readability 15
    Comments 15
    Bonus 5 For an overall simple, readable, exceptional solution.

The Task

  1. Download the zip file data-for-the-test.zip
  2. This contains many .jpg files named in the format random-integer_name-of-person_four-digit-index.txt (e.g. 00374_CHAMMIKA_0042.txt)
  3. There is a set of files for each one of you.
    1. Use Python code to read all the files under your name and reconstruct the image.
    2. Save the image in jpg format with the name name-of-person.jpg
    3. Upload your code and resulting image into the IVLE folder Python Test.
      • Please name your code file in the format matric-number_test.ipynb (or matric-number_test.py)

Outline your strategy.

  • Use a docstring or Markdown to briefly outline your strategy before you start coding. This component is worth 15% of this test.
  • You do not have to stick to this strategy during implementation. Your approach can (and perhaps should) evolve as you attempt to find a solution.

Things to note:

  • Note:

    • The index always starts at zero.
    • The random-integer is a random number. (dah!)
    • Different individuals will have a different number of files.
    • Each file contains a portion of an image.
  • Some commands you might find useful:

    np.concatenate(), sort()