Monday 30 March 2015

W11: Déjà Vu

Programming is an Art Form That Fights Back

Do I still enjoy creative writing?
Yes.
Do I still want to make the best of everything and give it my all?
Yes.
Do I still sometimes regret not choosing something like art school?
Yes.
Do I still think I am blundering around trying to find my future?
Yes.
Do I still think my group from a2 is awesome?
Yes.
Do I still think programming is an art form that fights back?
Definitely.

Well, that about sums it up.











    Kidding. (Although my answer for every one of those is still true.)
I am still in the same state of attempting to figure my future out- and struggling.
I am still fascinated and impressed by many people's ability to learn and comprehend programming and the aspects of computer science.

    Anyways, I welcome the TA's back and emphasize, that in my opinion, programming is LARGELY learned by "doing". Of course, at first it was, "sweet! free thursdays for me :) ", but soon I realized the importance of the labs and the help provided by the TA's. I learned a lot from my TA during my labs and I relied on the labs as a major part of applying the concepts taught and understanding. Now that the end of the term is closer than ever- with exams starting only a week away, I really have to get through more lists of to-do's and have the material engraved in my mind- or something like that. I struggled with trees and recursion (slightly better now), but linked lists? wth.

    It's not just me though, I see that others have as well. As this fellow slogger has noted, that with practice, trees and recursion begin to feel more routinely, and linked lists just require practice as well. I find that, and I don't think I'm alone in this, computer science just takes a lot of practice and applying the concepts to actually learn. Another classmate, and a friend, has shared similar struggles in this course. In her slog, she mentions discovering the convenience for recursion and how a lot of the time, it's taking the time to think things through and not trying to immediately implement code; as well as drawing diagrams when necessary, pictures can actually really help.

    And yes, programming is an art form that fights back. It's like the Language of Shakespeare, it is its own language and it's probably marvelous and has some majestic features as well. Unfortunately, it's not something everyone can understand easily. I've heard people say that Shakespeare was just some babbling idiot and his works don't make sense, but isn't that me? I've wondered who the creator of python was and wondered if he was sane. I mean when I first looked at code, I thought, wouldn't it just be easier if there was proper grammer? Of course that would probably kill efficiency and possibly be even more complicated to write but what I'm trying to say is, programming is impressive, but it doesn't come easily (at least not to me); if you're really passionate and just love coding, then of course it's brilliant- but to me, it's like trying to understand Shakespeare for some people.


Sunday 22 March 2015

W10: Getting there? Or....

    Well, isn't it wonderful that the sun has come out, the sky is beautifully blue and the birds are chirping? Despite the fact that the TA's have been on strike and that I have been a little behind in my labs, I can't believe we're so far into the semester. The strike has been a little frustrating as we have not been provided with the help I find extremely beneficial during labs and I have not taken it upon myself, unlike this fellow classmate, https://taylorluntslog.wordpress.com/2015/02/26/week-7-one-way-or-another-im-gonna-find-you/, who has taken it upon himself to learn the material by himself and not be completely dependent on the profs. I can't believe that we only have less than two weeks really, before it's finals.

  • we talked about devising tests for subtract square, which we did examples for. Examples with diagrams which made it a little clearer to follow.
  • the assert statement in python, which is used to insert assertions into programs for debugging
  • unittest and test cases, which I remember doing in 108. Unittest was explained fairly well in the textbook we used for 108, Practical Programming: An Introduction to Computer Science Using Python 3; the examples were easy to understand as well as the guidelines on their structures.
  • Assignment 3 has been released and we've talked quite a bit about that; as there are two options for us on how we would like to complete the assignment. Both of which Prof. Heap went over in lecture. Due very very soon. Eeeeek! 

    Sometimes, as the end of the semester nears, I feel relieved and terrified at the same time. I feel like csc148 was a bit of a jump from csc108 and sometimes I'm afraid I haven't completely made it or that everyone else is successful while I'm still trying to find my way.
©Alex Kuo
That's all I have to say for now.

Saturday 14 March 2015

W9: Ode to 148

The anxiety rattling my nerves,
all weekend, and on monday too.
On tuesday was my 165 test,
and 148 on wednesday; how could I not be stressed?
Exams so soon, how could this be true.

