Monday, April 6, 2015

The Coder: An Unexpected Journey (LOOKING BACK)

(Source: http://www.comicbookbrain.com/hobbit-unexpected-journey.php)

About 3 months ago, I started my journey of CSC148, which is such an experience for me. In this course, I've learnt about object-oriented programming, ADTs and a lot of things.

After learning OOP, I am now able to create objects like shapes, dots, games and tables with Python. It was really excited to have objects with specified characteristics and methods like the property and actions they have in the real world. Also, learning OOP helps me to get ready for the next year's courses.

As for ADT, this really took me some time to get through everything. Queues, stacks, trees (a lot of trees) and linked list, I have to know them from understanding their names, and their name has really labeled out their properties. From learning about ADT, I can store value efficiently in each circumstance. However, I still need to do more practice.

Speaking of practice, labs really helps me to understand contents for each week respectively. After learning the theoretical stuff in lectures, labs give us opportunities to literally work on it, discover it by ourselves. Although there was no more labs after the strike, the lab materials were still posted, so it still helps.

Quiz during labs were not difficult for me, but still, no more after the strike, and I did miss them.

As for assignments, they really took me a lot of efforts, and nights, to finish them. However, by doing assignments, I learnt to communicate with other students, share our ideas. I have to admit that it was tough to understand other people's code, but once I have made it, wow, "That idea is awesome", "So are yours", "let's merge them", and that's how assignments are accomplished. We work together and learn from each other.

After all, I have to say that I love CS. I love CS so much that I'm gonna go along this path.

Week 11: Good to see you again

About 3 months ago a guy called Ajax claimed that CSC148 will be easy to conquer if he understands everything, get all the tricks of the implements. He thought he was smart enough to do so. He thought he was so gifted in computer science that he did not have to put much effort on this course. The time has proved his mistake. And of course, this Ajax guy is myself.

During the last few months of my CSC148 journey, I have witnessed a lot, including object-oriented programming, various abstract data structures and recursion, and that's really a lot of stuff for a started. During the learning, I realized that there is no shortcut, well, shortcuts are for the smart guys, which I'm not. I have to go step by step, memorize everything and understand everything.

However, the CSC148 was of a lot of fun for me, and it's my favorite course of the term. It's a course that I really learnt something from, unlike those hollow, boring courses. It has started my way to the field of computer science, and I'm going along this path.

(Patching up)Week 6: Summary of Object-Oriented Programming concepts

Object-Oriented Programming, AKA OOP, is a concept I've been working on in the first few weeks of the course.

The first time I've heard about this was in high school. However, sadly, I couldn't work on it because the syllabus said no. The first time I apply this concept was in PHY151 course. I was asked to apply a class Ball, with properties including redius, speed, coordinates xyz and mass. It was really excited to set up the first object, feels like I have created a ball inside the computer. The first time I actually learn about OOP and implementing class was in CSC108, which class was used for unittest.

Finally, in CSC148, I could finally work on OOP, basing on the fundamentals I've got in CSC108. After doing the first few classes and labs, I realized that implementing a class is just like set up a set of functions so that clients could generate objects with the code. In the first lab, I was asked to implement a class of race registry. After doing that, I feel just like I'm holding a sheet of table in my had, which I can enroll racers, check information with.

Compared with OOP, what we've done in CSC108 was like 1+1=2 in math, and OOP is the start of my programming journey.

Binary Search Tree: Speeding up the searching

The second midterm of CSC148 has taken place this week. Comparing with T1, T2 seems to be harder to handle, because of the vary of Data Structures are like a water fountain keeps injecting water into my low-capacity head. I'm like eating a meal without chewing, swallowing everything and get stuck when digesting.

Here comes another piece of food: The Binary Search Tree. After the exam, I had a one-hour lecture digging on Binary Search Tree deeper and deeper. In CSC108, after we've done sorting, there was a peek on binary search, which was comparing target with the one in the middle of a sorted list, in order to get rid of half of the useless value.

As for BST, everything are well sorted when they are added to the tree, with the smaller value on the left, and bigger on the right. This inspires me in those recursion functions. After learning BST, I now realized that I can use those if statements to eliminate the steps, like putting a precondition in the very beginning of the code, to prevent the function from running when the value inputted is not eligible, and hence speed up my function.

Sunday, April 5, 2015

How to apply an ADT wisely?

During the last few weeks of the course, I have learnt about several kinds of abstract data structures including Queue, Tree, Binary Tree and Binary Search Tree. This week, I also learnt Linked List. Although it is not so hard to implement these data structures, I always get confused on which data structure to choose in applications.

To solve this problem, I went to a formal CSC148 student and asked for her advice. "Play with them," says she, "It was really cool when you find out it is eligible to link a linked list from the back to the front and create a ring-like list." She also told me that it is very important to understand the properties for each type of data structure. For instance, in BST, the value on the left is always smaller than the node and the value on the right is always bigger. This can be highly efficiency when searching for a typical value in the structure since every time the code makes a comparison, at least half of the useless values are filtered.

So, to choose which data structure to implement, we should understand the usage of the required structure, find out the characteristics of the data, and then choose the right one.

(SUMMARY ON ADT) Some notes on Abstract Data Types

Since taking the CSC148 course, I'm seen several kinds of  data structures, like stack, queues and trees. After taking lectures and lab works, I have learnt to setup these structures and make use of them in the assignment.

I found lots of my friends found it difficult to distinguish between queue and stack, but I am doing it well. Just like the name of these two data structures, queues are like the queues in Starbucks, while, the person in the front leave the queue after taking orders, and the costumers join the queue from the end. The stacks are like like a stack of cards on the table, while people can only pick or add cards from the top. Trees are way easier to understand, it's just like a tree, got data on the branches and nodes, while data grows on it.

Although I have learnt to implement these structures, I am lack of experience on applying it in real-life cases. Sometimes it's hard to decide which of them should be implemented, or how to represent data in these structures. For example, I found Tree is useful in Assignment 2 to represent all those possible moves and results of the game to predict which move is better, but it takes days to work it out, and I'm still working on it. Sad Story.

Sunday, February 22, 2015

Week 5: midterm midterm midterm

This week was tough one. Three of my courses, CSC148, CSC165 and MAT137, have set the midterms in this week.

CSC148 was the first one among the three courses above. At first, I was in panic preparing for it, because this is the first midterm of this course, and I have no idea about what kind of questions will I face to in the test.

Usually, I use past tests a lot when preparing for exams. However, in this course, the past papers are not so helpful, because the previous classes share a different coverage of Test 1 from us, and the categories of questions are quite different as well. Hopefully, I still know that the exam is to test how well do I understand the stuff taught in this course. Then I started to review on the course notes, Lecture slides, handouts, and of course, the lab materials. It was tough though, since I didn't get all the document well organized. Well, the test was not so hard as imagined.

After the test, we've got a lecture about queue. I found lots of my friends found it difficult to distinguish between queue and stack, but I am doing it well. Just like the name of these two data structures, queues are like the queues in Starbucks, while, the person in the front leave the queue after taking orders, and the costumers join the queue from the end. The stacks are like like a stack of cards on the table, while people can only pick or add cards from the top.

By the way, I found out that as a computer science student, Bahen Information Center is my second home for me. ;)