Project # 2 was just due an hour ago, so I thought I should share my perspective view on this project.
I was initially worried on how hard it might be and since the amount of time I had for this project was much less than the last one due to the fact that there were numerous other assignments to hand in as the term is coming to an end. Thus, I didn't really have any time to look at it until this week but I am happy that I manage to finish it within the due date.
Overall, I thought this project was much easier than the last and it contained less problems to do and it was fairly simple to do. I found that the hardest question was regarding the definition that includes local and map-images. Since there were no check-expects required for the definition of map-images, it was hard to figure out what it was actually suppose to do and thus I had trouble using it within another definition. I also noticed that it was easier to perform the check-expects for interpolate-image was easier to perform when you assign a simple shape (like a blue square) since it grabs two pictures of same size and compares the colour between them.
I will try to post some more blogs before end of this week, so look out for some more blogs!
Friday, November 30, 2012
Saturday, November 24, 2012
Wikipedia Project III
Hi, I just wanted to provide an update on my Wikipedia project and give a brief run down of what I did.
I decided to take on the task of adding links to other sites in order to de-orphan an article. My article is on 55th Guksu (http://en.wikipedia.org/wiki/55th_Guksu), which is one of the tournament for Go. Go is an ancient board game that originated from China. It is very difficult game to master and thus there are huge skill gap between amateurs and professional Go players. Therefore, tournaments such as Guksu (one of Korean Go tournament) are very popular in Asia.
At first, I started by checking if '55th Guksu' had any hyper-linked "related topics", which would simplify things and make my task much easier at finding related articles that I can link my article to. However, I was unable to find any hyper-linked "related topics", thus I decided to search a bit about Guksu and the game Go in general to get a better understanding of this tournament.
The first article I visited was 'Go', but I was unsuccessful in finding an appropriate place to add my link for 55th Guksu. Thus, I changed my plan and decided to search for Guksu. Luckily, in the article for Guksu, there were history of title holders. Thus, I decided to link the 2011 Guksu, which is the 55th Guksu. I also decided to search the name of the 55th Guksu champion and linked 55th Guksu under his history as well. Finally, I managed to find the runner-up for 55th Guksu and decided to to link the 55th Guksu under his achievements since being a runner-up on a big tournament like Guksu is a very huge accomplishment as a professional Go player.
Once I finished with linking my article, I finally got rid of the orphan template as it no longer satisfies the condition to be in orphan template.
I decided to take on the task of adding links to other sites in order to de-orphan an article. My article is on 55th Guksu (http://en.wikipedia.org/wiki/55th_Guksu), which is one of the tournament for Go. Go is an ancient board game that originated from China. It is very difficult game to master and thus there are huge skill gap between amateurs and professional Go players. Therefore, tournaments such as Guksu (one of Korean Go tournament) are very popular in Asia.
At first, I started by checking if '55th Guksu' had any hyper-linked "related topics", which would simplify things and make my task much easier at finding related articles that I can link my article to. However, I was unable to find any hyper-linked "related topics", thus I decided to search a bit about Guksu and the game Go in general to get a better understanding of this tournament.
The first article I visited was 'Go', but I was unsuccessful in finding an appropriate place to add my link for 55th Guksu. Thus, I changed my plan and decided to search for Guksu. Luckily, in the article for Guksu, there were history of title holders. Thus, I decided to link the 2011 Guksu, which is the 55th Guksu. I also decided to search the name of the 55th Guksu champion and linked 55th Guksu under his history as well. Finally, I managed to find the runner-up for 55th Guksu and decided to to link the 55th Guksu under his achievements since being a runner-up on a big tournament like Guksu is a very huge accomplishment as a professional Go player.
Once I finished with linking my article, I finally got rid of the orphan template as it no longer satisfies the condition to be in orphan template.
Friday, November 23, 2012
Trees/leaves, Harvest, Flatten, Depth, Apply and map functions
After the Tutorial earlier this week, I was able to figure out what each functions within the nested.rkt. So
I will briefly explain the functions covered in nested.rkt and if there are any questions, feel free to leave and comment on this post and I will get back to them as soon as possible.
Trees and leaves
They first define a tree and leaves:
Tree = A structure that has values left and right from the root. We can treat this like an organizational tree that we often see when trying to organize small to big things.
i.e. (define tree1 (make-gtree "AAA" leaf1 leaf2)) will give:
ACTG
AAA
I will briefly explain the functions covered in nested.rkt and if there are any questions, feel free to leave and comment on this post and I will get back to them as soon as possible.
Trees and leaves
They first define a tree and leaves:
Tree = A structure that has values left and right from the root. We can treat this like an organizational tree that we often see when trying to organize small to big things.
i.e. (define tree1 (make-gtree "AAA" leaf1 leaf2)) will give:
Tree1
leaf1 leaf2
Leaf = Definition for input that has empty left and right terms
i.e. (define leaf1 (make-gtree "ACTG" empty empty))
Empty Empty
Harvest
Harvest function will grab all of the 'trees' and 'leaves' together and creates a list from it.
i.e. Given that
(define tree1 (make-gtree "AAA" leaf1 leaf2))
(define leaf1 (make-gtree "ACTG" empty empty))
(define leaf2 (make-gtree "GTCA" empty empty))
Thus if one provides input of 'harvest tree1', one should have an output of (list "AAA" "ACTG" "GTCA")
If one were to plot it into a diagram, it would look something like this:
ACTG GTCA
Empty Empty Empty Empty
Flatten
Next function that's mentioned is flatten. Which grabs all the list that is within a big list, and combines all of them to create a one big list that contains all the variables within the lists.
Flatten is defined as:
(define (flatten L)
(cond
[(not (list? L)) (list L)]
[else (apply append (map flatten L))]))
So, if we have a list as :
(define L1
(list 1 2 3 (list 4 5 6) 7 8 (list 9 1 (list 2 3))))
and we apply flatten function to it, one would get :
(list 1 2 3 4 5 6 7 8 9 1 2 3))
Depth
And finally, depth function will find how many lists are found within a given input.
Depth is defined as:
(define (depth L)
(cond
[(not (list? L)) 0]
[else (add1 (apply max (map depth L)))]))
So if we have a list as:
(list 1 (list 2) 3))
and we apply depth function to it, one would get an output of:
2
This is because there are two lists within the given function.
Map vs Apply
Although it is not directly mentioned within the nested.rkt, there are 2 other important functions that must be discussed about. They are the map and apply function.
Map will apply the given operation to a given list and provide an output of a list that contains all the variables that the operation was applied to.
For example,
(map add1 (list 1 2 3 4)) would give an output of (list 2 3 4 5) because all the variables within the list were added by 1.
Apply on the other hand is a little different. First of all, it provides a numerical output and not a list even thought the input was a list to begin with. The apply function will use the given operation and treat like all the variables within a given list as part of same equation to apply the operation with.
For example,
(apply + (list 1 2 3 4)) would give an output of (10) since 1+2+3+4=10.
Tuesday, November 20, 2012
Plans to study for this week's quiz
So earlier today (as in yesterday since its after midnight), I have roughly went over the tutorial exercise sheet, and I am planning to over it in detail tomorrow (Tuesday). So far, my impression of this week's tutorial exercise (#8) is fairly simple. It seems like the first point about list function is sort of a review as we already learned about this function long time ago. Then when i tried opening the November 14th racket code, I immediately noticed the three new functions as stated on the exercise handout. The functions depth, harvest, and flatten all seems like functions that deals with lists, and thus the input must be a list. I will have to investigate further on how these functions actually change or modify the list to see its effects. Hopefully by tomorrow night, I can have some sort of basic intuition of these three functions before going to the tutorial on Wednesday.
Wednesday, November 14, 2012
2nd Test Prep
Hello, I hope everyone did well on the test. I am sure some people found it difficult and others probably found it the easiest thing they have ever written. I found there were a lot more word questions than the last one and noticed it was weighted half of the test. Anyway, I know this is a bit late in case some people needed study notes, but I decided to post my study notes so others can compare with theirs and hopefully there are some things to add to their list before going into the final exam (which is actually a month away!)
**Notice when I wrote the Lecture numbers, I meant the lectures starting from the last test date. (Starting with Algorithm)
Lecture 1
Algorithms
·
Al-Khwarizmi
– A Persian mathematician, astronomer, and geographer. He is considered one of
the inventor of algebra, as his solution of linear and quadratic equations done
in Arabic was discovered in twelfth century.
·
Greatest
Common Divisor (GCD) = the largest whole number that divides two non-negative
whole numbers
·
So
GCD(12, 20) = 4
·
Euclid’s
algorithm = GCD(48,18) => Divide 48 by 18
to get 2 with
remainder of 12
=> 18 divide by 12 to get 1 with remainder of 6 => 12 divided by 6 to get 2 with remainder of 0
·
So,
GCD (a, b) = GCD (b, remainder of a/b)
Lecture 2
·
If
there are two or more algorithms solving the same problem, then you have to
choose the one that is more efficient
·
There
obviously isn’t an algorithm that solves every problem
·
Halting
problem = problem of deciding whether when given a program and an input, that
the program will run forever or eventually halt
·
Alan
Turing proved in 1936 that there cannot exist a general algorithm to solve the
halting problem for all possible program-input pairs
How to solve a new problem
·
Understand
the problem – what’s required, what’s given, solver-name: input -> output,
draw pictures
·
Devise
Plan(s) – different types of searches
·
Try
the plan
·
Look
back and analyze what went wrong if the plan doesn’t work
Lecture 3
Von Neumann
Architecture
·
Memory-mapped
I/O = allows input and output devices to be treated the same as memory
·
System
bus = a single computer bus (a subsystem that transfer data between components
inside a computer/between computers) that connects the major components of a
computer system. This will reduce costs and improve modularity.
·
=>
It becomes the following components
·
1:
Data bus = to carry information
·
2:
Address bus = determine where it should be sent
·
3:
Control bus = determine its operation
Von Neumann
Bottleneck
·
Shared
bus between the program memory and data memory leads to bottleneck
·
The
limited throughput (data transfer rate) between the CPU and memory compared to
the amount of memory
·
Because
the program memory and data memory cannot be accessed at the same time, the
throughput is much smaller than the rate at which the CPU can work, which would
affect the processing speed when the CPU is required to perform minimal
processing on large amounts of data
·
Thus
the CPU is continuously forced to wait for needed data to be transferred to or
from memory
Moore’s Law
·
Observation
that over the history of computing hardware, the number of transistors on
integrated circuits doubles approximately every two years.
Input,
Output
Storage
(Data storage device)
·
A
device for recording (storing) information (data).
Hard drive
·
Capacity
is specified in unit prefixes corresponding to power of 1000 (So 1-terabye (TB)
= 1000 gigabyte (GB)) and not all of it is available to the user due to use by
the file system
·
Performance
is specified by the time to move the heads to a file plus the time it takes for
the file to move under its head and the speed at which the file is transmitted
Compact Disc (CD)
·
Used
to store digital data
·
CD
data is represented as tiny indentations known as ‘pits’, encoded in a spiral
track moulded into the top of the polycarbonate layer
·
CD
is read by focusing a laser through the bottom of the polycarbonate layer. The
change in height between pits and lands results in a difference n the way light
is reflected. By measuring the intensity change with a photodiode, the data can
be read from the disc.
Flash Drive
·
A
flash drive does not contain any moving parts (except for electrons) , they are
very robust mechanically
·
Information
stored in electron chamber
·
Compare
to hard drives, flash drives use little power, have no fragile moving parts,
and very light and small
·
Resistant
to mechanical shock, magnetic fields, scratches, and dust.
·
However,
it can only sustain limited number of rewrites before the drive fails.
·
Flash
memory places RAM
Lecture 4
·
Sharing
big computers with smaller computers
·
There
were a lot of computers that were dedicated to one job, however as time passed,
the new revolution has come where you can stop one task and start another.
An operating system should have:
1)
Kernel
= main component of operating systems, and acts as a bridge between application
and the actual data processing done at the hardware level. It’s responsibilities
include managing the system’s resources
2)
Utilities = repair and maintain machine
ROT13
·
The
26 alphabet is split into first 13 and last 13. Then in order, the first
alphabet corresponds to the first in the second batch.
·
ABCDEFGHIJKLM
·
NOPQRSTUVWXYZ
Lecture 5
Network
Topology
Topological
structure of a network, and may be depicted physically or logically. The shape
of the cabling layout used to link devices is called physical topology and
logical topology shows how data flows within a network.
Bus
·
In
local area networks, bus topology is used, where each node is connected to a
single cable
·
Each
computer/server is connected to the single bus cable
·
A
signal from the source travels in both directions until it finds the intended
recipient, and then the data is accepted.
·
All
machines can transmit signal at any given time
·
If
another machine is transmitting at the same time, then it waits for a random
interval of time before re-transmitting them.
·
Since
it consists of only one wire, it is inexpensive to implement but expansive to
manage the network
Star
·
Each
network host is connected to a central hub, in order to be classified as a star
network, all the nodes on the network must be connected to one central device.
·
It
is considered easiest topology to design and implement.
·
However,
it also means that the hub represents a single point of failure
Ring
·
A
network topology that is set up in a circular fashion
·
Signal
travels around the ring in one direction and each device grabs the incoming
signal and transmits them to next device.
·
The
signal travels until the recipient gets the message which will then keep
propagating in the ring until the original sender receives it and conclude that
the message has been sent
·
The
network is dependent on the ability of the signal to travel around the ring
Very delayed first post
Very delayed
first post of my blog
Hello, and
welcome to Tony’s blog! To be honest, I been so busy and worked up with other
quizzes and tests in CSC 104 that I completely forgot about SLOGs. However,
instead of crying and whining about it, I will try my best to interest everyone
in what I learned in this course.
To introduce a little bit about
this course, this course’s title is “The why and how of computing” and it
introduces fundamental ideas behind computers and why one should be introduced
with basic computing. At a time like this, I believe many finds themselves
having to use a computer to do a certain type of work. Whether that is to play
games, finish essays, using it at workplace, etc, almost everyone at this
generation should have experienced using a computer before. Thus, I firmly believe,
for any program, at least one computer science course must be required. This is
also one of many reasons why I decided to take this course.
Since I am late on making my
first post, in an attempt to retract some of the guilt, I will try to summarize
what we have learned so far and some big notions that were introduced.
History of
computing technology
·
Data
were often stored in punched cards that were often not programmable, or not
electronic.
·
Technically,
because human labour was much cheaper (a lot electricity were required and was
more expansive) the first computers were ran by women as they worked more
efficiently
·
Eventually,
the computers became accessible to everyone although it still looks differently
from what we are use to
Important Notion: Boolean Logic
OR Gate
A
|
B
|
A or B
|
True
|
True
|
True
|
True
|
False
|
True
|
False
|
True
|
True
|
False
|
False
|
False
|
The way I
think about OR Gates are by saying that if either A or B are ‘True’, it is
automatically ‘True’. Thus, the moment
you see one ‘True’, the outcome is ‘True’. This is very useful in programming
as one when wants to let the program to take action when either outcome of A or
outcome of B is fulfilled. This ideology is often used not only in programming
but also in many other fields like math, physics, chemistry, etc.
AND GATE
A
|
B
|
A and B
|
True
|
True
|
True
|
True
|
False
|
False
|
False
|
True
|
False
|
False
|
False
|
False
|
AND Gates
are in a way opposite of OR Gates. This is because both A and B must be ‘True’
in order for the outcome to be ‘True’. Thus, I always look at both A and B and
attempt to find ‘False’ (instead of ‘True’ like the OR gate) and the moment I
see ‘False’ in either A or B, I know the outcome is ‘False’. This is often used
in programming and other areas of academics when one wants to let more than one
criterion to be satisfied before taking any action as an outcome.
NOT GATE
A
|
NOT A
|
True
|
False
|
False
|
True
|
NOT Gates
are very simple in short statements that don’t involve multiple steps as the
output is just the opposite of the input. One of the most important idea to
take away from NOT gates are the fact that it is very important to know where
the NOT gates are introduced. For example (NOT (A or B)) can be very different
from (A or (NOT B)). With one misstep
with integrating NOT gates in circuits will completely ruins the result and one
must be always careful to locate where the NOT gates are position within a
circuit or a statement.
Important Notion: Binary Numbers
Binary vs. Base 10
Binary -> Base 10
In order to
get binary to base 10, one just needs to know two things. One is that the
binary numbers are only in 0 or 1. Second is that the first number of binary
number corresponds to 2^0 and second number will correspond to 2^1, and it goes
on. So in a way, you have to read the binary numbers from right to left in
order to correctly identify which power it will go until.
Ex
111011 = 1
(2^5) + 1(2^4) + 1(2^3)+ 0(2^4) + 1(2^3) + 0(2^0) + 1(2^1) + 1(2^0) = 59 (in
base 10)
Base 10 -> Binary
I believe
this is best explained if one were to ask a series of questions. Here is an
example,
Ex
Base 10
number is 59.
So we ask
ourselves, does 59 fit for 2^(biggest number it can fit into)
59 ->
Does it fit for 2^6? Answer: NO
59 ->
Does it fit for 2^5? Answer: YES
Since 2^5 =
32, then 59-32=27, and thus our new number that we ask questions to is 27
27 ->
Does it fit for 2^4? Answer: YES
Like the
last part, 27-2^4=11
11->
Does it fit for 2^3? Answer: YES
11-2^3=3
3->Does
it fit for 2^2? Answer: NO
3->Does
it fit for 2^1? Answer: YES
3-2=1
1-> Does
it fit for 2^0? Answer: YES
1-1=0
Okay, now
that we have reached 0, we can begin to construct our binary number. By looking
at all the ‘YES’s from the questions, that is where you would have 1, and 0
will correspond to ‘NO’
So again,
writing from right to left and reading the questions from bottom to top.
You should
get 0111011, since the first 0 is insignificant, you may take it out and thus
you get: 59=111011 in binary numbers.
Binary Addition
First thing
to know is the basic addition:
0+0=0
0+1=1
1+1=10 (not
10, but 1 and 0)
1+1+1=11
(again, not 11, but 1 and 1)
|
It is very
simple to basic addition we learned in elementary school, except that there are
only 0 and 1 and the additions to those are stated above.
Binary Subtraction
Same
subtraction as normal 0 and 1:
1-0=1
|
Binary Multiplication
Basic multiplication:
0x0=0
1x0=0
0x1=0
1x1=1 (with no
carries)
The way you perform
multiplication is very similar to normal multiplication, except when adding the
finished multiplied products, make sure to refer again to binary addition as it
follows those rules to perform the addition.
Ex
Binary Division
Binary division is
also very similar to normal division, thus in a way, division requires multiple
binary subtractions as you will constantly subtract the divided product to the
dividend.
Ex
Subscribe to:
Posts (Atom)





