Here it is. The first time I'm going to be having a 'final' in University. Stereotypically, university students stay up all night in the library with cans and cans of red bulls, pouring over books and books. Luckily, this term is easy, as I only have one final to write. Though it seems like many students have already started pulling all nighters in the library, I plan to organise my time to not pull and such thing.
To begin with, I need to go over all the lecture slides and take the notes about computer history. Actually this part is really important for me since I always lost marks on the computer history part.
Then, I found out that the video clips about DrRacket are also kind of important because these videos are the base of the application of DrRacket. Since the material got more difficult, the base is essential to understand.
Next, I may not forget the contents in every single tutorial. The tutorials contain useful information. Also the quizzes I got back with the feedback from the professors will be useful review materials.
Finally, I hope I will get good marks. :)
Wednesday, December 5, 2012
Converting into Binary
On September 26th, I learned about binary numbers for the first time. I was like "oh my god, what's these weird numbers". As I looked around the room, it was clear that a sense of confusion had ran across the entire classroom. My classmates all had a puzzled face, a few who understood, and others, who already gave up. I know the importance of Binary number so when I came back to home, I searched it up on the website and then I finally got some ideas.
Take converting 255 into Binary numbers as an example.
Step 1: Understand the Problem
I looked at it, and understood the problem. It wanted to convert a number in regular base 10 form in a number in base 2 form.
Step 2 : Devising a Plan
Since I looked at it from an online source, all I had to do was copy the solution posed on for a different number and apply the same formula for the number 255
Step 3 : Carrying out the plan
I solved this problem by doing the following.
-Divide 255 by 2, I get 127, and the remainder is 1
-Divide 127 by 2, get 63 , and the remainder is 1
-Divide 63 by 2, get 31, and the remainder is 1
-Divide 31 by 2, get 15, and the remainder is 1
-Divide 15 by 2, get 7, and the remainder is 1
-Divide 7 by 2, get 3, and the remainder is 1
-Divide 3 by 2, get 1, and the remainder is 1
After doing this, I got the answer by starting from the bottom of the chain
So the answer should be---- 1111111
Step 4 : Looking back
Since I got the answer, I checked the answer by doing the followings.
1*2^0+1*2^1+1*2^2+1*2^3+1*2^4+1*2^5+1*2^6+1*2^7=255
There you go!
Take converting 255 into Binary numbers as an example.
Step 1: Understand the Problem
I looked at it, and understood the problem. It wanted to convert a number in regular base 10 form in a number in base 2 form.
Step 2 : Devising a Plan
Since I looked at it from an online source, all I had to do was copy the solution posed on for a different number and apply the same formula for the number 255
Step 3 : Carrying out the plan
I solved this problem by doing the following.
-Divide 255 by 2, I get 127, and the remainder is 1
-Divide 127 by 2, get 63 , and the remainder is 1
-Divide 63 by 2, get 31, and the remainder is 1
-Divide 31 by 2, get 15, and the remainder is 1
-Divide 15 by 2, get 7, and the remainder is 1
-Divide 7 by 2, get 3, and the remainder is 1
-Divide 3 by 2, get 1, and the remainder is 1
After doing this, I got the answer by starting from the bottom of the chain
So the answer should be---- 1111111
Step 4 : Looking back
Since I got the answer, I checked the answer by doing the followings.
1*2^0+1*2^1+1*2^2+1*2^3+1*2^4+1*2^5+1*2^6+1*2^7=255
There you go!
My Second CS Project
Here's my second CS project.
Actually it was much easier than the last one, but involved more math calculations.
Basically what were required was to write some check-expects in onder to make all the tests pass.
I found something interesting while working on the project.
When I was required to write two check-expect expressions for interpolate-image, one for when n = DENOM, the other for whem n = NUMER, I tried two kinds of check-expects and they all worked.
Firstly I tried
(check-expect (interpolate-image pic:calendar (flip-horizontal pic:calendar) 30)
(flip-horizontal pic:calendar))
(check-expect (interpolate-image pic:hacker (flip-horizontal pic:hacker) 30)
(flip-horizontal pic:hacker))
and then I tried
(check-expect (interpolate-image pic:calendar (flip-vertical pic:calendar) 30)
(flip-vertical pic:calendar))
(check-expect (interpolate-image pic:hacker (flip-vertical pic:hacker) 30)
(flip-vertical pic:hacker))
The difference was that I used "flip-horizontal" in the first one but "flip-vertical" in the second one but they all worked! Yeah!
By the way, doing project really helped me prepare the test!
Actually it was much easier than the last one, but involved more math calculations.
Basically what were required was to write some check-expects in onder to make all the tests pass.
I found something interesting while working on the project.
When I was required to write two check-expect expressions for interpolate-image, one for when n = DENOM, the other for whem n = NUMER, I tried two kinds of check-expects and they all worked.
Firstly I tried
(check-expect (interpolate-image pic:calendar (flip-horizontal pic:calendar) 30)
(flip-horizontal pic:calendar))
(check-expect (interpolate-image pic:hacker (flip-horizontal pic:hacker) 30)
(flip-horizontal pic:hacker))
and then I tried
(check-expect (interpolate-image pic:calendar (flip-vertical pic:calendar) 30)
(flip-vertical pic:calendar))
(check-expect (interpolate-image pic:hacker (flip-vertical pic:hacker) 30)
(flip-vertical pic:hacker))
The difference was that I used "flip-horizontal" in the first one but "flip-vertical" in the second one but they all worked! Yeah!
By the way, doing project really helped me prepare the test!
Subscribe to:
Posts (Atom)