2015年3月31日星期二

slogs for week 11: revisit previous slogs.

I revisit the slog for week 8. I mentioned that I had struggled with doing assignment 2 and especially described the details modification of "current_score" function. I made a complaint that this assignment costed me large amount of time because I adjusted the code for almost half a day due to just one mistake. I even said in the slogs for week 9 that I am frightened when I am debugging.

However, when I finished the assignment 3 this week, I realized that searching the problems I met in the website could help a lot because many people provided a solution to your questions online. In fact, for the assignment 3, we didn't know how to control the number of characters under 80 meanwhile passing the doctest.It seemed that there would be another half day to think about this question. At this time, my classmates reminded me that I could search "normalize white space" on the Internet. When I did as he said, I found it really helpful and there was a explicit solution to my question on the website. Therefore, I was aware that I probably could not solve this problem if I think by myself. Through this issue, I deeply understand that I should know the importance of looking for help on the Internet. This approach is convenient and effective.

Through this experience, my "debugging" phobia has been somehow relieved. This is the major change of my thought. Previously I regarded debug as a miserable experience. But for now, as I have got some approaches, I feel much more confident when I am debugging.

The last but not the least, when I am doing assignments with my partner, his mind affects me a lot and many ideas he came up with is really instructive. As he has enriched experience in coding JAVA and C, I learned a lot by working with him. Usually, he could answer almost all my questions and broaden my horizon. For now, I have studied many techniques and tricks which are not introduced in csc108 and csc148 about python. Hence, I feel really grateful to my partner and I am really satisfied with the process of learning csc148 this semester.   

  

         

2015年3月30日星期一

slogs for week 10

For this week, not many materials introduced in the lecture. The "assertion" is not a strange thing for me because such "assert except..." statement is already used in the solution of previous labs. So for this week, there is not much work load.

In addition, I find assignment 3 easier than the two previous assignments because I have already thought about the questions presented by assignment 3 instruction while I was doing assignment 2. When I was struggling with finishing minimax strategy, I found that minimax is kind of "repetitive" and "redundant". Minimax starts with base case and includes many repetitive cases. In order to avoid double counting, pruning and updating is necessary.

For the lab of this week, debugging is mentioned in the last section. As a matter of fact, I am really scared of debugging because it is really time-consuming and sometimes it is even nearly impossible to find the bug.Therefore, when I take programming course, I am always worried about the coding homework. In the coming summer vacation and next semester, I will focus on improving coding skills and doing more exercise so that I could overcome "debugging" phobia.

In conclusion, this week I can have a rest in studying csc148. However, coding practice is continuing.

 
   

2015年3月18日星期三

slogs for week 9: Term test 2

For this week, the only task is taking Term Test 2. I spent three full days preparing for this test from Sunday to Tuesday because I must improve my recursion coding skills. 

I prepared for this test mainly by doing previous labs. There are still many questions I have not solved. Initially, just as I mentioned in the last slog, I could not handle the recursion problem fluently and I must thoroughly trace the function otherwise I cannot come up with a solution. However, when I asked a second-year student for a solution, he could always quickly solve the questions, which really shocked me. I asked him how I can figure out the solution as quickly as possible. He said "You don't need to trace the recursion. You just need to think about one tree or plus a sub-tree. To put it another way, you can solve most recursion problems within one or two steps." After three-day practice, I finally comprehend his words. Furthermore, in csc240 course, I have learned the proof of recursive algorithm at the same time. Under the guidance of this course, I found that recursion in mathematical expression is induction. Therefore, I grasped the key to recursion. Every time when I solve a recursion, I only need to think about the equivalent induction. Induction is the reason why we only need to take one or two recursive steps into consideration. It just simply repeats same calls every time. So we are only required to find different complete cases for each time.

Luckily, I got a good test on Wednesday. As most coding problems in the exam are variant versions of lab questions, I solved all of them rapidly.  

      

slogs for week 8: linkedlist and assignment 2

This week, we have learned a new data structure --- linked list. Generally speaking, this data structure is not related to recursion. As linked list is a linear structure, it is much easier than binary tree structure. For this section, we have learned the new concept --- pointer, aiming at mutating the corresponding linked list.

At the very beginning, I cannot understand what cur_node and lnk.front really are. Sometimes, I am just not able to distinguish them and use them correctly. Fortunately, after doing the lab of this week, I eventually understand what they are and I can solve almost all the questions in this lab.

The most challenging task this week is assignment 2. The minimax strategy is really complicated and we almost gave up when we were designing the program. Finally, thanks to the instructor TA, we finally come up with a solution. In addition, we also met a lot of other difficult challenges when we were testing the program. For example, we modified the "current_score" function for multiple times because it cannot output the correct current score. However, we cannot find the flaw of the algorithm until we changed one variable "self.player" into "self.next_player". By accident, we got the correct version of this algorithm. Based on our modification, we traced the algorithm back and finally knew why we understood the recursion in a false way.In short, this assignment is really hard and really time-consuming.

Now, the next challenging task is coming next week --- term test 2. I feel really diffident because I still cannot handle the recursion problems fluently. In fact, when I am doing a little more complicated recursion problem, I still need to trace the function otherwise I cannot fully understand the question and where I need to modify. Therefore, I must improve my recursion coding skills in few days.

    
 

slogs for week 7: Recursion and object-oriented programming and abstract data structures

Last week, we learned binary tree and binary search tree. Same with week 6, I still cannot finish lab questions,but the good news is my recursion coding skills has improved distinctively. As a result, I am able to use recursion to solve one of the functions in assignment 2 called "current_score".