And then the weekend was over,
and monday came too soon.
Oh proofs, if only I knew what to do.
And 148, please give me a clue-
I prayed as I looked at the beautiful moon.

In psych I could not sit still,
I could not focus and my mind wandered.
I thought about the test of 165,
as I waited for 2:00 to arrive.
About university and life I pondered.

Right after handing in the test,
for a question, I thought of a better solution.
No time to dwell on that though-
I just hope the mark won't be too low.
Now time to review about code execution.

Tuesday afternoon I was quite busy.
Studying had to be put off till a bit later,
but trust me, computer science is no jest.
So I ALWAYS try my best,
too bad there's always someone greater.

And so the studying began,
or I guess it would deemed procrastination by then.
The reviewing of labs, and binary trees,
that I had to open my window to allow for a cool breeze.
I really needed to be quite zen.

Linked Lists?
Where do I even begin.
Probably at self.front,
walking through the list, continuing the hunt
until I reach self.back, or West Berlin?

Binary trees, bst's and linked lists,
up until 3:00, "studying"/writing my aid sheet.
If only I could do really well, 
but I started getting tired, that I could tell.
I dreamt I did well, if that was real, wouldn't it be sweet.

Wednesday morning, I was very nervous.
Then it was time, and I made it through. 
I think I understood, 
can't say for sure if I did good, 
but for now, I bid you adieu.

Friday 6 March 2015

W8: Programming is an Art Form That Fights Back

It's past midnight so technically it's Sunday morning and I'm doing a bit of relaxing which means my slogging.
My recollection of this past week?

  • CSC148 ASSIGNMENT #2 DEADLINE: MARCH 05, 10PM
  • CSC165 ASSIGNMENT #2 DEADLINE: MARCH 06, 11:59PM
