Sunday, 5 April 2015

WEEK 12 ~ Review, Review, Review

     With exams only days away it's easy for me to get overwhelmed with all that I need to study for. It is stressful to think that we are not allowed to have any aid sheet during the final exam because I have become quite used to having one around when doing my labs and assignments, and most importantly when writing the midterms. It's easy to think that memorizing everything is the only way I can pass but, without an aid sheet, I am sure that the final exam will be much more focused on coding that shows our conceptual understanding, as it should. Personally, I do like that format of the midterms and I wouldn't mind being tested in that same way (of course with much more time than just 50min!). I am so glad that our exam for this course is at the end of the month because I need all the time I can get to review, review, review!

     I mainly need to study recursion and binary trees because I think dedicating my time to those two topics will help me improve my coding in other topics like sorting and mutation.

     We were told that the if we have a strong grasp of the type of coding needed to understand and complete all the labs then we have what it takes to do well on the final. I think I could have worked harder during the lab period and have better results on my quizzes that I did poorly on (because we could not finish the labs on time). I cannot afford a low mark for this final and I must work hard throughout this month. I made a study plan for working on the labs each week (doing as much as I can) and then starting to review the exams a week before the final. My idea is that if I practice throughout the month I'll be better at remembering the methods I can use for new problems, rather than reviewing it all in one sitting. My exams for other courses are not back to back so I have chance to make this study method work!

    All the best to everyone!

Saturday, 28 March 2015

WEEK 11 ~ Looking Back...

     


   
     One more week and we are done! In the past ten weeks we have covered these topics:

1. Abstract Data Types (i.e. general concepts of built-in functions, methods, graphs, queues, stalks.)
2. Classes and Subclasses (i.e.  general concepts of OOP, inheritance, special methods)
3. Test Cases (i.e. doctests, unittests, assertions, raising errors)
4. Intro to Recursion (i.e tracing)
5. Intro to Tree class and methods (i.e. general concepts, BTNodes, implementing recursion)
6. Binary Search Trees (i.e general concepts, inorder/preorder/postorder)
7. BST Mutations (i.e insert and delete methods)
8. LinkedLists (i.e. general concepts, LTNodes, iteration, mutation)
9. Sort methods (i.e. bubble sort, selection sort, insertion sort, quick sort, merge sort)
10. Raising Errors (i.e. NotImplementedError, AssertionError)

     Looking back I realize I know more conceptually than I do when I start implementing it in code (as seen through doing the labs) and this discrepancy has been consistent throughout the term (thus the quote above by Donald Knuth). In fact, I need more practice in a bulk of these topics strictly because of my overconfidence that I understand the concept. Every week I have been telling myself enough practice will help me improve - which it has - but without help on the labs it's been really hard to keep up. My answers differ from the one's in the lab solutions and, often times, from the answers taken up in class. The only advice I have for myself at this point is to continue doing as much as I can alone and then asking for help when I am really stuck.

     Particularly, my biggest problem is still recursion. Between weeks 6 and 7 I thought I had finally nailed recursion after doing the labs and class exercises on my own but as the weeks went on and the BSTs and LinkLists got more complex I started to get stuck on recursion again. I did refresh my knowledge of recursion, trees, and general classes before our second midterm on week 9 - which I had some confidence going into (having made silly coding mistakes here and there) - but without our marks for that test and the last assignment I do not know where I am at. Some of the topics above have been covered in Intro to Programming last semester but this course is a big jump from that.

    I've noticed - from reading other blogs - that I lot of other students have also had a hard time with the assignments as I have and have consequentially spent more time working on the assignments than on lab exercises. It has also been hard for the bulk of us to work without the help our TAs because of the strike, but I still do recognize that a lot of students work together outside of class to get work done. This is something I should consider doing because I've mostly been working alone this term and nevertheless I do see that I improve when I work with others.

     On that note, I'll end off by saying that we are at the last stretch of the course and if there is any good time to make a change in personal work ethics it is right now. It's worrisome to think the course is pretty much over and this last assignment and exam is the my final chance to bring my marks up. Nevertheless, I'm sure we can all do it.

     Cheers

Sunday, 22 March 2015

WEEK 10 ~ Assignment 2 Overview & Assertion

     The second assignment was taken up this week and we were able to see examples on strategy minimax. This helped clarify the bugs we were having trouble with when we were doing the assignment. It did help to take it up in class instead of just the feedback online because other students got to ask questions and share their ideas about their strategies.

     In addition to reviewing the assignment we were also introduced to the assertion which, when used well, can help make coding and debugging easier. We implemented assertion on previous functions which helped show it's practical use to an extent. I will still need some more practice debugging and a bit more clarification on how to implement it before I start the assignment.

     Cheers.

