Saturday, April 4, 2015

Entry 10: Recap of Weeks 11 & 12 + Final Thoughts

     On this final week of classes, I want to share my thoughts on this course as a whole. It began as an introduction to the construction of classes and ended with the Big-Oh of two or more algorithms, which was the main topic of weeks 11 and 12. The transition from CSC108 to this course was very appropriate because that course provided the foundation of the Python programming language. I was expected to be comfortable with every aspect of Python, especially constructing classes. For the most part, I had to issues with the first several weeks of this course. I think the confusion began with the introduction of recursion; I understood the concept, but I was unsure how or when to use it in a problem. Over time, I became more comfortable with recursion and Assignment 3 give me the opportunity to use it effectively.
     The objective of Assignment 3 was to complete a series of functions for a tree class, but the nodes of this tree were made of game states. The root of the tree is the start of a game and the leaves of the tree are the concluding game states of each scenario. Hopefully, the TAs mark this assignment as well as Assignment 2 as soon as possible.




     To conclude, I want to thank Professor Heap for all the work he has done to make this course an utter success. Despite the work stoppage that occurred in the month of March, he remained composed and provided help to many students including myself regarding the assignments as well as the term tests. To all the students of this course, I wish everyone the best of luck on your exams!

Friday, March 27, 2015

Entry 9: Revisiting Entry 1 (Why Do Geeks Need to Know How to Write?)

     Next week is the last week of classes before the start of exam season and here is a reflection of how I changed as a person from the first blog entry. The underlying theme of that post was why geeks need to know how to write. My response to this important question was the only way for one to express his or her feelings is through writing. Throughout the semester, I realized that writing is one part of the bigger picture which is communication. It is virtually impossible for humans to interact with each other without communication. Sometimes, I find myself struggling to transmit my thoughts in words whether it is through writing or speaking. Throughout the year, I have met many wonderful people, all with their own unique traits and characteristics including this student. His response to the question of why geeks should write is on par with my own perspective. He says that working in groups requires collaboration and that can only be accomplished through "proper transmission of ideas which often involve good documentation and commenting". I firmly believe this applies to all areas of education including Computer Science.
      This student believes that working alone has its benefits and drawbacks, but working with others is a skill that must be obtained at an early age. Personally, I do not mind working with myself because I can organize my thoughts and execute the plans that I have in regards to an assignment. However, it would be nice to work with one or two individuals because each member of the group can contribute his/her thoughts and create a hub of information that can be used to devise and execute a plan. The challenge for me is to approach people and not worry about how other people will judge my thoughts. I always run into the habit of thinking about what everyone else might say about me and this has been a part of me since my days in elementary school. As I became older, my mind opened up and I felt increasingly comfortable communicating with others.
     Ever since that blog post was released, I felt increasingly comfortable to approach strangers and communicate to them. I do believe that I am a better person and the weekly blog posts have led me to communicate more to the people I love as well the people I am bound to meet in the near future.
   

Friday, March 20, 2015

Entry 8: Recap of Week 9 - Term Test

     Highlights of this week include the Term Test and a BST function called "insert". Monday's lecture was mainly a review session of content from the past 6 weeks. It was somewhat helpful, but most of my confidence was acquired from the aid sheet. Overall, I think I did okay on that test, but I was a little confused on the last question, which involved the use of recursion. I think I need additional practice with recursion because I have trouble applying the core structure to a particular program. In regards to the insert function, its main objective is to place a new data object in a binary search tree starting from the root. Since it is a binary tree, the new data object is placed according to its value; if it is less than the root, then place it to the left of the root, and vice-versa.
     The function was also applicable to this week's lab and I was able to complete with little or no issues. In regards to the CUPE 3903 Unit 1 Strike, I am unsure if it will end prior to the exam period because it seems both sides have not returned to the bargaining table. Hopefully, the situation will improve in the coming days.

Friday, March 13, 2015

Entry 7: Recap of Week 8 - Linked Lists

This week's main feature focus is the LLNode class; it represents a Linked List, which is a list of nodes connected by one another. This is best visualized with a diagram and Monday's lecture demonstrated that:




