diff --git a/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json b/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json index a5186d3..4e92e41 100644 --- a/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json +++ b/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json @@ -80,7 +80,7 @@ "File Hashes": { "algorithms/index.md": "1583c07edea4736db27c38fe2b6c4c31", "algorithms/sorting/index.md": "2d5a18a3079d96fa9e3d4289181a8b6c", - "algorithms/sorting/insertion-sort.md": "e26909d0b4097e8e072d0b19667bf586", + "algorithms/sorting/insertion-sort.md": "d40da14992d8331a07cebe1c4cfa41d4", "bash/index.md": "3b5296277f095acdf16655adcdf524af", "bash/prompts.md": "61cb877e68da040a15b85af76b1f68ba", "bash/quoting.md": "b1d8869a91001f8b22f0cdc54d806f61", @@ -88,8 +88,8 @@ "bash/shebang.md": "9006547710f9a079a3666169fbeda7aa", "c/escape-sequences.md": "0d6219ebb51f6f21e026de67603e25b8", "c/index.md": "aa8a34c62e7bc284ff589e28609222dc", - "gawk/index.md": "b1e9209e0ab1f7837b004f51d72200c2", - "gawk/variables.md": "ba568df484571c8e0fa89d0005c827c0", + "gawk/index.md": "0a305a0477085fd2f4145536735ca94a", + "gawk/variables.md": "8c567c9e387f1bed8200cf28a7e28502", "index.md": "e48e895feeed7046425bb2ee15419770", "journal/2024-01-31.md": "7c7fbfccabc316f9e676826bf8dfe970", "journal/2024-02-01.md": "3aa232387d2dc662384976fd116888eb", @@ -103,9 +103,9 @@ "posix/index.md": "f7b1ae55f8f5e8f50f89738b1aca9111", "posix/signals.md": "2120ddd933fc0d57abb93c33f639afd8", "templates/daily.md": "7866014e730e85683155207a02e367d8", - "posix/regexp.md": "e41bf86b770958316df1e20578d6020f", + "posix/regexp.md": "43825a1b9ed0dd7eeb1b6fe35c928bfe", "journal/2024-02-04.md": "e2b5678fc53d7284b71ed6820c02b954", - "gawk/regexp.md": "dbd5f9f85a2658b304a635a47379e871", + "gawk/regexp.md": "d9229f1eabe1b99e965eecaa03bee86c", "_templates/daily.md": "7866014e730e85683155207a02e367d8", "_journal/2024-02-05.md": "f8505abd415c50fd97c81fd6153a6d4f", "_journal/2024-02-06.md": "1ea415f3c3f5be17f796b9a0d4df565f", @@ -114,22 +114,35 @@ "_journal/2024-02-02.md": "a3b222daee8a50bce4cbac699efc7180", "_journal/2024-02-01.md": "3aa232387d2dc662384976fd116888eb", "_journal/2024-01-31.md": "7c7fbfccabc316f9e676826bf8dfe970", - "logic/equiv-trans.md": "e8f25b1425d4dfc8c5dc01a3ff71d08f", + "logic/equiv-trans.md": "6554eae8e908f848059043299dfb51c6", "_journal/2024-02-07.md": "8d81cd56a3b33883a7706d32e77b5889", "algorithms/loop-invariants.md": "cbefc346842c21a6cce5c5edce451eb2", "algorithms/loop-invariant.md": "d883dfc997ee28a7a1e24b995377792b", "algorithms/running-time.md": "5efc0791097d2c996f931c9046c95f65", "algorithms/order-growth.md": "6e0f9e751eab24d74652851454264008", "_journal/2024-02-08.md": "19092bdfe378f31e2774f20d6afbfbac", - "algorithms/sorting/selection-sort.md": "212140ad8bf70a56b73080bc7317f643", + "algorithms/sorting/selection-sort.md": "73a077a726afd376650d1bd9e2d0bed9", "algorithms/index 1.md": "6fada1f3d5d3af64687719eb465a5b97", "binary/hexadecimal.md": "a9633bbc9b53cc8c16ce6e56022f62e0", - "binary/index.md": "d41d8cd98f00b204e9800998ecf8427e", - "_journal/2024-02-09.md": "4a9ecfac710160c2d8d11077a739a97b", + "binary/index.md": "a67b5d0c8ac53e076590f315cce22201", + "_journal/2024-02-09.md": "a798d35f0b2bd1da130f7ac766166109", "c/types.md": "cf3e66e5aee58a94db3fdf0783908555", "logic/quantification.md": "b7cf646a8c33aa83f48ddc37c733fafb", "c/declarations.md": "381bb6ddbecd369b78012112b3a8e5de", - "algorithms/sorting/bubble-sort.md": "6bffe3dabde3d6d4414ca3b5afdb1684" + "algorithms/sorting/bubble-sort.md": "16dad1016dc6555163e42ba20f1d152d", + "_journal/2024-02-10.md": "562b01f60ea36a3c78181e39b1c02b9f", + "_journal/2024-01/2024-01-31.md": "7c7fbfccabc316f9e676826bf8dfe970", + "_journal/2024-02/2024-02-09.md": "a798d35f0b2bd1da130f7ac766166109", + "_journal/2024-02/2024-02-08.md": "19092bdfe378f31e2774f20d6afbfbac", + "_journal/2024-02/2024-02-07.md": "8d81cd56a3b33883a7706d32e77b5889", + "_journal/2024-02/2024-02-06.md": "1ea415f3c3f5be17f796b9a0d4df565f", + "_journal/2024-02/2024-02-05.md": "f8505abd415c50fd97c81fd6153a6d4f", + "_journal/2024-02/2024-02-04.md": "f77a3c5f3ce7969120f226738836dc92", + "_journal/2024-02/2024-02-03.md": "c6d411f0e2e964270399dd3a99f48382", + "_journal/2024-02/2024-02-02.md": "a3b222daee8a50bce4cbac699efc7180", + "_journal/2024-02/2024-02-01.md": "3aa232387d2dc662384976fd116888eb", + "_journal/2024-02/2024-02-10.md": "562b01f60ea36a3c78181e39b1c02b9f", + "_journal/2024-02-11.md": "b8c72e835176c4b3e779e5243fc77b6b" }, "fields_dict": { "Basic": [ diff --git a/notes/_journal/2024-01-31.md b/notes/_journal/2024-01/2024-01-31.md similarity index 100% rename from notes/_journal/2024-01-31.md rename to notes/_journal/2024-01/2024-01-31.md diff --git a/notes/_journal/2024-02-11.md b/notes/_journal/2024-02-11.md new file mode 100644 index 0000000..ec2be51 --- /dev/null +++ b/notes/_journal/2024-02-11.md @@ -0,0 +1,11 @@ +--- +title: "2024-02-11" +--- + +- [ ] Anki Flashcards +- [ ] KoL +- [ ] Sheet Music (10 min.) +- [ ] OGS (1 Life & Death Problem) +- [ ] Korean (Read 1 Story) +- [ ] Interview Prep (1 Practice Problem) +- [ ] Log Work Hours (Max 3 hours) \ No newline at end of file diff --git a/notes/_journal/2024-02-01.md b/notes/_journal/2024-02/2024-02-01.md similarity index 100% rename from notes/_journal/2024-02-01.md rename to notes/_journal/2024-02/2024-02-01.md diff --git a/notes/_journal/2024-02-02.md b/notes/_journal/2024-02/2024-02-02.md similarity index 100% rename from notes/_journal/2024-02-02.md rename to notes/_journal/2024-02/2024-02-02.md diff --git a/notes/_journal/2024-02-03.md b/notes/_journal/2024-02/2024-02-03.md similarity index 100% rename from notes/_journal/2024-02-03.md rename to notes/_journal/2024-02/2024-02-03.md diff --git a/notes/_journal/2024-02-04.md b/notes/_journal/2024-02/2024-02-04.md similarity index 100% rename from notes/_journal/2024-02-04.md rename to notes/_journal/2024-02/2024-02-04.md diff --git a/notes/_journal/2024-02-05.md b/notes/_journal/2024-02/2024-02-05.md similarity index 100% rename from notes/_journal/2024-02-05.md rename to notes/_journal/2024-02/2024-02-05.md diff --git a/notes/_journal/2024-02-06.md b/notes/_journal/2024-02/2024-02-06.md similarity index 100% rename from notes/_journal/2024-02-06.md rename to notes/_journal/2024-02/2024-02-06.md diff --git a/notes/_journal/2024-02-07.md b/notes/_journal/2024-02/2024-02-07.md similarity index 100% rename from notes/_journal/2024-02-07.md rename to notes/_journal/2024-02/2024-02-07.md diff --git a/notes/_journal/2024-02-08.md b/notes/_journal/2024-02/2024-02-08.md similarity index 100% rename from notes/_journal/2024-02-08.md rename to notes/_journal/2024-02/2024-02-08.md diff --git a/notes/_journal/2024-02-09.md b/notes/_journal/2024-02/2024-02-09.md similarity index 53% rename from notes/_journal/2024-02-09.md rename to notes/_journal/2024-02/2024-02-09.md index 1d546ec..7454e68 100644 --- a/notes/_journal/2024-02-09.md +++ b/notes/_journal/2024-02/2024-02-09.md @@ -6,9 +6,11 @@ title: "2024-02-09" - [x] KoL - [x] Sheet Music (10 min.) - [ ] OGS (1 Life & Death Problem) -- [ ] Korean (Read 1 Story) +- [x] Korean (Read 1 Story) - [ ] Interview Prep (1 Practice Problem) -- [ ] Log Work Hours (Max 3 hours) +- [x] Log Work Hours (Max 3 hours) * Logged information about prominent predefined `awk` variables. -* Created flashcards for C data type declarations. \ No newline at end of file +* Created flashcards for C data type declarations. +* Added notes on bubble sort. +* Added notes on existential/universal quantification. \ No newline at end of file diff --git a/notes/_journal/2024-02/2024-02-10.md b/notes/_journal/2024-02/2024-02-10.md new file mode 100644 index 0000000..ce7826c --- /dev/null +++ b/notes/_journal/2024-02/2024-02-10.md @@ -0,0 +1,13 @@ +--- +title: "2024-02-10" +--- + +- [x] Anki Flashcards +- [x] KoL +- [x] Sheet Music (10 min.) +- [x] OGS (1 Life & Death Problem) +- [ ] Korean (Read 1 Story) +- [ ] Interview Prep (1 Practice Problem) +- [ ] Log Work Hours (Max 3 hours) + +* Some reading around how `awk` handles field separators. \ No newline at end of file diff --git a/notes/algorithms/sorting/bubble-sort.md b/notes/algorithms/sorting/bubble-sort.md index 4142947..98c36e2 100644 --- a/notes/algorithms/sorting/bubble-sort.md +++ b/notes/algorithms/sorting/bubble-sort.md @@ -20,6 +20,14 @@ Adaptive | Yes ![[bubble-sort.gif]] +%%ANKI +Basic +Describe bubble sort in a single sentence. +Back: Repeatedly swap the smaller of adjacent records downward. +Reference: Thomas H. Cormen et al., *Introduction to Algorithms*, 3rd ed (Cambridge, Mass: MIT Press, 2009). + +END%% + %%ANKI Basic What is bubble sort's best case runtime? diff --git a/notes/algorithms/sorting/insertion-sort.md b/notes/algorithms/sorting/insertion-sort.md index ef12231..db72e53 100644 --- a/notes/algorithms/sorting/insertion-sort.md +++ b/notes/algorithms/sorting/insertion-sort.md @@ -20,6 +20,14 @@ Adaptive | Yes ![[insertion-sort.gif]] +%%ANKI +Basic +Describe insertion sort in a single sentence. +Back: Repeatedly put the next record into a sorted array from right to left. +Reference: Thomas H. Cormen et al., *Introduction to Algorithms*, 3rd ed (Cambridge, Mass: MIT Press, 2009). + +END%% + %%ANKI Basic What is insertion sort's best case runtime? diff --git a/notes/algorithms/sorting/selection-sort.md b/notes/algorithms/sorting/selection-sort.md index 70ef18d..7e1285a 100644 --- a/notes/algorithms/sorting/selection-sort.md +++ b/notes/algorithms/sorting/selection-sort.md @@ -20,6 +20,15 @@ Adaptive | No ![[selection-sort.gif]] + +%%ANKI +Basic +Describe selection sort in a single sentence. +Back: Repeatedly put the smallest unsorted record at the end of a sorted array. +Reference: Thomas H. Cormen et al., *Introduction to Algorithms*, 3rd ed (Cambridge, Mass: MIT Press, 2009). + +END%% + %%ANKI Basic What is selection sort's best case runtime? diff --git a/notes/gawk/index.md b/notes/gawk/index.md index 52d1e29..4c60f84 100644 --- a/notes/gawk/index.md +++ b/notes/gawk/index.md @@ -293,6 +293,36 @@ Reference: Robbins, Arnold D. “GAWK: Effective AWK Programming,” October 202 END%% +%%ANKI +Basic +What is the output of the following? +```bash +$ echo ' abc' | awk '{ print }' +``` +Back: `‏‏‎ ‎abc` (with leading whitespace) +Reference: Robbins, Arnold D. “GAWK: Effective AWK Programming,” October 2023. [https://www.gnu.org/software/gawk/manual/gawk.pdf](https://www.gnu.org/software/gawk/manual/gawk.pdf) + +END%% + +%%ANKI +Basic +What is the output of the following? +```bash +$ echo ' abc' | awk ' { $1 = $1; print }' +``` +Back: `abc` (without leading whitespace) +Reference: Robbins, Arnold D. “GAWK: Effective AWK Programming,” October 2023. [https://www.gnu.org/software/gawk/manual/gawk.pdf](https://www.gnu.org/software/gawk/manual/gawk.pdf) + +END%% + +%%ANKI +Basic +How is `$$0` rebuilt after assignment `$1 = $1`? +Back: By intercalating `OFS` between values of `$1` through `NF`. +Reference: Robbins, Arnold D. “GAWK: Effective AWK Programming,” October 2023. [https://www.gnu.org/software/gawk/manual/gawk.pdf](https://www.gnu.org/software/gawk/manual/gawk.pdf) + +END%% + ## Exit Status On success, `gawk` exits with status code `EXIT_SUCCESS`. On failure, with status code `EXIT_FAILURE`. On fatal error, `gawk` exists with status code `2`. #c diff --git a/notes/gawk/regexp.md b/notes/gawk/regexp.md index 02034a9..a39c63b 100644 --- a/notes/gawk/regexp.md +++ b/notes/gawk/regexp.md @@ -72,8 +72,8 @@ END%% %%ANKI Basic -Why is it recommended to avoid using `^`/`$` in `RS`? -Back: These anchors match the beginning/end of a string, not of a line. +Why is it recommended to avoid using `^` and `$$` in `RS`? +Back: These anchors match the beginning and end of a string, not of a line. Reference: Robbins, Arnold D. “GAWK: Effective AWK Programming,” October 2023. [https://www.gnu.org/software/gawk/manual/gawk.pdf](https://www.gnu.org/software/gawk/manual/gawk.pdf) END%% diff --git a/notes/gawk/variables.md b/notes/gawk/variables.md index 5de7cda..672fd22 100644 --- a/notes/gawk/variables.md +++ b/notes/gawk/variables.md @@ -118,7 +118,7 @@ END%% %%ANKI Basic What implementation detail inspires avoiding `RS = "\0"`? -Back: Most `awk` implementations store strings internally as C-style strings? +Back: Most `awk` implementations store strings internally as C-style strings. Reference: Robbins, Arnold D. “GAWK: Effective AWK Programming,” October 2023. [https://www.gnu.org/software/gawk/manual/gawk.pdf](https://www.gnu.org/software/gawk/manual/gawk.pdf) END%% @@ -133,6 +133,9 @@ END%% * `NF` (**N**umber of **F**ields) * The 1-indexed number of fields found in the current record. +* `FS` (**F**ield **S**eparator) + * The separator used to distinguish fields from one another. + * Defaults to `" "` which is a special character for **runs** of spaces, tabs, and newlines. %%ANKI Basic @@ -165,6 +168,51 @@ Reference: Robbins, Arnold D. “GAWK: Effective AWK Programming,” October 202 END%% +%%ANKI +Cloze +The {`FS`} variable is used to change the {field separator}. +Reference: Robbins, Arnold D. “GAWK: Effective AWK Programming,” October 2023. [https://www.gnu.org/software/gawk/manual/gawk.pdf](https://www.gnu.org/software/gawk/manual/gawk.pdf) + +END%% + +%%ANKI +Cloze +{`FS`} is to `awk` as {`IFS`} is to Bash. +Reference: Robbins, Arnold D. “GAWK: Effective AWK Programming,” October 2023. [https://www.gnu.org/software/gawk/manual/gawk.pdf](https://www.gnu.org/software/gawk/manual/gawk.pdf) +/END%% + +%%ANKI +Basic +What is the default value of `FS`? +Back: `" "` +Reference: Robbins, Arnold D. “GAWK: Effective AWK Programming,” October 2023. [https://www.gnu.org/software/gawk/manual/gawk.pdf](https://www.gnu.org/software/gawk/manual/gawk.pdf) + +END%% + +%%ANKI +Basic +What value of `FS` is specially handled? +Back: `" "` +Reference: Robbins, Arnold D. “GAWK: Effective AWK Programming,” October 2023. [https://www.gnu.org/software/gawk/manual/gawk.pdf](https://www.gnu.org/software/gawk/manual/gawk.pdf) + +END%% + +%%ANKI +Basic +How is `FS = " "` interpreted? +Back: As a contiguous sequence of spaces, tabs, and newlines. +Reference: Robbins, Arnold D. “GAWK: Effective AWK Programming,” October 2023. [https://www.gnu.org/software/gawk/manual/gawk.pdf](https://www.gnu.org/software/gawk/manual/gawk.pdf) + +END%% + +%%ANKI +Basic +What distinguishes `FS` value `" "` and `[ \t\n]+`? +Back: When set to the former, `awk` strips leading and trailing whitespace from each record. +Reference: Robbins, Arnold D. “GAWK: Effective AWK Programming,” October 2023. [https://www.gnu.org/software/gawk/manual/gawk.pdf](https://www.gnu.org/software/gawk/manual/gawk.pdf) + +END%% + ## References * Robbins, Arnold D. “GAWK: Effective AWK Programming,” October 2023. [https://www.gnu.org/software/gawk/manual/gawk.pdf](https://www.gnu.org/software/gawk/manual/gawk.pdf) \ No newline at end of file diff --git a/notes/logic/equiv-trans.md b/notes/logic/equiv-trans.md index 2efa93f..8ab1492 100644 --- a/notes/logic/equiv-trans.md +++ b/notes/logic/equiv-trans.md @@ -582,7 +582,7 @@ END%% %%ANKI Basic What is a "theorem" in the equivalence-transformation formal system? -Back: An equality derived from the axioms and inference rules. +Back: An equivalence derived from the axioms and inference rules. Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. END%% @@ -668,7 +668,7 @@ END%% %%ANKI Basic -Where are $\land$ and $\lor$ found within a proposition in DNF? +Where are $\land$ and $\lor$ found within a DNF proposition? Back: $\lor$ separates disjuncts containing $\land$. Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. @@ -692,7 +692,7 @@ END%% %%ANKI Basic -Where are $\land$ and $\lor$ found within a proposition in CNF? +Where are $\land$ and $\lor$ found within a CNF proposition? Back: $\land$ separates conjuncts containing $\lor$. Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. diff --git a/notes/posix/regexp.md b/notes/posix/regexp.md index a5d94d4..bcbe1dc 100644 --- a/notes/posix/regexp.md +++ b/notes/posix/regexp.md @@ -150,6 +150,14 @@ Reference: “POSIX Basic Regular Expressions,” accessed February 4, 2024, [ht END%% +%%ANKI +Basic +How is the `*` operator written equivalently as an interval expression? +Back: `{0,}` +Reference: “POSIX Basic Regular Expressions,” accessed February 4, 2024, [https://en.wikibooks.org/wiki/Regular_Expressions/POSIX_Basic_Regular_Expressions](https://en.wikibooks.org/wiki/Regular_Expressions/POSIX_Basic_Regular_Expressions). + +END%% + %%ANKI Basic What does the `+` operator do? @@ -158,6 +166,14 @@ Reference: “POSIX Basic Regular Expressions,” accessed February 4, 2024, [ht END%% +%%ANKI +Basic +How is the `+` operator written equivalently as an interval expression? +Back: `{1,}` +Reference: “POSIX Basic Regular Expressions,” accessed February 4, 2024, [https://en.wikibooks.org/wiki/Regular_Expressions/POSIX_Basic_Regular_Expressions](https://en.wikibooks.org/wiki/Regular_Expressions/POSIX_Basic_Regular_Expressions). + +END%% + %%ANKI Basic What does the `?` operator do? @@ -166,6 +182,14 @@ Reference: “POSIX Basic Regular Expressions,” accessed February 4, 2024, [ht END%% +%%ANKI +Basic +How is the `?` operator written equivalently as an interval expression? +Back: `{0,1}` +Reference: “POSIX Basic Regular Expressions,” accessed February 4, 2024, [https://en.wikibooks.org/wiki/Regular_Expressions/POSIX_Basic_Regular_Expressions](https://en.wikibooks.org/wiki/Regular_Expressions/POSIX_Basic_Regular_Expressions). + +END%% + * `{n}`, an **interval expression**, matches the preceding element `n` times. * `{n,}` matches the preceding element at least `n` times. * `{n,m}` matches the preceding element between `n` and `m` times.