Twelfth week

What did you do this past week?

I did a big data assignment in its entirety, which took a lot less time than I originally expected. I also made some good progress on both my AI assignment and the Life assignment.

What will you do next week?

I want to have all of the hackerrank tests for Life passed tomorrow. Then, on Tuesday, I’ll need to put some serious work in to my AI assignment. After that I’m going to go in to work on Wednesday, then enjoy having some time off.

What’s in your way?

Not much, surprisingly enough. I thought my partner and I’s schedules would cause some serious issues for the Life assignment, but so far it has proven to be much easier than I initially anticipated.

What’s my experience of the class?

I really like timing aspect of hackerrank. It shows that you can’t rely on asymptotic complexity alone, especially with the relatively small size of our inputs. Sometimes ‘optimizations’ will make things slower in the long-run. (Note: this may also be because the compiler is magic and knows better than you).

Tip-of-the-week

Been stuck wondering how to test asserts using gtest? I looked in to it today, and found that testing assertions and the like is called ‘death testing’, and can be done with ASSERT_DEATH(thingToCall, regexString) or EXPECT_DEATH(same params).

Note that death testing and valgrind don’t always play nice together as valgrind notices the forked child of the death test’s execution ending. You can silence the output from the child by modifying your makefile to have the flag “–child-silent-after-fork=yes” wherever you call valgrind.

For example:
$(VALGRIND) –child-silent-after-fork=yes ./TestLifeConway

Leave a comment