2014年2月17日星期一

csc148 SLOG4

We learnt about binary trees this week. I was somehow familiar with it since I was also learning it in class csc240. It is always a good news to have different classes linked together. Though, I was sometimes confused by the expression. Also, I was still having trouble finding the base cases for recursion functions. 

Assignment was hard for me and exams was filling my week. I had to accept some scarifies. I was unable to find out the best way for the recursion, but at least I finished the three files. Besides, I had great trouble when running GUI files. I was also experiencing the problem like ‘cheese does not have attribution highlight’. I spent hours on it and finally fixed it. Actually my original TOAHModel.py used a different cheese-location storing method. It worked well when I ran it in Python Shell, but not when complementing with GUI. I should have read the hand out carefully. That wasted me a lot of time.

I wasn’t so worried about the lab. My partner and I did well in it. We finished the tasks before class was over. 

2014年2月9日星期日

csc148 SLOG3

    I am now beginning to understand recursion functions. Actually I am doing quite well in this week’s lab. I finished all the tasks in the lab and thought of the optional ones. All I need to improve now is to practice finding the base case for recursion functions. In the lab for example, I did manage to get the code work, and it contains itself as a recursion function, but the base case wasn't separated and instead is aligned with the recursion lines.

    Besides, I am getting used to put adjacent lines into one. For example,
                if x > 1:
                    return True
                else:
                    return False
can be squeezed into one line :
                return True if x>1 else False
That saves a lot of space and is just as easy to read as the longer one.

    
    The problem for me this week is probably understanding assignment 1. And now I am having a hard time with it. I admit I feel a little delighted when seeing the sentence saying that this assignment is challenging. Deadline is approaching. 

2014年2月2日星期日

csc148 SLOG2

    I think I am in the right class. When I was taking csc108 last semester, I thought that coding was easy. Now I find that it isn’t in csc148. Actually it was very challenging. There were always new methods and words popping up in my mind (for example, method isinstance). Sometimes old things got replaced by fresh ones. I should have pointed it out in last week’s SLOG. For example, a new way to represent type contract in docstring is to add a colon after the input variable, and simply write the type contract there. (def something(variable:type)->type). For another, a loop can be written in a single line (//ToDo for x in f(x)). But these are the reasons I am studying.

    We learned more about recursion this week. I remembered the turtle best since it drew something on the screen. Recursion does save time and cut down lengths in programming. Though, it was hard for me to understand a recursion code at a glance.

    Just like last week, I got lost when doing the tutorial task. I almost went crazy when writing the test file. I didn’t finish the lab, but I completed it in my dorm. That drove me crazy again. All that stuck me were those tiny little bugs, like spelling errors or missing a bracket. A very simple mistake could kill my program. I wanted to say it was just because of carelessness. Nonetheless, I knew I wasn’t comprehending the material well. I have to practice more. Also, reviewing is necessary. Sometimes I have to search the previous slides and examples for some knowledge learned. I forget things.