Monday, February 24, 2014
Week 6
The assignment 1 is due this Thursday and my partner and I are working together on this relatively tough work. We did some tests to test whether our program works fine.
Reading Week is coming soon and I'm happy to have plenty of time to find more interesting things about computer science during the break. I have a plan for this reading week including learning more recursion and doing more practice, and learning some new programming language such as objective-C and Java...
We learned some new things about "Tree" although we have already encountered binary tree problem in one of the previous lab. Apart from some terminology of trees, we learned how to implement different methods to, for example, count the leaves, nodes and so on. It requires quite a bit thoughts and a good understanding about recursion.
I find labs really helpful. I can not only meet challenging problems and discuss with my fellows, but also make friends at the same time!
Anyway, I love programming:)It makes me feel alive~
Thursday, February 13, 2014
Week 5
This week is for ASSIGNMENT ONE!!!!
I spent many hours working on the assignment.
I found the lab for this week is very challenging and needs quite a bit of thought, especially those extra problems. But it helps me understand recursion better.
We basically learned recursion and function scopes this week. And I found the explanation of the assignment 1 by our professor is very useful.
Anyway, I have to make more efforts in order to achieve a better understanding about python programming.
Here, I'm sharing my code of the extra problems for this week's lab.
I'm not sure about the correctness about my code, so if any of you find there's something that needs improving, please leave a comment! Thanks a lot!
Here, I'm sharing my code of the extra problems for this week's lab.
I'm not sure about the correctness about my code, so if any of you find there's something that needs improving, please leave a comment! Thanks a lot!
Tuesday, February 4, 2014
Week 4
This week, we mainly learned recursion and some applications.
It firstly seemed to be magic because the function can call itself recursively as if it is already defined. But as I learned more about it, I found that it just execute many times until it gets a return value and it will put its return value to the last step until all the steps have been accomplished. It needs base class to tell when to stop.
I can understand most of the examples of recursion functions but I still have some difficulties in writing my own recursion functions. I found tracing the recursion is very useful in understanding it.
I have read the handout for assignment 1 but I haven't started coding yet.
I hope I can finally understand recursion fully.
It firstly seemed to be magic because the function can call itself recursively as if it is already defined. But as I learned more about it, I found that it just execute many times until it gets a return value and it will put its return value to the last step until all the steps have been accomplished. It needs base class to tell when to stop.
I can understand most of the examples of recursion functions but I still have some difficulties in writing my own recursion functions. I found tracing the recursion is very useful in understanding it.
I have read the handout for assignment 1 but I haven't started coding yet.
I hope I can finally understand recursion fully.
Wednesday, January 22, 2014
Week3: Object oriented programming
So far, we have been learning object oriented programming for 3 weeks and it gives me a feeling that object oriented programming is revealing a much more colorful world of programming for all of us. And there are so many new stuffs to learn and to think about. We no longer depend on and learn from the weekly video lectures which have limited time and material in it, but are supposed to read more professional articles and discover those sometimes confusing but useful methods on the Internet on our own. This can be not only very challenging but frustrating as well, because every time I read those articles, I can't wholly understand them, and I feel like it's still a long way to go to become a professional and experienced programmer.
During the 3-week studying about OOP, I find two things quite interesting. One is that almost everything in Python is an object. For example, we can do many things with "list", because any list is an object from maybe "List Class", and those methods are defined inside this class. Therefore, every object has its own memory address. An interesting analogy about class is "Human Class". We are all different object of "Human" class. We have names, which are the attributes of the objects from this class, and we also have "methods" such as eating and drinking, which may result in the change of our weights and heights that are attributes of this class. The other interesting thing is that there is inheritance among classes. Every class inherits automatically from "object" class, which has many special methods in it such as "__init__", ""__eq__"". And we can also override those old methods without changing any code from the parent class. What's more, we can use the built-in function super() to call the methods in the parent class any time we like, which gives us much freedom. However, I think we lack practice about class inheritance and I hope we will encounter problems about it in the assignments.
During the 3-week studying about OOP, I find two things quite interesting. One is that almost everything in Python is an object. For example, we can do many things with "list", because any list is an object from maybe "List Class", and those methods are defined inside this class. Therefore, every object has its own memory address. An interesting analogy about class is "Human Class". We are all different object of "Human" class. We have names, which are the attributes of the objects from this class, and we also have "methods" such as eating and drinking, which may result in the change of our weights and heights that are attributes of this class. The other interesting thing is that there is inheritance among classes. Every class inherits automatically from "object" class, which has many special methods in it such as "__init__", ""__eq__"". And we can also override those old methods without changing any code from the parent class. What's more, we can use the built-in function super() to call the methods in the parent class any time we like, which gives us much freedom. However, I think we lack practice about class inheritance and I hope we will encounter problems about it in the assignments.
Subscribe to:
Posts (Atom)


