From f826a9c3a3bbac6e7a88aabe7cc5b991d7fecf48 Mon Sep 17 00:00:00 2001 From: Isaac Date: Mon, 12 Sep 2022 10:18:32 -0300 Subject: [PATCH] Edit blog posts to be more clear on home page --- journal/_src/posts/2022-09-07-lab-one.md | 1 - journal/_src/posts/2022-09-12-lab-two.md | 46 ++++++++++++++++++++---- journal/index.html | 19 +++++++--- journal/sitemap.txt | 1 + 4 files changed, 55 insertions(+), 12 deletions(-) diff --git a/journal/_src/posts/2022-09-07-lab-one.md b/journal/_src/posts/2022-09-07-lab-one.md index d231860..fb12537 100644 --- a/journal/_src/posts/2022-09-07-lab-one.md +++ b/journal/_src/posts/2022-09-07-lab-one.md @@ -1,7 +1,6 @@ Title: Lab One Date: 2022-09-12T08:50:12 Tags: cs2163, lab, frog, git -# Lab One In this lab we learned about how to use frog and git, and how to interact with the university git remote. ## Frog diff --git a/journal/_src/posts/2022-09-12-lab-two.md b/journal/_src/posts/2022-09-12-lab-two.md index 002326e..ee014f9 100644 --- a/journal/_src/posts/2022-09-12-lab-two.md +++ b/journal/_src/posts/2022-09-12-lab-two.md @@ -1,10 +1,42 @@ - Title: lab two + Title: Lab Two Date: 2022-09-12T08:43:16 - Tags: DRAFT - -_Replace this with your post text. Add one or more comma-separated -Tags above. The special tag `DRAFT` will prevent the post from being -published._ - + Tags: cs2163, lab, git, racket +In this lab we learned more about git, and using racket to draw shapes +## Additional Git Information +Git grep was useful in finding any file with the given content I am looking for without having to open all of them to find what I am looking for. This would have been useful to know before I removed the social media links without grep. + +Git status was useful in showing the status of my changes, and the added and untracked files. + +I also used `raco frog --clean` to keep my git repository clean before commiting. + +Git log showed me the history of my project's commits, which was useful in reminding myself what I had done the previous lab + +## Racket Introduction + +Running racket from the command line was not too hard and the display bug was fixed by simply using the `displayln` function instead of `display` + +DrRacket is a Racket IDE with a REPL. REPL stands for read-evaluate-print-loop, which is what the racket repl does. + +In DrRacket, I used the circle function (`(circle 10)`), the rectangle function (`(rectangle 10 20`) and that the error that is given when you try to run a function with too many arguments. I also learned how to combine the output (append) the output of two functions together. + +I learned how to define names for a specific function call, like saving the function `(circle 10)` as variable `c`. Appending the output of defined functions also works. For example `(hc-append c c)` would print `(circle 10)` twice. + +You can also use this functionality to define functions, for example, give your define statement an argument and you can use that within the rest of the define statement. This is best examplained by showing that `(define (square n) (filled-rectangle n n))` will define a square by using the pre-existing filled rectangle function. + +In racket you can create what are known as "local bindings" which are functions that are local (belong to) a parent function. You can define these individually with another define function, or to define them by using `let` or `let*`, with the latter letting later bindings use earlier bindings. Both of them let you define more than one binding at once. + +It was also noted how identifiers were scoped within a language, with a function arguemnt being avialable throughout the function, and when a variable is not in scope, it does not "exist" so can therefor be defined again, like in this example +``` +(define (rgb-series mk) + (vc-appned + (series (lamda (sz) (colorize (mk sz) "red"))) + (series (lamda (sz) (colorize (mk sz) "green"))) + (series (lamda (sz) (colorize (mk sz) "blue"))))) +``` +This shows that sz can be defined multiple times because within a given series each sz is only within the scope of the series, and each sz is therefor unique. + +Lists in Racket are very important and this can be seen through the way functions map onto lists. As shown in the documentation you can map a list of squares to a colorize function which contains a list of colors. You can also apply things to lists. + +Racket also features a module system, which is where you declare the set of the language you are working on with the `#lang` keyword. You can also import additional libraries with the `require` keyword. You can install modules from racket files or from the raco package manager that comes with Racket. \ No newline at end of file diff --git a/journal/index.html b/journal/index.html index 904bb1a..dab8569 100644 --- a/journal/index.html +++ b/journal/index.html @@ -6,7 +6,7 @@ CS2163 Blog - + @@ -57,7 +57,7 @@ @@ -97,12 +97,23 @@

By: Isaac Shoebottom

-

Lab One

-

In this lab we learned about how to use frog and git, and how to interact with the university git remote.

+ +
+
+

Lab Two

+

+ - cs2163, lab, git, racket

+

By: Isaac Shoebottom

+
+ +

In this lab we learned more about git, and using racket to draw shapes

+
diff --git a/journal/sitemap.txt b/journal/sitemap.txt index 36a8139..9d7e653 100644 --- a/journal/sitemap.txt +++ b/journal/sitemap.txt @@ -1,2 +1,3 @@ http://www.example.com/2022/09/lab-one.html +http://www.example.com/2022/09/lab-two.html http://www.example.com/About.html