Sunday, February 10, 2013

CSC104 SLOG Week 5 (of the course)- Tori

Hello again! :D


Introduction:

This week in CSC104 was a short one for me because: 1) I wasn't able to attend the first class of the week (which was on a Tuesday), and 2) we had our FIRST TEST on Thursday, which meant there was no Quiz or Tutorial on Friday! 

So, this week was even SHORTER than the previous weeks! 

I asked a wonderful friend for notes from the Tuesday I wasn't in class for, but unfortunately can't read much from them, and also am having a very difficult time understanding them, so I am going to ask her to explain them to me, AND go for much needed extra help! 

Also, I attempted to download the "Aggregates" link posted on the course website, but it didn't seem to work, so I NEED to get extra help for sure.

I will update this week's SLOG as soon as I understand what I missed last week.

Sorry to disappoint! I didn't forget about updating! 

Getting into the "SLOG" of Things:

I will update this section as soon as I have a clear understanding of what aggregates are and how they apply to this course. Sorry about that! 

Monday, February 4, 2013

CSC104 SLOG Week 4 (of the course)- Tori

TOPIC of the Week: DEFINING FUNCTIONS (Cue scary background music!!!)

Hello again! :)



Introduction:


Sorry for making this update quite late, but I've been SUPER busy with homework, midterms and assignments. 

This week in class, we REALLY got into the SLOG of things! My Professor changed up the pace and showed us how to define functions. Although I enjoyed seeing make barracuda move, I felt EXTREMELY intimidated because I didn't fully understand how to do the actual defining. So, as you might have already guessed, the quiz didn't go too well on Friday. :( Well, don't fret because I have a plan! :) I am going to see my Instructor for extra help with SPECIFIC questions such as: 
1) What does "rotate1" mean? 
2) What is the "1" used for? 
3) Can we do an example together that shows the steps (even on paper) in defining a function and making it rotate 360 Degrees? 

Before I ask my Professor these questions, I am going to take the initiative to try my best to figure out the answers by watching his videos from this week, which I will post later on in this SLOG. :)


Getting into the "SLOG" of Things:


Video 1 is about modelling simple events, such as rotating an image. I found it very helpful the first time I watched it, but I DEFINITELY need to watch it a few more times! ALL credit goes to Danny Heap, my Professor. His video is below.
Video 1: http://www.youtube.com/watch?feature=player_embedded&v=aujB2yNMBIw#!

Video 2 taught me to define the image more smoothly, rather than moving, say 90 Degrees, and then pausing for a while, and then moving another 90 Degrees, and so on. This video was interesting because I would NEVER have thought I would be learning how to rotate an image. Although I don't completely understand this exercise completely, I am going to re-watch this video and do the exercise ALONG with it. Once again, ALL credit goes to Danny Heap, my Professor. His second video of the week below.
Video 2: http://www.youtube.com/watch?feature=player_embedded&v=lOPMi1OIF_M

I really encourage you to go and look at these videos, because they're SO awesome, and extremely interesting! I will let you all know how my endeavor to understand this week's lectures goes next week! Also, I HAVE A MIDTERM IN COMPUTER SCIENCE THIS THURSDAY, FEB. 7th!!!!! I will  also keep you posted on how THAT goes. I am DETERMINED to do well on this test to make up for this week! 

I will be posting again soon! :)) Off to write an essay... :P

Friday, January 25, 2013

CSC104 SLOG Week 3 (of the course)- Tori


TOPIC of the Week: Composing Definitions (for Identifiers, Outputs, Functions without Design, Non predetermined Functions, and more!)                                                        



Introduction:



Hi everyone, and welcome back! :)

Today (Friday) officially ends week 3 of CSC104, and thus begins my weekly update! 

Wow! I honestly can't believe how quickly this week has flown by! Nevertheless, I have some new updates for you. :D

In terms of the Question to be answered later on, which was: "What programming language is being used to code for text (i.e. Dr. Racket, Java, etc.)??", I have yet to ask my Instructor about it, so I will most likely have an answer for you next week! :) 

So, let's see what I have learned this week.


Getting into the "SLOG" of Things:

