Sunday, March 29, 2015

Revisiting Week 3 Slog of “Why Geeks Should Write?

This is the week 11 of the course and I want to revisit a slog that I wrote on week 3 discussing my opinion on the prompt “why geeks should write?” Back then I agree on that geeks definitely should write because of two main reasons, the first one is that mastering their language skills will be critical for these computer scientists to communicate (subjected related or not related to computer science) with other people in society . Another reason I stated was that refining their language skill can help write better programs by having more concise and clear docstrings and comments. Now at the end of the course, I couldn’t agree more on these reasons and I also developed new rationales why geeks or computer scientists should write.
Throughout the course, one of the things that professor Heap stressed is that he will only look at codes that have proper docstrings in it because it is essential to have it for great coding. Therefore by practicing their writing skills, computer scientists can have better docstrings in their programs, making it much easier for them and other people to keep track of the coding. Refining your writing skills for geeks can also be monumental for those who want to apply for a job in any field. With the summer holiday coming soon, a lot of computer science students will hope to get an internship related to this field and often the employers will want them to write a compelling resume to explain why they are suitable for that particular position. Even though these jobs might be related to programming, the resume still has to be written in proper English and this is why computer scientists should write to make sure their writing skills are adequate.

Throughout the term, I have been reading other student’s slogs and I came across Kristina’s slog in week 3 about “why geeks should write?” (https://kristinamadethis.wordpress.com/2015/01/22/why-should-geeks-write/) She mentioned a great point about geeks should write because they need to record their problems and solution down for the benefits of themselves and others. I completely agree with her on that aspect, I feel like a lot of programming is about problem solving and there are infinite amount of problems related to programming so it is crucial for computer scientists to sit down and clearly record the problem and solution so others or maybe themselves will have a much easier time when this problem arises for them. Ultimately, geeks writing can be beneficial for not only themself but others as well. 

Sunday, March 22, 2015

Week 10 - SLOG

This week, I learned about how to find good test subjects for running unit test. For example, for testing the minimax strategy for the subtract square game, a unittest subject of 11 is worthless as any possible answers would fulfill the minimax requirement so therefore 11 is a terrible choice and would only test that the minimax function would return an int or not. A good unittest subject would be something like 25 where the minimax function should only return 25 as it is the only number that leads to a sure victory, hence eliminating passing the unittest due to randomness.
I really enjoyed doing the devise subtract square tests worksheet in class with professor Heap leading the way to help understand what is a good test case for unittest. The step by step process in the worksheet is a very methodical way for me to learn how to make that judgement. With this worksheet, I definitely speeded up the process of learning how to pick the appropriate test cases for any particular unittest (especially the ones where it is testing functions that has randomness in it) so this is something I really appreciate.
I found the assumption question about linked list that professor Heap raised up in this week’s lecture is difficult to understand. I felt pretty frustrated that I did not really know what the assumption is as I still seem to have difficulty visualizing the whole linked list concept. I asked professor Heap after class for clarification and now I can say I do have a better understanding of this question now.
I am confident in the material covered this week largely thanks to the devise subtract square worksheet and the lecture this well. This methodical teaching method really clicked with me so I feel like I have a good grasp of this week’s material. I do have to say since around 30% of the lecture is introducing assignment 3, there was not whole lot of material that was presented.
I was proud that I know I had the correct answer for the minimax function of assignment 2 as professor Heap presented the model answer of the minimax function and it was pretty similar in terms of the execution. This has to be my biggest achievement tin csc148 his week in a somewhat quite week for this course.

As TAs were again on strike this week, the tutorial was essentially forced to cancel so I only worked on the tutorial on my own during my spare time. I found that the tutorial’s instruction was clear and I was able to follow it to the end. Although I completed it but I still have to look at the answers for this week lab when it’s posted to see if I have the correct answer or not.

Thursday, March 12, 2015

Week 9 SLOG

This week we had our second term test so we only had a 30 minutes lecture. So with a short lecture length, the amount of material learned is minimal. However I still learned about how to write about insert and delete function for Binary Tree.  Insert function is the easier function to implement out of the two, by using the property of binary tree, setting a condition for base case and using recursion, it can be implemented. Delete function is tougher to write as you have to consider every situation and write an if statement for each of this situation with recursion.
Maybe because the lecture is so short this week, we only worked on these two functions and therefore professor Heap worked on it really slowly by drawing diagrams and look at every situation extensively. I really enjoyed this type of slow and methodical teaching as it makes sure the students will be able to absorb these materials slowly and thoroughly.
I found the algorithm of the delete function for binary tree is difficult to visualize and therefore difficult to implement. The list of scenarios to consider for the delete function is really in depth and hence it takes some time to visualize every single one of it. However, thanks to a slow and methodical approach by professor Heap in teaching this function, it eased my frustration in learning this delete function.
I am confident in the material covered this week largely thanks there were simply not a lot of material that was covered due to the term test. The lack of content and the slow and methodical teaching method really clicked with me so I feel like I have a good grasp of this week’s material. However, the delete function is not an easy function to understand and write so I am sure I have to work on it more to fully comprehend.
I was generally proud of how I did in term test 2 as I think I was able to implement the functions requested in the term test without much of a hassle. Most marks of the term test come from the final two questions of this term test and I feel like I am able to provide a correct answer for these 2 questions and I am proud of it.
As TAs were on strike this week, the tutorial was essentially forced to cancel so I only worked on the tutorial on my own during my spare time. I found that the tutorial’s instruction was clear and I was able to follow it to the end. As mentioned above, we had our second term test and I felt it went pretty good. I am confident that I got a correct answer for question 1, 3 and 4 which required me to write recursion functions for binary tree and linked list and understand arity for the class Tree. However question 2 is the most challenging question for me as it asked us to write the order of a post_order search, I did not really know the answer for this question as it was only covered briefly in the lectures.

More on delete function for binary tree, I originally had an issue of not knowing what to do with the helper function find_max. This frustrated me for during the lecture but then I asked professor Heap after the class for clarification and I learned how this helper function works and how it helped to implement the delete function. 

Monday, March 9, 2015

Week 8 SLOG

This week, I learned about Linked list and a special class called LLNode in class. The concept of linked list is absolutely new to me and it is yet another concept that needs recursion for it to function properly, so essentially this week lecture material is again on the major theme of recursion. I learned that linked lists structure is like similar objects linked together through a connection, in the lecture it is presented as self.next for the class LLNode.
I really enjoyed doing the append method for linked list worksheet in class with professor Heap leading the way to help simplify the questions. The step by step process in the worksheet is a very methodical way for me to learn how to visualize this append function. With this worksheet, I definitely speeded up the process of learning and comprehending this special concept of linked list so this is something I really appreciate and hope professor Heap will keep doing in class and he has been doing it for like 4 classes in a row I believe.
I found that implementing the strategy of Minimax in assignment 2 is pretty challenging as the I was having trouble on how to connect the score to a move and what is the correct order in writing that particular recursion function. I am able to solve this issue by going to office hours twice during the week and ask professor Heap for assistance. Although the meeting time was short, I still think the help was monumental as I had a much better idea and concept about the minimax function and how a helper function would assist me in completing this step.
I am slightly confident in the material covered this week largely thanks to the write append method worksheet and the lecture this well. This methodical teaching method really clicked with me so I feel like I have a good grasp of this week’s material. However, linked list is still a new concept for me and I am sure I have to work on it more to fully comprehend it and I need to do it within this week as Term test 2 is coming up soon.
I was very proud of my assignment 2 and I considered it to be my biggest achievements this week. Initially I was having trouble to understand how to properly implement the minimax class and I think I spent like 2-3 hours just going trial and error as I didn’t have a great grasp on how to deal with it as I was not quite sure how to package a score and a move together with a recursion is mostly needed. However through piazza discussion and office hours, I was able to understand minimax and ultimately I think I was able to implement it properly.
As TAs were on strike this week, the tutorial was essentially forced to cancel so I only worked on the tutorial on my own during my spare time. I found that the tutorial’s instruction was clear and I was able to follow it to the end. Although I completed it but I still have to look at the answers for this week lab when it’s posted to see if I have the correct answer or not.

More on Assignment 2, I originally had an issue of not knowing what to do with rough_outcome in Tippy_state as it seems to be very similar to Minimax. This frustrated me for quite some time but then I posted my question on the piazza forum and ask professor Heap for some ideas to solve this issue, I learned that this method is actually meant to be crude and imperfect so this gave me an idea on how to implement it and I am satisfied with the method I implemented for rough_outcome although it took me quite some time and effort to figure it out. 

Sunday, March 1, 2015

Week 6 SLOG

This week we focused more deeply on recursion. A new concept that I learned is class Tree, a class that presents a lot of recursion problem. Tree has a lot of new features and terminology that I learned like node, tree, height, depth etc. This new concept is a classic example of recursion and it helps me further comprehend this subject.
I really enjoyed doing the writing recursion equation worksheet in class with professor Heap leading the way to help simplify the questions. The step by step process in the worksheet is a very methodical way for me to learn how to write recursion equations. With this recursion worksheet, I definitely speed up the process of learning how to write recursion equations so this is something I really appreciate and hope professor Heap will keep doing in class.
I found that the lab is pretty challenging as the class tree can be ambiguous and difficult to visualize so I am having trouble of tracing recursion and writing recursion equation. I am able to solve this issue by asking for help and clarification from the TA and finally able to understand the lab thoroughly. At the end, I felt like I am able to complete the lab quiz with ease thanks my understanding for the lab and lecture material.
I am pretty confident in the material covered this week thanks to the recursion worksheets that did wonder in my ability to understand class Tree and writing recursion equation. The methodical method really clicked with me so I feel like writing recursion equation is no longer a hassle for me and I am implement it in Assignment 2 that was posted this week.
Recursion is a common issue in a lot of academic field especially math and statistics. We sometimes lack the knowledge of the depth of the question but we still have to have an equation to work on it. For example, if I want to do a summation of numbers in a nested list, a recursion can be the best solution to solve these kinds of questions as it will deal with any nested list no matter what the depth of the list is.
I was very proud of my progress in writing recursion equation, a case by case strategy that has really clicked with me. By considering different scenarios of recursions and writing if statements for each of it, I can write a recursion code or at least a code for class Tree.   
I originally had an issue of visualizing the class Tree and how does each variable in __init__ really mean in this particular class. I was able to solve this issue by asking professor Heap for further clarification during the middle break of the lecture and I am now able to visualize how the tree is composed from the variables in the initializing method. 

Friday, February 27, 2015

Week 5 SLOG

This week there was only 1 lecture as the text occupied 1 lecture section so there is not a lot of material covered this week. However, something new that I learned is the important of parenthesization in computer science and it that python is really sensitive to have the perfect parenthesization for the program to work. Sometimes the code is too long and we might not be able to detect an error in parenthesization and the code wouldn’t run because of it, recursion codes can be helpful in these situations to help us detect and correct the parenthesization. Although we didn’t learn exactly how to write that recursion code but I did learn that this is a method to solve this common issue.
I really enjoyed doing the term test this week. I felt the test is really fair by testing the students the exact material covered in the lectures but they didn’t make it too difficult or easy. I felt like I was enjoying doing the test the whole time although this may be attributed to I personally felt like I did well.
I found the lab this week to be a quite challenging as the material covered this week did not go into detail so I was finding myself asking for help from TA a lot during the lab section, but after working on it for 2 hours I was able to complete the lab test with ease.
I am pretty confident in the material covered this week thanks simply not that much material that was covered. I feel like the lab helped cemented my understanding for the material.
I was very proud of my test and I considered it to be my biggest achievements in CSC148 this week. I felt like I didn’t encounter any major difficulty during the test and was able to complete the 3 questions without much hassle. Although I hope there was a little extra time for me to double check my work but overall I am happy and quite confident with how I did in this term test.
Ask, then answer, some questions you had about course content (Explain how you solve the question)

I originally had an issue of not knowing what to do with the queue_list in this week’s lab as I was having trouble understanding how ADT and all the helper functions work. This frustrated me for quite some time so I keep asking the lab TA for clarification and ultimately I am able to understand all of it and complete the lab.

Thursday, February 26, 2015

Week 7 - Thoughts on object-oriented programming

Throughout the course of CSC148, object-oriented programming has been the major theme. Most of codes showed in class or we need to write are based on object-oriented programming. This can be clearly seen in both assignment 1 and assignment 2 as object-oriented programming is a crucial requirement for those two tasks. The diversity of object-oriented programming is significant but the one type that this course is focusing on is class-based , creating new classes and it’s subclasses for different objects. I learned about this class-based coding a little bit in CSC108 but here in CSC148, I am able to fully understand why classes are so essential to coding.

At the first 2 weeks of the course, I was having trouble understanding why classes and subclasses are emphasize in the course as I feel it’s a waste of time by making more python files for different classes. However I now understand that classes are kind of like folders where it groups and organizes similar stuff together. Although I feel this is sort of irrelevant at this stage of my personal coding as my programs are not that sophisticated but I can definitely see how this type of object-oriented programming can be really helpful with a complex program. The way that there is a general parent class that can be really simple but its subclasses have detail coding that follow the parent class closely so all the subclasses are very similar. The inheritance feature of classes is the magic of object-oriented programing where all the subclasses can inherit all the functions from the parent class but it also let the user to override these inherited functions if needed,  this is essential as it still let subclasses to be grouped under its parent class without losing much flexibility when modifying the codes.


Although the organization and grouping that classed-based coding brings is really helpful but I still find that it could be tedious and time consuming to write all codes in this format. At least for the level of programs I am writing right now for this course, I feel like object-oriented programming is unnecessary as the codes do not need new instances or subclasses to make it neater. This means that at this point I feel like object-oriented programming is less efficient for me then regular programming or at least subclasses can be ignored but still be able to complete a program that works as intended.