Sunday, 5 April 2015

Slog 10

This course had a lot of ups and downs throughout the semester.  At the beginning I felt confident about the material.  Taking CSC108 before this course was a major help in understanding the first concepts that we did and to get through the first test.  Once the basic things were out of the way things definitely started to pick up with recursion and trees/linked lists.  These concepts were obviously new to me and understanding them was a challenge. This course helped me to gain more confidence in myself in not just computer science but in my life.  The extra work I had to do to understand some concepts as well as further revision of previous work really helped me gain better study habits.  The teachers were always there for help whenever anyone needed it and the fact that they stayed after class to answer questions everyday was a major help to everyone.  The assignments were a good way to practice teamwork and I especially loved having three people in a group to divide the work out more evenly and take some pressure off everyone.  I feel like my group worked really well together and we became closer during the semester.  The tests were very balanced in terms of the difficulty of the questions.  They were all fair and there was never a time in which I felt like the questions were not a good way of testing the knowledge of the certain subject.  With the TA strike happening the professors really stepped up in keeping the course going and trying to make things easier for us.  When there were tutorials the time spent in them was very helpful and really made life a little easier.  Overall this course prepared me very well for upcoming courses and I have a positive attitude to everything that we have done and the amazing job the TA's and professors did for all of us.

Saturday, 28 March 2015

Slog 9

The second last week of classes is here and this week we covered some review of assignment 2 and went over some of the classes to discuss the proper implementation as well as talking about assertions.  What I really enjoy about this class is all the review that happens at the beginning of each class.  We review certain concept covered in previous weeks in order to supply a full understanding of the concept.  This was much needed when talking about the assignment 2 functions, especially minimax.  We covered an implementation of minimax as well as discussed the different test cases that prove useful at giving useful information about the class and its functions.  We learned that the validity and quality of the test cases is vital at making sure you have covered everything that could occur in the code and making sure you have suitable code that runs and does what it is supposed to do.  This week we also learned about assertions.  Assertions are things that we know are true within the code and what we assume is true at the start of a function or method.  There are different types of assertions such as assertions that state what we know and assertions to check a type contract.  Assertions prove useful in many ways.  Assertions help with finding bugs, they can point out the existence of of a bug even when there are no symptoms as well as locating the actual bug within the code.  Assertions also communicate important things about your code.  When writing down what must be true at certain points and what you expect to happen, this can point out errors or bugs within the code.  Assertions prove to be very useful when designing and implementing code.

Slog 8

This week's topic was testing, but more specifically implementing and understanding minimax.  As many of my fellow peers would agree, minimax was a very tough subject and ultimately I was not able to fully implement it in assignment 2.  We struggled with the whole concept and writing the code so this week was really helpful when it came to fully understanding the code for minimax.  With the tutorials still over it was still a struggle at to get all the extra help with understanding the concepts, but ultimately I still feel like I needed this to improve my learning habits outside of school.  The term test also happened this week which I feel like I was pretty prepared for.  Some of the functions for linked lists were tricky and I feel like i could have done a lot better with more studying but that is another lesson learned for the future.  Since the test happened this week there was not much to cover in one lecture.  We went over the methods for BST (binary search trees).  A binary search tree relies on the property of the keys that are smaller than the parent are in the left subtree and the larger ones are on the right.  This image gives an example of a binary search tree:
 ../_images/simpleBST.png


Slog 7

Throughout the entire talk of data structures we have used Python lists to implement the data types presented.  A list is a simple, yet useful way of to provide the programmer with a large variety of options at presenting data types.  Not all programming languages have a list collection so the programmer must implement the list manually using an un-ordered list or linked list.  Linked lists to me was a somewhat easier concept to comprehend than trees.  I learned a linked list is made up of nodes, where each node makes reference to the next one in the list.  A node has a value and a next which takes the value of the next node in the list.  A linked list can be one of two things:

1. An empty list which is represented by None
2. A node that contains a value object and a reference to a linked list

The node class can be written as follows:
class Node:
    def __init__(self, value=None, next=None):
        self.value = value
        self.next  = next

    def __str__(self):
        return str(self.value)

with the __init__ class initializing the value within the node and next that takes on the value of the following node.  The next image helps to really represent what is going on in during a linked list.  As you traverse down the list you obtain a new current value for each node with the next value refereeing to the following node's value.  
../_images/traversal.png

There are many different implementations for a linked list and many different uses for them.

Sunday, 8 March 2015

Slog 6

Week 7 was definitely an eye-opener in this course.  With the introduction of trees and linked lists I quickly began to realize that things have gotten a lot harder.  It took me a while to really understand the concept of a tree and to understand the basis of coding one.  The recursion and multiple steps was a little confusing but I was ultimately able to understand a large portion of what was being introduced.  Assignment 2 was definitely another eye-opener since it was much more challenging then assignment 1.  The implementation of the MiniMax strategy was definitively stretching my capabilities in this course.  My group and I had spent hours upon hours trying to decipher and work around certain parts in order to make the code work.  I enjoyed creating the actual tippy game though because it was an interesting twist from regular tic tac toe.  On another note, not having the tutorial due to the strike really caused me to have to step up in the amount of work I do outside of class.  I usually look forward to going to the tutorials and having the TA there to answer questions, but since there wasn't one I had to resort to a lot more individual learning.  This past week has been tough but I feel like it has helped me gain better habits and be able to expect more challenging concepts that will come ahead.

Monday, 2 March 2015

Slog 5

OOP (Object Oriented Programming) is type of programming that relies upon the use of data structures that contain data, also referred to as objects, and upon methods that is just a series of code that perform different tasks or procedures.  The break down of the basic concepts in OOP is illustrated below:

class( data type definition )
-field (data member)
-method (function member)

object/instance (piece of data)

When defining a class we define a data type composed of a bunch of other pieces of data.  Those pieces of data, those fields, can be any type of data that exists in the language.  When creating a class, the class itself is just a blueprint for creating different pieces of data.  The actual pieces of data themselves are called instances, or more commonly, are called objects.  The other type of data associated with the class are methods.  These methods are the operations for acting upon the data.  When we instantiate a class, the instance gets its own fields that are different from all the other fields of different instances from the same class.  These instances have their own distinct fields, but they share the same methods from the class.  

Classes can inherit from other classes in order to create objects with similar characteristics from all the inherited classes.  Using an OOP approach to programming forces the programmer to place data in an area that can not be easily accessed by the rest of the system.  The data is stored within  the methods and must be called in order to retrieve or modify the data stored in them.   With OOP code can easily be reused again and again in different scenarios to solve problems.

Tuesday, 24 February 2015

Slog 4

OOP (Object Oriented Programming) is type of programming that relies upon the use of data structures that contain data, also referred to as objects, and upon methods that is just a series of code that perform different tasks or procedures.  A major part of OOP is creating different objects that interact with each other and are comparable based on the similar characteristics obtained from methods.  Objects are instances of classes that are assigned their properties from methods and can easily be compared to other similar objects from similar classes.  Classes can inherit from other classes in order to create objects with similar characteristics from all the inherited classes.  Using an OOP approach to programming forces the programmer to place data in an area that can not be easily accessed by the rest of the system.  The data is stored within  the methods and must be called in order to retrieve or modify the data stored in them.   With OOP code can easily be reused again and again in different scenarios to solve problems.