This week (Week #3) in class, we discussed the quite difficult to understand, and daunting topic of DEFINING our own codes on Dr. Racket! :S I must admit, I was somewhat (*very*) intimidated, but Professor Heap reassured the class that we would not have to define functions on the upcoming Quiz (which I did today, actually)! Thank goodness! Whew! :P 
Although I'm still fairly intimidated with defining functions in the interactions pane, I am completely up for the challenge because I want to master Dr. Racket! :)

1) We learned how to make programming much easier for ourselves by defining certain "identifiers" to stand for certain words. This makes programming much easier in Dr. Racket because we don't have to CONSTANTLY copy and paste images, write out long numbers OR sentences! It's wonderful! :) Also,we were shown how to place images beside or on top of each other. Some of the images I used (a can of pop, for instance) came out VERY interesting to look at, to say the least!
The class was shown how to essentially create Dr. Racket "Inception" by creating a function application with other function applications WITHIN them! Wow! In performing this exercise, we learned to calculate the sum of, say 49 divided by 7 with 23 x 90, appending (adding) the first, say five, characters (**SEE string- append function from last week's post!) of "forty- three" to the first, say three, characters of thirty- seven to produce forty-thi
Also, we learned to horizontally and vertically flip an image (flip: horizontal (p)) or (flip: vertically (p)) and place it either next to or on top of itself. 
3) Then, we learned to define a function referred to as shrinking. This function first produces the original function, then places a half (1/2) scaled cope of that original image beside itself. As well, we defined a function called mirror-rosette, which produced the mirror image -going from left to right- of rosette. Rosette being another function we assigned an image, words, or numbers to. Again, rosette is a great tool used to make us lazy computer scientists that much more lazy!!! :D
4) The next part showed us how to create functions STEP-BY-STEP. :) I found this particularly useful, as breaking the steps down made the logic behind the steps MUCH easier. So, thanks, Sir! :) An example gave was to create a function using the words "half-flip". These two words take one image as input, and scales the SAME image to half of its size; hence the "half" in the function. Also, this function flips the image horizontally. 


Question to be answered later on (hopefully): 
For the "half- flip" function, how can I flip it vertically, and how do I know this particular function is flipping the image horizontally?

A short description and explanation of what we learned in each section of defining Dr. Racket functions:

1) Defining Identifiers (to stand for Dr. Racket Values) and Domestication for Dr. Racket:
- Setting identifiers to stand for values by typing the following in the interactions pane:
(require picturing-programs) 
(define jumbo (p)) --> type the word "jumbo" into the task pane and press enter to display only the image of the picture defined with the word "jumbo"
Similarly, this can be done for numbers: 
(require picturing-programs)
(define lucky 1.612131256) --> type the word "lucky"  into the task pane and press enter to display only the number defined with the word "lucky"
Also, this operation can be done with long sentences:
(require picturing-programs)
(define words "Today is the most wonderful day ever because it is a Friday. I was born on a Friday, and this day of the week signifies the start to the weekend.") --> type the word "words" into the task pane and press enter to display the words in commas. 
**REMINDER**: Once you have defined your values, DON'T FORGET to click "run" on the upper right corner of the Dr. Racket page
- To see each STEP performed in defining each of the values, click STEP. This will show you the steps in defining the function when you HIGHLIGHT the definitions you would like to see the steps for. You can select jump to--> beginning or end of selected area to narrow-down your steps even further and save time searching through the ENTIRE definition for a select word. :)
- The former (STEPS involved in defining each function) is useful because you can find the inverse of, say, "lucky", by typing the following into the interactions pane:
(define forgot-lucky lucky), you would type "forgot-lucky" in the task pane OR (define inverse-lucky (/ 1 lucky), you would simply type "inverse-lucky" in the task pane OR (define small-jumbo (scale 1/3 jumbo), you would type "small-jumbo" in the task pane--> scales the image to 1/3 of its original size. 
- You can define a new identifier to see what the first, say, 10 characters of the sentence defined by "words" is:
(define opening-words (substring words 0 10) --> "Today is the"
- Defining the functions further by typing:
(define mirror-small-(p)) (flip-horizontal small-jumbo)--> type "mirror-small-(p)" to evaluate to a new value

I enjoyed learning about how to simplify my life, even if it was only in one aspect (computers/ programming). I find these operations very useful in that they save a lot of time, and effort. Convenience is key in Computer Science! :)

ALL CREDIT goes to the YouTube channel "Danny Heap", who is my Professor: 

2) Composing Output as Input:

BEFORE I begin to explain what I learned in this section, I must admit that I was baffled, and did not fully understand this section; however, I will explain it as best I can, and will update this post next week when I understand it fully (I will be asking my Professor about this section!). 

Question to be answered later on:
How to define outputs as inputs? 

I will continue this post tomorrow. 














Friday, January 18, 2013

CSC104 SLOG Week 2 (of the course)- Tori

      TOPIC of the Week: Algorithms, Dr. Racket Language, Expressing, Combining and Transforming Values using Dr. Racket Language

Introduction:

Hello, and welcome to SLOGging for Survival! :) I'm glad you dropped by! In this Blog, I will be keeping a log of my participation in a course I am taking for Computer Science; recording milestones, difficulties, and steps to solve these difficulties as I learn. Also, I'll be reacting to concepts presented in the course material that I find interesting, weird, OR wacky! I will finally be adding questions whenever I think of one that I will be answering when I gain more knowledge about the subject, so, don't be alarmed! ;) hope you enjoy your visit! :D 

