Week Two
Did I mention I’m taking Generic Programming and STL alongside of this for fun? Because these past couple of days have been a bit more stressful than fun. While Downing released the projects on Thusday, he didn’t really go over them until Friday, and with Father’s day on Sunday I have already had plans to go home. Thank god I decided to look over the specs one more time when I came home, because I didn’t realize he only gave us 4 days from when he went over the project to when it is due. Not only do I get to have fun cramming one project out, but I get two! Did I mention I’m also taking chem lab with the constant busy work? I’m really starting to miss the two weeks he gave us on Collatz now.
Anyways, enough of that rant. As far as the project goes I really can’t say I’m the biggest fan of TravisCI at the moment. These past couple of days I’ve spent more time trying to understand why TravisCI doesn’t like coverage, numpy, or pydoc. I ended up giving up on pydoc (for now..) and after bashing the .travis.yml file with desperate tweaks here and there I somehow solved the numpy problem (I think?). As for coverage, when I took out the commands from the makefile and put them into .travis.yml I finally got the clues that I needed. Turns out the TravisCI virtual machine isn’t a part of the UT CS network. Hard coding in direct paths meant nothing to Travis, and because it was being run as part of the makefile it didn’t spit out the errors I wanted to see. Oh, and I guess I started on the actual Netflix.py program. Still haven’t gotten to the interesting part since I was too focused on having a good testing base set up, but that’s what tomorrow is for!
Tip of the week
Think you can write some good looking code? Take the ultimate challenge and run it through a lint where so-called experts have come together and written entire documents on the subject! The one for Python is Pylint and installing and using it can be as simple as:
sudo apt-get install pylint
...
pylint my_source_code.py
For some of the more vim-savy people out there there’s also an amazing vim plugin that can run pylint on your current vim buffer every time you write to a file and give you errors/warnings on a line-by-line basis. It’s called Syntastic and I highly recommend it!