Wednesday 1 April 2015

Last impressions

Overall I found the course to be fairly easy. Although, I did have to go over a couple hurdles. I really like how quizzes made up ten percent of our grade because they were fairly easy to get perfect on and they forced me to keep myself from falling behind. However, the TA strike did cause a huge hurdle I had to go over. I am a fairly lazy person and unless I have enough incentive to do something I wouldn't do it. So in the case of the lab questions, I barely had any incentive to do them because I was not going to be tested on them and the exam date is pretty late so I could catch up after I'm done my other four exams. But, I thought to myself, after those 4 exams I would probably want to rest for a bit and I might end up wasting a lot of time. Because of this thought, I ended up doing all the labs on time. I am fairly happy about that because I wouldn't have to catch up and I would be able to rest for a while after four of my exams.

Looking back on the first test, I really regret not reading my email. I didn't know that we were allowed to bring a cheat sheet. When I went to the test room I saw that 90 percent of the people in the room had a cheat sheet and I felt so dumb. I lost a couple percent because my syntax for one of my classes weren't on point and a cheat sheet could have prevented that. However, it did teach me a good lesson, to check my emil everyday.

The first assignment was pretty fun. It was nice going away from having to use starter code and be able to be a little more creative. Being able to make a game was pretty cool too, csc108 assignment were pretty being because they were mostly about string manipulation and they weren't challenging.

The second assignment was pretty awesome in my opinion. I never knew how to write a strong strategy that the computer can use. Whenever I wrote a game, the moves that the computer used were always random. Also, assignment two was also the only time I really felt challenged. Having to write minimax using recursion was the only time I couldn't watch Youtube videos while doing an assignment because I had to focus.

Recursion was kind of a hurdle at first, but because there was a format for it and once you write recursive code a couple times it becomes really easy. However, that first hurdle was kind of hard to get by because I didn't really know what to write for the first line, but after a few examples were gone over in class, I got the hang of it. My friend Timothy also had the same troubles as me.

Wednesday 25 March 2015

Revisit

So I will be revisiting my impressions of week 9 slog. Overall, I mostly agree with what I wrote for my week 9 slog. However, I do disagree with my thoughts that linked list was hard and that the cheat sheet was useful.

Firstly, I will be talking about why I disagree about how I thought linked list was hard. It was a fairly simple concept first of all. All you have to know was that there is a front and a back and that the front was a chain of nodes all linked together. To find a specific node all you have to do is write node.nxt and keep checking over each node. I don't know why I had so much trouble with it in the first place. Maybe it was because of how it was taught in class. There was an unnecessary number of diagrams that didn't help at all and in my opinion were counter productive. Also, the TA strike started on the week of the linked list tutorial and because I'm really lazy I waited until the last day to do the tutorial, so that may have made linked lists feel harder than they really are.

Lastly, I'll be talking about how the cheat sheet was mostly useless. While doing the test I didn't refer to my cheat sheet. I only looked at it to check over my test and I didn't make any changes at all, I only confirmed that my answers were right.

My friend Kevin also came to the same conclusion also, he didn't really use the cheat sheet for any of the questions. Although, he didn't really call it a complete waste because the cheat sheet forced him to go over everything all over again and fill up the sheet.

My other friend Timothy disagreed with me on the linked list part. He found it hard because it was harder to visualize than trees. He said that it also contained two objects which also made it a lot more confusing. He also started doing the lab much later than me, so that could have contributed to his experience as well.

Monday 16 March 2015

Impressions of week 9: Test Week!

This week in the lecture, we went over what was going to be covered on the test and a bit of review. First we were told that the test covers week 5-8, which has lass coverage than last year. We were told we were supposed to know the tree definitions, so I went back to the old slides and reviewed the definitions. Also, we were supposed to know the types of traversals. There are three types, which are in-order, pre-order, and post-order. The class was also told we had to know how to write recursive functions on class Tree, so I went over that also. For binary trees were also had to know how to write recursive functions for it too, I also went over that. The last thing the class had to know was linked lists. There was small problem though. I didn't fully understand the concepts for it and it seemed to be pretty hard.

To over come the lack of understanding of linked lists I asked others and checked other slogs, my friend Tim wrote in his slog hat he didn't fully understand it either, but he said that redoing the lab and rereading it can be really helpful. I took his advice and went read over the lab again and re did the questions that I had the most trouble with. In the end it helped a lot and I felt a lot more confident for the upcoming test.

