Friday, 4 April 2014

Week 13

This week was relaxing. No labs, simple exercise and only one class that contained new content. The only problem I came across dealt with part B of E4. I tried returning the max value of the BST tree, but the auto marker outputted failures. I changed my code to instead return the max BSTNode; however, the auto marker did not run for me to ensure this is the correct way to complete this exercise. This was fun, I'm out peace.

Sunday, 30 March 2014

Week 12

Test 2 didn't quite go as was planned... I did very poorly.
For the is_plex problem, it was very difficult for me since my is_regex was complicated to begin with, so it was really hard for me to do this question. I had so much code that covered the entire page! For instance I would delete all trailing +'s. As for LinkedLists, I REALLY have to review and completely understand this concept if I plan to do well on the exam.

To boost our self-esteem, this weeks lab was a joke. It consisted of us copying and pasting times into excel. As simple as it was, it proved to be useful because it allowed us to compare the speeds of the different types of sorting. I can conclude that Bubblesort is the slowest, and the build-in sort is the fastest. If I ever have time, I'd want to look into the build-in sort code to see exactly why it is the fastest. That's it that's all folks, see you next time!

Monday, 24 March 2014

Week 11

Assignment 2 is finally completed! In my opinion, the overall difficulty of Assignment 2 was easier than Assignment 1. I managed to write the type contracts without forgetting like last time :).

Labs on the other hand were very difficult and puzzling. I'd say this weeks lab, which combined LinkedLists and binary search tree, was the hardest lab of all of my computer science career. Most of my fellow class mates can agree with me on that one, since the TA had to step in and explain how to do it with full detail.

I'm a bit worried about test 2, since I'm not very comfortable with LinkedLists. I need to use my remaining time before the test to have a better understanding of this concept in order to do well. We'll see how it goes!

Sunday, 16 March 2014

Week 10

Assignment 1 was finally marked... about time!

I was pretty disappointed at my mark since I lost over 8% simply because I did not put type contracts in the doc-strings. A simple thing costed me a chunk of my mark. It's very unfortunate, but I will learn from my mistakes and always include complete doc-strings.

This weeks lab was quite a fascinating way of challenging the minds of computer science students. We were required to find the number of nodes in the tree that was less than a given number. The cool part about it was that we had to code this in multiple ways! 

Regarding Exercise 3, I managed to finish part A correctly, but part B was a different story.
My function instead returned the sum of the values of the path that had the largest sum. This is wrong because I didn't make my function return the sum of the values of the LONGEST path.

Nothing too special this week, but stay tuned for next weeks post, where I discuss Assignment 2 part 2!

Sunday, 9 March 2014

Week 9

This weeks lab was the exact same as last weeks, since it truly was the most difficult lab so far.
It was only after my T.A explained the main idea of how to go about coding (by drawing diagrams of LinkedLists) that my partner and I understood what to do. Although I did not completely fathom the code for Queue, my partner was kind enough to thoroughly explain the code step by step. As a result, I completely understood the lab, so thank you partner!

 Regarding Assignment 2 Part 1, I had difficulty beginning my code, just like I did with Assignment 1.
Once I understood the objective of the assignment, my fingers did their magic with ease.

To the markers of Assignment 1, hurry up! :)

Sunday, 2 March 2014

Week 8

So... the midterm.
It was fair. I understood my errors right after I finished the test. I didn't return the function call in the Palindrome question, nor did I return False as an else.
My T.A didn't lie when she said that this weeks lab would be one of the hardest. LinkedLists can get sort of complicated without the use of recursion. I suppose it will just take more practice and time to fully understand how to manipulate LinkedLists, just like recursion.
Not too much to discuss this week, but expect a lot more next week.

Sunday, 23 February 2014

Week 7

Alright, I'm not about that cheesy joke stuff. Let's get straight to the point.
Assignment 1 was long and hard. Want to know what else is long and hard? 
Finding the "best-know solution" to Step 5.
I made countless attempts to code the best solution to this step, but in the end I could not find it.
I was thinking of using a loop to iterate through all i between 1 and the number of cheeses, and then choosing the i that would return the least amount of moves, but unfortunately, I could not translate my idea into code.