Saturday, 14 March 2015

WEEK 9 ~ BSTs & LinkedLists

     

     Working with BSTs and LinkedLists are actually quite interesting. I noticed from doing the labs that there are many ways for iterating over the same trees and still getting the same results. However, this also means that the order in which the trees are iterated over effects the order of the results. This part was a bit challenging for me when working with BSTs. It was challenging for me to return the nodes of a tree in order from smallest to largest (or vice versa) without using the sort method. The only method I can think of is iterating over the nodes until the smallest is found (and then returning it in a list) and then re-iterating over the tree in the same way until all the nodes are listed from smallest to largest. 

     For LinkedLists it was a tad bit harder than just working with BSTs. This is only because we are working with two classes at the same time; LLNode and LinkedLists. Being able to add in new nodes using LLNode is helpful but I still tend to mix up some of the objects between the two classes (self.value and self.data). 

     Nevertheless, there are so many ways to mutate a LinkedList and I hope to be able to master the techniques shown in class for this week (i.e. insert and delete). 

     Cheers
   
     P.S It's the ultimate Pi Day today!!! 3.14.15 !!!

Friday, 6 March 2015

WEEK 8: Here We Go Again...


     Okay, this week did not go as planned. I hoped to be able to finish my work early and review lecture material so that I can do this week's lab. Unfortunately, that didn't work out. Instead, I gave most of my attention to the latest assignment that was due yesterday. My partner and I didn't meet the assignment requirements thoroughly but we got as much done as we could with the time that was available to us. Next week is the last midterm and and I hope to improve my mark for that.

     Only four more weeks of classes left and I hope to make the best of it. The work is piling up between all my classes so time management is key. First things first, I'll do this week's lab and then start reviewing for the midterm. 

     All the best to those in the same boat as me. Hard work pays off. 

     Cheers

Wednesday, 25 February 2015