When I am doing the assignment 2, I get a much deeper understanding of object-oriented programming. In fact, before this assignment, even though professor said a lot about what "object-oriented" is, I still could not grasp the key to this concept. However, after doing this assignment and discussing with fellow students, I could finally be able to simplify this concept. Python and Java is object-oriented languages. When using these two languages, we usually write class such as: class tree, class stack and etc. Especially for Java, we could only write class by using java while python could also accept independent blocks of functions.

CSC148 has introduced multiple simple abstract data structures so far. Tree, binary tree, binary search tree and etc. I especially want to talk about the binary tree in details. Binary tree is a recursive structure, which has a left tree and right tree. Tree-list and class are two effective ways to represent tree structure.



Reference: http://bit.ly/1MLcaEu 

2015年3月2日星期一

slogs for week 6: learning tree structure this week

In this week, professor introduced a new data structure---tree. We learned to use basic recursion coding skills to solve relevant tree questions. When I was doing the lab for week six, I find it hard to solve all of those questions. For me, I could only finish half of the tasks. Therefore, I hope professor or TA could post the solution to all the lab questions.

When it comes to lab, I must say that I think there might be something wrong with the quiz. The quiz requires me to write code for counting leaves of a certain tree. However, the example it provided is probably wrong because one of the value it returned is not the number of leaves. Hence, this problem makes me so confused that I could not find a way to add the "redundant one" to the final result. 

I think tree structure really improved my recursion coding skills. Because it is a kind of application of recursion. However, I am not very confident about this new material because I just cannot finish the lab questions. The level of quiz questions seems more suitable for me (crying). For now, I could only consult fellow students for those questions, but it really makes me struggling and consulting is really time consuming. I hope I can find another way to solve this tricky problem in the coming weeks.

Generally speaking, I learned something interesting and made some enhancement this week.   

2015年2月7日星期六

I have learned much more materials than the first few weeks

Due to two midterm tests on Wednesday's evening, I missed CSC148's lecture for this week. However, I still learned a bunch of new things in the lab.

I remember that professor Danny only mentioned the simple structure of stacks. At that time, I feel really confused and I have no idea about how to use this kind of data structure. Fortunately, in this week's lab, I have learned how to use this data structure to deal with given list and construct given function. In addition, another relevant simple data structure "queue" has been taught in this lab. Interestingly, when I know more about queue, I get to know more about stacks. 

In the second place, I have solved one of my confusion in this lab. When I study csc108, I didn't quite understand what the main function is. In the lab of this week, we are required to write something below " if name = '__main__' " to satisfy given function. By the application of main function, I finally understand what main function is and how to use it.

Last but not the least, I took the first midterm of this course and I felt really bad because I have made a stupid mistake. When I trace the recursion, I didn't pay attention to what the "len" means and I incorrectly deal with the part of "len" method. Honestly speaking, I feel really whiny when I am writing docstring and it is really time consuming during the test. Fortunately, I eventually finish the test right at the end of the last minute.
  
In conclusion, I am really satisfied about this week's study. The midterm test inspires me to keep going and the lab teaches me real thing.    

2015年2月2日星期一

what I have learned this week

Last week I have learned a new tool of coding from the lecture --- the recursion. Based on my personal experience, the recursion problem is easy to understand but hard to code by myself. I really need to practice coding recursion simply because it is hard for me to find the deep structure.

In addition, my first assignment for this course has been completed. I spend a lot of time on finishing this assignment. I think the body function is not the tough one while the interface is pretty a new thing for me and initially I don't know how to deal with it according to professor's instruction. However, while working with my partners, I finally figure out a solution to connect the interface with the game body.

However, I still feel a little bit confused about studying CSC148. For now, I think I have learned how to write a subclass, how to use special method and how to use recursion. Even though I have studied bunch of new things, I still feel frustrated because I haven't done enough exercise to practice them. And that is why I am not confident with taking the first midterm.

In conclusion, a lot of wonderful experience this week. I get to know python program more and more and I really enjoy this process.

2015年1月21日星期三

Why geek should write?

After reading the material provided in the course website, I find that writing is very useful and this skill could help geek in three significant aspects.

(1)Communicate with other programmers:
If a programmer cannot write good description and annotation, it is hard for him to communicate with other programmers because his code is unreadable. Geek usually comes up with some good creative ideas. Thus, it is meaningful that Geek can share their ideas with other programmers. If geek has a good writing skills, he can spread his idea through writing blogs, plans and etc. Just like what Linus Torvalds did for advertising linux. No matter what, writing is one of the four fundamental skills that people should have to communicate with surrounding people.

(2)Write debug journal:
This aspect is not about discussing with other people but talking to ourselves. The most usual thing that a geek often do is doing research or more specifically debugging a program. Many workers mention that writing a debug journal is very helpful when you are struggling with a computer science assignment.Through writing debug journal, we can keep reminding ourselves of where the complex point is and in addition it can help us keep record of the problems we have met before so that we can collect knowledge from actual experience. This is the way a programmer makes progress. Writing debug journal requires us to know how to describe the problem accurately and how to express our idea explicitly. In, short, writing skill is important for a geek programmer to make progress. 

(3)Inspire other co-workers:
If a geek could perfectly express their ideas in a blog and show them to more people, there will be an increasing number of programmers getting benefits from the share. Therefore, writing is one of main ways for geek to interact with the world and improve together with other comrades.

In conclusion, writing is very important and necessary for all the excellent programmers. Start with practicing writing blogs is a good beginning for us.