From 8552efd74a7b50afc87b536451e6e86125f1c19a Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Mon, 18 Dec 2023 22:21:30 -0700 Subject: fix spelling --- Content/about/index.md | 4 +- .../2019-05-05-Custom-Snowboard-Anemone-Theme.md | 2 +- ...2020-01-16-Image-Classifier-Using-Turicreate.md | 2 +- .../posts/2020-03-03-Playing-With-Android-TV.md | 4 +- Content/posts/2020-03-08-Making-Vaporwave-Track.md | 2 +- Content/posts/2023-03-17-future-of-writing.md | 5 +- Content/posts/2023-04-30-n-body-simulation.md | 6 +- Content/posts/2023-10-04-bomb-lab.md | 6 +- Content/posts/2023-11-28-shell-lab.md | 145 +++++++++++++++++++++ 9 files changed, 161 insertions(+), 15 deletions(-) create mode 100644 Content/posts/2023-11-28-shell-lab.md (limited to 'Content') diff --git a/Content/about/index.md b/Content/about/index.md index f5f251f..55fc7a5 100644 --- a/Content/about/index.md +++ b/Content/about/index.md @@ -10,7 +10,7 @@ Hi! My name is Navan Chauhan. I do lots of different things. Most of the bigger projects I am working on are currently private/unlisted. Although, all of them will be open-sourced, I don't want to publish them until I am happy with the version 1.0. -Main website with links: [https://navan.website](https://navan.website) +Landing page with other links, and projects: [https://hi.navan.dev](https://hi.navan.dev) ## Contact Me @@ -26,4 +26,4 @@ My GPG Fingerprint: * [Mirror: Personal Instance of Gitea](https://pi4.navan.dev/gitea) * [GoatCounter: This Website's Analytics](https://navanchauhan.goatcounter.com) * [Twitter: @navanchauhan](https://github.com/navanchauhan) -* [Mastodon: @navanchauhan@mastodon.social](https://mastodon.social/@navanchauhan) \ No newline at end of file +* [Mastodon: @navanchauhan@mastodon.social](https://mastodon.social/@navanchauhan) diff --git a/Content/posts/2019-05-05-Custom-Snowboard-Anemone-Theme.md b/Content/posts/2019-05-05-Custom-Snowboard-Anemone-Theme.md index 5ae9970..144c249 100644 --- a/Content/posts/2019-05-05-Custom-Snowboard-Anemone-Theme.md +++ b/Content/posts/2019-05-05-Custom-Snowboard-Anemone-Theme.md @@ -43,7 +43,7 @@ tags: Tutorial, Jailbreak, Designing, Snowboard, Anemone Now, you might ask what is the difference between `PackageName` and `ThemeName`? -Well, if for example you want to publish two variants of your icons, one dark and one white but you do not want the user to seperately install them. +Well, if for example you want to publish two variants of your icons, one dark and one white but you do not want the user to separately install them. Then, you would name the package `MyTheme` and include two themes `Blackie` and `White` thus creating two entries. More about this in the end ## Creating Icons diff --git a/Content/posts/2020-01-16-Image-Classifier-Using-Turicreate.md b/Content/posts/2020-01-16-Image-Classifier-Using-Turicreate.md index 5045a57..e45c337 100644 --- a/Content/posts/2020-01-16-Image-Classifier-Using-Turicreate.md +++ b/Content/posts/2020-01-16-Image-Classifier-Using-Turicreate.md @@ -6,7 +6,7 @@ tags: Tutorial, Colab, Turicreate # Creating a Custom Image Classifier using Turicreate to detect Smoke and Fire -*For setting up Kaggle with Google Colab, please refer to my previous post* +*For setting up Kaggle with Google Colab, please refer to my previous post* ## Dataset diff --git a/Content/posts/2020-03-03-Playing-With-Android-TV.md b/Content/posts/2020-03-03-Playing-With-Android-TV.md index ace4f4c..841646b 100644 --- a/Content/posts/2020-03-03-Playing-With-Android-TV.md +++ b/Content/posts/2020-03-03-Playing-With-Android-TV.md @@ -34,13 +34,13 @@ The other option is to go to your router's server page and get connected devices * Go To Settings * About -* Continously click on the "Build" option until it says "You are a Developer" +* Continuously click on the "Build" option until it says "You are a Developer" ## Enable-ADB * Go to Settings * Go to Developer Options -* Scroll untill you find ADB Debugging and enable that option +* Scroll until you find ADB Debugging and enable that option ## Connect-ADB diff --git a/Content/posts/2020-03-08-Making-Vaporwave-Track.md b/Content/posts/2020-03-08-Making-Vaporwave-Track.md index 6d96871..8c82d3b 100644 --- a/Content/posts/2020-03-08-Making-Vaporwave-Track.md +++ b/Content/posts/2020-03-08-Making-Vaporwave-Track.md @@ -14,7 +14,7 @@ Vaporwave is all about A E S T H E T I C S. Vaporwave is a type of music genre t # How to Vaporwave -The first track which is considered to be actual Vaporwave is Ramona Xavier's Macintosh Plus, this set the the guidelines for making Vaporwave +The first track which is considered to be actual Vaporwave is Ramona Xavier's Macintosh Plus, this set the guidelines for making Vaporwave * Take a 1980s RnB song * Slow it down diff --git a/Content/posts/2023-03-17-future-of-writing.md b/Content/posts/2023-03-17-future-of-writing.md index 8a3584a..b77bac6 100644 --- a/Content/posts/2023-03-17-future-of-writing.md +++ b/Content/posts/2023-03-17-future-of-writing.md @@ -2,6 +2,7 @@ date: 2023-03-17 13:57 description: My thoughts on writing in the 21st century. tags: ramblings, writing +draft: true --- # Future of Writing @@ -17,7 +18,7 @@ able to recall anything with 100% guarantee. So, the question arises, does it still make sense to put time and effort into writing blog posts? You can simply ask an autoregressive model to generate it for you, based on bullet points. -I feel like writitng still has a place in this world. Limitting ourselves to a model trained on a finite dataset, feels like an insult to creativity. +I feel like writitng still has a place in this world. Limiting ourselves to a model trained on a finite dataset, feels like an insult to creativity. If neural networks stopped being prediction machines, and were actually able to "think", I would still believe that creativity wins. Even if that creativity was now coming from the machine. @@ -27,4 +28,4 @@ As long as I am alive, and I have the spirit of being rebellious, I am never goi Even if we have a tool that can generate the perfect essay, we humans will still write. -Why? Just because we can. \ No newline at end of file +Why? Just because we can. diff --git a/Content/posts/2023-04-30-n-body-simulation.md b/Content/posts/2023-04-30-n-body-simulation.md index 6d6cda6..9c8e7b1 100644 --- a/Content/posts/2023-04-30-n-body-simulation.md +++ b/Content/posts/2023-04-30-n-body-simulation.md @@ -23,11 +23,11 @@ Workflow: The n-body problem is a classic puzzle in physics (and thus astrophysics) and mathematics that deals with predicting the motion of multiple celestial objects that interact with each other through gravitational forces. -Imagine you are observing a *cosmic dance* between multiple celestial bodies, all tugging on one another as they move through space. The n-body problem aims to undersand and predict the paths of these objects as they move through space. +Imagine you are observing a *cosmic dance* between multiple celestial bodies, all tugging on one another as they move through space. The n-body problem aims to understand and predict the paths of these objects as they move through space. When `n=2`, i.e we have only two objects, say the Earth and the Moon, we can easily apply Newtonian physics to predict their motion. However, when `n>2`, the problem becomes much more difficult to solve analytically.[1] This is because each object feels the gravitational pull from all other objects, and thus the equations of motion become coupled and non-linear. -As the number of objects increases, finding an exact solution becomes impossible, and we rely on analyticals approximations. +As the number of objects increases, finding an exact solution becomes impossible, and we rely on analytical approximations. ## Visualising a basic orbit @@ -717,4 +717,4 @@ function plotRandomNBodySimulation() { ## References 1. Barrow-Green, June (2008), "The Three-Body Problem", in Gowers, Timothy; Barrow-Green, June; Leader, Imre (eds.), *The Princeton Companion to Mathematics*, Princeton University Press, pp. 726–728 -2. Moore, Cristopher (1993), "Braids in classical dynamics", *Physical Review Letters*, 70 (24): 3675–3679 \ No newline at end of file +2. Moore, Cristopher (1993), "Braids in classical dynamics", *Physical Review Letters*, 70 (24): 3675–3679 diff --git a/Content/posts/2023-10-04-bomb-lab.md b/Content/posts/2023-10-04-bomb-lab.md index 8205765..91f8f9f 100644 --- a/Content/posts/2023-10-04-bomb-lab.md +++ b/Content/posts/2023-10-04-bomb-lab.md @@ -133,7 +133,7 @@ The program first compares if the first number is not 0. If the number is not 0, By executing `mov %rsp,%rbp` we are setting the base pointer (`%rbp`) to point to this address. -Now, for the second instruction `mov $0x1,%ebx`, we are initalising the `%ebx` register with the value 1. Based on the assembly code, you can see that this is being used as a counter/index for the loop. +Now, for the second instruction `mov $0x1,%ebx`, we are initialising the `%ebx` register with the value 1. Based on the assembly code, you can see that this is being used as a counter/index for the loop. ```shell @@ -168,7 +168,7 @@ Then, the value at the memory location pointed by `%rbp` is added to the value i 0x0000555555555628 <+61>: je 0x555555555614 ``` -Here, we can see that the program increments `%ebx` by 1, adds a 4 byte offset to `%rbp` (the number we will be matching now), and checks if `%ebx` is equal to 6. If it is, it breaks the loop and jumps to `` succesfully finishing this stage. +Here, we can see that the program increments `%ebx` by 1, adds a 4 byte offset to `%rbp` (the number we will be matching now), and checks if `%ebx` is equal to 6. If it is, it breaks the loop and jumps to `` successfully finishing this stage. Now, given that we know the first two numbers in the sequence are `0 1`, we can calculate the other numbers by following the pattern of adding the counter and the value of the previous number. @@ -372,7 +372,7 @@ BINGO! The program expects an integer, character, and another integer. Onwards. The program checks whether `scanf` returns a value <= 2, if it does then it calls the `explode_bomb` function. -*Note: `scanf` returns the number of fields that were succesfully converted and assigned* +*Note: `scanf` returns the number of fields that were successfully converted and assigned* ```shell 0x0000555555555665 <+45>: cmpl $0x7,0xc(%rsp) diff --git a/Content/posts/2023-11-28-shell-lab.md b/Content/posts/2023-11-28-shell-lab.md new file mode 100644 index 0000000..ab735b8 --- /dev/null +++ b/Content/posts/2023-11-28-shell-lab.md @@ -0,0 +1,145 @@ +--- +date: 2023-11-28 +description: Walkthrough of Shell Lab for CSCI 2400 Computer Systems +tags: C, CSCI2400, UNIX +draft: true +--- + +# Shell Lab + +## Introduction + + +... + + +We will be solving this lab trace by trace. + +## trace01 + +We don't have to do anything here. The pre-existing code skeleton already passes this. + +## trace 02 + +``` +# +# trace02.txt - Process builtin quit command. +# +quit +WAIT +``` + +From the lab handout, we know that we need to implement this in the `builtin_cmd` + +``` +// builtin_cmd: Recognizes and interprets the built-in commands: quit, fg, bg, and jobs. [25 lines] + +///////////////////////////////////////////////////////////////////////////// +// +// builtin_cmd - If the user has typed a built-in command then execute +// it immediately. The command name would be in argv[0] and +// is a C string. We've cast this to a C++ string type to simplify +// string comparisons; however, the do_bgfg routine will need +// to use the argv array as well to look for a job number. +// +int builtin_cmd(char **argv) +{ + string cmd(argv[0]); + return 0; /* not a builtin command */ +} +``` + +We can simply add an if statement and check if the passes string is equal to `quit` + +``` +int builtin_cmd(char **argv) +{ + string cmd(argv[0]); + if (cmd == "quit") { + exit(0); + } + return 0; /* not a builtin command */ +} +``` + +Now, we also need to make sure we are checking if the passes command is a builtin command. So, looking at `eval` + +``` +///////////////////////////////////////////////////////////////////////////// +// +// eval - Evaluate the command line that the user has just typed in +// +// If the user has requested a built-in command (quit, jobs, bg or fg) +// then execute it immediately. Otherwise, fork a child process and +// run the job in the context of the child. If the job is running in +// the foreground, wait for it to terminate and then return. Note: +// each child process must have a unique process group ID so that our +// background children don't receive SIGINT (SIGTSTP) from the kernel +// when we type ctrl-c (ctrl-z) at the keyboard. +// +void eval(char *cmdline) +{ + /* Parse command line */ + // + // The 'argv' vector is filled in by the parseline + // routine below. It provides the arguments needed + // for the execve() routine, which you'll need to + // use below to launch a process. + // + char *argv[MAXARGS]; + + // + // The 'bg' variable is TRUE if the job should run + // in background mode or FALSE if it should run in FG + // + int bg = parseline(cmdline, argv); + if (argv[0] == NULL) + return; /* ignore empty lines */ + + return; +} +``` + +We simply add a check for `builtin_cmd` + +``` +void eval(char *cmdline) +{ + /* Parse command line */ + // + // The 'argv' vector is filled in by the parseline + // routine below. It provides the arguments needed + // for the execve() routine, which you'll need to + // use below to launch a process. + // + char *argv[MAXARGS]; + + // + // The 'bg' variable is TRUE if the job should run + // in background mode or FALSE if it should run in FG + // + int bg = parseline(cmdline, argv); + + if (argv[0] == NULL) + return; /* ignore empty lines */ + + // First check if it is a builtin command + if (!builtin_cmd(argv)) { + return; + } + + return; +} +``` + +## Trace 03 + +``` +# +# trace03.txt - Run a foreground job. +# +/bin/echo tsh> quit +quit +``` + + -- cgit v1.2.3