Wednesday 5 December 2012

Exam time

Well, yesterday was the last day of classes and tonight this SLOG thing is due. I just want to end this on a high saying that even though I did slack a bit in the beginning, I did what I could do to recover from the slack and even finishing off my blog on the last day. I'm glad that I took this course because my brother is a computer science major in Waterloo and I've always been a bit curious about that side of things. I may even take CSC108 next semester depending on my schedule and see where that leads me. I could even minor in this program, after all I'm still in second year.

Anyways, I'm glad I did all my projects and caught up with everything in the end and I can reflect on that well. The difference between the second midterm and the first midterm just goes on to show that I have had indeed a rough time at the start, but I gradually decided to focus more and catch up with things and here I am full of confidence going into exams.

I hope and I know I can do well on the CSC104 exam and so here's to a final goodbye to a course that I have thoroughly enjoyed and hoping that I have benefited from this experience well. Maybe I can even do more in computer science (and I'm thinking about it), so who knows...

Project #2

Project #2 was certainly interesting. To start off, I would like to say I definitely worked more on this than the first project. Some of the problems on the project took a lot longer than I thought and were a bit confusing. It's a good thing I attended the tutorial on Friday when it was due. Nonetheless, I'll demonstrate one of the confusing parts that I found in the project.


(check-expect (interpolate-color 2/3 (make-color 0 0 0 255) (make-color 6 9 12 255))
              (make-color 4 6 8 255))
; !!! fix interpolate-color
(define (interpolate-color f c1 c2)
  (make-color (strict-interpolate f (color-red c1) (color-red c2))
              (strict-interpolate f (color-green c1) (color-green c2))
              (strict-interpolate f (color-blue c1) (color-blue c2))
              (strict-interpolate f (color-alpha c1) (color-alpha c2))))

So here is the correct answer, or at least I think it was the correct answer to fixing interpolate-color. However, this was not the first answer I had to this one.

My first reaction was: "Oh, that's simple. I just need to define something accordingly to what the check-expect says!" I had originally written down something like this.

(define (interpolate-color f c1 c2)
 (make-color (* f  ( + (color-red c1) (color-red c2))))
                     (* f  ( + (color-green c1) (color-green c2))))
                     (* f  ( + (color-red c1) (color-red c2))))
                     255))

So in theory, this works. When running the check-expect it runs because it's true, there's no other explanation; 6 x 2/3 is 4, 9 x 2/3 is 6, 12 x 2/3 is 8, and the normal 255 is just consistent.

However, a friend of mine checked over my project during the tutorial and told me it was wrong and thankfully I realized that I should read the instructions before jumping to fix any problems.


This was the note:


; interpolate-color : color color number -> color
; Produce the color that is strictly interpolated fraction f between c1 and c2.

So, it appeared simple still, but I had to use strict-interpolate in there and I managed to figure it out. Hopefully I get maximum marks in this project, because I want to come out of this class with a good mark.


Project #1

Project #1 took a while to finish, but thank God that I found someone in my residence that was in the same class. We agreed to work on it together and it was a lot of help. I felt however, that some of these problems recited in the notes were pretty straightforward. I guess that was the whole purpose of the project, to show that we understand what we have learned so far in lectures and apply them with some logical thinking and problem-solving.

For instance, the function below requested that we show two check-expect functions.


(define (clarify-color c)
  (make-color
   (color-red c)
   (color-green c)
   (color-blue c)
   (cond
     [(> (+ (color-red c) (color-green c) (color-blue c)) 650) 0]
     [else (color-alpha c)])))

Well, obviously if anyone has been attending lectures and tutorials, this should not take long to solve. It meant that if the values of color-red, color-green, and color-blue all added to over 650, then color-alpha should have a value of 0. Such was how my partner and I decided to input our check-expect values as shown below.


(check-expect
 (clarify-color (make-color 30 30 30 30))
 (make-color 30 30 30 30))

(check-expect
 (clarify-color (make-color 255 255 255 30))
 (make-color 255 255 255 0))

30 + 30 + 30 = 90 so the color-alpha does not change, whereas 255 + 255+ 255 = 765, which is way over 650.

There were some check-expect functions, which in all honesty you could copy most of from the define functions and added values to it and also, checking the fix key required a bit more time than the problems solved above. Overall though, I felt that the project was great for refreshing what we have learned in class and applying them into Dr.Racket.

Term Test 1

Term test 1 was harder than expected. It was the first midterm for the course and I felt kind of confident, but did not really know what to expect. I had skimmed through the history part and reviewed all the binary stuff and past quizzes.

After taking the test, I felt bad. I felt I did horrible. I vaguely remembered the first two questions about the history of Computer Science. I guess I didn't review them properly, but there were only two of them. The rest of the problems I'm sure I got most of them right except for the last question. This is the part that screwed me over and cost me most of my marks.

Since I didn't get my last quiz back, I guess I didn't review the (check-expect) function. How does this work? I had no clue at the time. I knew the define function and everything that was covered before that but unfortunately I couldn't figure it out and I had to leave a blank to get the 20% that I could get from the questions.

This made me motivation to go over every lecture slide and the quizzes, including all the history, for the next midterm.

Wikipedia Part 3

While I did get a poor mark for my Part 2 of the Wikipedia assignment, I put a lot of effort on Part 3 of my assignment to show that I did indeed put at least four hours of work into it. It was the Thursday night before the due date, I worked an hour editing pages grammatically and commas and whatnot. Then I decided to take the night off and finish what I could on Friday evening.

On Friday evening, I worked for a good four hours, even some of the pages that I hadn't originally listed in my plans. I put references in some of the pages as well as editing and correcting grammar as the Wikipedia help page had indicated. I hope I get full marks for it, because reflecting on my part 2 marks, I really wanted to improve and I did put a lot more effort into this.

Tuesday 4 December 2012

Wikipedia Assignment Part two.

To be honest, I did not expect a mark so low on the part 2 of the Wikipedia assignment when I got it, but then again I guess I did kind of deserve it. What I basically did was skim through the community portal and look through basic grammatical changing tips and such. It might have taken me maybe less than an hour to do this, but I did know what I was going to do. I just wrote down what I planned to do which really was not much, but it was work that I could do for four hours. I guess I could have explained things in more detail considering I was supposed to show that I have done a few hours of work researching how I was gonna edit these Wikipedia pages.

Friday 30 November 2012

Term Test 2

So last Wednesday night, we had the second term test of the semester. Taking into consideration that I got a fairly low mark for my first term test, I studied extremely hard during the fall break. Due to the fact that I got 0's in two of the last quizzes, I had to go back and review all the tutorials and then apply them in the racket codes as well as try them out myself.

My reflections after the test were: I should have studied more for history.

I had done extremely well to cover all the Dr. Racket stuff up to date, so I was so sure that I would do well in the term test. When I saw that three pages were covering just the history of computer science, I almost got a heart attack. I mean I did go over the history, but it was just a general overview that I reviewed one night; and I didn't really focus much on it.

Nonetheless, I checked the test marks last night and turns out I got 34/40 which makes me somewhat satisfied due to the fact that I thought I did worse initially.

I am content. Now to finish off Project #2.