Linkers and XML

main
Joshua Potter 2024-12-12 06:28:56 -07:00
parent e43e654c21
commit 217f84f12d
26 changed files with 1130 additions and 109 deletions

View File

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

View File

@ -0,0 +1,9 @@
---
title: "2024-12-12"
---
- [x] Anki Flashcards
- [x] KoL
- [x] OGS
- [ ] Sheet Music (10 min.)
- [ ] Korean (Read 1 Story)

View File

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

View File

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

View File

@ -0,0 +1,9 @@
---
title: "2024-12-09"
---
- [x] Anki Flashcards
- [x] KoL
- [x] OGS
- [ ] Sheet Music (10 min.)
- [ ] Korean (Read 1 Story)

View File

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

View File

@ -0,0 +1,9 @@
---
title: "2024-12-12"
---
- [x] Anki Flashcards
- [x] KoL
- [x] OGS
- [ ] Sheet Music (10 min.)
- [ ] Korean (Read 1 Story)

View File

@ -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).
<!--ID: 1733401142066-->
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;
```

View File

@ -660,20 +660,6 @@ Reference: https://stackoverflow.com/a/17371914
<!--ID: 1733144155076-->
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
<!--ID: 1733144155079-->
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).

View File

@ -426,7 +426,289 @@ Reference: Jens Gustedt, _Modern C_ (Shelter Island, NY: Manning Publications Co
<!--ID: 1732622657269-->
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.
<!--ID: 1733607099482-->
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.
<!--ID: 1733607180457-->
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.
<!--ID: 1733607099489-->
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.
<!--ID: 1733607099492-->
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.
<!--ID: 1733607099495-->
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.
<!--ID: 1733607099498-->
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.
<!--ID: 1733607099501-->
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.
<!--ID: 1733607099505-->
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.
<!--ID: 1733607099508-->
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.
<!--ID: 1733607099511-->
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.
<!--ID: 1733607099514-->
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.
<!--ID: 1733607099518-->
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.
<!--ID: 1733607099521-->
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.
<!--ID: 1733607099525-->
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.
<!--ID: 1733607099533-->
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.
<!--ID: 1733607099537-->
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.
<!--ID: 1733607099540-->
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.
<!--ID: 1733607099544-->
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.
<!--ID: 1733607099547-->
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.
<!--ID: 1733607099551-->
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.
<!--ID: 1733607099555-->
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.
<!--ID: 1733607099560-->
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.
<!--ID: 1733607099566-->
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.
<!--ID: 1733607099570-->
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.
<!--ID: 1733607099576-->
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.
<!--ID: 1733607099581-->
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.
<!--ID: 1733607099587-->
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.
<!--ID: 1733607099593-->
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.
<!--ID: 1733607099598-->
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.
<!--ID: 1733607099604-->
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.
<!--ID: 1733607099609-->
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.
<!--ID: 1733607099614-->
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.
<!--ID: 1733607099619-->
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.
<!--ID: 1733607099625-->
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).

View File

@ -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).
<!--ID: 1727432419498-->
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).
<!--ID: 1733308613469-->
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)); }
```

View File

@ -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).
<!--ID: 1733060664884-->
@ -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).
<!--ID: 1733060664888-->
@ -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).
<!--ID: 1733064332819-->
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).
<!--ID: 1733242332404-->

View File

@ -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.
<!--ID: 1706994861286-->
END%%

View File

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

View File

@ -536,14 +536,6 @@ Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combi
<!--ID: 1716745016012-->
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).
<!--ID: 1716745016014-->
END%%
%%ANKI
Basic
When is variable $x$ in term $P$ said to be "bound" and "free"?

7
notes/linkers/index.md Normal file
View File

@ -0,0 +1,7 @@
---
title: Linkers
TARGET DECK: Obsidian::STEM
FILE TAGS: linkers
tags:
- linkers
---

104
notes/linkers/static.md Normal file
View File

@ -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.
<!--ID: 1733671136073-->
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.
<!--ID: 1733671136078-->
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.
<!--ID: 1733671136081-->
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.
<!--ID: 1733671136084-->
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.
<!--ID: 1733671136088-->
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.
<!--ID: 1733671136092-->
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.
<!--ID: 1733671136097-->
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.
<!--ID: 1733671136102-->
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.
<!--ID: 1733671136107-->
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.
<!--ID: 1733671136112-->
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.
<!--ID: 1733671136117-->
END%%
## Bibliography
* Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.

View File

@ -129,41 +129,6 @@ Reference: Allemang, Dean, James A. Hendler, and Fabien L. Gandon. _Semantic Web
<!--ID: 1722191359882-->
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.
<!--ID: 1722340624986-->
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.
<!--ID: 1722340624991-->
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.
<!--ID: 1722340624996-->
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.

261
notes/ontology/xml.md Normal file
View File