After doing the test, a lot of weight felt like it came off of my shoulders. The test turned out to be a lost easier than I thought it would be and it put me in a good mood! Some of the questions that I expected to be on the test was on it, so I felt well prepared. However, the question about the max and min height of the binary tree kind of threw me off, although I am fairly confident that I got it right, which is a good sign! I was also pretty happy about being able to bring a cheat sheet to the test. It allowed me to confirm that one of my answers were correct.

Friday 13 March 2015

Impressions Of Week 8

On week 8 I learned about linked lists. There are two ways of thinking about linked list structures. The first way is to think of it as lists made of an item and a sub-list. The second way is to think of a linked list as objects with a value and a reference to other similar objects. My way of thinking about it is a train. I think of each section of a train as an object and the head of the train is index zero. First we learned how the node class __init__ method is written. Self.value is the value of the node and self.next is the value of the next node. If we are at the end of the list the value of self.next is None.

We also learned how to write a wrapper class for linked list. The instance variables are self.front; the front of the list, self.back; the back of the list, and self.size; the size of the list. Additionally, we learned that most of the work of special methods is done by the nodes __repr__, __str__, and __eq__. Then, once the special methods are done for the nodes, it’s easy to do them for the entire list.

We were also explained how to write a __contains__ method that checks every node if it has the same value of a specific object. To do that we would have to use a while loop to cycle through all the nodes.

Thursday 5 March 2015

Impressions Of Week 7

During week 7 we learned more about assignment 2. Assignment 2 continues the game-playing framework of assignment 1. It adds a new game and a new strategy.

The new game is Tippy, a variation of Tic Tac Toe. In this variation instead of creating a line, you create a "Z" shape with "X"s or "O"s. In Tic Tac Toe if you play perfectly the game will always end up a tie. However, in Tippy if you go first you are guaranteed to win if you play perfectly and if you go second and your opponent plays perfectly you are guaranteed to lose. In my opinion, this means that it is really easy to test if you made a strong strategy for the game. Because if the strategy loses once when it goes first, it means that it is flawed.

We also learned about the minimax strategy. It is a strong strategy that assumes that both players are rational and have full information about the current game. It looks at the disadvantages of each possible move and selects the one with best outcome.

Finally we learned about rough_outcome. It makes an educated guess at the score without looking ahead of possible future moves. So it checks if you can win in the next move, if your opponent can win in the next move, or neither of the above.

Thursday 26 February 2015

Summary Of Object-Oriented Programming

Over CSC148 so far, I learned a lot of object-oriented programming concepts that I did not learn about in high school and programming on my own time. However, I did learn most of the simpler concepts in CSC108.

Objects are the most basic unit of object oriented programming. Objects are made up of data and functions that operate on data that are bundled as an unit. It is a unique instance of a data structure that's defined by its class. An object comprises class variables, instance variables and methods. A class variable is a variable that is shared by all instances of a class. Class variables are defined in a class. A instance variable is a variable that is defined inside a method and belongs only to the current instance of a class. Both these variables can be used in a method to adjust values and to return values. A method is a function that is defined in a class definition.

Classes were gone over in class too. When you define a class you define the instructions for an object, a python class has exact specifications. Classes may contain variable definitions and methods, or subroutines that can be run by the corresponding object. To create a class you write "class InsertNameHere():" and from there you can add methods to add additional function. The professor also taught inheritance. One of the most useful aspects of object-oriented programming is code re-usability. As it's name suggests inheritance is the process of forming a new class from an existing class that is from the existing class called as base class, new class is formed called as derived class. To declare that we are extending a super class we write "class NewClass(SuperClass):." We can also add methods and attributes to specialize the class. The base class is basically the parent and the derived class is the child.

Thursday 12 February 2015

OOP Concepts

Over this course I learned a lot of object-oriented programming concepts.

Firstly, I will talk about objects. Objects are the basic unit of object oriented programming. Objects are data and function that operate on data that are bundled as an unit.

I learned about classes also. When you define a class you define a blueprint for an object, a python class has exact specifications. Classes may contain variable definitions and methods, or subroutines that can be run by the corresponding object. To create a class you write "class NewClass():" and from there you can add methods.

The class was taught inheritance also. One of the most useful aspects of object-oriented programming is code re-usability. As the name suggests inheritance is the process of forming a new class from an existing class that is from the existing class called as base class, new class is formed called as derived class. To declare that we are extending a super class we write "class NewClass(SuperClass):" we can also add methods and attributes to specialize the class.

I found all of these concepts very interesting and fun to learn.