Wednesday, 30 March 2016

Week 11: Revisiting Week 4

My week 4 self thought that the main use of Linked lists was to make stacks and queues easier to implement. I was aware of the problems they could solve, but I didn't have any clue that the data structure related so closely to trees. My views have changed on the infinity capabilities of code. When I wrote the week 4 entry I was also looking ahead to the first assignment. At that point in the semester I did not believe it was possible to write a driving simulation that would have all the events occurring with just one data structure and a few short weeks. Well I ended up surprising myself after writing the first two files things started to build up. The class design recipe made jumping between files incredibly easy. I was able to code over multiple days and not spend too much time trying to figure out what I did. My views on assignments at that time were to work until they were done, then add in documentation and make it pretty. This semester has changed that. Assignment two ended up taking me less time and I understood it a lot better because of the course material.

The second Assignment also was a great example of how the linked list data type that I thought was so powerful could lead into better programs. While we used a tree to hold all the future moves, concepts from searching and drawing out a linked list when writing code were extremely useful in writing both of the solution finding searches. My ability to learn a new concepts and then implement them in code has improved. This course has changed my approach to computer science and coding. No longer do I see a problem and start writing code without a direction. Assignments are a lot less scary when you look through them and don't have to spend more time debugging because everything was preplanned. As I reach the end of CSC148 I feel like my skill as a computer scientist have improved and my overall love of Computer science has increased.

Monday, 21 March 2016

Week 10: Assignment Two

Thursday is the due date of our final assignment for the semester. I am working with my same partner and we have all files but one completed. We had a few issues with thinking ahead of extensions but that was solved by drawing out some pictures and making helper functions for each direction of solutions. (Ex: the mn puzzle, you can move the piece up, down, left, right) Now we are working through the two puzzle tool searches. Depth first search is our current focus and we need to think about how we want to hold the data and return the correct things. After class today I will spend a few hours focusing on it. I am currently on track to finish in the next to days.

This week in class we will be introducing big O and the whole idea of run time. I have some prior knowledge of these concepts from my Harvard CS experience and csc165. Headed into the end of the semester I am having a really good time coding and I am working towards learning all of the class concepts.

Thursday, 17 March 2016

Week 9: Mid term and A2

What a busy week. We had our second mid term on Wednesday and have an assignment do the following Thursday. All of the course content is starting to come together. The earlier weeks of class design are more important now as the amount and complexity of the code increases. Working on assignment two I have noticed that it takes a lot longer to write less lines of code, but that the code does a lot more. Along with the class design, the concepts we have been learning this week in class would not have been possible without the earlier recursion classes. Looking over a binary search tree would be a lot  messier if done without recursion.

Speaking of writing less but doing more, the mid term this week was a lot less writing compared to the first one. With less writing came a lot more thinking. Every question required thinking of different cases and all but one of them had some recursive element. Redoing the labs and looking over previous mid terms gave me a good sense of what to expect so there were no surprises for me on the exam. I was expecting there to be some form of tracing but that did not show up. I thought the mid term was extremely fair and covered the most important class concepts. I look forward to the final concepts of the course and finishing off assignment two.

Wednesday, 9 March 2016

Week 8: Trees

Our skills from last weeks introduction are being put to the test with Trees! What better object to traverse recursively? They have an finite depth, but each tree has a different depth. Each tree node will have children nodes or none. The node will also have some value that we can modify. When writing methods and functions for trees, its the same thought process as recursion. The first case is considering a tree with one node, and the second is considering a node with children.

The in class example this week was writing a method that would evaluate a tree with the outside leaves being numbers and the inner nodes being operations. it was an interesting structure to draw out and then code for. I am starting to see how the trees will be used in assignment 2.

Tuesday, 1 March 2016

Week 7: Recursion

Recursion, a word that for some reason brings up fear in almost all pre 148 computer science students. Well Monday I walked into class to find a worksheet with that dreaded word at the top. I found myself picturing all of the new possibilities with Recursion. I can write code that has a finite depth, without coding for the number of layers. The first example of a list of lists of unknown depth was really interesting. Without recursion I have no idea how to sum up all the elements or do some small search. Now with just a few lines of code I can do way more operations then any mess of nested for loops. Recursion looks a lot cleaner and using the method of solving the base case (depth of 0) and then looking at it for each subsequent depth case made creating recursive code a breeze.

I am not sure if this was planned, but two of my other classes also started recursion at the same time. CSC165 and MAT137 started defining sequences recursively. I must admit that this was overwhelming at first, but the more recursive problems I solve, the more comfortable I become. It's a new way of thinking and requires spending a lot more time per line of code compared to before.

Where is recursion taking me? Assignment two was posted this weekend and it is very obvious that I will be using recursive searching to find future moves for solving puzzles and weather a solution is a still a solutions available. The introduction to recursion has changed the way I approach computer science problems and I look forward to writing more code with it.

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.

Monday, 25 January 2016

Getting into the groove of CSC148

It is week three of my second semester at UofT and I am taking CSC148. In these first few weeks I have noticed a huge difference in structure compared to my first computer science class (CSC108). It is kinda strange not having PCRS to do every week, but tutorials fill that void. Assignment one was just posted and looking at the spec it is a lot less specific compared to CSC108. It no longer explains how to write each function, but instead gives descriptions of classes and what each file should contain. It feels a lot more abstract, before I was just manipulating variables, now I am making networks of classes. Even though it is more challenging, the course material is a lot more interesting and I am having a good time thinking up all of the problems I can solve with it.

CSC148 has already taken classes to a new level. Early on we learned how to make variables private. What a great way to protect users from themselves! The one thing that bugs me about the python language is that if the user wants to work around a private variable, they can. Coming from a Java background this is slightly confusing but I am sure I will get used to it. I'm sure that I will become more comfortable with Python classes as I work my way through the first assignment.