diff --git a/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json b/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json index 360d66e..4670b91 100644 --- a/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json +++ b/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json @@ -236,7 +236,8 @@ "abs-up.png", "abs-down.png", "abs-right-down.png", - "abs-left-down.png" + "abs-left-down.png", + "triple-table-repr.png" ], "File Hashes": { "algorithms/index.md": "3ac071354e55242919cc574eb43de6f8", @@ -262,7 +263,7 @@ "nix/callPackage.md": "9aeeaa22878434d3c4498cb92cfe230b", "nix/index.md": "4efc7fcc4ea22834ba595497e5fb715c", "posix/index.md": "97b1b8ecb9a953e855a9acf0ab25b8c8", - "posix/signals.md": "8cdb56708b187389b5bd4d75e762ec76", + "posix/signals.md": "47c5a79b70a543ffe05fcaf9f54d6db4", "templates/daily.md": "7866014e730e85683155207a02e367d8", "posix/regexp.md": "d7d1b8cde49c405d44c7e1d9343769c0", "journal/2024-02-04.md": "e2b5678fc53d7284b71ed6820c02b954", @@ -349,9 +350,9 @@ "_journal/2024-02-23.md": "219ce9ad15a8733edd476c97628b71fd", "_journal/2024-02/2024-02-22.md": "312e55d57868026f6e80f7989a889c2b", "c17/strings.md": "b021b6f18f865aa89b3088907cdaae94", - "c17/index.md": "856fa90e945e84cf6b651fed44df4cad", + "c17/index.md": "4b5a563b8079ea6afb9c57648a2b0124", "c17/escape-sequences.md": "a8b99070336878b4e8c11e9e4525a500", - "c17/declarations.md": "d66c1fb83f3bddaec61f3b9644f9fd6d", + "c17/declarations.md": "d0d0b4ce2d2608dbfffa6182593eae7a", "algorithms/sorting/merge-sort.md": "6506483f7df6507cee0407bd205dbedd", "_journal/2024-02-24.md": "9bb319d5014caf962a9ce3141076cff4", "_journal/2024-02/2024-02-23.md": "0aad297148e8cc4058b48b7e45787ca7", @@ -417,7 +418,7 @@ "_journal/2024-03/2024-03-17.md": "23f9672f5c93a6de52099b1b86834e8b", "set/directed-graph.md": "b4b8ad1be634a0a808af125fe8577a53", "set/index.md": "29f5f295765101fe11d821faa908b027", - "set/graphs.md": "a5b0503f723baa65ab4b3af3e7ba7fe5", + "set/graphs.md": "a45ee330f9b1a7ed18f520424ab3ca1d", "_journal/2024-03-19.md": "a0807691819725bf44c0262405e97cbb", "_journal/2024-03/2024-03-18.md": "2c711c50247a9880f7ed0d33b16e1101", "awk/variables.md": "e40a20545358228319f789243d8b9f77", @@ -602,13 +603,13 @@ "_journal/2024-06/2024-06-04.md": "52b28035b9c91c9b14cef1154c1a0fa1", "_journal/2024-06-06.md": "3f9109925dea304e7172df39922cc95a", "_journal/2024-06/2024-06-05.md": "b06a0fa567bd81e3b593f7e1838f9de1", - "set/relations.md": "f29889b9cde0e8bb24fae4f5c37fb7ad", + "set/relations.md": "4888c4c5ea94a41f00eb7cd932a723d8", "_journal/2024-06-07.md": "795be41cc3c9c0f27361696d237604a2", "_journal/2024-06/2024-06-06.md": "db3407dcc86fa759b061246ec9fbd381", "_journal/2024-06-08.md": "b20d39dab30b4e12559a831ab8d2f9b8", "_journal/2024-06/2024-06-07.md": "c6bfc4c1e5913d23ea7828a23340e7d3", "lambda-calculus/alpha-conversion.md": "a68f3cc1565fb26335218986808a1190", - "lambda-calculus/index.md": "0e47dcd2ac0c84ad4c1a5e7609dade5f", + "lambda-calculus/index.md": "1e2d544f08f1564c4d3aa874d5e09745", "x86-64/instructions/condition-codes.md": "9c05ed99f5c96162e25f0ec4db55c656", "x86-64/instructions/logical.md": "a15c7da43cb97badef8ba4f8aadf9cbb", "x86-64/instructions/arithmetic.md": "e2c4c9caa51e089e313d6c9d3c3c0a12", @@ -690,7 +691,7 @@ "_journal/2024-07-13.md": "13b5101306b5542b8a1381a6477378ca", "_journal/2024-07/2024-07-12.md": "8073584fae2fe7bffcd4b69a7cd29058", "hashing/static.md": "3ec6eaee73fb9b599700f5a56b300b83", - "hashing/addressing.md": "d7d508ac10a66a6ca7b372eb6b76040d", + "hashing/addressing.md": "3c8151d2c98d1163641fd16efe1c2b64", "ontology/index.md": "0994403dcd84415f1459752129b55f65", "ontology/permissivism.md": "643e815a79bc5c050cde9f996aa44ef5", "ontology/properties.md": "91ece501551c444afcd119d7197958ef", @@ -717,7 +718,7 @@ "logic/classical/index.md": "ee0a4b2bfcfa2cab0880db449cb62df1", "logic/classical/truth-tables.md": "b739e2824a4a5c26ac446e7c15ce02aa", "formal-system/proof-system/index.md": "c0358072f83d73989f4a7e98dbc0dc32", - "formal-system/proof-system/equiv-trans.md": "72d96306d5bc818e67b5a6aa777b7036", + "formal-system/proof-system/equiv-trans.md": "31a1e87c019fbf1a8d0ea491afbca808", "formal-system/logical-system/index.md": "708bb1547e7343c236068c18da3f5dc0", "formal-system/logical-system/pred-logic.md": "4559020fde708b9d0184d9fd56559c98", "formal-system/logical-system/prop-logic.md": "e486b55b20298d41fddce0d1ec53f391", @@ -742,7 +743,7 @@ "_journal/2024-07-28.md": "8a2393673132ac57a86b3b528bfc4a16", "_journal/2024-07/2024-07-27.md": "7c48690746d8320494e29e92390eb6ee", "ontology/rdf/uri.md": "7dde3e92eee17ea85e75df3fdc5f8d51", - "ontology/rdf/index.md": "36424c9bad6088cdee67f74e3b8a019f", + "ontology/rdf/index.md": "328f7b84d4893c45eef4f0d6e921ba69", "ontology/philosophy/permissivism.md": "07ef1e14269646957cfb9cb0a833968d", "ontology/philosophy/nominalism.md": "46245c644238157e15c7cb6def27d90a", "ontology/philosophy/index.md": "d132b8f4a69bdb664c822366fb27fa64", @@ -796,7 +797,7 @@ "_journal/2024-08/2024-08-17.md": "b06a551560c377f61a1b39286cd43cee", "calculus/bounds.md": "f89de98e888b36af3b921fc0bdb1d281", "calculus/index.md": "5ee4d950533ae330ca5ef9e113fe87f3", - "x86-64/instructions/conditions.md": "093cf907ccbb665961134624d19e31d3", + "x86-64/instructions/conditions.md": "1ebef6ae787041c831045362904f1723", "_journal/2024-08-20.md": "e8bec308d1b29e411c6799ace7ef6571", "algebra/arch-prop.md": "bca3724ef5aae3f7f20907108087af47", "_journal/2024-08/2024-08-19.md": "94836e52ec04a72d3e1dbf3854208f65", @@ -872,7 +873,7 @@ "_journal/2024-09/2024-09-23.md": "d5589199e01c1794774b310e94d89374", "_journal/2024-09-26.md": "ce334b0576d6d7495150abd5c7e1ce61", "_journal/2024-09/2024-09-25.md": "c8a3414e27c8ce635fe995c2dfbf6019", - "c17/macros.md": "c6113f598e859eabb2d0712ff9b584a2", + "c17/macros.md": "131df9dcd4aa65d701b391005d6e5b18", "_journal/2024-09-27.md": "dd82b2c5c5389b6a35c4c2fcf857417c", "_journal/2024-09/2024-09-26.md": "2d3e8325e7ab63168c460f18e7aa1afc", "_journal/2024-09-28.md": "7726baed125a2561def07dcaf48bf5a0", @@ -896,7 +897,7 @@ "_journal/2024-10/2024-10-06.md": "65a8e538144f59ee9e7296110cc9aa14", "_journal/2024-10-09.md": "66acb6c8abbf0c860966223f3299c2bc", "_journal/2024-10/2024-10-08.md": "2f737d8198b12bf635808964c4887ae1", - "x86-64/procedures.md": "eba67bb16589d24f235fa0fb0067f552", + "x86-64/procedures.md": "f23965d17368e34834824511b309c3f9", "_journal/2024-10-10.md": "29e4be2c164c63f8b7aab56bddee3dd6", "_journal/2024-10/2024-10-09.md": "458811cdab772a7b3dbc1dd8ae5c51ee", "_journal/2024-10-15.md": "6e696a8d16ba257ed89e8564b771d290", @@ -965,7 +966,7 @@ "_journal/2024-11/2024-11-21.md": "951b6034d60a40dbd8201c50abf0dbb9", "_journal/2024-11/2024-11-20.md": "951b6034d60a40dbd8201c50abf0dbb9", "_journal/2024-11/2024-11-19.md": "d879f57154cb27cb168eb1f1f430e312", - "set/cardinality.md": "dd5a057609b6e5dcc030c97a700abe58", + "set/cardinality.md": "270b48a3559c055cb15216f70101ecc2", "geometry/area.md": "dc362cb5be314b2b9e4ecc53f2289af0", "_journal/2024-11-23.md": "911f82ab8aede5ecdb96493aef64b0b9", "_journal/2024-11/2024-11-22.md": "51117030e2364dbce3a8d507dead86ae", @@ -976,8 +977,8 @@ "_journal/2024-11-26.md": "29bc0b54d23034b9108e567a1d5fa8ac", "_journal/2024-11/2024-11-25.md": "1ec17a8473fa9c4779090ecbd22d70ef", "calculus/intervals.md": "6a317fb5053b172611e9e7ae6f66f609", - "c17/storage.md": "271d9579dc753ecff11b5c227e029d94", - "c17/functions.md": "283167c88e447fa4dd6284b8ea1ce93e", + "c17/storage.md": "07f0aa969d502df97f757318bde3c166", + "c17/functions.md": "f0893e6974d1ab6d4b9e1f06ecfc9237", "_journal/2024-11-27.md": "5a58e3a0bd08c689d30600021937495d", "_journal/2024-11/2024-11-26.md": "af7573eb695b61106e04c9f1aee51cc3", "_journal/2024-11-28.md": "4321856aec890b179f1b569b908bba60", @@ -998,7 +999,22 @@ "_journal/2024-12/2024-12-04.md": "965f6619edf1002d960203e3e12a413b", "_journal/2024-12-06.md": "d75323d0fec57f4fc1f13cb4370df18d", "_journal/2024-12/2024-12-05.md": "4f3b1e7a43e01cc97b0eed6fbc6c1f96", - "calculus/integrals.md": "a7ef5031ca474cd9d37c1aea85e96237" + "calculus/integrals.md": "a7ef5031ca474cd9d37c1aea85e96237", + "_journal/2024-12-07.md": "bfb6c4db0acbacba19f03a04ec29fa5c", + "_journal/2024-12/2024-12-06.md": "d73b611d2d15827186a0252d9b9a6580", + "_journal/2024-12-08.md": "5662897539b222db1af45dcd217f0796", + "_journal/2024-12/2024-12-07.md": "bfb6c4db0acbacba19f03a04ec29fa5c", + "linkers/static.md": "cc56ddfc33f605d26b954ec242abc4cf", + "linkers/index.md": "84ffda7dddc04d2843b98224f1b7a0e1", + "_journal/2024-12-09.md": "8988f0e8f0060f4b86d17e0bc4e7ff7e", + "_journal/2024-12/2024-12-08.md": "5662897539b222db1af45dcd217f0796", + "_journal/2024-12-10.md": "c12d380d24d7d1dc2e74a57a1b79399e", + "_journal/2024-12/2024-12-09.md": "4e53268af725ff79db4c0956d0b556ff", + "ontology/xml.md": "5b345c09ac60821f88ed5b592e411df6", + "_journal/2024-12-12.md": "e7393c01b44c5b804f86f45b8b899b59", + "_journal/2024-12-11.md": "e7393c01b44c5b804f86f45b8b899b59", + "_journal/2024-12/2024-12-10.md": "d4f43b32220dbe174be514397b1bb035", + "_journal/2024-12/2024-12-11.md": "e7393c01b44c5b804f86f45b8b899b59" }, "fields_dict": { "Basic": [ diff --git a/notes/_journal/2024-12-12.md b/notes/_journal/2024-12-12.md new file mode 100644 index 0000000..6e1ffa5 --- /dev/null +++ b/notes/_journal/2024-12-12.md @@ -0,0 +1,9 @@ +--- +title: "2024-12-12" +--- + +- [x] Anki Flashcards +- [x] KoL +- [x] OGS +- [ ] Sheet Music (10 min.) +- [ ] Korean (Read 1 Story) \ No newline at end of file diff --git a/notes/_journal/2024-12-06.md b/notes/_journal/2024-12/2024-12-06.md similarity index 100% rename from notes/_journal/2024-12-06.md rename to notes/_journal/2024-12/2024-12-06.md diff --git a/notes/_journal/2024-12/2024-12-07.md b/notes/_journal/2024-12/2024-12-07.md new file mode 100644 index 0000000..e5496c1 --- /dev/null +++ b/notes/_journal/2024-12/2024-12-07.md @@ -0,0 +1,11 @@ +--- +title: "2024-12-07" +--- + +- [x] Anki Flashcards +- [x] KoL +- [x] OGS +- [ ] Sheet Music (10 min.) +- [ ] Korean (Read 1 Story) + +* Notes on C's [[c17/index#Compilation|compiler driver]]. \ No newline at end of file diff --git a/notes/_journal/2024-12/2024-12-08.md b/notes/_journal/2024-12/2024-12-08.md new file mode 100644 index 0000000..59d5918 --- /dev/null +++ b/notes/_journal/2024-12/2024-12-08.md @@ -0,0 +1,12 @@ +--- +title: "2024-12-08" +--- + +- [x] Anki Flashcards +- [x] KoL +- [ ] OGS +- [ ] Sheet Music (10 min.) +- [ ] Korean (Read 1 Story) + +* Additional notes on [[cardinality#Cardinal Numbers|cardinal numbers]]. +* Finished "Finite Sets" in Enderton's "Elements of Set Theory". \ No newline at end of file diff --git a/notes/_journal/2024-12/2024-12-09.md b/notes/_journal/2024-12/2024-12-09.md new file mode 100644 index 0000000..352407b --- /dev/null +++ b/notes/_journal/2024-12/2024-12-09.md @@ -0,0 +1,9 @@ +--- +title: "2024-12-09" +--- + +- [x] Anki Flashcards +- [x] KoL +- [x] OGS +- [ ] Sheet Music (10 min.) +- [ ] Korean (Read 1 Story) \ No newline at end of file diff --git a/notes/_journal/2024-12/2024-12-10.md b/notes/_journal/2024-12/2024-12-10.md new file mode 100644 index 0000000..7448875 --- /dev/null +++ b/notes/_journal/2024-12/2024-12-10.md @@ -0,0 +1,12 @@ +--- +title: "2024-12-10" +--- + +- [x] Anki Flashcards +- [x] KoL +- [x] OGS +- [ ] Sheet Music (10 min.) +- [ ] Korean (Read 1 Story) + +* A few flashcards on [[signals#SIGBUS (7)|SIGBUS]]. +* Basic notes on [[xml|XML]]. \ No newline at end of file diff --git a/notes/_journal/2024-12/2024-12-11.md b/notes/_journal/2024-12/2024-12-11.md new file mode 100644 index 0000000..6e1ffa5 --- /dev/null +++ b/notes/_journal/2024-12/2024-12-11.md @@ -0,0 +1,9 @@ +--- +title: "2024-12-12" +--- + +- [x] Anki Flashcards +- [x] KoL +- [x] OGS +- [ ] Sheet Music (10 min.) +- [ ] Korean (Read 1 Story) \ No newline at end of file diff --git a/notes/c17/declarations.md b/notes/c17/declarations.md index a13db58..21cc027 100644 --- a/notes/c17/declarations.md +++ b/notes/c17/declarations.md @@ -18,11 +18,11 @@ C declarations were designed so that the declaration of an object looks like the %%ANKI Basic -Consider the following translation unit. What does the declaration refer to? +Which parts of the following translation unit are declarations? ```c extern const int x, y; ``` -Back: The entire line. +Back: The entire line is a single declaration. Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf). END%% @@ -40,7 +40,7 @@ END%% %%ANKI Basic -Consider the following translation unit. What does the declaration refer to? +Which parts of the following translation unit are declarations? ```c int* a, b; ``` diff --git a/notes/c17/functions.md b/notes/c17/functions.md index 3453332..0f8d8d9 100644 --- a/notes/c17/functions.md +++ b/notes/c17/functions.md @@ -660,20 +660,6 @@ Reference: https://stackoverflow.com/a/17371914 END%% -%%ANKI -Basic -How can we rewrite the following with as few `*`s as possible? -```c -int sum2d(int, int, int a[*][*]); -``` -Back: -```c -int sum2d(int, int, int a[][*]); -``` -Reference: https://stackoverflow.com/a/17371914 - -END%% - ## Bibliography * “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf). diff --git a/notes/c17/index.md b/notes/c17/index.md index 3e4c2f4..b4204c2 100644 --- a/notes/c17/index.md +++ b/notes/c17/index.md @@ -426,7 +426,289 @@ Reference: Jens Gustedt, _Modern C_ (Shelter Island, NY: Manning Publications Co END%% +## Compilation + +Most compilation systems provide a **compiler driver** that invokes a **preprocessor**, **compiler**, **assembler**, and [[linkers/static|linker]]: + +1. The C preprocessor (e.g. `cpp`) translates C source files (`.h` and `.c`) into ASCII intermediate files (`.i`). +2. The C compiler (e.g. `cc1`) translates intermediate files into ASCII assembly-language files (`.s`). +3. The assembler translates assembly-language files into **relocatable object** files (`.o`). +4. The linker bundles all relocatable object files and produces an **executable object** file. + +%%ANKI +Basic +The compiler driver usually consists of what four programs? +Back: The preprocessor, compiler, assembler, and linker. +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 +The term "C compiler" usually refers to what more accurate term? +Back: A compiler driver. +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 +On Unix systems, what kind of file typically has a `.h` extension? +Back: C header files. +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 +On Unix systems, what kind of file typically has a `.c` extension? +Back: C translation units. +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 +On Unix systems, what kind of file typically has a `.i` extension? +Back: ASCII intermediate files. +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 +On Unix systems, what kind of file typically has a `.s` extension? +Back: ASCII assembly-language files. +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 +On Unix systems, what kind of file typically has a `.o` extension? +Back: Relocatable object files. +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 +On Unix systems, a C preprocessor usually inputs files with what extension(s)? +Back: `.h` and `.c`. +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 +On Unix systems, a C preprocessor usually outputs files with what extension(s)? +Back: `.i` +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 +On Unix systems, a C compiler (not compiler driver) usually inputs files with what extension(s)? +Back: `.i` +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 +On Unix systems, a C compiler (not compiler driver) usually outputs files with what extension(s)? +Back: `.s` +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 +On Unix systems, an assembler usually inputs files with what extension(s)? +Back: `.s` +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 +On Unix systems, an assembler usually outputs files with what extension(s)? +Back: `.o` +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 +On Unix systems, a linker usually inputs files with what extension(s)? +Back: `.o` +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 +What ambiguity exists when discussing the C compiler? +Back: We could refer to the compiler (e.g. `cc1`) or the compiler driver. +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 +On Unix systems, what kind of file does a linker usually input? +Back: Relocatable object files. +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 +On Unix systems, what kind of file does a linker usually output? +Back: Executable object files. +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 +On Unix systems, what kind of file does an assembler usually input? +Back: ASCII assembly-language files. +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 +On Unix systems, what kind of file does an assembler usually output? +Back: Relocatable object files. +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 +On Unix systems, what kind of file does a C preprocessor usually input? +Back: C source files. +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 +On Unix systems, what kind of file does a C preprocessor usually output? +Back: ASCII intermediate files. +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 +On Unix systems, what kind of file does a C compiler (not compiler driver) usually input? +Back: ASCII intermediate files. +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 +On Unix systems, what kind of file does a C compiler (not compiler driver) usually output? +Back: ASCII assembly-language files. +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 component of a compiler driver produces ASCII intermediate files? +Back: The preprocessor. +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 component of a compiler driver produces an executable object file? +Back: The linker. +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 component of a compiler driver produces ASCII assembly-language files? +Back: The compiler. +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 component of a compiler driver produces ASCII relocatable object files? +Back: The assembler. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +The operating system provides a function called the **loader** that copies the code and data of the executable object file into memory, and then transfers control to the beginning of the program. + +%%ANKI +Basic +What function does the OS provider to run an executable object file? +Back: The loader. +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 +What kind of file does a loader usually input? +Back: An executable object file. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Cloze +The loader copies {code and data} from an {executable object file} into {memory}. +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 +The loader copies code and data from what kind of file? +Back: An executable object file. +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 +The loader copies code and data into what? +Back: Memory. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Cloze +The loader transfers {control} to the {beginning of a loaded program}. +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 +At a high-level, the loader is responsible for performing what two actions? +Back: Copying code/data and beginning program execution. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + ## Bibliography +* Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. * “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf). * Jens Gustedt, _Modern C_ (Shelter Island, NY: Manning Publications Co, 2020). \ No newline at end of file diff --git a/notes/c17/macros.md b/notes/c17/macros.md index b137f58..1ab76a6 100644 --- a/notes/c17/macros.md +++ b/notes/c17/macros.md @@ -99,7 +99,7 @@ END%% %%ANKI Basic Why aren't compound literals suitable for ICE? -Back: They are objects, not constants. +Back: Compound literals are objects, not constants. Reference: Jens Gustedt, _Modern C_ (Shelter Island, NY: Manning Publications Co, 2020). END%% @@ -173,7 +173,7 @@ END%% %%ANKI Basic What does the `#` operator do? -Back: Stringify arguments. +Back: Stringifies arguments. Reference: Jens Gustedt, _Modern C_ (Shelter Island, NY: Manning Publications Co, 2020). END%% @@ -232,7 +232,7 @@ END%% Basic Given the following translation unit, what is output to `stdout`? ```c -#define foo(T, U) #T +#define foo(T) #T int main(void) { printf("%d\n", foo(123)); } ``` diff --git a/notes/c17/storage.md b/notes/c17/storage.md index b33810b..3a5db7c 100644 --- a/notes/c17/storage.md +++ b/notes/c17/storage.md @@ -73,7 +73,7 @@ END%% %%ANKI Basic -When; does an object whose identifier has external linkage have a static storage duration? +When does an object whose identifier has external linkage have a static storage duration? Back: When the identifier is declared without storage-class specifier `_Thread_local`. Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf). @@ -81,7 +81,7 @@ END%% %%ANKI Basic -When; does an object whose identifier has external linkage have a thread storage duration? +When does an object whose identifier has external linkage have a thread storage duration? Back: When the identifier is declared with storage-class specifier `_Thread_local`. Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf). @@ -298,7 +298,7 @@ END%% %%ANKI Basic Which storage class specifier(s) can be used to declare an object with automatic storage duration? -Back: `auto` +Back: `auto` and {`register`}. Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf). END%% @@ -694,7 +694,7 @@ END%% %%ANKI Basic -Variables declared with storage-class specifier can't alias? +Variables declared with what storage-class specifier can't alias? Back: `register` Reference: Jens Gustedt, _Modern C_ (Shelter Island, NY: Manning Publications Co, 2020). diff --git a/notes/formal-system/proof-system/equiv-trans.md b/notes/formal-system/proof-system/equiv-trans.md index dc65d7e..eebbb71 100644 --- a/notes/formal-system/proof-system/equiv-trans.md +++ b/notes/formal-system/proof-system/equiv-trans.md @@ -15,7 +15,7 @@ tags: %%ANKI Basic Who is the author of "The Science of Programming"? -Back: David Gries +Back: David Gries. Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. END%% diff --git a/notes/hashing/addressing.md b/notes/hashing/addressing.md index e99e810..4b15b84 100644 --- a/notes/hashing/addressing.md +++ b/notes/hashing/addressing.md @@ -581,7 +581,7 @@ END%% %%ANKI Basic Consider closed hashing in a table of $m$ slots. What is the hash function's domain? -Back: Given universe of keys $U$, $U \times \{0, 1, \ldots, m\}$. +Back: Given universe of keys $U$, $U \times \{0, 1, \ldots, m - 1\}$. Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022). END%% diff --git a/notes/lambda-calculus/index.md b/notes/lambda-calculus/index.md index 4e5ee95..03ef2c3 100644 --- a/notes/lambda-calculus/index.md +++ b/notes/lambda-calculus/index.md @@ -536,14 +536,6 @@ Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combi END%% -%%ANKI -Basic -When is variable $x$ in term $P$ said to be "free and binding"? -Back: N/A. -Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. [https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf](https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf). - -END%% - %%ANKI Basic When is variable $x$ in term $P$ said to be "bound" and "free"? diff --git a/notes/linkers/index.md b/notes/linkers/index.md new file mode 100644 index 0000000..53d0a37 --- /dev/null +++ b/notes/linkers/index.md @@ -0,0 +1,7 @@ +--- +title: Linkers +TARGET DECK: Obsidian::STEM +FILE TAGS: linkers +tags: + - linkers +--- diff --git a/notes/linkers/static.md b/notes/linkers/static.md new file mode 100644 index 0000000..87115f1 --- /dev/null +++ b/notes/linkers/static.md @@ -0,0 +1,104 @@ +--- +title: Static Linkers +TARGET DECK: Obsidian::STEM +FILE TAGS: linkers::static +tags: + - linkers +--- + +## Overview + +To build an executable, a linker must perform two main tasks: + +1. **Symbol resolution**. The linker must associate each symbol reference with exactly one symbol definition. +2. **Relocation**. The linker must relocate code and data sections by associating a memory location with each symbol definition, and then modifying all of the references to those symbols so that they point to this memory location. + +The linker blindly performs relocations using detailed instructions generated by the assembler called **relocation entries**. + +%%ANKI +Basic +According to Bryant et al., a static linker must perform what two tasks? +Back: Symbol resolution and relocation. +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 of symbol resolution or relocation happens first? +Back: Symbol resolution. +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 +What is the goal of symbol resolution? +Back: To associate each symbol reference with exactly one symbol definition. +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 +What is the goal of relocation? +Back: To assign a memory location to each symbol and update references accordingly. +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 +*Why* must relocation happen after symbol resolution? +Back: We should not assign multiple addresses to the same symbol. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Cloze +{Symbol resolution} associates each {symbol reference} with exactly one {symbol definition}. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Cloze +{Relocation} assigns a {memory location} to each symbol and {updates references} accordingly. +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 +What does it mean for a linker to relocate a code and/or data section? +Back: It associates a memory location with each symbol definition and updates references accordingly. +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 +What is emitted by the assembler to help the linker relocate sections? +Back: Relocation entries. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Cloze +The assembler outputs {relocation entries} to guide the linker during {relocation}. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Cloze +The {1:assembler} outputs relocation entries to guide the {1:linker} during relocation. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +## Bibliography + +* Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. \ No newline at end of file diff --git a/notes/ontology/rdf/index.md b/notes/ontology/rdf/index.md index 6435114..3fef104 100644 --- a/notes/ontology/rdf/index.md +++ b/notes/ontology/rdf/index.md @@ -129,41 +129,6 @@ Reference: Allemang, Dean, James A. Hendler, and Fabien L. Gandon. _Semantic Web END%% -## Standard Namespaces - -W3C have defined a number of standard namespaces for use with Web technologies: - -* `xsd` - * Refers to the XML schema definition. -* `xmlns` - * Refers to XML namespaces. -* `rdf` - * Refers to identifiers used in RDF. - -%%ANKI -Basic -What is the standard `xsd` namespace an acronym for? -Back: **X**ML **S**chema **D**efinition. -Reference: Allemang, Dean, James A. Hendler, and Fabien L. Gandon. _Semantic Web for the Working Ontologist_. 3e ed. ACM Books 33. New York: Association for computing machinery, 2020. - -END%% - -%%ANKI -Basic -What is the standard `xmlns` namespace an acronym for? -Back: **XML** **N**ame**s**pace. -Reference: Allemang, Dean, James A. Hendler, and Fabien L. Gandon. _Semantic Web for the Working Ontologist_. 3e ed. ACM Books 33. New York: Association for computing machinery, 2020. - -END%% - -%%ANKI -Basic -What is the standard `rdf` namespace an acronym for? -Back: **R**esource **D**escription **F**ramework. -Reference: Allemang, Dean, James A. Hendler, and Fabien L. Gandon. _Semantic Web for the Working Ontologist_. 3e ed. ACM Books 33. New York: Association for computing machinery, 2020. - -END%% - ## Bibliography * Allemang, Dean, James A. Hendler, and Fabien L. Gandon. _Semantic Web for the Working Ontologist_. 3e ed. ACM Books 33. New York: Association for computing machinery, 2020. \ No newline at end of file diff --git a/notes/ontology/xml.md b/notes/ontology/xml.md new file mode 100644 index 0000000..dbebc14 --- /dev/null +++ b/notes/ontology/xml.md @@ -0,0 +1,261 @@ +--- +title: XML +TARGET DECK: Obsidian::STEM +FILE TAGS: xml +tags: + - xml +--- + +## Overview + +**Extensible Markup Language** (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. + +%%ANKI +Basic +What is XML an acronym for? +Back: E**x**tensible **m**arkup **l**anguage. +Reference: “XML,” in _Wikipedia_, November 2, 2024, [https://en.wikipedia.org/w/index.php?title=XML](https://en.wikipedia.org/w/index.php?title=XML&oldid=1254990843). + +END%% + +An XML document is divided into **markup** and **content**. A **tag** is a markup construct beginning with `<` and ending with `>`. An **element** is a logical document component spanning a start and end tag or consisting of just an empty-element tag. + +%%ANKI +Cloze +An XML document is divided into {markup} and {content}. +Reference: “XML,” in _Wikipedia_, November 2, 2024, [https://en.wikipedia.org/w/index.php?title=XML](https://en.wikipedia.org/w/index.php?title=XML&oldid=1254990843). + +END%% + +%%ANKI +Basic +What is an XML tag? +Back: Markup beginning with a `<` and ending with a `>`. +Reference: “XML,” in _Wikipedia_, November 2, 2024, [https://en.wikipedia.org/w/index.php?title=XML](https://en.wikipedia.org/w/index.php?title=XML&oldid=1254990843). + +END%% + +%%ANKI +Basic +What is an XML element? +Back: A logical document component spanning start and end tags or just an empty-element tag. +Reference: “XML,” in _Wikipedia_, November 2, 2024, [https://en.wikipedia.org/w/index.php?title=XML](https://en.wikipedia.org/w/index.php?title=XML&oldid=1254990843). + +END%% + +%%ANKI +Basic +What kind of tag is ``? +Back: A start tag. +Reference: “XML,” in _Wikipedia_, November 2, 2024, [https://en.wikipedia.org/w/index.php?title=XML](https://en.wikipedia.org/w/index.php?title=XML&oldid=1254990843). + +END%% + +%%ANKI +Basic +What kind of tag is ``? +Back: An end tag. +Reference: “XML,” in _Wikipedia_, November 2, 2024, [https://en.wikipedia.org/w/index.php?title=XML](https://en.wikipedia.org/w/index.php?title=XML&oldid=1254990843). + +END%% + +%%ANKI +Basic +What kind of tag is ``? +Back: An empty-element tag. +Reference: “XML,” in _Wikipedia_, November 2, 2024, [https://en.wikipedia.org/w/index.php?title=XML](https://en.wikipedia.org/w/index.php?title=XML&oldid=1254990843). + +END%% + +%%ANKI +Basic +What does an XML tag begin with? +Back: A `<` character. +Reference: “XML,” in _Wikipedia_, November 2, 2024, [https://en.wikipedia.org/w/index.php?title=XML](https://en.wikipedia.org/w/index.php?title=XML&oldid=1254990843). + +END%% + +%%ANKI +Basic +What does an XML element begin with? +Back: A start tag or empty-element tag. +Reference: “XML,” in _Wikipedia_, November 2, 2024, [https://en.wikipedia.org/w/index.php?title=XML](https://en.wikipedia.org/w/index.php?title=XML&oldid=1254990843). + +END%% + +%%ANKI +Basic +What does an XML tag end with? +Back: A `>` character. +Reference: “XML,” in _Wikipedia_, November 2, 2024, [https://en.wikipedia.org/w/index.php?title=XML](https://en.wikipedia.org/w/index.php?title=XML&oldid=1254990843). + +END%% + +%%ANKI +Basic +What does an XML element end with? +Back: An end tag or empty-element tag. +Reference: “XML,” in _Wikipedia_, November 2, 2024, [https://en.wikipedia.org/w/index.php?title=XML](https://en.wikipedia.org/w/index.php?title=XML&oldid=1254990843). + +END%% + +## Namespaces + +Namespaces are declared using the reserved `xmlns` attribute. A declaration is formatted as follows: `xmlns[:]=""`. If no prefix is specified, the attribute defines the **default namespace**. + +%%ANKI +Basic +What is the standard `xmlns` namespace an acronym for? +Back: **XML** **N**ame**s**pace. +Reference: Allemang, Dean, James A. Hendler, and Fabien L. Gandon. _Semantic Web for the Working Ontologist_. 3e ed. ACM Books 33. New York: Association for computing machinery, 2020. + +END%% + +%%ANKI +Basic +What attribute is used to introduce a new XML namespace? +Back: `xmlns` +Reference: “XML Namespace,” in _Wikipedia_, April 11, 2024, [https://en.wikipedia.org/w/index.php?title=XML_namespace](https://en.wikipedia.org/w/index.php?title=XML_namespace&oldid=1218316095). + +END%% + +%%ANKI +Basic +Consider `xmlns:

=`. What term is used to refer to `

`? +Back: The prefix. +Reference: “XML Namespace,” in _Wikipedia_, April 11, 2024, [https://en.wikipedia.org/w/index.php?title=XML_namespace](https://en.wikipedia.org/w/index.php?title=XML_namespace&oldid=1218316095). + +END%% + +%%ANKI +Basic +Consider `xmlns:

=`. What term is used to refer to ``? +Back: The namespace name. +Reference: “XML Namespace,” in _Wikipedia_, April 11, 2024, [https://en.wikipedia.org/w/index.php?title=XML_namespace](https://en.wikipedia.org/w/index.php?title=XML_namespace&oldid=1218316095). + +END%% + +%%ANKI +Basic +What namespace name is used in the following XML attribute? +```xml +<... xmlns:xhtml="http://www.w3.org/1999/xhtml"> +``` +Back: `http://www.w3.org/1999/xhtml` +Reference: “XML Namespace,” in _Wikipedia_, April 11, 2024, [https://en.wikipedia.org/w/index.php?title=XML_namespace](https://en.wikipedia.org/w/index.php?title=XML_namespace&oldid=1218316095). + +END%% + +%%ANKI +Basic +What prefix is used in the following XML attribute? +```xml +<... xmlns:xhtml="http://www.w3.org/1999/xhtml"> +``` +Back: `xhtml` +Reference: “XML Namespace,” in _Wikipedia_, April 11, 2024, [https://en.wikipedia.org/w/index.php?title=XML_namespace](https://en.wikipedia.org/w/index.php?title=XML_namespace&oldid=1218316095). + +END%% + +%%ANKI +Basic +What does it mean to use an `xmlns` attribute without a prefix? +Back: This declares the default namespace of the associated tag. +Reference: “XML Namespace,” in _Wikipedia_, April 11, 2024, [https://en.wikipedia.org/w/index.php?title=XML_namespace](https://en.wikipedia.org/w/index.php?title=XML_namespace&oldid=1218316095). + +END%% + +%%ANKI +Basic +What does it mean to use an `xmlns` attribute without a namespace name? +Back: N/A. This is invalid syntax. +Reference: “XML Namespace,” in _Wikipedia_, April 11, 2024, [https://en.wikipedia.org/w/index.php?title=XML_namespace](https://en.wikipedia.org/w/index.php?title=XML_namespace&oldid=1218316095). + +END%% + +%%ANKI +Basic +How do I declare a new XML namespace with prefix `abc`? +Back: By including `xmlns:abc=` in the appropriate tag. +Reference: “XML Namespace,” in _Wikipedia_, April 11, 2024, [https://en.wikipedia.org/w/index.php?title=XML_namespace](https://en.wikipedia.org/w/index.php?title=XML_namespace&oldid=1218316095). + +END%% + +%%ANKI +Basic +Suppose there is no default namespace in scope. What namespace are elements assigned? +Back: N/A. They are not considered members of any namespace. +Reference: “XML Namespace,” in _Wikipedia_, April 11, 2024, [https://en.wikipedia.org/w/index.php?title=XML_namespace](https://en.wikipedia.org/w/index.php?title=XML_namespace&oldid=1218316095). + +END%% + +%%ANKI +Basic +Which namespace is `bar` a member of? +```xml + + + +``` +Back: `ns2` +Reference: “XML Namespace,” in _Wikipedia_, April 11, 2024, [https://en.wikipedia.org/w/index.php?title=XML_namespace](https://en.wikipedia.org/w/index.php?title=XML_namespace&oldid=1218316095). + +END%% + +%%ANKI +Basic +Which namespace is `bar` a member of? +```xml + + + +``` +Back: `ns1` +Reference: “XML Namespace,” in _Wikipedia_, April 11, 2024, [https://en.wikipedia.org/w/index.php?title=XML_namespace](https://en.wikipedia.org/w/index.php?title=XML_namespace&oldid=1218316095). + +END%% + +%%ANKI +Basic +Which namespace is attribute `a` a member of? +```xml + + + +``` +Back: N/A. `a` has no namespace. +Reference: “XML Namespace,” in _Wikipedia_, April 11, 2024, [https://en.wikipedia.org/w/index.php?title=XML_namespace](https://en.wikipedia.org/w/index.php?title=XML_namespace&oldid=1218316095). + +END%% + +%%ANKI +Basic +Which namespace is attribute `b` a member of? +```xml + + + +``` +Back: N/A. `b` has no namespace. +Reference: “XML Namespace,” in _Wikipedia_, April 11, 2024, [https://en.wikipedia.org/w/index.php?title=XML_namespace](https://en.wikipedia.org/w/index.php?title=XML_namespace&oldid=1218316095). + +END%% + +%%ANKI +Basic +Which namespace is attribute `b` a member of? +```xml + + + +``` +Back: `p` +Reference: “XML Namespace,” in _Wikipedia_, April 11, 2024, [https://en.wikipedia.org/w/index.php?title=XML_namespace](https://en.wikipedia.org/w/index.php?title=XML_namespace&oldid=1218316095). + +END%% + +## Bibliography + +* Allemang, Dean, James A. Hendler, and Fabien L. Gandon. _Semantic Web for the Working Ontologist_. 3e ed. ACM Books 33. New York: Association for computing machinery, 2020. +* “XML,” in _Wikipedia_, November 2, 2024, [https://en.wikipedia.org/w/index.php?title=XML](https://en.wikipedia.org/w/index.php?title=XML&oldid=1254990843). +* “XML Namespace,” in _Wikipedia_, April 11, 2024, [https://en.wikipedia.org/w/index.php?title=XML_namespace](https://en.wikipedia.org/w/index.php?title=XML_namespace&oldid=1218316095). \ No newline at end of file diff --git a/notes/posix/signals.md b/notes/posix/signals.md index d4cbdf5..7f4fb67 100644 --- a/notes/posix/signals.md +++ b/notes/posix/signals.md @@ -9,8 +9,6 @@ tags: ## Overview -This is an overview of specific POSIX signals. - Code | Name ----- | -------------- 1 | SIGHUP @@ -24,8 +22,6 @@ Code | Name 13 | SIGPIPE 15 | SIGTERM -## Details - %%ANKI Basic What command can we run to access the official manual page for signals? @@ -50,7 +46,15 @@ Reference: Cooper, Mendel. “Advanced Bash-Scripting Guide,” n.d., 916. END%% -### SIGHUP (1) +%%ANKI +Basic +What does it mean for a program to (perform a) trap? +Back: It is terminated abruptly before its usual end. +Reference: Jens Gustedt, _Modern C_ (Shelter Island, NY: Manning Publications Co, 2020). + +END%% + +## SIGHUP (1) A process receives a `SIGHUP` signal when the terminal it is attached to goes away before it finishes executing. @@ -129,7 +133,7 @@ Reference: `man 1 ps` END%% -### SIGINT (2) +## SIGINT (2) Indicates the process was interrupted by the user. Happens when pressing `Ctrl-C` from the controlling terminal. @@ -156,7 +160,7 @@ Reference: Dowling, “A List of Signals and What They Mean.” END%% -### SIGILL (4) +## SIGILL (4) Indicates the CPU encountered an instruction it does not understand or does not have permission to execute. Can often indicate corruption in some way or perhaps an attempt to execute data instead of code. @@ -199,7 +203,7 @@ Reference: Dowling, “A List of Signals and What They Mean.” END%% -### SIGABRT (6) +## SIGABRT (6) A signal, usually sent when the process itself invokes `abort()`. Indicates an "emergency stop". @@ -221,7 +225,7 @@ END%% %%ANKI Basic -What signal corresponds to the idea of an "emergency stop"? +Which signal corresponds to the idea of an "emergency stop"? Back: `SIGABRT` Reference: Dowling, “A List of Signals and What They Mean.” @@ -245,12 +249,39 @@ Tags: c17 END%% +## SIGBUS (7) + +Indicates the CPU encountered an instruction to access memory it cannot physically address, i.e. an invalid address for the address bus. + +%%ANKI +Cloze +Signal {`SIGBUS`} corresponds to number {7}. +Reference: Dowling, “A List of Signals and What They Mean.” + +END%% + %%ANKI Basic -What does it mean for a program to (perform a) trap? -Back: It is terminated abruptly before its usual end. -Reference: Jens Gustedt, _Modern C_ (Shelter Island, NY: Manning Publications Co, 2020). - +Which signal usually corresponds to alignment errors when accessing memory? +Back: `SIGBUS` +Reference: Dowling, “A List of Signals and What They Mean.” + +END%% + +%%ANKI +Basic +When does the CPU emit a `SIGBUS` signal? +Back: When it tries accessing memory it cannot physically address. +Reference: Dowling, “A List of Signals and What They Mean.” + +END%% + +%%ANKI +Basic +What is the `BUS` in `SIGBUS` short for? +Back: **Bus** error. +Reference: Dowling, “A List of Signals and What They Mean.” + END%% ## Bibliography diff --git a/notes/set/cardinality.md b/notes/set/cardinality.md index c24554f..8c19af6 100644 --- a/notes/set/cardinality.md +++ b/notes/set/cardinality.md @@ -36,7 +36,7 @@ END%% %%ANKI Basic -Suppose there exists a one-to-one function $F$ from $A$ into $B$. When is $A \approx B$? +Suppose there exists a one-to-one function $F$ from $A$ into $B$. When does this imply $A \approx B$? Back: When $F$ is also onto $B$. Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). @@ -44,7 +44,7 @@ END%% %%ANKI Basic -Suppose there exists a function $F$ from $A$ onto $B$. When is $A \approx B$? +Suppose there exists a function $F$ from $A$ onto $B$. When does this imply $A \approx B$? Back: When $F$ is also one-to-one. Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). @@ -52,7 +52,7 @@ END%% %%ANKI Basic -Suppose there exists a one-to-one function $F$ from $A$ onto $B$. When is $A \approx B$? +Suppose there exists a one-to-one function $F$ from $A$ onto $B$. When does this imply $A \approx B$? Back: Always, by definition. Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). @@ -435,6 +435,321 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre END%% +If one set $A$ of cardinality $\kappa$ is finite, then all of them are. In this case $\kappa$ is a **finite cardinal**. Otherwise $\kappa$ is an **infinite cardinal**. + +%%ANKI +Basic +How many sets $A$ exist such that $\mathop{\text{card}} A = 0$? +Back: $1$ +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +How many sets $A$ exist such that $\mathop{\text{card}} A = n^+$ for some $n \in \omega$? +Back: An infinite many. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +Let $n \in \omega$. When is $\{X \mid \mathop{\text{card}} X = n\}$ a set? +Back: When $n = 0$. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +Let $n \in \omega$. When is $\{X \mid \mathop{\text{card}} X = n\}$ a class? +Back: Always. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +What class can we construct to prove $\{X \mid \mathop{\text{card}} X = 1\}$ is not a set? +Back: $\bigcup\, \{\{X\} \mid X \text{ is a set} \}$, i.e. the union of all singleton sets. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +What is a finite cardinal? +Back: A cardinal number equal to $\mathop{\text{card}} A$ for some finite set $A$. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +What is an infinite cardinal? +Back: A cardinal number equal to $\mathop{\text{card}} A$ for some infinite set $A$. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +The finite cardinals are exactly what more basic set? +Back: $\omega$ +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +What set does $\aleph_0$ refer to? +Back: $\mathop{\text{card}} \omega$ +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +What is the "smallest" infinite cardinal? +Back: $\aleph_0$ +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +Let $C \subseteq A$ where $A \approx n$ for some $n \in \omega$. What does $\mathop{\text{card}} C$ evaluate to? +Back: A natural number $m$ such that $m \underline{\in} n$. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +Let $C \subset A$ where $A \approx n$ for some $n \in \omega$. What does $\mathop{\text{card}} C$ evaluate to? +Back: A natural number $m$ such that $m \in n$. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +How is proposition "any subset of a finite set is finite" expressed in FOL? +Back: $\forall n \in \omega, \forall A \approx n, \forall B \subseteq A, \exists m \in n, B \approx m$ +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +How is the following more succinctly stated? $$\forall n \in \omega, \forall A \approx n, \forall B \subseteq A, \exists m \in n, B \approx m$$ +Back: Any subset of a finite set is finite. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +Suppose sets $A$ and $B$ are finite. When is $A \cup B$ infinite? +Back: The union of two finite sets is always finite. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +Let $m, n \in \omega$ s.t. $A \approx m$ and $B \approx n$. What is the largest value $\mathop{\text{card}}(A \cup B)$ can evaluate to? +Back: $m + n$ +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +Let $m, n \in \omega$ s.t. $A \approx m$ and $B \approx n$. What is the smallest value $\mathop{\text{card}}(A \cup B)$ can evaluate to? +Back: $\mathop{\text{max}}(m, n)$ +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +Let $m, n \in \omega$ s.t. $A \approx m$ and $B \approx n$. When does $\mathop{\text{card}}(A \cup B) = m + n$? +Back: When $A$ and $B$ are disjoint. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +Let $m, n \in \omega$ s.t. $A \approx m$ and $B \approx n$. When does $\mathop{\text{card}}(A \cup B) = m$? +Back: When $B \subseteq A$. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +Suppose sets $A$ and $B$ are finite. When is $A \cap B$ finite? +Back: The intersection of two finite sets is always finite. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +Let $m, n \in \omega$ s.t. $A \approx m$ and $B \approx n$. What is the largest value $\mathop{\text{card}}(A \cap B)$ can evaluate to? +Back: $\mathop{\text{min}}(m, n)$ +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +Let $m, n \in \omega$ s.t. $A \approx m$ and $B \approx n$. What is the smallest value $\mathop{\text{card}}(A \cap B)$ can evaluate to? +Back: $0$ +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +Suppose sets $A$ and $B$ are finite. When is $A \times B$ finite? +Back: The Cartesian product of two finite sets is always finite. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +Let $m, n \in \omega$ such that $A \approx m$ and $B \approx n$. What does $\mathop{\text{card}}(A \times B)$ evaluate to? +Back: $m \cdot n$ +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +### Addition + +Let $\kappa$ and $\lambda$ be any cardinal numbers. Then $\kappa + \lambda = \mathop{\text{card}}(K \cup L)$, where $K$ and $L$ are any disjoint sets of cardinality $\kappa$ and $\lambda$, respectively. + +%%ANKI +Basic +Let $\kappa$ and $\lambda$ be any cardinal numbers. How is $\kappa + \lambda$ defined? +Back: As $\mathop{\text{card}}(K \cup L)$ where $K$ and $L$ are disjoint sets with cardinality $\kappa$ and $\lambda$, respectively. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +Let $K$ and $L$ be sets. How is $\mathop{\text{card}}(K \cup L)$ expressed in terms of cardinal numbers? +Back: N/A. $K$ and $L$ must be *disjoint* sets for this to make sense. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +Let $K$ and $L$ be disjoint sets. How is $\mathop{\text{card}}(K \cup L)$ expressed in terms of cardinal numbers? +Back: As $\kappa + \lambda$ where $\kappa = \mathop{\text{card}} K$ and $\lambda = \mathop{\text{card}} L$. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +Let $K \approx \kappa$ and $L \approx \lambda$. What is necessary for $\mathop{\text{card}}(K \cup L) \approx \kappa + \lambda$? +Back: That $K$ and $L$ are disjoint. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Cloze +{Addition} of cardinal numbers is defined in terms of the {union} of sets. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +### Multiplication + +Let $\kappa$ and $\lambda$ be any cardinal numbers. Then $\kappa \cdot \lambda = \mathop{\text{card}}(K \times L)$, where $K$ and $L$ are any sets of cardinality $\kappa$ and $\lambda$, respectively. + +%%ANKI +Basic +Let $\kappa$ and $\lambda$ be any cardinal numbers. How is $\kappa \cdot \lambda$ defined? +Back: As $\mathop{\text{card}}(K \times L)$ where $K$ and $L$ are sets with cardinality $\kappa$ and $\lambda$, respectively. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +Let $K$ and $L$ be sets. How is $\mathop{\text{card}}(K \times L)$ expressed in terms of cardinal numbers? +Back: As $\kappa \cdot \lambda$ where $\kappa = \mathop{\text{card}} K$ and $\lambda = \mathop{\text{card}} L$. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +Let $K \approx \kappa$ and $L \approx \lambda$. What is necessary for $\mathop{\text{card}}(K \times L) \approx \kappa \cdot \lambda$? +Back: N/A. This is true by definition. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Cloze +{Multiplication} of cardinal numbers is defined in terms of the {Cartesian product} of sets. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +### Exponentiation + +Let $\kappa$ and $\lambda$ be any cardinal numbers. Then $\kappa^\lambda = \mathop{\text{card}}(^LK)$, where $K$ and $L$ are any sets of cardinality $\kappa$ and $\lambda$, respectively. + +%%ANKI +Basic +Let $\kappa$ and $\lambda$ be any cardinal numbers. How is $\kappa^\lambda$ defined? +Back: As $\mathop{\text{card}}(^LK)$ where $K$ and $L$ are sets with cardinality $\kappa$ and $\lambda$, respectively. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +Let $K$ and $L$ be sets. How is $\mathop{\text{card}}(^LK)$ expressed in terms of cardinal numbers? +Back: As $\kappa^\lambda$ where $\kappa = \mathop{\text{card}} K$ and $\lambda = \mathop{\text{card}} L$. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +Let $K$ and $L$ be sets. How is $\mathop{\text{card}}(^KL)$ expressed in terms of cardinal numbers? +Back: As $\lambda^\kappa$ where $\kappa = \mathop{\text{card}} K$ and $\lambda = \mathop{\text{card}} L$. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Basic +Let $K \approx \kappa$ and $L \approx \lambda$. What is necessary for $\mathop{\text{card}}(^LK) \approx \kappa^\lambda$? +Back: N/A. This is true by definition. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + +%%ANKI +Cloze +{Exponentiation} of cardinal numbers is defined in terms of the {set of functions} between sets. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + ## Bibliography * Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). \ No newline at end of file diff --git a/notes/set/graphs.md b/notes/set/graphs.md index f8e9f82..db18776 100644 --- a/notes/set/graphs.md +++ b/notes/set/graphs.md @@ -1064,7 +1064,7 @@ END%% %%ANKI Basic In an undirected graph, when is $\langle v_0, v_1, \ldots, v_k \rangle$ considered a non-trivial cycle? -Back: When $v_0 = v_k$, $k > 0$, and all edges in the path are distinct. +Back: When the tuple forms a path satisfying $v_0 = v_k$ for some $k > 0$. Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022). END%% diff --git a/notes/set/relations.md b/notes/set/relations.md index c69dc69..e73567a 100644 --- a/notes/set/relations.md +++ b/notes/set/relations.md @@ -1259,7 +1259,7 @@ END%% %%ANKI Basic Can a relation be both reflexive and trichotomous? -Back: Yes. +Back: Yes, the empty relation. Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). END%% diff --git a/notes/x86-64/instructions/conditions.md b/notes/x86-64/instructions/conditions.md index ce6f41f..ce67e7f 100644 --- a/notes/x86-64/instructions/conditions.md +++ b/notes/x86-64/instructions/conditions.md @@ -745,7 +745,7 @@ END%% %%ANKI Basic -Is the following considered a direct or indirect jump? +Is the following considered a direct or indirect jump instruction? ```x86 jmp *(%rax) ``` @@ -756,7 +756,7 @@ END%% %%ANKI Basic -Is the following considered a direct or indirect jump? +Is the following considered a direct or indirect jump instruction? ```x86 jmp .L1 ``` @@ -767,7 +767,7 @@ END%% %%ANKI Basic -Is the following considered a direct or indirect jump? +Is the following considered a direct or indirect jump instruction? ```x86 jmp *%rax ``` @@ -778,7 +778,7 @@ END%% %%ANKI Basic -Is the following considered a direct or indirect jump? +Is the following considered a direct or indirect jump instruction? ```x86 jg *%rax ``` diff --git a/notes/x86-64/procedures.md b/notes/x86-64/procedures.md index 902480b..3265e0b 100644 --- a/notes/x86-64/procedures.md +++ b/notes/x86-64/procedures.md @@ -37,7 +37,7 @@ END%% %%ANKI Basic -What instructions are used to store and retrieve from the x86-64 stack? +What two instructions are used to adjust the top of the x86-64 stack? Back: `pushq` and `popq`. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.