Monday 25 November 2013

A2 Results Analysis

After receiving the results of our second assignment I must say that both me and my partner were quite pleased with the results. We scored 43/44, a near perfect grade, however when I looked to the part that lost us that single mark I was somewhat dissatisfied with the feedback given.

The comment left by the marker was simply that one part of the code was too complicated, I was hoping for it to tell us how we could have made it better. I thought about it for a while but I guess I just wasn't clever enough to figure out how to make the code any less complicated. I really want to know how the code should look like. The lost mark was attributed to "Match Simple Star".

If anyone had gotten perfect on that part, it would be greatly appreciated if you could share your solution to that part! I would love to see how it was supposed to be done.

Monday 18 November 2013

Peek - a - boo

Today we learned how to hide internal variables set restrictions on what the value of an instance variable could be.

It's happening again, I now have an uncontrollable urge to back through all my code and privatize variables and such. I've kept different drafts of the programs I've written and it's really rewarding to go through them to see how they've evolved. It really does feel like I'm learning and improving my work.

Wednesday 13 November 2013

Term Test 2 Aftermath

I was slightly late for my term test today, the TTC was having issues and the wait was just dreadful.

While surfing other Slogs I found that the most highly occurring problem that people were having were related to recursion. Ah... recursion such a complicated concept to grasp yet so elegant in execution. There was something inside me that just seemed to say that there will be lots of recursion on the test, so that's what I spent most of my time trying to perfect.

As I sat down, a bit embarrassed by my tardiness, I took a quick look at the test. I couldn't believe the questions I was seeing. After around 15 minutes I had finished the test and checked it over twice. Unsure what else to add I decided to just hand it in.

As soon as I left the room I started up my laptop to check if the functions I wrote actually did what they were suppose to do. That's the beauty of comp-sci tests, you can check your answers without waiting for solutions to be posted and sure enough it seemed like my functions were doing fine.

I stood up to strike a victory pose before leaving the exam center, humming a tune.


Oh! Also I got my calculator layout done and all the buttons work as well!
.........well
...... except the "=" button........
...I'll have to work on that one :)


Tuesday 5 November 2013

Catch the Code

After learning about Big-O and the run time of code, I decided to go back and try to "catch" all my old code. That is, I went back all the way to exercise 1 to see if the code I wrote could be caught and beat in run time by a more efficient method. After adjusting some of my exercises to improve their run time it became apparent to me that I hadn't really given a second thought about the run time before I learned about it. After this little practice with efficient coding, I must say it felt to to see my programs cleaned up.

But what about the other end?

I felt curious to see just how bad I could make the run time of a program become. After trying a few times, I found that to hit a run time of O(n!) was actually pretty hard. Who knew that ruining the run time of a program could be harder than to do it the most efficient way?