The key elements of a Linked List are the front, back and size. The front refers to the first node of a linked list, while the back refers to the last node of a linked list. Size is simply the total number of nodes in a linked list. The process of forming a method involves the same process of an if-else statement. This student mentioned that formulating a method requires an initial base case, followed by recursion. During the Wednesday lecture, Professor Heap spoke about specific methods associated with linked lists; one of them was _contains_. This method simply checks whether a specific node exists in a linked list. This involves scanning through each node of the linked list. I understood this process and had no problems with the other methods, but recursion remains to be a challenge in some cases. Hopefully, more practice strengthens my ability to write recursive methods. 

Saturday, March 7, 2015

Entry 6: Recap of Week 7 & TA Strike

     This week, I learned more about the structure of Assignment 2, including the Minimax strategy, which I struggled since receiving the assignment. The bulk of this week's content was about Trees and the procedures used to search for a specific item within a tree. Professor Heap spoke about three searching methods: Inorder, preorder and postorder. Each of these methods all involve three steps, but these steps are arranged differently. For example, the procedure of the inorder method is the following: search in the left subtree recursively followed by a search in the node, followed by searching in the right subtree recursively. These three steps are performed in the other two methods, but ordered differently. In the postorder method, the current node is checked after recursively checking the left and right subtrees. Below is a visual representation of the three methods:


     In regards to the CUPE 3902 strike, I am worried that this strike might persist throughout the rest of the month, possibly into April. The cancellation of my tutorials seems like a welcoming affair, but the lack of teaching assistance is somewhat a problem for myself. I usually send emails to my teaching assistants regarding specific material about the course, but unfortunately, this cannot continue until the strike is over. Hopefully, the two sides of this strike unite and return to the bargaining table sooner rather than later.

Saturday, February 28, 2015

Entry 5: Object-Oriented Programming (Part 2)

     Last time, I discussed some basic information regarding OOP and how I became fond of the concept. Despite OOP being the most popular system of coding, it has its drawbacks (Keep in mind that these drawbacks are based on information collected from various sources, which will be included at the bottom of this post). First of all, OOP-based programs require more effort because they are more complex, thus, require more planning and preparation prior to coding. Secondly, OOP-based programs have more lines of code, which may lead to reduced application performance. I think these drawbacks are very minor because OOP-based programs require the collaboration of multiple programmers to successfully implement a program. As for the second drawback, this is virtually non-existent on today's systems because they are equipped components that trump the risk of reduced performance. From fast central processing units to solid state drives, all these components covert to a seamless experience, which is shown in the program.


     Recently, I read several blog posts of a few other students and I was surprised by the level of commonality regarding object-oriented programming. One of these posts was written by Alex Kuo and he too wrote about how classes are used to bring the system "together". Another post, written by Timothy Lock, wrote about the Turtle class and how Professor Heap used conventional OOP to use this class for various tasks. As I said in my last post, I already have experience in OOP, particularly with the Java programming language, but I believe I need more practice to become an expert. Hopefully, learning Python can enhance my ability to use OOP.


Saturday, February 14, 2015

Entry 4: Object-Oriented Programming Concepts

     I first encountered object-oriented programming back in high school. Specifically, in Grades 11 & 12, I learned Java and the basics of object-oriented programming. I was a little skeptical about the idea because I was unsure if there were any benefits (or drawbacks) to the idea. My first real encounter of programming was learning Visual Basic back in Grade 10. Essentially, learning that language was the reason I became interested in Computer Science because it was simple and straightforward. It took some time getting used to Java because the structure of developing a program was different compared to Visual Basic. So for the most part, I am familiar with the basic structure of object-oriented programming. 


A Cluster of OOP Languages


     OOP is composed of multiple objects, each containing its own set of data and functions. The advantage to this mode of programming is multiple objects can communicate to each other to perform a specific set of tasks. Visual Basic requires more effort because if an element requires changes, these changes must be made throughout the entire body of code. In my experience with Visual Basic, I created a program that simulates the card game "Black Jack" and it contained nearly 8000 lines of code. I say about 40% of the code was repetitive, which proves the efficiency of OOP. Another advantage to OOP over traditional programming is multiple instances of an object can be made by inheriting its definition. If I have multiple instances of an object and I wanted to modify a specific attribute, I can simply make the changes in its definition and these changes will apply to all the instances of that object. 

     As Professor Heap stated at the beginning of the semester, the most important virtue for first-year students is laziness and OOP perfectly fulfills this goal. 