*Side note*: While composing this particular post, and because I now am somewhat familiar with what programming codes look like, I noticed that when one clicks the "HTML" button on the upper left side, the program code appears for what I have written thus far. Awesome and interesting! :)

Question to be answered later on (hopefully): 
What programming language is being used to code for text (i.e. Dr. Racket, Java, etc.)??

(Reminder: I will be able to answer this question in another post, hopefully!)

Getting into the "SLOG" of Things:

In class this week (Week #2), we discussed whether or not we could use algorithms to solve big problems (such as the meaning of life, or why life on Earth still continues to survive). The Instructor skillfully showed the class the potential issues with such an algorithm, such as if more than one way is created to solve issue 'X', then which way is best? As well, we considered how long and tedious it would be to write this algorithm.  Then, tips were given to solve new algorithmic problems, which I found extremely helpful because it will be of great assistance in the rest of the course! 

I really enjoyed learning about algorithms because they genuinely interest me, and I LOVE finding more efficient ways to do my Philosophy homework! ;) 

Also, we explored applications of Dr. Racket, and learned about racket values, but, more specifically: 1) Expressing Values, 2) Transforming Images, 3) Combining Values and 4) Decomposing Values. 

A short description and explanation of what we learned in each section of racket values:
1) Expressing Values:
- Flipping images (written as: flip-horizontal (p), or flip-vertical (p)). (p) is the image copied. 
- Converting decimals to improper fractions (done by right- clicking the decimal and selecting: "convert to mixed fraction")
- Finding dimensional values (height and width) of 2-Dimensional objects (written as image-height (p), or image-width (p)). 
- Finding the number of characters in a word/ sentence (performed by writing the word/ sentence wanting to be interpreted in (""). I.e. "amazing" has 7 characters. But, to find the number of characters in "amazing", I would type (string-length "amazing") into the interactions pane of Dr. Racket (not the top pane because that's where functions are defined). 7 would be the result of typing this word and using the latter as an algorithm. 
- Using true and false functions: i.e. (and true false) --> false (the "and" means ": are both of the words true?), i.e. 2. (or false true)--> true (the "or" means: at least 1 of these words are true). 

ALL CREDIT goes to the YouTube channel "Danny Heap", who is my Professor: http://www.youtube.com/watch?feature=player_embedded&v=Jg1tvgeKGqg

Something I enjoyed about this section was flipping images because I found it fun to change the original image to something different, and because this was a lot easier than trying to find a way to flip the image! I LOVE algorithms! They make life SO much easier, especially on Dr. Racket! :) 

2) Transforming Images:
- Flipping an image left or right (written as: (flip-main (p))- flips image on its left-hand side, and (flip-other (p)) flips image right-hand side
- Alt +P allows you to edit images that you've already used
- Scaling images (changing their size) (written as: (scale 3 (p))- meaning: scale the following image, (p) to 3 times its original size, or (scale 1/3 (p))- meaning: scale the following image (p) to 1/3 its original size. 
- Scaling images with "x" and "y" dimensions separately, "x" meaning height, and "y" meaning width by typing: (scale/xy 2 1/2 (p)). 2 applies to "x" and 1/2 applies to "y"). 
- Rotating images (rotate 180 (p))- meaning rotate (p) 180 degrees

Something I enjoyed about this section was how easy it was to scale separate dimensions of an image. This was great to learn because it is exact, unlike using the Microsoft Word cursor to make images a certain size; you simply type how much you need each dimension to be scaled by, and Dr. Racket scales it! Wonderful! :) Did I mention that I LOVE algorithms?! ;)

