From eb3cc5743ae8d264ae5bfa3c6de2345b7c62ef61 Mon Sep 17 00:00:00 2001 From: Joshua Potter Date: Sun, 25 Feb 2024 06:50:52 -0700 Subject: [PATCH] Fixup flashcards. --- .../plugins/obsidian-to-anki-plugin/data.json | 22 ++++--- notes/_journal/2024-02-25.md | 11 ++++ notes/_journal/{ => 2024-02}/2024-02-24.md | 10 ++- notes/binary/integer-encoding.md | 16 +++++ notes/c17/strings.md | 64 ++++++++++++++----- notes/combinatorics/combinations.md | 12 +--- .../combinatorics/multiplicative-principle.md | 4 +- notes/combinatorics/permutations.md | 8 --- notes/gawk/variables.md | 30 +++++++-- notes/logic/equiv-trans.md | 8 +-- notes/logic/propositional.md | 12 +--- notes/posix/signals.md | 41 ++++++++++++ 12 files changed, 168 insertions(+), 70 deletions(-) create mode 100644 notes/_journal/2024-02-25.md rename notes/_journal/{ => 2024-02}/2024-02-24.md (52%) diff --git a/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json b/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json index ce797f1..f92a703 100644 --- a/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json +++ b/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json @@ -94,19 +94,19 @@ "c/escape-sequences.md": "7b4bbf159908320249158acfe47a9074", "c/index.md": "a021c92f19831bdd2bca4cbf813882fe", "gawk/index.md": "e4da41ba6a2c2602d9f15f2930608e3c", - "gawk/variables.md": "73b12bd0d7d6f97b4a7285aaf2c45bfa", + "gawk/variables.md": "6797b75269d1e6c6a5f3fe8c4a029f8f", "index.md": "e48e895feeed7046425bb2ee15419770", "journal/2024-01-31.md": "7c7fbfccabc316f9e676826bf8dfe970", "journal/2024-02-01.md": "3aa232387d2dc662384976fd116888eb", "journal/2024-02-02.md": "a3b222daee8a50bce4cbac699efc7180", "journal/2024-02-03.md": "c6d411f0e2e964270399dd3a99f48382", "logic/index.md": "46cdc7a552900e99a7d2d0140971118c", - "logic/propositional.md": "41e1490c98a249a6d435f896f08a856b", + "logic/propositional.md": "a72983987cd89df9a451973a4d45e82d", "lua/index.md": "fd3d0b66765f0e9df233e8e02ce33e94", "nix/callPackage.md": "140a02e57cd01d646483e3c21d72243d", "nix/index.md": "4efc7fcc4ea22834ba595497e5fb715c", "posix/index.md": "97b1b8ecb9a953e855a9acf0ab25b8c8", - "posix/signals.md": "4fe63c3c9507b2e15c9ad6f3a2b541db", + "posix/signals.md": "df397d7198c6904d26396a79c72e32a0", "templates/daily.md": "7866014e730e85683155207a02e367d8", "posix/regexp.md": "f5fb177c7356faf1bf768023c2563c54", "journal/2024-02-04.md": "e2b5678fc53d7284b71ed6820c02b954", @@ -119,7 +119,7 @@ "_journal/2024-02-02.md": "a3b222daee8a50bce4cbac699efc7180", "_journal/2024-02-01.md": "3aa232387d2dc662384976fd116888eb", "_journal/2024-01-31.md": "7c7fbfccabc316f9e676826bf8dfe970", - "logic/equiv-trans.md": "588ef4e5185d2b833997e86ab4e85765", + "logic/equiv-trans.md": "4a781f0d21ee0942445cd31da3ec396f", "_journal/2024-02-07.md": "8d81cd56a3b33883a7706d32e77b5889", "algorithms/loop-invariants.md": "cbefc346842c21a6cce5c5edce451eb2", "algorithms/loop-invariant.md": "29f9f9090a3109890d333a78acc18b50", @@ -172,16 +172,16 @@ "algorithms/binary-search.md": "dbbaf8d4be7aabef1ed232c1906b4c99", "_journal/2024-02-17.md": "7c37cb10515ed3d2f5388eaf02a67048", "_journal/2024-02/2024-02-16.md": "e701902e369ec53098fc2deed4ec14fd", - "binary/integer-encoding.md": "05049f4827556643f46315678d640cb3", + "binary/integer-encoding.md": "aaad7d74b5084093e4aa90fbb2212384", "combinatorics/index.md": "9a85e8858c50c9797243d6d01e1dcbe7", "_journal/2024-02-18.md": "67e36dbbb2cac699d4533b5a2eaeb629", "_journal/2024-02/2024-02-17.md": "7c37cb10515ed3d2f5388eaf02a67048", - "combinatorics/multiplicative-principle.md": "eae60248d68ba8bd2da5e4c3fea70109", + "combinatorics/multiplicative-principle.md": "f1430302e0a35b863fa965a834c4e40a", "combinatorics/additive-principle.md": "e968028670f95ee9a7c5499ff7cb6792", "_journal/2024-02-19.md": "30d16c5373deb9cb128d2e7934ae256a", "_journal/2024-02/2024-02-18.md": "67e36dbbb2cac699d4533b5a2eaeb629", - "combinatorics/permutations.md": "dd746d489d3e7d75cc7284755f7ee970", - "combinatorics/combinations.md": "6fc179a9bf4e3958f28c4c3f7da5cda0", + "combinatorics/permutations.md": "89ac52a1a02629718555ea1652fa3b66", + "combinatorics/combinations.md": "7a22b15ca1bf0160680509c1f442f2d0", "_journal/2024-02-20.md": "b85ba0eeeb16e30a602ccefabcc9763e", "_journal/2024-02/2024-02-19.md": "df1a9ab7ab89244021b3003c84640c78", "combinatorics/inclusion-exclusion.md": "4d5ba716bc90cd378c7c4c816b224c75", @@ -192,13 +192,15 @@ "_journal/2024-02/2024-02-21.md": "f423137ae550eb958378750d1f5e98c7", "_journal/2024-02-23.md": "219ce9ad15a8733edd476c97628b71fd", "_journal/2024-02/2024-02-22.md": "312e55d57868026f6e80f7989a889c2b", - "c17/strings.md": "bbe8983602adbeb38eff214beddedd84", + "c17/strings.md": "9edfc287cbe2ad6539b88793b0af731e", "c17/index.md": "78576ee41d0185df82c59999142f4edb", "c17/escape-sequences.md": "ebc63c6cdfbe60bbc2708c1b0c8da8bb", "c17/declarations.md": "46b135d583a992991c889d518fec1c0f", "algorithms/sorting/merge-sort.md": "f66f482e5bd551c765fcba564c938d67", "_journal/2024-02-24.md": "9bb319d5014caf962a9ce3141076cff4", - "_journal/2024-02/2024-02-23.md": "0aad297148e8cc4058b48b7e45787ca7" + "_journal/2024-02/2024-02-23.md": "0aad297148e8cc4058b48b7e45787ca7", + "_journal/2024-02-25.md": "fb1a48208c11d12262facc647749ca6f", + "_journal/2024-02/2024-02-24.md": "ee92fd63ebbda5f8ffa0abd06700ead1" }, "fields_dict": { "Basic": [ diff --git a/notes/_journal/2024-02-25.md b/notes/_journal/2024-02-25.md new file mode 100644 index 0000000..2f22f4f --- /dev/null +++ b/notes/_journal/2024-02-25.md @@ -0,0 +1,11 @@ +--- +title: "2024-02-25" +--- + +- [x] 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-24.md b/notes/_journal/2024-02/2024-02-24.md similarity index 52% rename from notes/_journal/2024-02-24.md rename to notes/_journal/2024-02/2024-02-24.md index ea80066..26f785b 100644 --- a/notes/_journal/2024-02-24.md +++ b/notes/_journal/2024-02/2024-02-24.md @@ -7,7 +7,7 @@ title: "2024-02-24" - [ ] Sheet Music (10 min.) - [x] OGS (1 Life & Death Problem) - [ ] Korean (Read 1 Story) -- [ ] Interview Prep (1 Practice Problem) +- [x] Interview Prep (1 Practice Problem) - [ ] Log Work Hours (Max 3 hours) * Add back some notes on shifting in preparation of integer arithmetic. @@ -24,4 +24,10 @@ title: "2024-02-24" * Q-317008 * Q-127207 * Q-366042 - * Q-144 \ No newline at end of file + * Q-144 +* Notes on unsigned addition. +* Notes on `SIGILL`. +* Leetcode problems + * [Valid Parentheses](https://leetcode.com/problems/valid-parentheses/description/) + * [Merge Two Sorted Lists](https://leetcode.com/problems/merge-two-sorted-lists/description/) + * [Generate Parentheses](https://leetcode.com/problems/generate-parentheses/description/) \ No newline at end of file diff --git a/notes/binary/integer-encoding.md b/notes/binary/integer-encoding.md index bb775a7..f6c94f0 100644 --- a/notes/binary/integer-encoding.md +++ b/notes/binary/integer-encoding.md @@ -979,6 +979,22 @@ Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Program END%% +%%ANKI +Basic +Given integer $0 < x < 2^w$, what is $x$'s unsigned additive inverse? +Back: $2^w - x$ +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +Which unsigned integer is its own additive inverse? +Back: $0$ +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + ## References * Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. diff --git a/notes/c17/strings.md b/notes/c17/strings.md index a2d3596..59a3de9 100644 --- a/notes/c17/strings.md +++ b/notes/c17/strings.md @@ -48,16 +48,18 @@ The syntax for the format placeholder is `%[flags][width][.precision][length]spe %%ANKI Basic -Which header file contains `printf` functionality? -Back: `stdio.h` +Which header file contains basic `printf` functionality? +Back: `` Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% %%ANKI Cloze -{1:`width`} field specifies a {2:minimum} number of characters while {2:`precision`} specifies a {1:maximum}. +{1:`width`} specifies a {2:minimum} while {2:`precision`} specifies a {1:maximum}. Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% @@ -65,76 +67,85 @@ END%% Cloze The {`width` and `precision`} fields are output related whereas the {`length`} field is input related. Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% -Flag | Description ---------- | ----------- -`-` | Left-aligns the output -`+` | Prepends a plus for positive signed-numeric types -`␣` | Prepends a space for positive signed-numeric types -`0` | Prepends zeros for numeric types +| Flag | Description | +| ---- | -------------------------------------------------- | +| `-` | Left-aligns the output | +| `+` | Prepends a plus for positive signed-numeric types | +| `␣` | Prepends a space for positive signed-numeric types | +| `0` | Prepends zeros for numeric types | %%ANKI Cloze The {`-`} flag {left-aligns the output}. Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% %%ANKI Basic What is the output of `printf("%-2d abc", 100)`? -Back: `100 abc` +Back: `100␣abc` Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% %%ANKI Basic What is the output of `printf("%-4d abc", 100)`? -Back: `100 abc` +Back: `100␣␣abc` Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% %%ANKI Basic What is the output of `printf("%.4d abc", 100)`? -Back: `0100 abc` +Back: `0100␣abc` Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% %%ANKI Basic What is the output of `printf("%04d abc", 100)`? -Back: `0100 abc` +Back: `0100␣abc` Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% %%ANKI Basic What is the output of `printf("%.4s abc", "efg")`? -Back: `efg abc` +Back: `efg␣abc` Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% %%ANKI Basic What is the output of `printf("%.2s abc", "efg")`? -Back: `ef abc` +Back: `ef␣abc` Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% %%ANKI Basic What is the output of `printf("%.2f abc", 0.01234)`? -Back: `0.01 abc` +Back: `0.01␣abc` Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% @@ -143,6 +154,7 @@ Basic How does the precision field affect `"%s"` parameters? Back: Strings are truncated if longer than the specified precision. Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% @@ -151,6 +163,7 @@ Basic How does the precision field affect `"%f"` parameters? Back: Decimal values are truncated if longer than the specified precision. Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% @@ -159,6 +172,7 @@ Basic What does a negative width field value indicate? Back: This is actually a positive width with a `-` (left-align) flag. Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% @@ -167,6 +181,7 @@ Basic The `-` `printf` flag overrides what default behavior? Back: Output is right-aligned by default. Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% @@ -174,6 +189,7 @@ END%% Cloze The {`+`} `printf` flag {prepends a plus for positive signed-numeric types}. Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% @@ -182,6 +198,7 @@ Basic The `+` `printf` flag overrides what default behavior? Back: Nothing is prepended to positive signed-numeric types by default. Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% @@ -189,6 +206,7 @@ END%% Cloze The {`␣`} `printf` flag {prepends a space for positive signed-numeric types}. Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% @@ -197,6 +215,7 @@ Basic The `␣` `printf` flag overrides what default behavior? Back: Nothing is prepended to positive signed-numeric types by default. Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% @@ -205,6 +224,7 @@ Basic How do the `+` and `␣` `printf` flags relate to one another? Back: Both prepend a character to positive signed-numeric types. Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% @@ -213,6 +233,7 @@ Basic What happens if both the `+` and `␣` `printf` flags are specified? Back: The `+` flag takes precedence. Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% @@ -220,6 +241,7 @@ END%% Cloze The {`0`} `printf` flag {prepends zeros for numeric types}. Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% @@ -228,6 +250,7 @@ Basic What option must be specified for the `0` `printf` flag to take effect? Back: The "width" option. Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% @@ -236,6 +259,7 @@ Basic The `0` `printf` flag overrides what default behavior? Back: Spaces are used to match the "width" option by default. Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% @@ -252,6 +276,7 @@ Basic *Why* do length modifiers for e.g. `char` exist? Back: For maximum portability in the face of default argument promotions. Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% @@ -259,6 +284,7 @@ END%% Cloze The {`hh`} length corresponds to the {`char`} type declaration. Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% @@ -266,6 +292,7 @@ END%% Cloze The {`h`} length corresponds to the {`short`} type declaration. Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% @@ -273,6 +300,7 @@ END%% Cloze The {`l`} length corresponds to the {`long`} type declaration. Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% @@ -280,6 +308,7 @@ END%% Cloze The {`ll`} length corresponds to the {`long long`} type declaration. Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% @@ -287,6 +316,7 @@ END%% Cloze The {`z`} length corresponds to the {`size_t`} type declaration. Reference: “Printf,” in *Wikipedia*, January 18, 2024, [https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962](https://en.wikipedia.org/w/index.php?title=Printf&oldid=1196716962). +Tags: printf END%% @@ -494,8 +524,8 @@ END%% Basic Given `int64_t x`, why is `printf("%d", x)` a problem? Back: `%d` matches an `int` which is not necessarily 64-bits. -Tags: printf Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. +Tags: printf END%% diff --git a/notes/combinatorics/combinations.md b/notes/combinatorics/combinations.md index b8acbfe..dc14c95 100644 --- a/notes/combinatorics/combinations.md +++ b/notes/combinatorics/combinations.md @@ -56,14 +56,6 @@ Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n END%% -%%ANKI -Basic -How is a $k$-combination expressed recursively? -Back: Include or exclude a candidate, then find $(k - 1)$- or $k$-combinations on the remainder. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - %%ANKI Basic How is a $k$-combination of $n$ objects denoted? @@ -138,7 +130,7 @@ END%% %%ANKI Basic -*Why* are binomial coefficients "symmetric" +*Why* are binomial coefficients "symmetric"? Back: The number of ways to choose $k$ objects is the same as the number of ways to *not* choose those $k$ objects. Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). @@ -459,7 +451,7 @@ END%% %%ANKI Basic How many lattice paths exist from one corner of a chess board to the opposite corner? -Back: $\binom{16}{8}$ +Back: $\binom{14}{7}$ Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). END%% diff --git a/notes/combinatorics/multiplicative-principle.md b/notes/combinatorics/multiplicative-principle.md index b45ad6c..80d8b0c 100644 --- a/notes/combinatorics/multiplicative-principle.md +++ b/notes/combinatorics/multiplicative-principle.md @@ -55,7 +55,7 @@ END%% %%ANKI Basic -If $A$ is finite, how is $A \times B$ rewritten as $|A|$ disjoint sets? +If $A$ is finite, how is $A \times B$ rewritten as the union of $|A|$ disjoint sets? Back: Given $A = \{a_1, \ldots, a_n\}$, $(\{a_1\} \times B) \cup \cdots \cup (\{a_n\} \times B)$. Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). @@ -63,7 +63,7 @@ END%% %%ANKI Basic -If $B$ is finite, how is $A \times B$ rewritten as $|B|$ disjoint sets? +If $B$ is finite, how is $A \times B$ rewritten as the union of $|B|$ disjoint sets? Back: Given $B = \{b_1, \ldots, b_n\}$, $(A \times \{b_1\}) \cup \cdots \cup (A \times \{b_n\})$. Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). diff --git a/notes/combinatorics/permutations.md b/notes/combinatorics/permutations.md index 3455d90..76a172e 100644 --- a/notes/combinatorics/permutations.md +++ b/notes/combinatorics/permutations.md @@ -69,14 +69,6 @@ Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n END%% -%%ANKI -Basic -How is permutation expressed recursively? -Back: Put each candidate in the current position, finding all permutations of the remainder each time. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - %%ANKI Basic How is $n!$ permutations of $n$ objects derived? diff --git a/notes/gawk/variables.md b/notes/gawk/variables.md index c27f9be..ac538f2 100644 --- a/notes/gawk/variables.md +++ b/notes/gawk/variables.md @@ -95,12 +95,12 @@ END%% * The separator used to distinguish records from one another. * Defaults to `"\n"`. -`RS == ??` | Description ----------------------- | ------------------------------------- -`"\n"` | Records are separated by the newline character. This is the default. -*any single character* | Records are separated by each occurrence of the character. Multiple successive occurrences delimit empty records. -`""` | Records are separated by runs of blank lines. Leading/trailing newlines in a file are ignored. If `FS` is a single character, then `"\n"` also serves as a field separator. -*regexp* | Records are separated by occurrences of characters that match *regexp*. Leading/trailing matches delimit empty records. +| `RS == ??` | Description | +| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `"\n"` | Records are separated by the newline character. This is the default. | +| *any single character* | Records are separated by each occurrence of the character. Multiple successive occurrences delimit empty records. | +| `""` | Records are separated by one or more blank lines. Leading/trailing newlines in a file are ignored. If `FS` is a single character, then `"\n"` also serves as a field separator. | +| *regexp* | Records are separated by occurrences of characters that match *regexp*. Leading/trailing matches delimit empty records. | %%ANKI Cloze @@ -151,7 +151,7 @@ END%% %%ANKI Basic How is `RS = ""` interpreted? -Back: `""` indicates runs of newlines should be treated as the record separator. +Back: `""` indicates one or more blank lines should be treated as the record 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%% @@ -164,6 +164,22 @@ Reference: Robbins, Arnold D. “GAWK: Effective AWK Programming,” October 202 END%% +%%ANKI +Basic +What distinguishes `RS` value `""` and `\n`? +Back: The former separates on one or more *blank* lines, not just a newline character. +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 regexp is closest to mirroring `RS = ""` behavior? +Back: `\n\n+` +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 If `RS = ""` and `FS` is set to {a single character}, the {newline character} *always* acts as a field separator. diff --git a/notes/logic/equiv-trans.md b/notes/logic/equiv-trans.md index ce30fe0..f41677d 100644 --- a/notes/logic/equiv-trans.md +++ b/notes/logic/equiv-trans.md @@ -215,7 +215,7 @@ END%% %%ANKI Basic The term "equivalent" refers to a comparison between what two objects? -Back: Propositions. +Back: Expressions. Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. END%% @@ -579,7 +579,7 @@ END%% %%ANKI Basic -What identifier is guaranteed to not occur in $E_e^x$? +What identifier is guaranteed to not occur freely in $E_e^x$? Back: None. Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. @@ -587,7 +587,7 @@ END%% %%ANKI Basic -What identifier is guaranteed to not occur in $E_{s(e)}^x$? +What identifier is guaranteed to not occur freely in $E_{s(e)}^x$? Back: $x$. Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. @@ -595,7 +595,7 @@ END%% %%ANKI Basic -*Why* does $x$ not occur in $E_{s(e)}^x$? +*Why* does $x$ not occur freely in $E_{s(e)}^x$? Back: Because $s(e)$ evaluates to a constant proposition. Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. diff --git a/notes/logic/propositional.md b/notes/logic/propositional.md index 99b2680..0c74825 100644 --- a/notes/logic/propositional.md +++ b/notes/logic/propositional.md @@ -43,7 +43,7 @@ END%% %%ANKI Basic What is an atomic statement? -Back: It cannot be broken up into smaller statements. +Back: One that cannot be broken up into smaller statements. Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). END%% @@ -51,7 +51,7 @@ END%% %%ANKI Basic What is a molecular statement? -Back: It can be broken up into smaller statements. +Back: One that can be broken up into smaller statements. Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). END%% @@ -71,14 +71,6 @@ Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n END%% -%%ANKI -Basic -What distinguishes a sentence from a predicate? -Back: The latter is a sentence that contains free variables. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - %%ANKI Basic What distinguishes a predicate from a statement? diff --git a/notes/posix/signals.md b/notes/posix/signals.md index e9eb377..8eebc3a 100644 --- a/notes/posix/signals.md +++ b/notes/posix/signals.md @@ -156,6 +156,47 @@ Reference: Dowling, “A List of Signals and What They Mean.” END%% +### SIGILL (4) + +%%ANKI +Cloze +Signal {`SIGILL`} corresponds to number {4}. +Reference: Dowling, “A List of Signals and What They Mean.” + +END%% + +%%ANKI +Basic +What is the `ILL` in `SIGILL` short for? +Back: **Ill**egal instruction +Reference: Dowling, “A List of Signals and What They Mean.” + +END%% + +%%ANKI +Basic +When does a process receive a `SIGILL` signal? +Back: When the CPU encounters an instruction it can't run. +Reference: Dowling, “A List of Signals and What They Mean.” + +END%% + +%%ANKI +Basic +Corruption of machine code would probably cause what signal raise? +Back: `SIGILL` +Reference: Dowling, “A List of Signals and What They Mean.” + +END%% + +%%ANKI +Basic +Attempts to run a privileged instruction would probably cause what signal raise? +Back: `SIGILL` +Reference: Dowling, “A List of Signals and What They Mean.” + +END%% + ## References * Cooper, Mendel. “Advanced Bash-Scripting Guide,” n.d., 916.