Friday, February 6, 2015

Entry 3: Week 4 - Recursion & Term-Test

     The main topic of this week is called Recursion. It is essentially breaking up a problem into smaller sub-problems until the problem can be solved immediately with no required steps. At first, it seemed fairly straight-forward, thanks to Professor Heap's example of the function "sum_list". This function takes in a single parameter and if it is a number, the function will simply return that number. However, if it is a list of numbers, it will return the sum of the numbers in that list. Recursion is designed so that if this list of numbers contains a nested list of numbers, the function will break up the list into smaller calculations.
This week's lab was based on tracing the Recursion process of a particular function. I received a mark of 1/2 because I missed the main focus of Recursion which is to break down the function as much as possible. The function was the following:

def ce(L):
     """(list of int) -> int
     """

   
     if isinstance(L, list):

        return sum([ce(x) for x in L])

     else:

        return 1

One of the tracing problems was the following:

Trace ce([15, 5, 3, 32, 19])

My first reaction was to take the sum of all the numbers in the list because according to the function definition, if the argument is a list of integers, it should return the sum of that list. However, I realized upon inspection, I misinterpreted the function definition. If each element in the list is not a list, it will return 1. Therefore, the solution to this problem would be the following:

ce([15, 5, 3, 32, 19]) -> sum([ce(x) for x in [15, 5, 3, 32, 19]])
                       -> sum([1, 1, 1, 1, 1])
                       -> 5

I believe tracing Recursion requires a little more practice and hopefully, I can master this practice in the coming days.

     Another important highlight to note is the term test. It consisted of three questions on Recursion and the construction of classes. It was a fair test and thanks to the extra practice I had with tracing Recursion, I was completely confident on what I wrote in each question. One of my friends (http://jinsooparkcsc148.blogspot.ca/) had problems with tracing Recursion, but I am sure he understands the main idea of it, which is to break down a function into smaller processes. Overall, this week has been the busiest so far this term and according to Professor Heap, he will teach how to code Recursion in the coming weeks.

Friday, January 30, 2015

Entry 2: Recap of Weeks 1-3

     This is course is essentially an extension of CSC108, which I already completed last term. The last few weeks were mainly about classes and its applications. Classes were briefly discussed in CSC108, but that course only mentioned its structure and a few standard methods. This course goes much deeper into the behaviour of classes as well as its applications. I was very familiar with the idea of classes and its characteristics because I created my own Java classes back in high school. The creation and use of Python classes is essentially identical to Java classes, where there is a class definition and a list of class-specific methods. Back when I was introduced to Python classes in CSC108, I was somewhat surprised by the simplicity of Python classes, compared to Java. Aside from classes, Professor Heap discussed recursion in Week 3. Basically, it is a system where a method uses itself within its definition. It took a few examples for me to understand it, but now I am okay with it. 

     A few other fragments of information were also discussed, particularly in Weeks 2 & 3. Prof. Heap discussed abstract data types and testing code with unit test. This is mainly review, since most of this information was lectured in CSC108. So far, this course is off to a great start and I am looking forward to more surprises in the coming weeks. 

Sunday, January 25, 2015

Entry 1: Why Do Geeks Need to Know How to Write?

     After a relatively successful completion of Term 1, I feel that I can finally balance the priorities of school and home with ease. I have conducted many experiments of where and when I should complete my school work; it was a challenge because it seemed that my time to do school work conflicted with other tasks. However, I finally found a balance between the two. As a huge fan of technology, I feel excited when new electronics are released into the market. I always search out the functionality of a product as well as its specifications. I may even consider myself a geek, but regardless, I love technology. 

     To answer the question directly, I think writing is the only form of communication that speaks for oneself. Regardless of whether a person likes or dislikes writing, he or she must know how to express his or her own feelings and thoughts. I consider myself a very shy person and I always resort to writing when I need to express one or more of my thoughts.