ALL CREDIT goes to the YouTube channel "Danny Heap", who is my Professor:

3) Combining Values:
- Overlaying images: (overlay (p1) (p2)). (p1) meaning the first image, (p2) meaning the second image, and so forth...
- Combining numbers with addition and multiplication: (+ 1 2 3 4) --> 10, and (* 1 3) --> 3. The "*" sign, in this case, means to multiply the numbers that follow that symbol
- Finding quotients (number of times one number goes into another): (quotient 9 3), meaning: how many times does 3 go into 9? --> 3
- Using the former (finding quotients) to find remainders! I.e. for how many times 9 goes into 24, first type (quotient 24 9)--> 2. Then, type (remainder 24 9)--> 6 (So, 24/9= ~2.6). 
- Combining strings (from 1). Use (string- append "hi" "my" "name" "is" "short") --> himynameisshort (like Twitter hash-tags!) 
- I learned to ask if numbers are equal, and the result was either "true" or "false". i.e. (equal? 3 9) --> false
- Asking whether 1<3<2: (< 1 3 2) --> false
:S - Asking whether 1/2 is less than or equal to 1... (or (< 1/2 1) (equal? 1/2 1)) --> true. --> I STILL DON'T FULLY UNDERSTAND THIS INSTRUCTION, so I accept this as a challenge, even though it frustrates me to no end. I will ask how to solve this and explain what is meant by the function (or (< 1/2 1) (equal? 1/2 1)) NEXT WEEK! So stay tuned! 
:S - Asking whether 1/2 is less than AND equal to 1 (and (<1/2 1) (equal? 1/2 1)) --> false (See above for the "or" --> I'm still confused! 

I plan to solve these understanding issues by asking my Instructor(s) for help, as well as looking over my notes, asking friends in the class to explain the concepts to me, and/or watching the videos provided for Combining Values. 

I enjoyed finding quotients easily because I usually take quite a long time to find quotients AND remainders of numbers without a calculator! I got very frustrated because I couldn't understand two commands, but will be sorting this problem out for next week! :) 

ALL CREDIT goes to the YouTube channel "Danny Heap", who is my Professor: 

4) Decomposing Values:
- Finding how many pixels wide an image is: (image- width (p)), or (image- height (p)) 
- Getting sum of image by cropping off top of image: (crop- top 100 (p)) - 100 means crop 100 pixels off the top of the image. Similarly, you can crop pixels off the left/ right/ etc. of the image by replacing the "top" with "left/ right/ etc."
- Cropping numbers (like pi or "e"): (round e) --> #i3.0 (#i means 3.0 is not an exact number)
- Converting inexact to exact: (inexact->exact #3.0) --> 3
- Rounding down to nearest integer: (floor e) --> #i2.0
- Pulling out numbers in a substring: (substring 01290192 2 4)- means pull out numbers 2-4 from the list given (01290192), BUT start counting numbers FROM ZERO and don't include the 4th number!! Solution: "2 9". This works for letters as well. 

I enjoyed learning how to crop images on Dr. Racket because I can't always find the crop tool on Microsoft word, so this is very convenient! :)

ALL CREDIT goes to the YouTube channel "Danny Heap", who is my Professor: 


Also, the Fibonacci sequence was converted into Dr. Racket language as follows:


(define (fib n)
(if
(< n 2)
n
(+ (fib (- n 1)) (fib (- n 2)))))


ALL CREDIT goes to Danny Heap, who provided the class with this endlessly useful and interesting method of defining the sequence! 

I feel quite confident about material covered this week, and enjoyed learning how to use algorithms! Also, I really like this course so far because I can relate the material to using technology, which is my goal. I want to understand what I'm using in terms of computing and technology in general! 

One of my achievements this week was learning how to use many functions in Dr. Racket! :D

My test went well this week, and hopefully this assignment (my SLOG) will go well as well! 



That's it for this week! :)