Nest journal entries into months.

c-declarations
Joshua Potter 2024-02-11 05:33:02 -07:00
parent 5434084a58
commit 49fbfb0ec5
21 changed files with 185 additions and 19 deletions

View File

@ -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": [

View File

@ -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)

View File

@ -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.
* Created flashcards for C data type declarations.
* Added notes on bubble sort.
* Added notes on existential/universal quantification.

View File

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

View File

@ -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).
<!--ID: 1707589393196-->
END%%
%%ANKI
Basic
What is bubble sort's best case runtime?

View File

@ -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).
<!--ID: 1707589393194-->
END%%
%%ANKI
Basic
What is insertion sort's best case runtime?

View File

@ -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).
<!--ID: 1707589393190-->
END%%
%%ANKI
Basic
What is selection sort's best case runtime?

View File

@ -293,6 +293,36 @@ Reference: Robbins, Arnold D. “GAWK: Effective AWK Programming,” October 202
<!--ID: 1706883732944-->
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)
<!--ID: 1707618833559-->
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)
<!--ID: 1707618833561-->
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)
<!--ID: 1707618833562-->
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

View File

@ -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)
<!--ID: 1707310981375-->
END%%

View File

@ -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)
<!--ID: 1707310981392-->
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
<!--ID: 1707405259930-->
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)
<!--ID: 1707618833549-->
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)
<!--ID: 1707618833552-->
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)
<!--ID: 1707618833555-->
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)
<!--ID: 1707618833556-->
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)
<!--ID: 1707618833558-->
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)

View File

@ -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.
<!--ID: 1707316178712-->
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.
<!--ID: 1707311868998-->
@ -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.
<!--ID: 1707311869003-->

View File

@ -150,6 +150,14 @@ Reference: “POSIX Basic Regular Expressions,” accessed February 4, 2024, [ht
<!--ID: 1707050923650-->
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).
<!--ID: 1707654685031-->
END%%
%%ANKI
Basic
What does the `+` operator do?
@ -158,6 +166,14 @@ Reference: “POSIX Basic Regular Expressions,” accessed February 4, 2024, [ht
<!--ID: 1707050923656-->
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).
<!--ID: 1707654685034-->
END%%
%%ANKI
Basic
What does the `?` operator do?
@ -166,6 +182,14 @@ Reference: “POSIX Basic Regular Expressions,” accessed February 4, 2024, [ht
<!--ID: 1707050923662-->
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).
<!--ID: 1707654685036-->
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.