Geek Life
Just another drone in the UofT system.
Tuesday, 7 April 2015
The End.
Is it me or did this term went by really really quickly? I remember my first CSC165 lecture like it was yesterday, although I do think it was due to the strike happening and there was lots of stuff going on with that which really made the term feel super short. I just want to say great job to everyone for making it this far, props to Danny as well for being such an awesome instructor, really a job well done. I guess the toughest part of this course was just recursions, trying to visualize it and implement it was all very tricky. But the lectures, labs, handouts, and assignments all did a great job complementing each other in regards to course material nicely. Looking back, I so much more confident in my programming skills than I was before and that's a really great feeling to have. From classes, subclasses to trees, recursions, and linked lists, this course has been a fun challenge, with a nice progression rate, great continuation from CSC108, and great professors, this course has just been great all around. Also, this course has made me feel more passionate about programming than before, which is funny considering how much I hated computer science in grade 11. I guess this is goodbye, I hope everyone has a great and safe summer and good luck on finals!
Blast from the past
In this post we're gonna take a quick look back at one of my old post and just discuss a few things. So the two posts I'm actually going to talk about is Recursions, recursions.. and Object-Orientated Programming. Now I chose these two posts because really I have learned quite a lot over these few weeks and now with my newfound experience I can see things from a different standpoint.
So first off, in Recursions, recursions.., even though this was a short post, reading back on it I can immediately say that I feel much more confident in handling recursions. And the key to that is lots and lots of practice. And with the Test 2 results back, I can say that recursion is definitely much less daunting than it seem back then, and I'm sure many of my fellow classmates all feel the same way. Reading from a handful of blogs posted, I can tell that if we did Test 1 now we'd all ace it, no problem.
Now, onto Object-Orientated Programming. So the reason why I wanted to talk about this was because how CSC165 has changed my train of thought. I've actually been learning Java on Code Academy and it really is the same as Python considering they are both OOP, and it has been a breeze so far. Creating a game in assignment 1 definitely has me thinking differently. Now, whenever I'm playing a game, I think oh how would this look like in code? It just makes the topic that much more fascinating and I can't wait to learn more about programming so I could really apply these skills in real life and even possibly create a game of my own.
So first off, in Recursions, recursions.., even though this was a short post, reading back on it I can immediately say that I feel much more confident in handling recursions. And the key to that is lots and lots of practice. And with the Test 2 results back, I can say that recursion is definitely much less daunting than it seem back then, and I'm sure many of my fellow classmates all feel the same way. Reading from a handful of blogs posted, I can tell that if we did Test 1 now we'd all ace it, no problem.
Now, onto Object-Orientated Programming. So the reason why I wanted to talk about this was because how CSC165 has changed my train of thought. I've actually been learning Java on Code Academy and it really is the same as Python considering they are both OOP, and it has been a breeze so far. Creating a game in assignment 1 definitely has me thinking differently. Now, whenever I'm playing a game, I think oh how would this look like in code? It just makes the topic that much more fascinating and I can't wait to learn more about programming so I could really apply these skills in real life and even possibly create a game of my own.
Review on Week 9
The week of Binary Search Trees, or BST for short. Well this is basically the Binary Trees that Danny showed us a few classes back with a small twist, where similar to the Binary Trees, there can only be a maximum of 2 children nodes per node. However, the right child node is always larger than the node's value and the left child node is always smaller than the node's value. The only tricky part for this week was the delete function in the BST code due to the many conditions that we have to check. But as Danny said, writing down the steps and illustrations definitely make it a lot simpler to implement the body. Here's the function I was talking about:
As you can see his notes really helps make sense of everything and makes implementing it a breeze.
On a side note, Test 2 was this week and it went really well which is really good news. I hope everyone did as well too. Let's just hope that the final would go as well as this!
As you can see his notes really helps make sense of everything and makes implementing it a breeze.
On a side note, Test 2 was this week and it went really well which is really good news. I hope everyone did as well too. Let's just hope that the final would go as well as this!
Review on week 8
Week 8 is the week of Linked Lists. Now I find linked list not as challenging as recursion was, and still is, to me. You see with linked list, drawing out the chain really helps visualize the function and helps figure out on what needs to be done, from changing the size or setting a new back value, drawing a picture definitely help with making sure nothing is missed. For example:
This really shows where the front is, what the next value is, what the back is and the size! This just shows how illustrating the problem can really help with problems.
However walking along the list can be quite tricky though, if the proper procedure is not carried out, the resulting linked list won't be anywhere near what we really want. But again, I want to say that Danny has been fantastic so far with his explanations, he does a really good job giving us a visual image with his explanation as well as answering questions. Also, he definitely moves at a very comfortable pace, allowing me to easily understand everything. This is what he showed in class:
And now reading this the second time, I find it a lot to understand!
On another note, Assignment 2 was due this week, and the TA's went on strike. Minimax was really tough and without the TA's and the 2 hour lineup for office hours, I'm just glad my group had a working one, albeit not a perfect one. At least Danny said he'd be more lenient so hopefully my group still gets a decent mark. The way I see it, the strike may prove to either a blessing or a curse for us students..
This really shows where the front is, what the next value is, what the back is and the size! This just shows how illustrating the problem can really help with problems.
However walking along the list can be quite tricky though, if the proper procedure is not carried out, the resulting linked list won't be anywhere near what we really want. But again, I want to say that Danny has been fantastic so far with his explanations, he does a really good job giving us a visual image with his explanation as well as answering questions. Also, he definitely moves at a very comfortable pace, allowing me to easily understand everything. This is what he showed in class:
On another note, Assignment 2 was due this week, and the TA's went on strike. Minimax was really tough and without the TA's and the 2 hour lineup for office hours, I'm just glad my group had a working one, albeit not a perfect one. At least Danny said he'd be more lenient so hopefully my group still gets a decent mark. The way I see it, the strike may prove to either a blessing or a curse for us students..
Review on Week 7
Just before reading week, Danny introduced us to trees and drew us one using a Turtle. This week, we go further in depth and really define a tree, from its roots to its leaves. We also defined pre-order, in-order, and post-order search when traversing a tree, which is really straightforward with this illustration:
In-order:
Pre-order:
Now to actually traverse the tree in the code to search for the right nodes or alter them can be very complicated, but it can be done using recursion. Recursion is so simple yet so complex at the same time, like tracing out a tree is so simple to us humans, yet for a computer it can be quite tricky! It does require lots of scribbling and mapping stuff out with pen and paper. I really find the handouts to be useful in helping me understand the lecture material better and it engages me so my mind doesn't wander off. And I think with practice makes perfect and soon recursion would be a piece of cake!
However the lab did seem to be a challenge for me as I got stuck at the second function. I couldn't figure out, for the life of me, how to build a list recursively as my method would pass define the list as empty every time it passes through the function recursively. But after some help from the TA, I finally got it to work and learned something new, which is always great!
In-order:
Post-order:
Pre-order:
Images taken off http://en.wikipedia.org/wiki/Tree_traversal
Now to actually traverse the tree in the code to search for the right nodes or alter them can be very complicated, but it can be done using recursion. Recursion is so simple yet so complex at the same time, like tracing out a tree is so simple to us humans, yet for a computer it can be quite tricky! It does require lots of scribbling and mapping stuff out with pen and paper. I really find the handouts to be useful in helping me understand the lecture material better and it engages me so my mind doesn't wander off. And I think with practice makes perfect and soon recursion would be a piece of cake!
However the lab did seem to be a challenge for me as I got stuck at the second function. I couldn't figure out, for the life of me, how to build a list recursively as my method would pass define the list as empty every time it passes through the function recursively. But after some help from the TA, I finally got it to work and learned something new, which is always great!
Monday, 16 February 2015
Object-Oriented Programming
To start off on this topic, I actually had to do a little research on the definition since I wasn't exactly sure what to write about. Doing a quick search on wiki, I found that object-oriented programming (OOP), is based on data structures, and procedural code, which is our methods and functions. So how OOP works in the grand scheme of it all is the objects are basically pieces of gears that work together. For example, in assignment 1, we had the parent classes which had methods that provided the general structure for different kinds of games and the subclass which inherited the general methods from the parent class and also included the methods for Subtract Square and its AI. And together, they produced a fully functional Subtract Square game. A thing to note is that since the methods in the parent classes aren't specific to any games, it usually passes an exception. This exception allows the parent class to have the general structure without having any procedural code, since you need to have code according to a specific game, which is located in the subclass. Some functions that don't belong to a class are called module-level functions. These type of functions operate independently from any other class but may use functions from other classes. Usually these are helper functions that make our lives easier by implementing these helper functions instead of having to code the same lines over and over again. That's basically what OOP is and I hope to learn about the other OOP languages such as C++ and Java in the future.
Recursions recursions..
Recursions are definitely one of the trickier topics so far in this course. Not only is it hard to keep track of the arguments and parameters as you try to visualize the process, knowing when to implement it is also a challenge in itself. On the test, I lost majority of my marks on the recursion section which is a good indication that I need to brush up on my recursive skills. The labs are quite helpful when it comes to doing so, which I have to pay extra attention to for the next test. Another thing I find really helpful is the handouts that Danny does with us in class. I find that I am able to understand things better via demonstrations or examples shown in class and these handouts also causes me to engage in class and think about the topic at hand. I think with the handouts, labs, and a little bit of review, the next test shouldn't be too much of a challenge!
Subscribe to:
Posts (Atom)




