More tags. ASCII and c-style strings.
parent
1c1ffb989a
commit
3e012b49b5
|
@ -78,29 +78,29 @@
|
|||
"bubble-sort.gif"
|
||||
],
|
||||
"File Hashes": {
|
||||
"algorithms/index.md": "1583c07edea4736db27c38fe2b6c4c31",
|
||||
"algorithms/index.md": "a5ff7313f71777f1f3536e27dd9894fa",
|
||||
"algorithms/sorting/index.md": "2d5a18a3079d96fa9e3d4289181a8b6c",
|
||||
"algorithms/sorting/insertion-sort.md": "d40da14992d8331a07cebe1c4cfa41d4",
|
||||
"bash/index.md": "3b5296277f095acdf16655adcdf524af",
|
||||
"bash/index.md": "3dfeb538d781e4645e3aaaf32beb1034",
|
||||
"bash/prompts.md": "61cb877e68da040a15b85af76b1f68ba",
|
||||
"bash/quoting.md": "b1d8869a91001f8b22f0cdc54d806f61",
|
||||
"bash/robustness.md": "7ab094b95ba2bfa885adba8e9efedf68",
|
||||
"bash/shebang.md": "9006547710f9a079a3666169fbeda7aa",
|
||||
"c/escape-sequences.md": "0d6219ebb51f6f21e026de67603e25b8",
|
||||
"c/index.md": "aa8a34c62e7bc284ff589e28609222dc",
|
||||
"c/index.md": "a021c92f19831bdd2bca4cbf813882fe",
|
||||
"gawk/index.md": "0a305a0477085fd2f4145536735ca94a",
|
||||
"gawk/variables.md": "8c567c9e387f1bed8200cf28a7e28502",
|
||||
"gawk/variables.md": "7408f450957ab007fbdbd687121da0d3",
|
||||
"index.md": "e48e895feeed7046425bb2ee15419770",
|
||||
"journal/2024-01-31.md": "7c7fbfccabc316f9e676826bf8dfe970",
|
||||
"journal/2024-02-01.md": "3aa232387d2dc662384976fd116888eb",
|
||||
"journal/2024-02-02.md": "a3b222daee8a50bce4cbac699efc7180",
|
||||
"journal/2024-02-03.md": "c6d411f0e2e964270399dd3a99f48382",
|
||||
"logic/index.md": "3084b41fe1451259a0cf3e54560c2e85",
|
||||
"logic/index.md": "46cdc7a552900e99a7d2d0140971118c",
|
||||
"logic/propositional.md": "e7dbb24674336beb44dc9ef4c9ae51ff",
|
||||
"lua/index.md": "26632dae1f852519e2f1af11d65c34eb",
|
||||
"lua/index.md": "fd3d0b66765f0e9df233e8e02ce33e94",
|
||||
"nix/callPackage.md": "140a02e57cd01d646483e3c21d72243d",
|
||||
"nix/index.md": "dd5ddd19e95d9bdbe020c68974d77a33",
|
||||
"posix/index.md": "f7b1ae55f8f5e8f50f89738b1aca9111",
|
||||
"nix/index.md": "4efc7fcc4ea22834ba595497e5fb715c",
|
||||
"posix/index.md": "97b1b8ecb9a953e855a9acf0ab25b8c8",
|
||||
"posix/signals.md": "2120ddd933fc0d57abb93c33f639afd8",
|
||||
"templates/daily.md": "7866014e730e85683155207a02e367d8",
|
||||
"posix/regexp.md": "43825a1b9ed0dd7eeb1b6fe35c928bfe",
|
||||
|
@ -124,7 +124,7 @@
|
|||
"algorithms/sorting/selection-sort.md": "73a077a726afd376650d1bd9e2d0bed9",
|
||||
"algorithms/index 1.md": "6fada1f3d5d3af64687719eb465a5b97",
|
||||
"binary/hexadecimal.md": "813512cb38700a8cb8ecf8ee9d6c9343",
|
||||
"binary/index.md": "a67b5d0c8ac53e076590f315cce22201",
|
||||
"binary/index.md": "ecb99ff4935e17317bf51f3ba45c1e41",
|
||||
"_journal/2024-02-09.md": "a798d35f0b2bd1da130f7ac766166109",
|
||||
"c/types.md": "cf3e66e5aee58a94db3fdf0783908555",
|
||||
"logic/quantification.md": "37655276de8da531ca2b12706a639224",
|
||||
|
@ -145,8 +145,11 @@
|
|||
"_journal/2024-02-11.md": "afee9f502b61e17de231cf2f824fbb32",
|
||||
"binary/endianness.md": "29c0aea671aa25aead580e9431aba8cc",
|
||||
"logic/normal-form.md": "d6a79aa850e9830def15e9012a774057",
|
||||
"_journal/2024-02-12.md": "a04ed5a77c12319ab80ba29b13526b3b",
|
||||
"_journal/2024-02/2024-02-11.md": "afee9f502b61e17de231cf2f824fbb32"
|
||||
"_journal/2024-02-12.md": "44e0ca1f3c320b75289a54514d777e34",
|
||||
"_journal/2024-02/2024-02-11.md": "afee9f502b61e17de231cf2f824fbb32",
|
||||
"encoding/ascii.md": "c01e50f96d0493d94dc4d520c0b6bb71",
|
||||
"encoding/index.md": "071cfa6a5152efeda127b684f420d438",
|
||||
"c/strings.md": "38f9cf9e2325565589f62e191221a83a"
|
||||
},
|
||||
"fields_dict": {
|
||||
"Basic": [
|
||||
|
|
|
@ -10,4 +10,5 @@ title: "2024-02-12"
|
|||
- [ ] Interview Prep (1 Practice Problem)
|
||||
- [ ] Log Work Hours (Max 3 hours)
|
||||
|
||||
* Read 삼 년 고개 (Three-Years Hill).
|
||||
* Read 삼 년 고개 (Three-Years Hill).
|
||||
* Notes on ASCII and C-style strings.
|
|
@ -1,3 +1,5 @@
|
|||
---
|
||||
title: Algorithms
|
||||
tags:
|
||||
- algorithm
|
||||
---
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
---
|
||||
title: Bash
|
||||
tags:
|
||||
- bash
|
||||
---
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
---
|
||||
title: Binary
|
||||
tags:
|
||||
- binary
|
||||
---
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
---
|
||||
title: C
|
||||
tags:
|
||||
- c
|
||||
---
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
---
|
||||
title: Strings
|
||||
TARGET DECK: Obsidian::STEM
|
||||
FILE TAGS: c
|
||||
tags:
|
||||
- c
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
A contiguous sequence of characters terminated by the `NUL` character (refer to [[ascii|ASCII]]). Text data is said to be more platform-independent than [[endianness|binary]] data since it is unaffected by word size or byte ordering.
|
||||
|
||||
%%ANKI
|
||||
Basic
|
||||
What is a C-style string?
|
||||
Back: A character array terminated with a `NUL` character.
|
||||
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
|
||||
<!--ID: 1707758281264-->
|
||||
END%%
|
||||
|
||||
%%ANKI
|
||||
Basic
|
||||
What character terminates all C-style strings?
|
||||
Back: `NUL`
|
||||
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
|
||||
<!--ID: 1707758281266-->
|
||||
END%%
|
||||
|
||||
%%ANKI
|
||||
Basic
|
||||
What is the decimal value of `NUL` in ASCII encoding?
|
||||
Back: `0`
|
||||
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
|
||||
<!--ID: 1707758281268-->
|
||||
END%%
|
||||
|
||||
%%ANKI
|
||||
Basic
|
||||
Text is more platform-independent than binary because it is unaffected by what two properties?
|
||||
Back: Word size and byte ordering.
|
||||
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
|
||||
<!--ID: 1707758281270-->
|
||||
END%%
|
||||
|
||||
## References
|
||||
|
||||
* Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
|
|
@ -0,0 +1,92 @@
|
|||
---
|
||||
title: ASCII
|
||||
TARGET DECK: Obsidian::STEM
|
||||
FILE TAGS: encoding::ascii
|
||||
tags:
|
||||
- encoding
|
||||
- ascii
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
A character encoding containing 128 code points, 95 of which are printable. Use the Unix command `ascii` to print out the following table:
|
||||
|
||||
```text
|
||||
Dec Hex Dec Hex Dec Hex Dec Hex Dec Hex Dec Hex Dec Hex Dec Hex
|
||||
0 00 NUL 16 10 DLE 32 20 48 30 0 64 40 @ 80 50 P 96 60 ` 112 70 p
|
||||
1 01 SOH 17 11 DC1 33 21 ! 49 31 1 65 41 A 81 51 Q 97 61 a 113 71 q
|
||||
2 02 STX 18 12 DC2 34 22 " 50 32 2 66 42 B 82 52 R 98 62 b 114 72 r
|
||||
3 03 ETX 19 13 DC3 35 23 # 51 33 3 67 43 C 83 53 S 99 63 c 115 73 s
|
||||
4 04 EOT 20 14 DC4 36 24 $ 52 34 4 68 44 D 84 54 T 100 64 d 116 74 t
|
||||
5 05 ENQ 21 15 NAK 37 25 % 53 35 5 69 45 E 85 55 U 101 65 e 117 75 u
|
||||
6 06 ACK 22 16 SYN 38 26 & 54 36 6 70 46 F 86 56 V 102 66 f 118 76 v
|
||||
7 07 BEL 23 17 ETB 39 27 ' 55 37 7 71 47 G 87 57 W 103 67 g 119 77 w
|
||||
8 08 BS 24 18 CAN 40 28 ( 56 38 8 72 48 H 88 58 X 104 68 h 120 78 x
|
||||
9 09 HT 25 19 EM 41 29 ) 57 39 9 73 49 I 89 59 Y 105 69 i 121 79 y
|
||||
10 0A LF 26 1A SUB 42 2A * 58 3A : 74 4A J 90 5A Z 106 6A j 122 7A z
|
||||
11 0B VT 27 1B ESC 43 2B + 59 3B ; 75 4B K 91 5B [ 107 6B k 123 7B {
|
||||
12 0C FF 28 1C FS 44 2C , 60 3C < 76 4C L 92 5C \ 108 6C l 124 7C |
|
||||
13 0D CR 29 1D GS 45 2D - 61 3D = 77 4D M 93 5D ] 109 6D m 125 7D }
|
||||
14 0E SO 30 1E RS 46 2E . 62 3E > 78 4E N 94 5E ^ 110 6E n 126 7E ~
|
||||
15 0F SI 31 1F US 47 2F / 63 3F ? 79 4F O 95 5F _ 111 6F o 127 7F DEL
|
||||
```
|
||||
|
||||
%%ANKI
|
||||
Basic
|
||||
What is a character encoding?
|
||||
Back: The assignment of numbers to graphical characters.
|
||||
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
|
||||
<!--ID: 1707757786284-->
|
||||
END%%
|
||||
|
||||
%%ANKI
|
||||
Basic
|
||||
How many code points are defined in ASCII?
|
||||
Back: 128
|
||||
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
|
||||
<!--ID: 1707757786288-->
|
||||
END%%
|
||||
|
||||
%%ANKI
|
||||
Basic
|
||||
How many *printable* code points are defined in ASCII?
|
||||
Back: 95
|
||||
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
|
||||
<!--ID: 1707757786289-->
|
||||
END%%
|
||||
|
||||
%%ANKI
|
||||
Basic
|
||||
What program can be used to print an ASCII table to the console?
|
||||
Back: `ascii`
|
||||
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
|
||||
<!--ID: 1707757786291-->
|
||||
END%%
|
||||
|
||||
%%ANKI
|
||||
Basic
|
||||
How many bits make up an ASCII character?
|
||||
Back: `7`
|
||||
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
|
||||
<!--ID: 1707757786292-->
|
||||
END%%
|
||||
|
||||
%%ANKI
|
||||
Basic
|
||||
What is the largest ASCII decimal value?
|
||||
Back: `127`
|
||||
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
|
||||
<!--ID: 1707757786294-->
|
||||
END%%
|
||||
|
||||
%%ANKI
|
||||
Basic
|
||||
What is the largest ASCII hexadecimal value?
|
||||
Back: `0x7F`
|
||||
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
|
||||
<!--ID: 1707757786295-->
|
||||
END%%
|
||||
|
||||
## References
|
||||
|
||||
* Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Encoding
|
||||
tags:
|
||||
- encoding
|
||||
---
|
|
@ -213,6 +213,36 @@ Reference: Robbins, Arnold D. “GAWK: Effective AWK Programming,” October 202
|
|||
<!--ID: 1707618833558-->
|
||||
END%%
|
||||
|
||||
%%ANKI
|
||||
Cloze
|
||||
Setting `FS` to {`""`} allows examining {each character of a record separately}.
|
||||
Reference: Robbins, Arnold D. “GAWK: Effective AWK Programming,” October 2023. [https://www.gnu.org/software/gawk/manual/gawk.pdf](https://www.gnu.org/software/gawk/manual/gawk.pdf)
|
||||
<!--ID: 1707756447064-->
|
||||
END%%
|
||||
|
||||
%%ANKI
|
||||
Cloze
|
||||
Setting `FS` to {`"\n"`} treats the {record as the single field}.
|
||||
Reference: Robbins, Arnold D. “GAWK: Effective AWK Programming,” October 2023. [https://www.gnu.org/software/gawk/manual/gawk.pdf](https://www.gnu.org/software/gawk/manual/gawk.pdf)
|
||||
<!--ID: 1707756447067-->
|
||||
END%%
|
||||
|
||||
%%ANKI
|
||||
Basic
|
||||
What value of `FS` ensures `$1 = $0`?
|
||||
Back: `"\n"`
|
||||
Reference: Robbins, Arnold D. “GAWK: Effective AWK Programming,” October 2023. [https://www.gnu.org/software/gawk/manual/gawk.pdf](https://www.gnu.org/software/gawk/manual/gawk.pdf)
|
||||
<!--ID: 1707756447069-->
|
||||
END%%
|
||||
|
||||
%%ANKI
|
||||
Basic
|
||||
*Why* does `awk` support a CSV mode?
|
||||
Back: Because CSV fields may contain commas and newlines.
|
||||
Reference: Robbins, Arnold D. “GAWK: Effective AWK Programming,” October 2023. [https://www.gnu.org/software/gawk/manual/gawk.pdf](https://www.gnu.org/software/gawk/manual/gawk.pdf)
|
||||
<!--ID: 1707756447071-->
|
||||
END%%
|
||||
|
||||
## References
|
||||
|
||||
* Robbins, Arnold D. “GAWK: Effective AWK Programming,” October 2023. [https://www.gnu.org/software/gawk/manual/gawk.pdf](https://www.gnu.org/software/gawk/manual/gawk.pdf)
|
|
@ -1,3 +1,5 @@
|
|||
---
|
||||
title: Logic
|
||||
tags:
|
||||
- logic
|
||||
---
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
---
|
||||
title: Lua
|
||||
tags:
|
||||
- lua
|
||||
---
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
---
|
||||
title: Nix
|
||||
tags:
|
||||
- nix
|
||||
---
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
---
|
||||
title: POSIX
|
||||
tags:
|
||||
- posix
|
||||
---
|
||||
|
|
Loading…
Reference in New Issue