@ -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).
<!--ID: 1733842094278-->
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).
<!--ID: 1733842094283-->
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).
<!--ID: 1733842094286-->
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).
<!--ID: 1733842094290-->
END%%
%%ANKI
Basic
What kind of tag is `<foo>`?
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).
<!--ID: 1733842094293-->
END%%
%%ANKI
Basic
What kind of tag is `</foo>`?
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).
<!--ID: 1733842094296-->
END%%
%%ANKI
Basic
What kind of tag is `<foo />`?
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).
<!--ID: 1733842094300-->
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).
<!--ID: 1733842094303-->
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).
<!--ID: 1733842094309-->
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).
<!--ID: 1733842094315-->
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).
<!--ID: 1733842094319-->
END%%
## Namespaces
Namespaces are declared using the reserved `xmlns` attribute. A declaration is formatted as follows: `xmlns[:<prefix>]="<namespace name>"`. 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.
<!--ID: 1722340624991-->
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).
<!--ID: 1733842094324-->
END%%
%%ANKI
Basic
Consider `xmlns:<p>=<n>`. What term is used to refer to `<p>`?
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).
<!--ID: 1733842094329-->
END%%
%%ANKI
Basic
Consider `xmlns:<p>=<n>`. What term is used to refer to `<n>`?
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).
<!--ID: 1733842094332-->
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).
<!--ID: 1733842094336-->
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).
<!--ID: 1733842094340-->
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).
<!--ID: 1733842094344-->
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).
<!--ID: 1733842094347-->
END%%
%%ANKI
Basic
How do I declare a new XML namespace with prefix `abc`?
Back: By including `xmlns:abc=<namespace name>` 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).
<!--ID: 1733842094351-->
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).
<!--ID: 1733842094354-->
END%%
%%ANKI
Basic
Which namespace is `bar` a member of?
```xml
<foo xmlns="ns1">
<bar xmlns="ns2" />
</foo>
```
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).
<!--ID: 1733842094358-->
END%%
%%ANKI
Basic
Which namespace is `bar` a member of?
```xml
<foo xmlns="ns1">
<bar />
</foo>
```
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).
<!--ID: 1733842094361-->
END%%
%%ANKI
Basic
Which namespace is attribute `a` a member of?
```xml
<foo xmlns="ns1">
<bar a="1" b="2" />
</foo>
```
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).
<!--ID: 1733842094365-->
END%%
%%ANKI
Basic
Which namespace is attribute `b` a member of?
```xml
<foo xmlns:p="ns1">
<bar a="1" b="2" />
</foo>
```
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).
<!--ID: 1733842094370-->
END%%
%%ANKI
Basic
Which namespace is attribute `b` a member of?
```xml
<foo xmlns:p="ns1">
<bar a="1" p:b="2" />
</foo>
```
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).
<!--ID: 1733842094375-->
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).

View File

@ -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.
<!--ID: 1708265979304-->
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).
<!--ID: 1727433781278-->
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`
<!--ID: 1706670390919-->
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.”
<!--ID: 1706815743870-->
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.”
<!--ID: 1708812571668-->
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.”
<!--ID: 1709131892342-->
@ -245,12 +249,39 @@ Tags: c17
<!--ID: 1709131892349-->
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.”
<!--ID: 1733839282847-->
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).
<!--ID: 1727433781278-->
Which signal usually corresponds to alignment errors when accessing memory?
Back: `SIGBUS`
Reference: Dowling, “A List of Signals and What They Mean.”
<!--ID: 1733839282851-->
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.”
<!--ID: 1733839282854-->
END%%
%%ANKI
Basic
What is the `BUS` in `SIGBUS` short for?
Back: **Bus** error.
Reference: Dowling, “A List of Signals and What They Mean.”
<!--ID: 1733839282857-->
END%%
## Bibliography

View File

@ -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).
<!--ID: 1732295060358-->
@ -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).
<!--ID: 1732295060362-->
@ -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).
<!--ID: 1732295060366-->
@ -435,6 +435,321 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre
<!--ID: 1733407760113-->
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).
<!--ID: 1733675315442-->
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).
<!--ID: 1733675315447-->
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).
<!--ID: 1733675315450-->
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).
<!--ID: 1733675315453-->
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).
<!--ID: 1733675315456-->
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).
<!--ID: 1733675315459-->
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).
<!--ID: 1733675315461-->
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).
<!--ID: 1733675315464-->
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).
<!--ID: 1733675315466-->
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).
<!--ID: 1733675315469-->
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).
<!--ID: 1733675315471-->
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).
<!--ID: 1733675315474-->
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).
<!--ID: 1733675315477-->
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).
<!--ID: 1733675315479-->
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).
<!--ID: 1733675522739-->
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).
<!--ID: 1733693785274-->
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).
<!--ID: 1733693785281-->
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).
<!--ID: 1733693785284-->
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).
<!--ID: 1733693785287-->
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).
<!--ID: 1733675522748-->
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).
<!--ID: 1733693785290-->
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).
<!--ID: 1733693785292-->
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).
<!--ID: 1733675522751-->
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).
<!--ID: 1733693785295-->
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).
<!--ID: 1733710439132-->
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).
<!--ID: 1733710439139-->
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).
<!--ID: 1733710439142-->
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).
<!--ID: 1733710439146-->
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).
<!--ID: 1733710439150-->
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).
<!--ID: 1733710439153-->
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).
<!--ID: 1733710439156-->
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).
<!--ID: 1733710439159-->
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).
<!--ID: 1733710439162-->
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).
<!--ID: 1733710439165-->
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).
<!--ID: 1733710439168-->
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).
<!--ID: 1733710755119-->
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).
<!--ID: 1733710439171-->
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).
<!--ID: 1733710439174-->
END%%
## Bibliography
* Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).

View File

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

View File

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

View File

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

View File

@ -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.
<!--ID: 1728480337614-->