Thursday 21 March 2013

csc week #8

for the lecture this week we have learned about how Von Neumann looks like, its basically bus connects ALU/control to memory (RAM) and I/O keyboard, monitor, storage. and how computer store information ( hard-drive, flash memory, CD etc)

and for week 8 to 10 we were working on the same topic-recursion.

for example : g : number -> image
(define (g d)
(cond
[(> d 0)
(overlay
(beside (g (- d 1)) (g (- d 1)))
(square (* 2 (image-width (g (- d 1)))) "outline" "green"))]
[else (square 10 "outline" "green")]))

the above command is trying to produce an image with condition "d (a solid number) bigger than 0"

if you put 0 instead of d, than it will produce " square 10 "outline" "green" " because for everything

less or equal to 0, that's under the condition [else (square 10 "outline" "green")]

if you put 1 instead of d it will gives you:

1) 2 (square  10 "outline" "green") besides each other

2) a bigger size of a square : (square (* 2 (image-width (g (0)))) "outline" "green")

3) and they overlay each other.

it looks complicated to me at first, but if you split up everything try to read it line by line, figure out

what each line is doing what, then everything becomes easy.

We have done lots of similar problems for the past 2 weeks (week 9 and 10) I am pretty confidence

for how to handle this type of problem.


Tuesday 5 March 2013

csc 104 week 7

this is a blog for week 7..
for the lecture this week, we basically talked about addition and multiplication of binary numbers..
this is not a hard but interesting topic, just to remember 1+1=0 and carry the 1 over!
it tells me how the computer calculate numbers..
same as sound and picture, both could be simulated using a stream of numbers (language that computer could recongnize) and convert them into arrays of glowing pixels...
Again, its all about algorithm and thats what this course all about...
(lecture materials were not hard so far but the project 1 is killing me!!)


Wednesday 13 February 2013

csc 104#4

so for the class on Tuesday we talked about "switching pixel" of the pictures
as we know pictures are basically make up by green, blue and red pixels..
within a picture, there could be over thousands and thousands of pixels..
with Dr.Racket we can playing around with those pixels..
let say there are 500 green, 500 blue and 500 red pixels within a picture..
we can replace the green pixels with red pixels and that would gives you a different look of the picture..it was not difficult but commands were a little bit complicated , i have to watch the video and practice more make sure i ace in this topic! this is also an interesting topic and  practical that allows us to play around with photo :)


at the end of the class we got our tests back but it was not the mark i expect to get...:(

Wednesday 6 February 2013

csc 104 #3

so the first mid term is coming tomorrow!! and i still haven't study yet!! i have read the past test yesterday there were some question that i didn't expect to see!! ( computer history..which i thought it was not important at the beginning...)
so what i have to do now it to read through the notes..prepare the aid sheet (hope it helps)...
and to watch through the videos in order to prepare for the exam...and to try out the past exam..
wish me luck!!
(sorry for the short blog since i have 2 exams coming this week...)

Tuesday 29 January 2013

csc104 blog#2

sorry for my belated blog..(it is supposed to be done last Friday lol)

so, for the lecture this week, we go over the evolution of computer.
At the early stage, people used clay tablets..(a stone liked tablets made by clay, people write/read information when sun-dried.
Abacuses-some kind of calculating tool,calculate by counting the rings or stones?? (not quite sure about it)
And then people invented some kind of huge machine "Pascaline" its a first generation calculator with number of gears. (not quite sure how it works too, looks like we calculate by turning those gears and read the numbers?)
The next one would be Jacquard loom and Babbages different engine (ya..same as above..huge,giant "machine" to solve simple maths..)
After hundreds of thousands of years...we finally have Personal Computer!!!
but those are not important,since they would not be on our exams...
so whats important?! Dr. Racket video!! ( this is the best way to learn because everything we need to know has been record as video and we can review and review and review .....u know..)
so video this week is to define something..for example (define jumbo im1), when we insert jumbo, im1 would be the feed back..or (define lucky 12345), we got 12345 back after inserted lucky etc..
the next would be i called it "multiple definition", which is a little bit complicated...
for example (define p im1)
                   (beside p (flip-horizontal p) (flip-vertical p))
then what you'd get would be im1(flip-horizontal im1)(flip-vertical im1), we have more than 1 command/definition and gives 1 result that's why i called it "multiple definition" lol
of course this is the simplest example of "multiple definition" there are lots of much more complicated example in the video I am not 100% confident about it but as long as I keep practicing I will be fine..

Thursday 17 January 2013

csc 104 diary

so here we go!! my first blog ever in my life and its because of csc 104...

the first class was on Jan 8th and we actually didn't learn anything significant,just a brief cover about the course and the course outline...o yeah..we did cover the first few pages of lecture slides...the most interesting topic in that lecture was "paper folding"...we have been asked to:
fold over upper surface of paper strip
after one fold, it has a downward crease
fold the once-folded strip again
and it has one upward, two downward
there are good physical reasons you
can't experiment far beyond 6 folds
given the number of folds,
predict the pattern
i was not quite sure what the prof is trying to teach at first.... so i Google it after class, and i found out that the purpose behind "paper folding" is not about "you can't fold a paper for no more than 7 times".. is all about "algorithm". it is a logical thinking of computer programming, also a step-by-step procedure for calculations. Since computer is not as smart as us, we have to tell the computer the exact command, exact instruction in order to solve problems.

the second class, Jan 10th, continue of last lecture..

prof Heap has used a simple example to demonstrate concept of algorithm..."Making peanut butter jam sandwiches". To teach someone who had never made peanut butter sandwiches to make PBJ. I remember that's what i wrote down...
1)  pick up a piece of bread
2) put some peanut butter on bread
3) pick up another bread
4) put some jam on bread
5) stick them together!

lucky prof Heap didn't pick my paper and speak it out .. because what i did was too simple, totally lack of information to teach someone (computer) how to make PBJ (to solve problems).
In order to make PBJ, I have to tell him,the computer, every single piece of information, every detail that it will use in order to solve problem...I would say computer is someone who doesn't know anything before you teach it..but it learn so fast, in a second, as long as you teach him right,and do not allow a single mistake...
So back to the PBJ, prof Heap acted as a computer tried to follow the command of procedure of making PBJ..but here is the problem, information was not detail enough, as I mentioned above..for example which way to turn in order to open the lid of the peanut butter jar? how to scoop up peanut butter? the angle that you put the knife inside the jar, and the amount of peanut butter that you scoop up blah blah blah ....
so to think logically is very important in computer programming, i am not a logical person obviously so what can i do when i encounter problems? i think the best way to solve problem is to discuss with classmates, exchange idea is very important, it helps each other to understand concepts better..
(but make sure i don't copy someone's work... )

In today's lecture Jan 15th, prof Heap talked about how to use write simple programming command by using DR RACKET...it is pretty fun.. for example DR RACKET can recognize number, integers and do some simple calculation..
>(+ 2  2  2)
> 6

>(* 3  3  3)
>27

To recognize True or False
 >(True)
>True

>(false)
>false

>(not true)
>false

>(not false)
>true

It can also flip picture vertically/horizontally..rotate picture, re-size/modify picture by removing pixels etc..I feel good about this topic because I have watched the video prof Heap posted online :)

so far I am pretty confidence with what we have done so far..what I need to do to for now is to practice more by using Dr Racket and prepare for the quiz coming this Friday!hopefully everything going smoothly!