Search This Blog

Wednesday, November 28, 2012

Term test #2 mark and week #12

I received my mark for the term test #2 today and I did a lot better than I expected.
The score was an improvement from the term test #1 which makes me satisfied.
After the first term test, I understood what the test format and questions are like which is why I managed to score better on the second one.
Now that the two tests are over and only have one quiz left in the course, there will be final exam to prepare for.
I expect the format to be like the quizzes and the tests so hopefully I can do well on the final as well.

While I was preparing for my final quiz of the course, I ran into some difficulty on DrRacket coding.
In tutorial #9 handout, we were told to fix the definition in spiral.rkt. All other parts I was able to make the correction. Nevertheless, I couldn't pass the tests for the part below.


; make-palindrome : string -> string
; Produce palindrome from s
(check-expect (make-palindrome "a") "a")
(check-expect (make-palindrome "ab")
              (string-append
               (substring "ab" 0 1)
               (make-palindrome (substring "ab" 1))
               (substring "ab" 0 1)))
(check-expect (make-palindrome "Danny")
              (string-append
               (substring "Danny" 0 1)
               (make-palindrome (substring "Danny" 1))
               (substring "Danny" 0 1)))
;
(define (make-palindrome s)
  (cond
    [(equal? (string-length s) 1) s]
    [else
     (string-append
      (substring s 0 1)
      (make-palindrome (substring s 1))
      (substring s 0 1))]))

I had to ask the TA at the tutorial just now to figure out the correct answer for this definition.
Before then, I was stuck for a while and wrote something like this.


(define (make-palindrome s)
  (cond
    [(equal? s "a") s]
    [else
     (string-append
      (substring s 0 1)
      (make-palindrome (substring s 1))
      (substring s 0 1))]))

This, for obvious reason, did not pass the test.
Now that the TA explained to me how it works, I understood why the above is not correct answer.
We will see how I do on my last quiz of the course!

Saturday, November 24, 2012

Wikipedia

Part 3 of Wikipedia assignment was due last night.
I managed to finish all three parts of the assignment.
The difficulty I had with this assignment was uploading images.
Wikipedia had some strict copyright rules so I could not upload some images that I thought would contribute significantly to improve the article.
Therefore, I uploaded some of my own photos to help improve the site.
From this assignment, I realized that I could actually help out on some ways and contribute to the community on Wikipedia.
Since high-school, I used the Wikipedia frequently but never had any experience of contributing to Wikipedia.
From doing this assignment, I learned that many people have made significant contribution on this site. Otherwise, Wikipedia would not have been widely used by many people.

Saturday, November 10, 2012

Project #1

I finished my first project last night.
I found it quite challenging and could not solve all the problems...
There were some tests that I could not pass and the clock itself did not work the way I wanted to...
When I pressed run on my assignment, the second-hand was rotating counter clockwise, not clockwise.
The other hands were rotating clockwise but I had difficulty in fixing the second-hand.
By the time I managed to fix it, I ran out of time and could not hand in the fixed file.
I think the biggest problem with this project for me was that I was overloaded with my other courses so I left this project up until the last minute.
I got anxious because I was running out of time.. maybe that's why I could not solve some problems.
From now on, I won't leave my assignments up until the deadline and finish early so I have enough time to carefully think and analyze the problems.