Although I did not manage to find the best solution, all in all the assignment proved to be useful. I reviewed many concepts and ideas from previous lectures just by coding, and its the first time I tackled a problem in this manner.

The best way to explain steps 1 to 4 can be explained by a wise coder by the name of Lyndon:
"It's like you are given a fill in the blank test, but the blanks themselves are missing..."
It took me a while to understand what I was doing because there weren't direct instructions to guide me.
After a few hours of glancing at pixels, I managed to get on track and code away. It was truly a dreadful task, but once I made the game work, I felt this burst of joy running through my veins!
That's all for now. Peace.

Sunday, 16 February 2014

Week 6

What's good Sloggers, you know who it is...
So here I am on a Sunday night, writing this slog... what a sight.
Reflecting on this weeks lectures, i'll say Trees are 2 e z.. yeah that's right.

Trees seem to be a relatively simple topic, but the definitions that tag along with it are going to take a little more time to memorize.

I really have nothing to say about Assignment 1 since I haven't started it yet, so expect next weeks SLOG to contain my opinion on it.

This weeks lab was something new! We were introduced to brand new concepts in the lab, but instead of applying it, we had to interpret code that used these concepts. Once we understood the code, we used our previous knowledge of coding to rewrite code in our own way. This is refreshing since it allows us to understand how new concepts work, instead of blindly memorizing how to use them. The lab was at a decent difficulty; however, my partner and I still had difficulties with Unit Testing. 

Sunday, 9 February 2014

Week 5

For our lab, we couldn't use insertion.
Instead, after some detailed instruction,
We were forced to use induction.
At first it was impossible to understand,
But hey... now I get it... all planned.

This week was the week I finally learned how to use recursion. After countless lessons, the time has come to use this knowledge and complete Assignment 1. I must say that I am looking forward to completing A1 because, we are finally given the opportunity to program a video game. I love programming video games since you can play the game while simultaneously testing your code, for maximum efficiency.

A good strategy I developed for testing recursive functions is to simply plug in test cases by hand and check the expected output, then compare it to the actual output. This was a useful tool for completing this weeks lab.

Not much else to say, recursive functions all day.

Saturday, 1 February 2014

Week 4

The glittery snow descended gracefully down as I walked back home with confidence. As I sat in my chair, I prepared my fingers to mash combinations of keystrokes which would result in a satisfying grade. Exercise 2 was her name...

This was the most difficult assignment I have ever done in my entire career of studying. As simple as it was supposed to be, It turned out to be a daunting task. "But why Mike, this exercise was easy as hell!"
One reason: I didn't carefully read the instructions. Only after doing so, I was able to complete the exercise with ease. From now on, I will focus on understanding what exactly the question is asking before I attempt it.

This week was full of exciting material because I finally realized the use of MAT102. Induction is essentially recursion! Although it is still quite complicated, it does make logical sense. In order to overcome this, I will read the recommended readings, and possibly some online readings from the Python website.

The lab this week was fairly straight forward (probably because my partner is a coding god); however, the unit testing was a little confusing. I particularly enjoyed this lab since the topic was entertaining.

All in all, I will improve by using the recommended readings more often, and by reading instructions more carefully.

Sunday, 26 January 2014

Week 3

I found Exercise 1 to be quite fitting in the organization of the course. Part A allowed me to review basic mathematical operations in Python, and Part B forced me to revisit the topic of Classes. This was necessary especially because many concepts needed to be refreshed after the long winter break.
This knowledge was required for stacks and queues.

I particularly enjoyed Part A of Exercise 1 because it gave me an understanding of how the sqrt() method can be made from scratch. I still have some confusion regarding Part B. How do you return /n so that it works just like printing \n?

Regarding Labs, it was a unique experience partnering up with a random stranger in order to complete a task. Stack's and Queue's run times made me second guess my code, since their run times were constant and linear, respectively. After realizing this, I pay closer attention to redundant code in order to reduce the run time.