I’m taking the Coursera course Discrete Optimization. It’s fun and challenging and I doubt I’ll have time to do very well, but I really enjoy this sort of thing. The programming assignments are fun, the lectures are hilarious. (The professor dressed as Indiana Jones and pretended to be literally trying to solve the Knapsack Problem because the temple was collapsing, for example.)
The submission process for programming assignments is pretty straightforward. Basically, you get a file called solver.py
, which you edit so that it returns the answer you want, and then you get a file called submit.py
, which calls solver.py
and sends the answer up to Coursera for grading. Many of the students will either write their solution in place in solver.py
or will call another python file from that one. But the course specifically permits you to write in another language, and then just have solver.py
invoke whatever else you wrote, by calling and executable and reading its output, for example.
Now, I’m trying to learn Rails, and making Rub gems, and Vagrant. I hope you see where this is going. Maybe there will be a prize for most CPU instructions executed in preparation for attempting to solve the homework question.
Here’s my setup:
solver.py
invokes a shell command that spins up a Vagrant box.
- The Vagrantfile, if it’s called in this way, will immediately spin up a rails server on localhost.
- Python will call localhost over http to get the answer to the assignment.
Continue reading “Rube Goldberg Coursera Work” →