From 8db8b687bf3dc69a39f977d22f5511fbd3f1f15a Mon Sep 17 00:00:00 2001 From: Miloslav Ciz Date: Thu, 7 Sep 2023 08:37:35 +0200 Subject: [PATCH] Update --- c_tutorial.md | 24 ++++++++++++------------ encyclopedia.md | 3 ++- race.md | 2 +- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/c_tutorial.md b/c_tutorial.md index 71c233c..1372c66 100644 --- a/c_tutorial.md +++ b/c_tutorial.md @@ -1230,9 +1230,9 @@ But what can pointers be good for? Many things, for example we can kind of "stor ``` #include -int backAccountMonica = 1000; -int backAccountBob = -550; -int backAccountJose = 700; +int bankAccountMonica = 1000; +int bankAccountBob = -550; +int bankAccountJose = 700; int *payingAccount; // pointer to who's currently paying @@ -1255,7 +1255,7 @@ int main(void) { // let Jose pay first - payingAccount = &backAccountJose; + payingAccount = &bankAccountJose; payBills(); buyFood(); @@ -1263,7 +1263,7 @@ int main(void) // that's enough, now let Monica pay - payingAccount = &backAccountMonica; + payingAccount = &bankAccountMonica; buyFood(); buyGas(); @@ -1272,16 +1272,16 @@ int main(void) // now it's Bob's turn - payingAccount = &backAccountBob; + payingAccount = &bankAccountBob; payBills(); buyFood(); buyFood(); buyGas(); - printf("Monika has $%d left.\n",backAccountMonica); - printf("Jose has $%d left.\n",backAccountJose); - printf("backAccountBob has $%d left.\n",backAccountBob); + printf("Monika has $%d left.\n",bankAccountMonica); + printf("Jose has $%d left.\n",bankAccountJose); + printf("Bob has $%d left.\n",bankAccountBob); return 0; } @@ -1317,7 +1317,7 @@ int main(void) } ``` -Function `getUnitCirclePoint` doesn't return any value in the strict sense, but thank to pointers it effectively returns two `float` values via its parameters `x` and `y`. These parameters are of the data type pointer to `int` (as there's `*` in front of them). When we call the function with `getUnitCirclePoint(i * 0.125 * 2 * PI,&pointX,&pointY);`, we hand over the addresses of the variables `pointX` and `pointY` (which belong to the `main` function and couldn't normally be accessed in `getUnitCirclePoint`). The function can then compute values and write them to these addresses (with dereference, `*x` and `*y`), changing the values in `pointX` and `pointY`, effectively returning two values. +Function `getUnitCirclePoint` doesn't return any value in the strict sense, but thank to pointers it effectively returns two `float` values via its parameters `x` and `y`. These parameters are of the data type pointer to `float` (as there's `*` in front of them). When we call the function with `getUnitCirclePoint(i * 0.125 * 2 * PI,&pointX,&pointY);`, we hand over the addresses of the variables `pointX` and `pointY` (which belong to the `main` function and couldn't normally be accessed in `getUnitCirclePoint`). The function can then compute values and write them to these addresses (with dereference, `*x` and `*y`), changing the values in `pointX` and `pointY`, effectively returning two values. Now let's take a look at pointers to structs. Everything basically works the same here, but there's one thing to know about, a [syntactic sugar](sugar.md) known as an arrow (`->`). Example: @@ -1477,7 +1477,7 @@ int main(void) } ``` -Notice that in `fopen` we now specify `"w"` (write) as a mode. Again, we check if the file has been opened successfully (`if (textFile != NULL)`). If so, we use a `while` loop to read and print all characters from the file until we encounter the end of file. The reading of file characters is done with the `fscanf` function inside the loop's condition -- there's nothing preventing us from doing this. `fscanf` again works the same as `scanf` (so it can read other types than only `char`s), just on files (its first argument is the file to read from). On encountering end of file `fscanf` returns a special value `EOF` (which is macro constant defined in the standard library). Again, we must close the file at the end with `fclose`. +Notice that in `fopen` we now specify `"r"` (read) as a mode. Again, we check if the file has been opened successfully (`if (textFile != NULL)`). If so, we use a `while` loop to read and print all characters from the file until we encounter the end of file. The reading of file characters is done with the `fscanf` function inside the loop's condition -- there's nothing preventing us from doing this. `fscanf` again works the same as `scanf` (so it can read other types than only `char`s), just on files (its first argument is the file to read from). On encountering end of file `fscanf` returns a special value `EOF` (which is macro constant defined in the standard library). Again, we must close the file at the end with `fclose`. We will now write to a binary file: @@ -1633,7 +1633,7 @@ int main(void) puts("The string you entered backwards:"); - while (charsRead > 0) + while (charsRead > 1) { putchar(inputChars[charsRead - 1]); charsRead--; diff --git a/encyclopedia.md b/encyclopedia.md index 6449b33..1116a9b 100644 --- a/encyclopedia.md +++ b/encyclopedia.md @@ -6,7 +6,7 @@ Encyclopedia (also encyclopaedia, cyclopedia or cyclopaedia, from Greek *enkykli { A favorite passtime of mine is looking up the same term in different encyclopedias and comparing them -- this can help get to the essence of actually understanding the term, as well as revealing censorship and different views of the authors. ~drummyfish } -**Similar terms:** encyclopedias, which also used to be called **cyclopedias** in the past, are similar to **dictionaries** and these works often overlap (many encyclopedias call themselves dictionaries); the main difference is that a dictionary focuses on providing linguistic information about the terms and has shorter term definitions, while encyclopedias have longer articles (which however limits the total number of terms it may contain). Encyclopedias are also a subset of so called **reference works**, i.e. works that serve to provide [information](information.md) and reference to it (other kinds of reference works being e.g. world maps or [API](api.md) references). A **universal/general** encyclopedia is one that focuses on human knowledge at wide, as opposed to an encyclopedia that focuses on one specific field of knowledge. **Compendium** can be seen almost as a synonym to encyclopedia, with encyclopedias perhaps usually being more general and extensive. **Micropedia** is another term, sometimes used to denote a smaller encyclopedia (one edition of Britannica came with a micropedia as well as a larger macropedia). +**Similar terms:** encyclopedias, which also used to be called **cyclopedias** in the past, are similar to **dictionaries** and these works often overlap (many encyclopedias call themselves dictionaries); the main difference is that a dictionary focuses on providing linguistic information about the terms and has shorter term definitions, while encyclopedias have longer articles (which however limits the total number of terms it may contain). Encyclopedias are also a subset of so called **reference works**, i.e. works that serve to provide [information](information.md) and reference to it (other kinds of reference works being e.g. world maps or [API](api.md) references). A **universal/general** encyclopedia is one that focuses on human knowledge at wide, as opposed to an encyclopedia that focuses on one specific field of knowledge. **Compendium** can be seen almost as a synonym to encyclopedia, with encyclopedias perhaps usually being more general and extensive. **Almanac** is also similar to encyclopedia, more focusing on tabular data. **Micropedia** is another term, sometimes used to denote a smaller encyclopedia (one edition of Britannica came with a micropedia as well as a larger macropedia). ## Notable/Nice Encyclopedias @@ -43,6 +43,7 @@ Here is a list of notable encyclopedias, focused on general knowledge English la | [Wikipedia](wikipedia.md) |2001...| CC BY-SA | online | 6M | largest and most famous, EXTREME PSEUDOLEFTIST CENSORSHIP AND POLITICAL PROPAGANDA, free culture | | Old Wikipedia | 2001 | GFDL | online | 19K | archived old Wikipedia, less censorship, https://nostalgia.wikipedia.org | | Pears' Cyclopedia | 1897 | PD (old) | 1 vol. 740p | | contains dictionary, general knowl. maps, reference etc., scanned on archive.org | +| World Almanac and Book of Facts|1868...| some PD (old) | 1 vol. | | interesting and useful information, data and facts from old to new age, US-centered | | The World Book |1917...| proprietary | 22 vol. | 17K | best selling print enc., large, probably high quality | | The World Book 1917 |1917 | PD (old) | 8 vol. | 3K | nicely readable | | Uncyclopedia |2005...| proprietary (NC) | online | 37K | parody, [fun](fun.md) enc. | diff --git a/race.md b/race.md index a8b690d..888722b 100644 --- a/race.md +++ b/race.md @@ -16,7 +16,7 @@ Another pseudoleftist argument is that "the DNA of any two individuals is 99.6 % Denying the facts regarding human race is called **[race denialism](race_denialism.md)**, the acceptance of these facts is called [race realism](race_realism.md). Race denialism is part of the basis of today's [pseudoleftist](pseudoleft.md) political ideology, theories such as polygenism (multiregional hypothesis) are forbidden to be supported and they're ridiculed and demonized by mainstream information sources like [Wikipedia](wikipedia.md) who only promote the [politically correct](political_correctness.md) "out of Africa" theory. [SJWs](sjw.md) reject any idea of a race with the same religious fanaticism with which Christian fanatics opposed Darwin's evolution theory. -**What races are there?** That depends on definitions, the boundaries between races are [fuzzy](fuzzy.md) and the lines can be drawn differently. Most generally races are called by the color of their skin, the most apparent attribute, i.e. White (Caucasian), Black (African, so called [negro](negro.md) and [negroid](negroid.md)), Yellow (Asian) and Brown (Indian). Some go as far as calling different nations separate races (e.g. the Norwegian race, Russian race etc.). One of the first scientific divisions of people into races was done by Francois Bernier in *New Division of the Earth by the Different Species or "Races" of Man that Inhabit It* into Europeans, Asians, Africans and Sami (north Europe), based on skin color, hair color, height and shape of face, nose and eyes. The Nuttall [Encyclopedia](encyclopedia.md) lists five main races: Caucasian (Indo-European), Mongolian (Yellow), Negro (Black), Malayan (Tawny), India (Copper-colored). A common, very general division is also that into three big groups: white, black and yellow. +**What races are there?** That depends on definitions, the boundaries between races are [fuzzy](fuzzy.md) and the lines can be drawn differently. The traditional, most general division still found in the greatest 1990s encyclopedias is to three large groups: **Caucasoid** (white), **Negroid** (black) and **Mongoloid** (yellow). These can be further subdivided. Some go as far as calling different nations separate races (e.g. the Norwegian race, Russian race etc.), thought that may be a bit of a stretch. One of the first scientific divisions of people into races was done by Francois Bernier in *New Division of the Earth by the Different Species or "Races" of Man that Inhabit It* into Europeans, Asians, Africans and Sami (north Europe), based on skin color, hair color, height and shape of face, nose and eyes. There is a controversial 1994 book called *The Bell Curve* that deals with differences in intelligence between races. [SJWs](sjw.md) indeed tried to attack it, however international experts on intelligence agree the book is correct in saying average intelligence between races differs (see e.g. [The Wall Street Journal's Mainstream Science on Intelligence](https://web.archive.org/web/20120716184838/http://www.lrainc.com/swtaboo/taboos/wsj_main.html)). An online resource with a lot of information on racial differences is e.g. http://www.humanbiologicaldiversity.com/. See also e.g. https://en.metapedia.org/wiki/Race_and_morphology. Note that even though the mentioned sites may be fascist, biased and contain propaganda of their own, they provide links to resources which the pseudoleftist mainstream such as [Wikipedia](wikipedia.md) and [Google](google.md) simply censor -- while we may not promote the politics and opinions of mentioned sites, we link to them to provide access to censored information so that one can seek truth and form his own opinions.