and then...
  • CSC165 TERM TEST #2: MARCH 10 during tutorial time
  • CSC148 TERM TEST #2: MARCH 11 during lecture time

    Well of course those weren't/aren't the only things on my mind but a large amount of last week was dedicated to working on csc148 a2. Organizing times to meet and work on the assignment with my group and still get other stuff in my life done. As soon as a2 was out, I read over the handout several times, then I started brainstorming. Over reading week I started writing but then I got stuck and didn't have anyone to discuss it with- so my next move was to look for a group to work with. Luckily, bingo! I found one! They weren't free until after reading week but I felt relieved that we could get started soon.

    Once we actually met up and started discussing and writing, everything seemed to be right on track. (I'm the sort of person that actually NEEDS to use an agenda, write and plan things out, and have a schedule). My teammates were wonderful! (They are still wonderful people!) I really enjoyed working with my teammates and new friends, Julia and Fiona, because there was so much interaction and discussion. In the past, I've worked on projects with people that barely communicate but still manage to get the task done- that's not bad, but I'm just not that type of person. I need to discuss and work on it together (if I'm in a group) to learn. I think we met up almost everyday for a couple of hours to work on it; I think meeting up helps us stay focused (or at least it helps me. I know if I were at my apartment I would probably get distracted, and if I got stuck I would probably take a nap or go do something else and then come back to it later- maybe even hours later...).

    Some of a2 was kind of confusing and took a while to figure out and understand but we made good progress each day I believe. I think I actually learned quite a bit about OOP in general just because of all the discussion we had for this assignment. When errors occurred or questions were raised, we all tried to help each other as best we could and it worked out fairly well.

    There wasn't too much to modify/add in game_view.py so that was done pretty quickly, as well as tippy_move.py. It did help me in that we were given starter code for subtract square, and some things were fairly similar so we could refer back to the examples for subtract square. tippy_game_state.py and strategy_minimax.py  was definitely more work, but it makes sense according to the break down of marks. Minimax though, we first had to understand what it was supposed to do, and to do that, we imagined it working with subtract square first, a simpler game. As well as for methods we were unsure for this game Tippy, we experimented first with subtract square to get a basic understanding before moving along.

    I won't go into many more details about how we worked on a2 but I surely did find it a productive week, especially with the help of my team! :) The midterm is coming up and I am nervous but as mentioned in this fellow classmates' slog: https://juliaslog.wordpress.com/2015/03/01/getting-it-together-an-attempt/, I need to go through my list of "to-do's" and get some studying done. Also, I didn't manage to finish the lab because I got stuck, which definitely means I need to go back and understand. I was also planning to go back and finish it but with a2 and everything else, I simply haven't had the chance :p

    In regards to my post title, I have always been more of an artistic person, this computer science I am doing right now has been a bit of a surprise to my family and friends as well as myself. I look at it as a sort of challenge to take on and find it kind of fascinating at the same time. Programming is kind of a struggle from time to time with certain concepts; I also think of it as something abstract and artistic, it has it's own beauty. It's pretty amazing what a little bit of code can actually do or represent. Sometimes I do regret not choosing something more artsy, but you never know :p I haven't exactly "discovered" my path yet, but I'm hoping I will soon. As for now, I accept these challenges presented before me and am determined to make the best of these opportunities and experiences and to gain from them! :)

    I also do enjoy creative writing from time to time and I've heard, 
"Like punning, programming is a play on words."


Sunday 1 March 2015

W7: Summary of Recursion

Have you heard of the butterfly dream?
A man dreaming of being a butterfly dreaming about being a man, dreaming about of being a butterfly dreaming about being a man....

Sometimes I think recursion is a beautiful thing, in a sense, artistic-
but art doesn't always need to be understood; therefore, recursion doesn't need to be understood right?
"Recursion is too deep for me, so I'll just admire it from afar".
 Not exactly.

I've talked about recursion quite a bit already, in the second part of week four's post:
http://ak148slogaddress.blogspot.ca/2015/02/w4-its-week-four.html
as well as touching on it in week five:
http://ak148slogaddress.blogspot.ca/2015/02/w5-re-re-re-re-cursion-recap.html

Now, I know I've said this before but for those of you that don't know,

People often joke, that in order to understand recursion,
you must first understand recursion. 

    So far, I think we've spent a fair bit of time on recursion, I'm not complaining- I find it rather helpful actually. The topic was first introduced in week four; we mostly tried to understand how it worked, tracing and tracing and tracing code. Continuous practice of tracing recursion helped me understand, not completely, I'll admit, but the gist of it. After the midterm, we started writing a bit of recursion and then we learned about trees- no, not maple, not cherry, not birch, not oaks or pines, but binary.
But before we talk about recursion and binary trees, we need to know some terminology.
  • root: the topmost node with no incoming edges. In this case, 8.
  • node: represented by a number in this binary tree (8, 3, 10, 1, 6, 14, 4, 7, 13). 
All nodes are one of the following:
leaf (children): node with no children (no outgoing edges). In this diagram, 1, 4, 7, and 13 are leaves. Also distinguished by left and right child, a parent (node 6) has a left child (node 4) and a right child (node 7).
internal node (parent nodes): node with one or more children. In this diagram, 3, 6, 10 and 14 are internal nodes.
  • edges: indicated by all the arrows connecting nodes.
  • subtree: a tree formed by any tree node together with its descendants and the edges leading to them.
  • height:  1 + the maximum path length in a tree. For this binary tree, it's height would be 1 + 4 (the longest path) = 5/ A node also has a height, which is 1 + the maximum path length of the tree rooted at that node.
  • depth: height of the entire tree minus the height of a node. Length of the path from the root to the node. Depth of node 7 is 4, depth of node 14 is 3, depth of node 10 is 2 etc.
    Now, these trees can get quite long, similar to family trees; and because they can get quite long, this is where recursion comes in. Recursion prevents us from having to go through the trees manually, which would probably take quite a long time, and imagine if you screwed up somewhere :p Now these trees have a base case, one that we can predict, manually and does not require recursion. Then, a general case,  one that calls itself and therefore does require recursion.

Here's an example that Danny showed us in lecture:
the if statement, is the base case- if there are no children, return 1. The else statement, then, is the general case- if there are children, go through the tree, count the number of children and return the sum.

    I think recursion is a simple concept, "a method that calls on itself", but learning how to trace and write it requires more patience and practice. Sometimes it's just hard to see what the function does and is therefore difficult to implement into code. I know I definitely need more practice writing the general cases so bye for now!