Tuesday, December 4, 2012

End of the term


Hi, since the term is closing to an end, I thought I should give my general overview and how I feel about this course.

I believe this course was very beneficial to me as it provided a lot of fundamental insights on how computers and programs work and the history behind them. My initial intention of choosing this course was to familiarize myself with some of the basic intuition that is needed in order to program. Being in 3rd year of Astrophysics specialist, I realized how important programming is and that programming is inevitable in modern science. In experimental physics, almost every apparatus is run by a program and every data analysis is collected by using a program. This is the case because doing anything manually always introduces new errors and it is not very efficient when there are a lot of repetitive procedures.

At first, I really did not like programming as it was something that I was not use to and I would always make small mistakes and not know why I kept on getting errors. It was especially frustrating when you know what to do in your head but you can’t seem to be able to code it with correct syntax to make the program work. But after taking this course, I think I can safely say that my confidence in programming has gone up. I also enjoy programming these days as the feeling one gets when they finally get the program to work is incredibly amazing.

The power of programming really shines when you need to do something that’s repetitive and you find yourself doing it manually. It’s times like those where you would rather have a program to do what you’re doing in a second. Another beauty is that once you have a program do something very simple like combining all the colours of pictures, or cropping a picture to a background, it is re-usable whenever you need it again.

Overall, I really enjoyed this course as it was very a fun learning new functions from Dr.Racket and all the history behind the creation of computers and algorithms. I really hope this course remains available for many more years as I think it is one of the most useful and interesting introductory courses one can take in University of Toronto. 

Sunday, December 2, 2012

What to study/Going into the exam


Since the end date for SLOG is before the exam date, I thought I should provide my current plan for how I am going to study for the exam.
I think it is much simpler to study for this exam if we were to break it up into 5 parts:
     1) General basic knowledge
·         This will be done by mainly relying on the lecture notes and studying the slides
·         You also can’t underestimate the additional notes that were posted on the website
·         I also found from previous tests that some basic searches online helps a lot to understand the topics better
·         Don’t worry too much on small details/facts because most questions on the past tests have been conceptual and based on a idea (all word questions for basic knowledge part
·         If the exam is anything like test 2, then this section is very critical as half of the marks from test 2 was based on general knowledge on lecture notes and additional notes that were posted on the website
     2) Calculations
·         Although this is 100 level course and there aren't many calculations that has to be done, there are still some calculations within the course such as the binary to decimal and vise-versa
·         Since you know if the exam is anything like the past tests, it will have the general knowledge questions (usually word questions) then couple of calculation question that may have to do with Dr.Racket codes or just basic calculations we learned from the course such as Boolean outputs
      3) Coding (Dr.Racket)
·         This section is probably what is viewed as most difficult component of the test, however I think this is perhaps the easiest
·         First of all, we had a lot of time to deal with all the functions that would be mentioned on the test since we had tutorial and quiz every week that we had to prepare for
·         Secondly, professor told us that if we do not know a specific function and how it works, we can ask for that. Thus, we shouldn’t have any problem with a specific definition that we are not familiar with. Which implies that the only thing we have to worry about is the concept behind these functions and its capabilities
·         Lastly, in order to get more familiar with Dr.Racket, I am planning to re-do all the recommended questions and mainly focus ones that has answers as well so I can always double check if I did the coding correctly, rather than expecting that I did
Make sure to look over past exams and our previous quizzes which will give us a huge hint on how the exam will be formatted.
Good luck studying everyone!

Saturday, December 1, 2012

Tutorial exercise #9


Hi, I noticed that I did not write much about this week’s tutorial exercise (#9). So although it has already past, I thought I should give my impression of this week’s tutorial and also the quiz.

Starting off with koch.rkt, there are two primary functions within this program. Firstly, the koch itself which uses the input given (which is a number) and displays an output of a line or multiple lines. It will just output a normal horizontal line, but as you increase your number value as input, it will rotate 60 degrees then rotate -60 degrees from the last position to make a triangular shape (with no bottom) like ‘^’.  It will continually add as you increase the number. Thus in the next function, the koch-snowflake, it takes these individual koch’s and puts them together. Which will ultimately create and snowflake shape if the value for input is high enough. Next program is spiral.rkt. This program seems to have the same intuitive concept as koch.rkt where the user inputs a number and depending on that value, it will display an output of spiral lines. Overall, the two programs were not very complicated once one is able to wrap their head around it. The quiz consisted of 5 questions which were all related to the functions mentioned above, I am not sure if I got them all right but the questions were very fair considering that the questions were directly from the program we studied during the tutorial.

I hope everyone did well on the quizzes and project #2!

Friday, November 30, 2012

Project 2

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!


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.

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:

Tree1
leaf1 leaf2

Leaf = Definition for input that has empty left and right terms
i.e. (define leaf1 (make-gtree "ACTG" empty empty))

ACTG
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:

AAA
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.