Thursday, 25 February 2016

Week 6: Assignment Due and Beginning of Recursion

After a few big coding sessions our simulation file ran! All was working with the events_small.txt file, but there were a few ride collisions in the events.txt file. Most of them were issues with the events.py file or dispatcher class not updating things properly. After all of that was working I noticed that one ride was not occurring. A few hours of debugging later and can you guess what error I was having? The most common one... an off by one error in the monitor class. Once that was fixed it was smooth sailing and the code is now uploaded on markus. I learned a lot about class design and abstracting functions to different files. It certainly made debugging a lot easier.

Along with the assignment, class lecture has just started explaining recursion and all the wonderful things it can do. It's hard to think about at first, but writing it out as base case and thinking about depth, assuming the level before it works makes things a lot simpler. I'm excited to see all of the new things that I can do with recursion that I previously could not do with just loops. This class just keeps getting better!

Tuesday, 9 February 2016

Week 5: Mid Term and the start of Assignment 1

This weekend my partner and I spent several hours starting assignment 1. This is the second time we have worked together on an a CS assignment and we already have a good work flow. The first class we had to write was location and it was a pleasure to write. The first thing we did was write the documentation and make some client code to test out class. Then we filled in the methods which all worked on the first try except for the issue of making a new location with coordinates of "3" and "4". This error was quickly fixed by adding a cast to int in the row, col call. The other files that we worked on went in a similar way and I started to feel that the assignment was doable. The best part of doing the assignment was after when we started to review for the mid term, most of the stuff we had been doing was review for the mid term!

Instead of having three hours of lecture this week, we will only have two because of the first mid term. This will cover everything from class design, to stacks and queues, and possibly some linked lists. Due to all the course material being online, studying is relatively straight forward and I am pretty confident on all of the topics. I guess we will see how I feel about this after the mid term!

Wednesday, 3 February 2016

Week 4: Linked Lists and more!

It's been over a year since I last did linked lists but it's coming back to me. Last time I did it in C so it was a little more confusing. Python makes it very easy to create a node object and a linked list. The more implementations of linked lists I see, the more useful it seems. The example in class make it very easy to make a queue. To pop the stack just take the front node and change the front pointer to point to the front nodes next value. In class we learned how to represent these ideas visually and it's surprising how much faster it is to code when you can look at a drawing of the end result. This is not surprising because the same result is achieved when writing the documentation first, something I know a lot of people don't do. I used to be like that but csc108's emphasis on doc strings caused me to change.

The other looming thing in this course is the first assignment. I have been reading it over and thinking of how I will implement each feature. To avoid wasting a lot of time on simple mistakes I have found a partner. Having a partner is great because sometimes a fresh set of eyes will catch a simple bug that would have taken hours to debug alone. So far the course has been very enjoyable and I am looking forward to next week of lectures.