WEEK 7: Debrief and Object-Oriented Programming (OOP)



     Success!

     Even a small challenge to overcome is a big step for a beginner programmer like me. I practiced recursion over the break and I finally got the hang of it! It may have taken many, many trials but I can say with some confidence that I understand recursion to some extent now. This week we are going to add on to what we already know using Binary Trees and practice recursion a tad bit more. It always feels like I've fallen behind when I don't finish my lab but I'm making an effort to completing it before the next lab.

     Now on to this week's topic: OOP

     I chose to write about OOP instead of recursion because I want to take this opportunity to step back and analyze for myself exactly what it is about OOP that I know and also to review the aspects of it I didn't fully understand weeks ago (when doing the first assignment). What is an object? What does it mean to be object oriented? These were the first questions I asked on the first day of classes. Here's what I know now:

     In python, all values are individual objects held a specific memory address that stores information and behavior (type of value and operations for it) of that object. So when we call an object we are calling onto the content (information/value) that it's memory address holds (unless directed otherwise).

    Within this type of programming we can also create a new class of objects. By creating a new class we can create any type of objects that operate in the way we design it to (with it's own functions, methods and restrictions). Here's an example of how a class is created:

    class ClassName:

           """This creates a new class. Your description of the class goes here."""

           def __init__(self):
                 """ (ClassName, type) -> NoneType
                 This method initializes ClassName with it's required parameters.
                 """
                 # initialize any parameters here.

           def specific_class_function(self):
                 """ (ClassName) -> Value
                  This method uses the argument to return something.
                  """
                  # implement function here based on intended return value and parameters.

use __str__ to create a string method representative of ClassName

use __repr__ to create an official string method representative of ClassName

use  __eq__ to create a method that compares two ClassName objects to see if they are equivalent.

Subclasses are child class of the parent class it takes as it's argument. A subclass inherits everything from the parent class and can also override the functions defined in the parent class.

    class SubclassName(ClassName):

           """This creates a subclass of ClassName. It inherits everything from ClassName."""

           def __init__(self):
                 """ (ClassName) -> NoneType
                  This method initializes SubclassName with it's required parameters.
                  """

Creating new objects can be simple or complicated as you want it to be and this is what makes OOP subjective and useful. The more we learn about OOP the more options we have at our disposal.

Cheers

(If there is any conceptual errors please let me know!)

Friday, 13 February 2015

WEEK 6 ~ Trees and Recursive Functions

     I'm not all too sure what I find more difficult: writing a recursive function or understanding the trees well enough to write the correct recursive function.

     The latest lab exercise on trees seemed simple at first but got pretty difficult the more we worked at it. My partner and I could not pass all the doctests no matter what we tried. Some code will pass more tests then the others but it was hard to tell if we were on the right track or if it was just worked under specific circumstances. It started to get frustrating which only made it harder. This weekend I'm going to try to finish up the lab exercise and ask for some hints from peers along the way.

     The new assignment requires us to implement recursion so I'm definitely going to spend some time during this reading week to practice recursion and do some of the extra exercises from the previous labs. As soon as I get through that I'm going to start on the assignment so I have enough time to fix the bugs I'll have in this assignment.

    Cheers

Friday, 6 February 2015

WEEK 5 ~ Midterm1 Done and New Code Tricks

     Our first midterm is over!

     I'd say if there was anything good about having a midterm exam is that it forces us to really take time to understand our work by an early date. Keeps me on track but it also shows me just how much I don't really know that well! I realized as I was writing my aid sheet for the exam that reading new code is much more easier for me than writing my own code in the same way. In fact, I'm still only fluent in the basic for loops and if statements and haven't gotten the idea of implementation of commas yet (i.e. "tuple constructor syntax"). But I'm working on it.

     As for what we are learning in class: tracing  recursion, stack and queues is surprisingly enjoyable. However, as mentioned, it isn't enough to know how to trace it, I need to get better at implementing my recursive functions, stacks and queues.

    On last weeks notes; I'm starting to get the hang of writing classes and subclasses. Making unittests help make sure my code is thorough but creating them is another difficulty for me. However, it might just all be a matter of time and practice. Here's hoping for improvement for next week!

    Cheers

Saturday, 31 January 2015

WEEK 4 ~ Completing Assignment 1 and Midterm Prep

     Assignment 1 is complete!

     The first assignment was to incorporate classes to create a general game view and a program to play the game Subtract A Square. Subtract A Square is a pretty straight forward game and  a simple game to set up but creating classes for it was pretty difficult for me.In the end I could not fix the bugs with my program before the deadline.  Something must have been missing or have gone wonky from my coding because the program would return an error.

    Or maybe it's something basic that I'm overlooking with classes and inheritance. I've only just started programming in September so I'll need to continue looking over my Intro to Programming notes and re-do some practice questions.  I'm definitely going to practice tracing and creating more classes and subclasses to insure I'm on the right track in this course. Good preparation is key to improving on my game(s) for the next assignment!

    Also, our first midterm is this coming Wednesday so I also have to review Recursion and Stacking  and all the other new tricks we are learning to make our programming lives simpler. Can't delay!

     Cheers

Thursday, 22 January 2015

WEEK 3 ~ Why Geeks Need To Know How To Write

     First and foremost, why use a standardized word like "geek"? Here's Google's definition so we're all on the same page:

geek
ɡēk/
noun
informal
plural noun: geeks
  1. 1.
    an unfashionable or socially inept person.

verb
3rd person present: geeks
  1. 1.
    engage in or discuss computer-related tasks obsessively or with great attention to technical detail.

     Oh. Geek. The sort of merge between both verb and noun form of the word. Geeks speak geek. Interesting.

     I made an effort to look up the word "geek" for a reason. Words are the way we communicate and the way we use words can definitely change our understanding. Geeks don't always have to speak geek.

     Geeks need to know how to write just as well as anyone else. Okay, maybe not write just as well but the necessity is just as high as it is for anyone else. Geeks need to be able to express themselves, explain themselves and promote themselves. The ideal way to do this is through writing because writing is, in a sense, communication. Writing is an essential skill that helps sharpen the skills you already have.

     From my own experience, writing has taught me to pay attention to the finer details of the topics I've written about. By doing that it helped me realize the things I didn't yet understand about the topics and how much more I need to know. Alternatively, it gives me a pretty good idea of what I do know best and alternative ways of approaching the same thing.

    Why do students in the Humanities work so hard in improving their writing skills? This is because it is the ideal way that they can communicate their ideas and their understanding of other peoples ideas. If it can't be put into words, meaning can be lost. No one wants to be lopsided (i.e. good at one thing and one thing only), we all want to be well-rounded in terms of our skills. Once you master the art of prose, communication and articulation of your thoughts comes easy as well.

     Primarily, for geeks, it's about finding meaning beyond your work. Let's say you're a geek and you come up with the best program in the world. You want others to see what's so good about it and why it's the best thing around. How can you do that if no one understands your work but you?  When you can make this transfer of knowledge from one form to another you really show your colleagues you know what you're doing and that you are the professional.

     Alternatively, maybe you're not much of a professional. Maybe there's a lot of things you need to improve on. In this case, writing can help bring out what's lacking so that there can be improvements. Whether it's writing for yourself or writing for others, there is nothing wrong in knowing how to write.

    Cheers

~ Welcome ~




 Weekly updates on the computer science journey.