This commit is contained in:
Miloslav Ciz 2024-05-15 18:01:55 +02:00
parent bf2ed8760e
commit 9ac84f6fd2
10 changed files with 1783 additions and 1772 deletions

View file

@ -177,8 +177,10 @@ Bear in mind the main purpose of this quiz is for you to test your understanding
74. If your computer resides in a private network that's connected to the Internet through a router that performs network address translation ([NAT](nat.md), common with many ISPs), why you typically cannot host a server that would be publicly accessible from the outside [Internet](internet.md)? I.e. explain how NAT works and say what's preventing outside computers from reaching your server behind it. How can you make your server work even behind NAT?
75. We know that in C (C99) we can kind of use arrays and pointers "interchangeably", we are taught they are really the same. However show at least one example of when the difference matters, i.e. considering e.g. `int *a;` vs `int a[N];` write some expressions with `a` in it where the distinction will be significant.
76. Write sed substitution command (the one that starts with `s/`) that will convert Markdown links (format: `[link text](destination)`) to HTML links (format: `<a href="destination">link text</a>`). You probably need [regular expression](regex.md) capture groups for this.
77. Give at least three examples of palindromic English words (read the same forward and backwards), each at least four letters long.
78. Did you enjoy this quiz?
77. Give at least three examples of palindromic English words (read the same forward and backwards), each at least four letters long.
78. Six extremely obese [women](woman.md) -- three normal and three lesbian -- want to get to a party that's in the sixth floor of a building. As they are morbidly obese using stairs is not an option, they have to use the lift. The lift is on the ground floor but its outside button is broken, it can only ride if there is at least one human inside it who controls it (and it also doesn't go to any other floor than the two), but it also cannot carry more than two women at once (remember, they are obese). Lesbian must never outnumber the normal women otherwise they wouldn't be able to control themselves and would rape them. The women are too dumb to solve the problem of how to get to the sixth floor without any rape happening, they call you to help them -- find a solution to this.
79. Does 0.999... (infinitely many 9s) equal 1?
80. Did you enjoy this quiz?
### Answers
@ -258,8 +260,10 @@ Bear in mind the main purpose of this quiz is for you to test your understanding
74. Behind NAT you're in a private network, computers inside it have no public addresses (their IP addresses are in the private range and potentially same as addresses of computers in other private networks), only the router has a public IP address that's unique within the Internet, i.e. from Internet's point of view there is only one device connected -- your router. Computers behind this router are invisible, so no one can connect to the server that's behind it. The possibility of you having a two way communication from within this private network with the outside Internet is enabled by the router who communicates for you when you ask for it, i.e. when you (from inside the private network) initiate the connection -- the router then creates the connection for you and talks to the outside world for you (translating your private address to its public address, hence *network address translation*). But no one can initiate communication from the outside, the router wouldn't know to whom he wants to speak. This can be solved e.g. by port forwarding (setting some default computer to which communication from outside will be redirected) or tunneling (keeping a constant connection with some outside proxy server that's listening to requests and resending them).
75. For example `sizeof(a)`: if `a` is a pointer, size of pointer will be returned whereas in case of array the size of the whole array will be returned. Similarly e.g. `&a`: if `a` is a pointer, we'll get a pointer to pointer (generally a different address) whereas in case of array `a` and `&a` gives the same address -- that of the array's first element (though the type will be different).
76. Something like `s/\[\([^]]*\)\](\([^)]*\))/<a href="\2">\1<\/a>/g`.
77. For example: poop, boob, civic, deed, level, rotor, madam, refer, stats etc.
78. yes
77. For example: poop, boob, civic, deed, level, rotor, madam, refer, stats etc.
78. For example (`L` = lesbian, `N` = normal): `LLLNNN *|` -> `NNNL |* LL` -> `NNNLL *| L` -> `NNN |* LLL` -> `NNNL *| LL` -> `NL |* NNLL` -> `NNLL *| NL` -> `LL |* NNNL` -> `LLL *| NNN` -> `L |* NNNLL` -> `LL *| NNNL` -> `|* NNNLLL`.
79. yes (look it up)
80. yes
## Other