Friday, February 21, 2014

Week - 6: A1 Completed

It has been a busy week for me with many things to do and exams and to study for. But the highlight of the week has to be completing A1. 
A1 definitely made understand recursion a lot better especially working out a way to solve moving the cheeses over the stool using the most efficient recursive algorithm. What I found to be really helpful in solving recursion problems is to visually see it happening. It showed patterns and insight to figuring out the solution.
The concept of trees was a fairly simple concept to understand. On the other hand, unit-testing is still a bit difficult for me code out. I still keep on referring back to previous labs and like looking up the API on how to use certain methods in the class unittest. I think I just need a bit more practice on it especially considering its on the first term test.

Sunday, February 9, 2014

Week 5 - A1

A1 is finally near completion with just the doc strings left which personally, are the most annoying things to write because its so much writing. But it pales in comparison to the amount of work it took to finish everything else. One of the most annoying parts was getting the GUIController to work because I had to spend several hours debugging. I'm not sure exactly what I changed, but somehow after changing like 3 things, everything worked. I'm still trying to figure out what I changed to get it to work because there have been so many instances where I literally change one thing and everything works. It feels good that everything work especially the algorithm for A1.

The tour.py algorithm for A1 is really really annoying because when trying to find the algorithm, the tracking of which variables are which gets so confusing especially once you add more and more cheeses. I have been lost in my tracking of the variables as to which one are representing which. I don't know how many papers I have scrunched up and threw away because I got lost. However, after finally not getting lost, the feeling of accomplishment was amazing. It wasn't the best solution, but party darn close. The key to figuring it out for me was keeping track of source, dest, int1 and int2 meticulously. I drew everything out on paper and then bamn, everything made sense. Never under estimate the power of paper and pen. It is your best friend when it comes to recursion and you have to keep track of variables that change. Happy tracking.

Saturday, February 1, 2014

Week 4 - Progress

What is a Function Object?
At first, I was confused too. Wikipedia attempted to explain it with many examples which to me did not help what so ever. In the end, my lab partner finally explained it to me and I got it. As it turns, I was overthinking about it. A function object is just a parameter in a function that refers to another function outside the function containing the parameter. Therefore, you don't have to call the function directly inside the function. It gets passed into the function as a parameter.

Recursion?!?!?!?
This was a fairly simple concept to comprehend, but to implement and fully understand was pretty complicated. It took a far bit of tracing before I began to understanding recursion and what it does. Recursion happens when a function uses itself in the function. I saw how it was really useful in solving problems that was really complicated to do without recursion. Simply put, recursion made solving certain problems really easy.

A1 - Brain Explosion
The assignment is really complicated and for me, really difficult to understand. I found the instructions to be really vague and I'm not really sure where to start exactly. I spent a long time just trying to see how the cheese was moved in 17 steps for only 6 pieces of cheese. Yes, I did spent my Friday night shoveling around 6 pens to try and move them across 4 pieces of paper in 17 steps. However, actually doing the program with real objects, it helped me see what things we need to do and how to do them. An example would be that each of the stools that the cheese goes on is like a stack where can you only take off the most recent one first and so forth. Hopefully a working program will be accomplished by the end of the week with another week left to further improve it.

Tuesday, January 21, 2014

Week 3 - Object Oriented Programming

Object oriented programming is something I have experienced in the past back in high school with Java. Both Java and Python are examples of object oriented programming. In object oriented programming, an object is created that handles both the data and functionality. An object data is not universally acceptable which means that only that object can access it by using a method. Not all objects have the same method. I found this to be difficult at first to learn because sometimes I find myself trying to use a method to access some data on an object that does not support that method. A part, I did find really confusing about object oriented programming was instance. It took me a while to understand that an instance meant creating the object in the program. I was never really sure what about it made it so confusing because now looking back, it was a simple concept. An instance is just creating the object in the program. However, I did find some concepts of object oriented programming such as inheritance. I simply thought about it in biological way. A class is like the parent and all the subclass of the class inherit the attributes and functionality of the parent, but the subclass can be slightly different just like how kids are not always like their parents. Overall, I feel that object oriented programming is a concept that can be grasped and understood easily if you think about it not just in the sense of programming. Some of the ideas/concepts are found in real life.