This commit is contained in:
Miloslav Ciz 2024-03-27 23:15:52 +01:00
parent 099fca51b7
commit 860b62cc6a
10 changed files with 2197 additions and 1746 deletions

View file

@ -1,10 +1,14 @@
# C Tutorial
{ Still a work in progress, but 99% complete. ~drummyfish }
{ Constant work in progress, mostly done but may still have some bugs. ~drummyfish }
This is a relatively quick [C](c.md) tutorial.
You should probably know at least the completely basic ideas of programming before reading this (what's a [programming language](programming_language.md), [source code](source_code.md), [command line](cli.md) etc.). If you're as far as already knowing another language, this should be pretty easy to understand.
You should probably how at least some basic awareness of essential programming concepts before reading this (what's a [programming language](programming_language.md), [source code](source_code.md), [command line](cli.md) etc.). If you're as far as already somewhat knowing another language, this should be pretty easy to understand.
This tutorial focuses on teaching pure C, i.e. **mostly just command line text-only programs**. There is a small bonus that shows some very basics of doing graphics programming at the end, but bear in mind it's inevitable to learn step by step, as much as you want to start programming graphical games, you first HAVE TO learn the language itself well. Don't rush it. Trust this advice, it is sincere.
If you do two chapters a day (should take like half and hour), in a week you'll know some basic C.
## About C And Programming
@ -507,7 +511,7 @@ Another local variable is `number` -- it is a local variable both in `main` and
And a last thing: keep in mind that not every command you write in C program is a function call. E.g. control structures (`if`, `while`, ...) and special commands (`return`, `break`, ...) are not function calls.
## More Details (Globals, Switch, Float, Forward Decls, ...)
## More Details (Globals, Switch, Float, Forward Decls, Program Arguments, ...)
We've skipped a lot of details and small tricks for simplicity. Let's go over some of them. Many of the following things are so called [syntactic sugar](sugar.md): convenient syntax shorthands for common operations.
@ -703,6 +707,41 @@ which prints
The functions `printDecorated1` and `printDecorated2` call each other, so this is the case when we have to use a forward declaration of `printDecorated2`. Also note the condition `if (fancy)` which is the same thing as `if (fancy != 0)` (imagine `fancy` being 1 and 0 and about what the condition evaluates to in each case).
And one more important thing: our program as a whole can be passed parameters when it's executed, which inside the program we can access as so called **command line arguments** (also known as *flags*, *switches* etc.). This is important especially under [Unix](unix.md) operating systems where we run programs from command line and where programs often work in non-interactive ways and are composed into bigger programs (similarly to how we compose small C functions into one big program); command line arguments are similar to arguments we pass to functions, they can inform our program to behave in certain way, for example to open a certain config file at start, to run in fullscreen mode, to print help and so on. When we compile our programs with the gcc compiler, e.g. like `gcc -o myprogram myprogram.c`, all the text after `gcc` are in fact arguments telling gcc which program to compile, how to compile it, how to name the output and so on. To allow our program to receive these arguments we add two parameters to the `main` function, one called `argc` (argument count) of integer type, saying how many arguments we get, and another called `argv` (argument [vector](vector.md)) of pointer to a pointer to char type (please don't get scared), holding an array of strings (each argument will be of string type). Operating system will automatically fill these arguments in when our program is started. Here is a short example demonstrating this:
```
#include <stdio.h>
int main(int argc, char **argv)
{
puts("You passed these arguments:");
for (int i = 0; i < argc; ++i)
printf("- \"%s\"\n",argv[i]);
return 0;
}
```
If you compile this program and run it e.g. like
```
./program hello these are "my arguments"
```
The program will output:
```
You passed these arguments:
- "./program"
- "hello"
- "these"
- "are"
- "my arguments"
```
Things to notice here are following: we passed 4 arguments but got 5 -- the first argument is the path of our program itself, i.e. we will always get at least this argument. Then we also see that our arguments are separated by spaces, but if we put them into double quotes (like the last one), it will become just one argument, keeping the spaces (but not the quotes). For now this knowledge will suffice, you will most definitely encounter command line arguments in real programs -- now you know what they are.
## Header Files, Libraries, Compilation/Building
So far we've only been writing programs into a single source code file (such as `program.c`). More complicated programs consist of multiple files and libraries -- we'll take a look at this now.
@ -1679,7 +1718,414 @@ The very basic thing we can do is to turn on automatic optimization with a compi
## Final Program
TODO
Now is the time to write a final program that showcases what we've learned, so let's write a quite simple but possibly useful [hex viewer](hex_editor.md). The program will allow us to interactively inspect bytes in any file, drawing their hexadecimal values along with their addresses, supporting one character commands to move within the file. If you want, you can take it and improve it as an exercise, for example by adding more viewing modes (showing decimal octal or ASCII values), maybe even allowing editing and saving the file. Here is the source code:
```
/* Simple interactive hex file viewer. */
#include <stdio.h>
#include <stdlib.h>
#define ROWS 10 // how many rows and columns to print at one screen
#define COLS 16
unsigned char *fileContent = NULL; // this will contain the loaded file
unsigned long long fileSize = 0; // size of fileContent in bytes
unsigned long long fileOffset = 0; // current offset within the file
const char *fileName = NULL;
// Loads file with given name into fileContent, returns 1 on success, 0 on fail.
int loadFile(const char *fileToOpen)
{
FILE *file = fopen(fileToOpen,"rb");
if (file == NULL)
return 0;
fseek(file,0L,SEEK_END); // get to the end of the file
fileSize = ftell(file); // our position now says the size of the file
rewind(file); // get back to start of the file
fileContent = malloc(fileSize); // allocate memory to load the file into
if (fileContent == NULL)
{
fclose(file); // don't forget to close the file
return 0;
}
if (fread(fileContent,1,fileSize,file) != fileSize)
{
fclose(file);
free(fileContent);
return 0;
}
fclose(file);
return 1;
}
// Call when loaded file is no longer needed.
void unloadFile(void)
{
free(fileContent); // free the allocated memory
}
// Draws the current screen, i.e. hex view of the file at current offset.
void drawScreen(void)
{
for (int i = 0; i < 80; ++i) // scroll the old screen our of the view
putchar('\n');
printf("%s: %llu / %llu\n\n",fileName,fileOffset,fileSize);
unsigned long long offset = fileOffset;
for (int i = 0; i < ROWS * COLS; ++i)
{
if (offset % COLS == 0)
printf("%04X ",(int) offset);
if (offset < fileSize)
printf("%02X ",fileContent[offset]);
else
printf(".. ");
offset++;
if (offset % COLS == 0) // break line after each COLS values
putchar('\n');
}
}
int main(int argc, char **argv)
{
if (argc < 2)
{
puts("ERROR: please pass a file to open");
return 1;
}
fileName = argv[1]; // (argv[0] is the name of our program, we want argv[1])
if (!loadFile(fileName))
{
printf("ERROR: couldn't open the file \"%s\"\n",fileName);
return 1;
}
int goOn = 1;
while (goOn) // the main interactive loop
{
drawScreen();
puts("\ntype command (w = end, s = start, a = back, d = next, q = quit)");
char userInput = getchar();
switch (userInput)
{
case 'q':
goOn = 0;
break;
case 's':
if (fileOffset + COLS < fileSize)
fileOffset += COLS;
break;
case 'w':
if (fileOffset >= COLS)
fileOffset -= COLS;
break;
case 'a':
fileOffset = 0;
break;
case 'd':
fileOffset = ((fileSize - COLS) / COLS) * COLS; // aligns the offset
break;
default:
puts("unknown command, sorry");
break;
}
}
unloadFile();
return 0;
}
```
To add a few comments: the program opens a file whose name it gets passed as a command line argument, so it is used as: `./hexview myfile`. We try to correctly perform all safety checks, e.g. if we actually get passed the file name, if we manage to open it and so on. Our program (a bit inefficiently) loads the whole file into memory (advanced programs only load parts of the file) -- for this it first checks the file size, allocates sufficient memory for it with `malloc` (also checking for errors) and loads it there. Then we have a function to draw the current file view and inside the main program body we have an interactive loop that loads and handles user commands and issues the view drawing. That is basically it!
## Bonus: Introduction To Graphics (ASCII, PPM, SDL2, ...)
Let's stress you should only get into graphics after you've written several purely command-line programs and are comfortable with the language. Don't try graphics programming until you can easily work with 2D arrays, structs and so on. [Graphics](graphics.md) is a huge topic of its own, there is so much we can't cover here, remember this is just a quick, basic starting point for making pictures with C.
For start please note that:
- **C itself doesn't know anything about graphics**. C is just trying to be a good programming language, it leaves the vast area of graphics for others to solve, therefore though you can try to avoid it (see below), typically you will use a third party [library](library.md) to draw some real pixels to the screen, there isn't a universal way of doing it, you have to choose specific solution based on what you want to achieve, what's available etc.
- **By graphics we really just mean drawing [pixels](pixel.md)**. Things like keyboard and mouse [input](io.md) (which you need for anything [interactive](interactivity.md) like [games](game.md)), loading [PNG](png.md) pictures, playing sounds, loading and displaying 3D models, detecting [collisions](collision.md) of virtual objects and so on won't necessarily be covered here, it's all too much to learn at once. We will ONLY be trying to show basic shapes on the screen.
- We'll be doing things in simplified ways here, omitting common [optimizations](optimization.md), safety checks and so on. Just know that in practice things will be yet a bit more complex.
So, how to actually do graphics? As said, graphics is a super wide topic, there is no [silver bullet](silver_bullet.md), all depends on what we really need. Consider the following:
- **Need to quickly draw something quite basic (e.g. a graph)? [Keep it simple](kiss.md) and just use [ASCII art](ascii_art.md).** You can draw simple pictures to the console with ASCII art, i.e. you emulate real screen pixels with text characters. This is a nice, natural transition from text to graphics when studying programming, so you may start with this. The disadvantage is you can only draw very simple, rough and low resolution pictures, usually without colors, but you can animate them and make your program a little bit interactive. By doing things yourself you'll also get an idea what graphics is about and will better understand why libraries you'll use later work the way they do. A big advantage is that ASCII art graphics can be done without any library (there are libraries like [ncurses](ncurses.md), but you probably won't need them) and will keep your program quite simple, nice and [portable](portability.md). You can use this for simple visualization, animations, games and so on.
- **Need to just produce one or two static pictures (e.g. function plot)? Output a picture file**. You can make a C program that will simply save a picture to a file which you can open in any image viewer. For this you can use quite simple libraries but it is also possible to load and save simple formats without any libraries at all! You can very easily export bitmap images (e.g. [PPM](ppm.md), [farbfeld](farbfeld.md), ...) as well as beautiful [vector](vector.md) images (e.g. by exporting [SVG](svg.md)) with curves, [antialiasing](antialiasing.md), fancy fonts and so on, you can auto-convert them with other tools to other formats and so on. This will suffice for many things like data visualizations, function plots, photo processing, even 3D rendering, while keeping your program highly [portable](portability.md), i.e. it will be usable everywhere, even on computers without any GUI or screen, it will be much less [bloated](bloat.md).
- **Need a fast, real time interactive program (e.g. a game)? Use a [library](library.md) for that**. If you want the "real deal", i.e. interactive, fully colorful high-res graphics, e.g. for a serious game, you'll typically have to use a library -- in C this library is traditionally [SDL2](sdl.md) (but there are many alternatives, e.g. [SFML](sfml.md), [Allegro](allegro.md), [SAF](saf.md), ...). This is a bit more complex, so only go this way if you really must -- you have to install the library, learn to use it and your program will become more bloated, less portable, bigger in size, harder to compile and so on.
We will show an example of each of these approaches further on.
But first let's quickly mention what graphics programming at this level is essentially about, i.e. the kind of "workflow" we'll always try to implement:
- The most essential thing is basically to be able to **draw a [pixel](pixel.md)**, i.e. set a [color](color.md) of one point in the picture. Once you can draw a single pixel, you can draw anything, just like to build any kind of house you have to be able to lay bricks -- every shape is just some formation of pixels that you can construct with C code: a [line](line.md) is just a series of pixels one next to another, [cricle](circle.md) is a curved line, rectangle is just area filled with pixels of some color and so on. So at the beginning we'll just have some way of drawing a single pixel. Typically this can be e.g. a function `drawPixel(x,y,color)` -- graphic libraries will normally offer you a function like this, letting you draw pixels without actually caring about what magic is going on inside the function. (Sometimes you will also encounter a lower level way in which the library maps a screen to memory and you will draw pixels by literally writing values to memory, i.e. with pointers or arrays.)
- With the basic pixel drawing function we'll draw our picture however we want -- if we're using a library, there may be helper functions and of course we can write our own functions too, for example `drawLine(fromX,fromY,toX,toY,color)`, `drawText(x,y,text,size,color)` and so on. The picture itself is just a virtual canvas, a computer memory holding numbers, typically a two dimensional [array](array.md) whose values are manipulated by the `drawPixel` function. At this point we are doing nothing else than changing values in memory.
- At the end, once drawing is complete, we have to **show (*present*) the picture**. This is to say that when we're drawing, the picture isn't actually seen, it is only changing in memory, it is shown to the user only when it's completed, i.e. when we issue a special command such as `drawingDone()`. Why can't the picture just be shown at all times? In theory it can, but you encounter problems, imagine e.g. a game that quickly redraws the picture on the screen -- here the user would see flickering, he might even see enemies show briefly behind a wall before the wall is actually drawn and so on. So a way to solve this is to do the drawing off screen and only at the end say "now we're done drawing, show the image" (for more details see [double buffering](double_buffering.md)).
- Also note that usually there is some kind of management around graphic code, i.e. some initialization of the program's window, setting its resolution, allocation of memory for the screen pixels, setting the pixel formats, [callbacks](callback.md) and so on. Similarly at the end you often have to clean things up and as many graphic systems are based on events, you have to periodically check events like key presses, window resizes etc. Interactive programs will furthermore have an infinite loop (so called *game loop*) in which they check events, redraw the screen, wait for a while (to keep the right [FPS](fps.md)) and so on. Libraries try to do many thing for you but you have to at least tell them some very basic things. So be prepared for a lot extra code.
Now let's finally do this. We'll set up some basic code for drawing a rectangle and try to draw it with different approaches.
The ASCII approach:
```
#include <stdio.h>
#define SCREEN_WIDTH 60
#define SCREEN_HEIGHT 25
char screen[SCREEN_WIDTH * SCREEN_HEIGHT]; // our virtual screen
// sets a single pixel at given coordinates
void drawPixel(int x, int y, char pixel)
{
int index = y * SCREEN_WIDTH + x;
if (index >= 0 && index < SCREEN_WIDTH * SCREEN_HEIGHT)
screen[index] = pixel;
}
// presents the drawn picture on the screen
void drawScreen(void)
{
for (int i = 0; i < 30; ++i) // shift old picture out of view
putchar('\n');
const char *p = screen;
for (int y = 0; y < SCREEN_HEIGHT; ++y)
{
for (int x = 0; x < SCREEN_WIDTH; ++x)
{
putchar(*p);
p++;
}
putchar('\n');
}
}
// fills rectangle with given pixel value
void drawRectangle(int x, int y, int width, int height, char pixel)
{
for (int j = 0; j < height; ++j)
for (int i = 0; i < width; ++i)
drawPixel(x + i,y + j,pixel);
}
int main(void)
{
int quit = 0;
int playerX = SCREEN_WIDTH / 2, playerY = SCREEN_HEIGHT / 2;
while (!quit) // main game loop
{
drawRectangle(0,0,SCREEN_WIDTH,SCREEN_HEIGHT,'.'); // clear screen with dots
drawRectangle(playerX - 2,playerY - 1,5,3,'X'); // draw player
drawScreen(); // present the picture
puts("enter command (w/s/a/d/q):");
char input = getchar();
switch (input)
{
case 'w': playerY--; break;
case 's': playerY++; break;
case 'a': playerX--; break;
case 'd': playerX++; break;
case 'q': quit = 1; break;
}
}
return 0;
}
```
With this we have a simple interactive program that draws a dotted screen with rectangle that represents the player, you can compile it like any other program, it uses no external libraries. User can move the rectangle around by typing commands. There is a main infinite loop (this is the above mentioned *game loop*, a typical thing in interactive applications) in which we read the user commands and redraw the picture on the screen. Notice we have our basic `drawPixel` function as well as the `drawScreen` function for presenting the finished picture, we also have a helper `drawRectangle` function. The `screen` array represents our virtual picture (it is declared as one dimensional array but in reality it is treated as two dimensional by the `setPixel` function). As an exercise you can try to draw other simple shapes, for example horizontal and vertical lines, non-filled rectangles -- if you're brave enough you can also try a filled circle (hint: points inside a circle mustn't be further away from the center than the circle radius).
Now let's try to do something similar, but this time creating a "real picture" made of true pixels, exported to a file:
```
#include <stdio.h>
#define SCREEN_WIDTH 640 // picture resolution
#define SCREEN_HEIGHT 480
unsigned char screen[SCREEN_WIDTH * SCREEN_HEIGHT * 3]; // screen, 3 is for RGB
// sets a single pixel at given coordinates
void drawPixel(int x, int y, int red, int green, int blue)
{
int index = y * SCREEN_WIDTH + x;
if (index >= 0 && index < SCREEN_WIDTH * SCREEN_HEIGHT)
{
index *= 3;
screen[index] = red;
screen[index + 1] = green;
screen[index + 2] = blue;
}
}
// outputs the image in PPM format
void outputPPM(void)
{
printf("P6 %d %d 255\n",SCREEN_WIDTH,SCREEN_HEIGHT); // PPM file header
for (int i = 0; i < SCREEN_WIDTH * SCREEN_HEIGHT * 3; ++i)
putchar(screen[i]);
}
// fills rectangle with given pixel
void drawRectangle(int x, int y, int width, int height, int red, int green,
int blue)
{
for (int j = 0; j < height; ++j)
for (int i = 0; i < width; ++i)
drawPixel(x + i,y + j,red,green,blue);
}
int main(void)
{
drawRectangle(0,0,SCREEN_WIDTH,SCREEN_HEIGHT,128,128,128); // clear with grey
drawRectangle(SCREEN_WIDTH / 2 - 32, SCREEN_HEIGHT / 2 - 32,64,64,255,0,0);
outputPPM();
return 0;
}
```
Wow, this is yet simpler! Although we have no interactivity now, we get a nice picture of a red rectangle on grey background, and don't even need any library (not even the file library!). We just compile this and save the program output to a file, e.g. with `./program > picture.ppm`. The picture we get is stored in [PPM](ppm.md) format -- a very simple format that basically just stores raw [RGB](rgb.md) values and can be opened in many viewers and editors (e.g. [GIMP](gimp.md)). Notice the similar functions like `drawPixel` -- we only have a different parameter for the pixel (in ASCII example it was a single ASCII character, now we have 3 color values: red, green and blue). In the main program we also don't have any infinite loop, the program is non-interactive.
And now finally to the more complex example of a fully interactive graphic using SDL2:
```
#include <SDL2/SDL.h> // include SDL library
#define SCREEN_WIDTH 640
#define SCREEN_HEIGHT 480
#define COLOR_WHITE 0xff // some colors in RGB332 format
#define COLOR_RED 0xe0
unsigned char _SDL_screen[SCREEN_WIDTH * SCREEN_HEIGHT];
SDL_Window *_SDL_window;
SDL_Renderer *_SDL_renderer;
SDL_Texture *_SDL_texture;
const unsigned char *_SDL_keyboardState;
int sdlEnd;
static inline void drawPixel(unsigned int x, unsigned int y, unsigned char color)
{
if (x < SCREEN_WIDTH && y < SCREEN_HEIGHT)
_SDL_screen[y * SCREEN_WIDTH + x] = color;
}
void sdlStep(void)
{
SDL_Event event;
SDL_UpdateTexture(_SDL_texture,NULL,_SDL_screen,SCREEN_WIDTH);
SDL_RenderClear(_SDL_renderer);
SDL_RenderCopy(_SDL_renderer,_SDL_texture,NULL,NULL);
SDL_RenderPresent(_SDL_renderer);
while (SDL_PollEvent(&event))
if (event.type == SDL_QUIT)
sdlEnd = 1;
SDL_Delay(10); // relieve CPU for 10 ms
}
void sdlInit(void)
{
SDL_Init(0);
_SDL_window = SDL_CreateWindow("program",SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH,SCREEN_HEIGHT,SDL_WINDOW_SHOWN);
_SDL_renderer = SDL_CreateRenderer(_SDL_window,-1,0);
_SDL_texture = SDL_CreateTexture(_SDL_renderer,SDL_PIXELFORMAT_RGB332,
SDL_TEXTUREACCESS_STATIC,SCREEN_WIDTH,SCREEN_HEIGHT);
_SDL_keyboardState = SDL_GetKeyboardState(NULL);
SDL_PumpEvents();
}
void sdlDestroy(void)
{
SDL_DestroyTexture(_SDL_texture);
SDL_DestroyRenderer(_SDL_renderer);
SDL_DestroyWindow(_SDL_window);
}
int sdlKeyPressed(int key)
{
return _SDL_keyboardState[key];
}
void drawRectangle(int x, int y, int width, int height, unsigned char color)
{
for (int j = 0; j < height; ++j)
for (int i = 0; i < width; ++i)
drawPixel(x + i,y + j,color);
}
int main(void)
{
int playerX = SCREEN_WIDTH / 2, playerY = SCREEN_HEIGHT / 2;
sdlInit();
while (!sdlEnd) // main loop
{
sdlStep(); // redraws screen, refreshes keyboard etc.
drawRectangle(0,0,SCREEN_WIDTH,SCREEN_HEIGHT,COLOR_WHITE);
drawRectangle(playerX - 10,playerY - 10,20,20,COLOR_RED); // draw player
// update player position:
if (sdlKeyPressed(SDL_SCANCODE_D))
playerX++;
else if (sdlKeyPressed(SDL_SCANCODE_A))
playerX--;
else if (sdlKeyPressed(SDL_SCANCODE_W))
playerY--;
else if (sdlKeyPressed(SDL_SCANCODE_S))
playerY++;
}
sdlDestroy();
return 0;
}
```
This program creates a window with a rectangle that can be moved with the WSAD keys. To compile it you first need to install the SDL2 library -- how to do this depends on your system (just look it up somewhere; on Debian like systems this will typically be done with `sudo apt-get install libsdl2-dev`), and then you also need to link SDL2 during compilation, e.g. like this: `gcc -O3 -o graphics_sdl2 -lSDL2 graphics_sdl2.c`.
This code is almost a bare minimum template for SDL that doesn't even perform any safety checks such as validating creation of each SDL object (which in real code SHOULD be present, here we left it out for better clarity). Despite this the code is quite long with a lot of [boilerplate](boilerplate.md); that's because we need to initialize a lot of stuff, we have to create a graphical window, a texture to which we will draw, we have to tell SDL the format in which we'll represent our pixels, we also have to handle operating system events so that we get the key presses, to know when the window is closed and so on. Still in the end we are working with essentially the same functions, i.e. we have `drawPixel` (this time with pixel as a single char value because we are using the simple [332](rgb332.md) format) and `drawRectangle`. This time `sdlStep` is the function that presents the drawn image on screen (it also does other things like handling the SDL events and pausing for a while to not heat up the CPU).
## Where To Go Next

View file

@ -12,7 +12,7 @@ Great nerds read encyclopedias linearly from start to finish just like a normal
**Similar terms:** encyclopedias, which also used to be called **cyclopedias** in the past, are similar to **dictionaries** and these types of books often overlap (many encyclopedias call themselves dictionaries); the main difference is that a dictionary focuses on providing linguistic information and generally has shorter term definitions, while encyclopedias have longer articles (which however limits their total number, i.e. encyclopedias will usually prefer quality over quantity). 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, tabulated values 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).
These are some **nice/interesting/benchmark articles** to look up in encyclopedias: [algorithm](algorithm.md), [anarchism](anarchism.md), Andromeda (galaxy), Antarctica, Atlantis, atom, [axiom of choice](axiom_of_choice.md), [Bible](bible.md), [big bang](big_bang.md), [black hole](black_hole.md), [brain](brain.md), [Buddhism](buddhism.md), [C](c.md) (programming language), [cannibalism](cannibalism.md), [capitalism](capitalism.md), castle, [cat](cat.md), [censorship](censorship.md), [central processing unit](cpu.md), [chess](chess.md), Chicxulub, China, [color](color.md), comet, [communism](communism.md), [computer](computer.md), [Creative Commons](creative_commons.md), [Deep Blue](deep_blue.md), [democracy](democracy.md), Democratic People's Republic of Korea, [depression](depression.md), [determinism](determinism.md), [dinosaur](dinosaur.md), dodo, [dog](dog.md), [Doom](doom.md) (game), [Earth](earth.md), [Einstein](einstein.md), [Elo](elo.md), [Encyclopedia](encyclopedia.md), [entropy](entropy.md), [ethics](ethics.md), [Euler's Number](e.md), [evolution](evolution.md), [font](font.md), [football](football.md), [fractal](fractal.md), [free software](free_software.md), [game](game.md), gigantopythecus, [go](go.md) (game), [god](god.md), [GNU](gnu.md) project, [hacker](hacking.md), Hanging Gardens of Babylon, [hardware](hardware.md), [Hitler](hitler.md), [Holocaust](holocaust.md), [homosexual](gay.md), [human](human.md), [information](information.md), intelligence, [Internet](internet.md), [IQ](iq.md), Japan, [Jesus](jesus.md), [Jew](jew.md), [language](language.md), [Latin](latin.md), [life](life.md), [light](light.md), lightning, [Linux](linux.md), [logarithm](log.md), [logic](logic.md), [love](love.md), Mammoth, [mathematics](math.md), Mariana Trench, Mars, Milky Way, Moon, [morality](morality.md), Mount Everest, [music](music.md), [necrophilia](necropiilia.md), [Open Source](open_source.md), negro, [nigger](nigger.md), pacifism, [pedophilia](pedophilia.md), [penis](penis.md), [pi](pi.md), Pluto, [prime number](prime.md), [quaternion](quaternion.md), Pompei, [Quran](quran.md), [race](race.md), Roman Empire, [sex](sex.md), [sine](sin.md), [schizophrenia](schizo.md), [software](sw.md), [Stallman](rms.md) (Richard), [star](star.md), Stonehenge, [suicide](suicide.md), Sun, Tibet, [technology](technology.md), Tetris, [time](time.md), Titanic, [transistor](transistor.md), Troy, Tyrannousaurus Rex, [UFO](ufo.md), [universe](universe.md), [Unix](unix.md), Uruk, [Usenet](usenet.md), Valonia Ventricosa (bubble algae), Vatican, Venus, video game, [Wikipedia](wikipedia.md), [woman](woman.md), [World War II](wwii.md), [World Wide Web](www.md), ...
These are some **nice/interesting/benchmark articles** to look up in encyclopedias: [algorithm](algorithm.md), [anarchism](anarchism.md), Andromeda (galaxy), Antarctica, Atlantis, atom, [axiom of choice](axiom_of_choice.md), [Bible](bible.md), [big bang](big_bang.md), [black hole](black_hole.md), [brain](brain.md), [Buddhism](buddhism.md), [C](c.md) (programming language), [cannibalism](cannibalism.md), [capitalism](capitalism.md), castle, [cat](cat.md), [censorship](censorship.md), [central processing unit](cpu.md), [chess](chess.md), Chicxulub, China, [color](color.md), comet, [communism](communism.md), [computer](computer.md), [Creative Commons](creative_commons.md), [Deep Blue](deep_blue.md), [democracy](democracy.md), Democratic People's Republic of Korea, [depression](depression.md), [determinism](determinism.md), [dinosaur](dinosaur.md), dodo, [dog](dog.md), [Doom](doom.md) (game), [Earth](earth.md), [Einstein](einstein.md), [Elo](elo.md), [Encyclopedia](encyclopedia.md), [entropy](entropy.md), [ethics](ethics.md), [Euler's Number](e.md), [evolution](evolution.md), [font](font.md), [football](football.md), [fractal](fractal.md), [free software](free_software.md), [game](game.md), gigantopythecus, [go](go.md) (game), [god](god.md), [GNU](gnu.md) project, [hacker](hacking.md), Hanging Gardens of Babylon, [hardware](hardware.md), [Hitler](hitler.md), [Holocaust](holocaust.md), [homosexual](gay.md), [human](human.md), [information](information.md), intelligence, [Internet](internet.md), [IQ](iq.md), Japan, [Jesus](jesus.md), [Jew](jew.md), [language](language.md), [Latin](latin.md), [life](life.md), [light](light.md), lightning, [Linux](linux.md), [logarithm](log.md), [logic](logic.md), [love](love.md), Mammoth, [mathematics](math.md), Mariana Trench, Mars, Milky Way, Moon, [morality](morality.md), Mount Everest, [music](music.md), [necrophilia](necropiilia.md), [number](number.md), [Open Source](open_source.md), negro, [nigger](nigger.md), pacifism, [pedophilia](pedophilia.md), [penis](penis.md), [pi](pi.md), Pluto, [prime number](prime.md), [quaternion](quaternion.md), Pompei, [Quran](quran.md), [race](race.md), Roman Empire, [sex](sex.md), [sine](sin.md), [schizophrenia](schizo.md), [software](sw.md), [Stallman](rms.md) (Richard), [star](star.md), Stonehenge, [suicide](suicide.md), Sun, Tibet, [technology](technology.md), Tetris, [time](time.md), Titanic, [transistor](transistor.md), Troy, Tyrannousaurus Rex, [UFO](ufo.md), [universe](universe.md), [Unix](unix.md), Uruk, [Usenet](usenet.md), Valonia Ventricosa (bubble algae), Vatican, Venus, video game, [Wikipedia](wikipedia.md), [woman](woman.md), [World War II](wwii.md), [World Wide Web](www.md), ...
**What is the best letter in an encyclopedia?** If you are super nerdy, you may start to search for your favorite starting letter -- this if [fun](fun.md) and may also help you e.g. decide which volume of your encyclopedia to take with you when traveling. Which letter is best depends on many things, e.g. the language of the encyclopedia, its size, your area of interest and so on. Assuming [English](english.md) and topics that would be interesting to the readers of [LRS wiki](lrs_wiki.md), the best letter is most likely C -- it is the second most common starting letter in dictionaries, has a great span and includes essential and interesting terms such as [computer](computer.md), [C](c.md) programming language, [cat](cat.md), [communism](communism.md), [capitalism](capitalism.md), [chess](chess.md), [christianity](christianity.md), [collapse](collpase.md), [CPU](cpu.md), [color](color.md), [culture](culture.md), [copyleft](copyleft.md), [compiler](compiler.md), [creative commons](creative_commons.md), [cryptography](cryptography.md), [copyright](copyright.md), [car](car.md), [cancer](cancer.md), [cellular automata](cellular_automaton.md), [consumerism](consumerism.md), [cosine](cosine.md), [Chomsky](chomsky.md), [CIA](cia.md), [cybernetics](cybernetics.md), [cracking](cracking.md), [chaos](chaos.md), [carbon](carbon.md), [curvature](curvature.md), [chemistry](chemistry.md), [censorship](censorship.md) and others. As close second comes S, the most frequent letter in dictionaries, with terms such as [Stallman](rms.md), [science](science.md), [shader](shader.md), [semiconductor](semiconductor.md), [silicon](silicon.md), [software](software.md), [sound](sound.md), [socialism](socialism.md), [state](state.md), [selflessness](selflessness.md), [speech recognition](speech_recognition.md), [steganography](steganography.md), [square root](square_root.md), [sudoku](sudoku.md), [suicide](kys.md), [speedrun](speedrun.md), [space](space.md), [star](star.md), [Sun](sun.md), [sine](sin.md), [Soviet union](ussr.md), [schizophrenia](schizo.md), [set](set.md), [suckless](suckless.md), [shit](shit.md), [sex](sex.md) and others. { This is based on a list I made where I assigned points to each letter. The letters that follow after C and S are P, M, A, E, T, L, R, F, D, G, I, B, H, U, N, W, V, J, O, K, Q, Z, Y, X. ~drummyfish }

View file

@ -64,7 +64,7 @@ From 1939 to 1945 there was **[World War II](ww2.md)**.
In hacker culture the period between 1943 (start of building of the [ENIAC](eniac.md) computer) to about 1955-1960 is known as the **Stone Age of computers** -- as the [Jargon File](jargon_file.md) puts it, the age when electromechanical [dinosaurs](dinosaur.md) ruled the Earth.
In 1945 the construction of **the first electronic digital fully programmable computer** was completed at University of Pennsylvania as the US Army project. It was named **[ENIAC](eniac.md)** (Electronic Numerical Integrator and Computer). It used 18000 vacuum tubes and 15000 relays, weighted 27 tons and ran on the frequency of 5 KHz. [Punch cards](punch_card.md) were used to program the computer in its machine language; it was [Turing complete](turing_complete.md), i.e. allowed using branches and loops. ENIAC worked with signed ten digit decimal numbers. Also in 1945 **[USA](usa.md) used two nuclear bombs to murder hundreds of thousands of civilians** in Japanese cities Hiroshima and Nagasaki.
In 1945 the construction of **the first electronic digital fully programmable computer** was completed at University of Pennsylvania as the US Army project. It was named **[ENIAC](eniac.md)** (Electronic Numerical Integrator and Computer). It used 18000 vacuum tubes and 15000 relays, weighted 27 tons and ran on the frequency of 5 KHz. [Punch cards](punch_card.md) were used to program the computer in its machine language; it was [Turing complete](turing_complete.md), i.e. allowed using branches and loops. ENIAC worked with signed ten digit decimal numbers. Also in 1945 on July 16 Americans detonated the first nuclear bomb in history as a test, later on that year **[USA](usa.md) used two nuclear bombs to murder hundreds of thousands of civilians** in Japanese cities Hiroshima and Nagasaki.
Among hackers the period between 1961 to 1971 is known as the **Iron Age of computers**. The period spans time since the first minicomputer ([PDP1](pdp1.md)) to the first microprocessor ([Intel 4004](intel4004.md)). This would be followed by so called *elder days*.
@ -94,4 +94,4 @@ After this very recent history follows, it's hard to judge which recent events w
## Recent History Of Technology
TODO: more detailed history since the start of Unix time
TODO: more detailed history since the start of Unix time

View file

@ -4,8 +4,9 @@ This is a list of myths and common misconceptions.
- **FALSEHOOD: "[Java](java.md) is highly [portable](portability.md)"**: While Java runs on several platforms, it's inefficiency and overhead of its extremely high level programming makes it unusable on devices with limited resources such as [embedded systems](embedded.md). Its [bloated](bloat.md) nature and high number of dependencies limit it to running on a few types of **mainstream** devices that are privileged to have the Java virtual machine implemented.
- **FALSEHOOD: "[C](c.md) is not [portable](portability.md)"**: C is extremely portable if written [correctly](lrs.md) (e.g. without dependencies), in fact it is probably the **most portable language in history** because firstly a C compiler is available for almost any platform -- a C compiler is one of the most essential things to have -- and secondly because C is extremely efficient and will run even on devices with extremely limited resources such as [embedded systems](embedded.md).
- **FALSEHOOD: "[Capitalism](capitalism.md) fuels progress"**: Monopolies that inevitably arise in capitalism want to forever prevent others from creating innovations that would make the subject of their business obsolete (e.g. fossil fuel businessmen will want to prevent electric cars). Of course, small businesses cannot compete with large corporations, therefore corporations win and keep the status quo. Small businesses can mostly only succeed in creating [bullshit](bullshit.md) that exists for its own sake (there is e.g. an online store selling literal shit) -- this we would not call a progress. Furthermore capitalism is against the important kind of progress such as social progress or education, because of course educated, independent and mature people would engage less in consumerism and even realize that capitalism is bad.
- **FALSEHOOD: "Feminism, LGBT, Antifa and similar are leftist movements"**: These are in fact [pseudoleftist](pseudoleft.md), fascist movements who don't care about true equality but rather privileges for a certain minority, just as the Italian fascist or Nazis did. This is proven by their [naming](name_matters.md) and means of operation such as violence, censorship, bullying etc. which are anti-equality.
- **FALSEHOOD: "[Capitalism](capitalism.md) fuels [progress](progress.md)"**: [Monopolies](monopoly.md) that inevitably arise in capitalism want to forever prevent others from creating innovations that would make the subject of their business obsolete (e.g. fossil fuel businessmen will want to prevent electric cars). Of course, small businesses cannot compete with large corporations, therefore corporations win and keep the status quo. Small businesses can mostly only succeed in creating [bullshit](bullshit.md) that exists for its own sake (there is e.g. an online store selling literal shit) -- this we would not call a progress. Furthermore capitalism is against the important kind of progress such as social progress or education, because of course educated, independent and mature people would engage less in consumerism and even realize that capitalism is bad.
- **FALSEHOOD: "[Feminism](feminism.md), [LGBT](lgbt.md), [Antifa](antifa.md) and similar are leftist movements"**: These are in fact [pseudoleftist](pseudoleft.md), [fascist](fascism.md) movements who don't care about true equality but rather privileges for a certain minority, just as the Italian fascist or Nazis did. This is proven by their [naming](name_matters.md) and means of operation such as violence, censorship, bullying etc. which are anti-equality.
- **FALSEHOOD: "Professional programmers are good programmers"**: The opposite is true, professionals are those who get paid for writing the [shittiest code](capitalist_software.md) imaginable, their aim is to make things quickly, satisfy metrics, they destroy and rape technology for profit and adhere to corporate [bullshit](bullshit.md). No skill beyond literacy is needed to do what they do, that's why we call them code monkeys, they don't and even cannot see programming as [art](art.md), they see it as something to be exploited for making living. Actual good programmer cannot psychologically bear doing this, so you cannot be a good and professional programmer at the same time, not in [21st century](21st_century.md).
- **FALSEHOOD: "Rich people are smart and vice versa"**: It's the other way around, see [IQ](iq.md).
- **FALSEHOOD: "Some celebrities are good people"**: Celebrities, nearly by definition, can never be good people. A lot of people seem to acknowledge that most celebrities are probably assholes, but almost everyone has that one favorite celebrity he thinks is "different", an "exception" -- it ought to be said there are no exceptions among celebrity assholes, in the same sense and by same principles by which there exist no ethical [corporations](corporation.md) or altruistic billionaires. Fame is a kind of [capital](capital.md) that's being [fought](fight_culture.md) for, it's impossible to get a celebrity status without active effort, a fight which ALWAYS comes with taking unethical steps, therefore only immoral individuals can ever become celebrities. Being known for exceptional abilities is one thing, but being a celebrity -- e.g. having one's face being shown to others frequently -- is another thing which has nothing to do with being good at something, it's solely about building one's image, taking opportunities, exploiting the system, being in right places (something that actually becomes the focus of said individual before getting better at his art). If a good man has an opportunity to become celebrity, he will willingly turn it down exactly because he is good and knows that being a celebrity is bad. So no, your celebrity is not special, he's an asshole like all other celebrities. Never worship [celebrities](hero_culture.md).
- TODO

View file

@ -12,6 +12,8 @@ Humans first started to use positive natural numbers, i.e. 1, 2, 3 ..., so as to
Basically **anything can be encoded as a number** which makes numbers a universal abstract "medium" -- we can exploit this in both mathematics and programming. Ways of encoding [information](information.md) in numbers may vary, for a mathematician it is natural to see any number as a multiset of its [prime](prime.md) factors (e.g. 12 = 2 * 2 * 3, the three numbers are inherently embedded within number 12) that may carry a message, a programmer will probably rather encode the message in [binary](binary.md) and then interpret the 1s and 0s as a number in direct representation, i.e. he will embed the information in the digits. You can probably come up with many more ways.
**[Order](order.md)** is an important concept related to numbers, we usually want to be able to compare numbers so apart from other operations such as addition and multiplication we also define the comparison operation. However note that not every order is total, i.e. some numbers may be incomparable (consider e.g. complex numbers).
Here are some [fun](fun.md) facts about numbers:
- Some people associate numbers with colors, though what color each number has seems to be completely subjective. See [synesthesia](synesthesia.md).
@ -173,23 +175,25 @@ TODO: what is the best number? maybe top 10? would 10 be in top 10?
## Numbers In Programming/Computers
While mathematicians work mostly with infinite number sets and all kind of "weird" hypothetical numbers like hyperreals and transcendentals, [programmers](programming.md) still mostly work with "normal", practical numbers and have to limit themselves to finite number sets because, of course, computers have limited memory and can only store limited number of numeric values -- computers typically work with [modulo](mod.md) arithmetic with some high power of two modulo, e.g. 2^32 or 2^64, which is a [good enough](good_enough.md) approximation of an infinite number set. Mathematicians are as precise with numbers as possible as they're interested in structures and patterns that numbers form, programmers just want to use numbers to solve problems, so they mostly use [approximations](approximation.md) where they can -- for example programmers normally approximate [real numbers](real_number.md) with [floating point](float.md) numbers that are really just a subset of rational numbers. This isn't really a problem though, computers can comfortably work with numbers large and precise enough for solving any practical problem -- a slight annoyance is that one has to be careful about such things as [underflows](underflow.md) and [overflows](overflow.md) (i.e. a value wrapping around from lowest to highest value and vice versa), limited and sometimes non-uniform precision resulting in [error](error.md) accumulation, unlinearization of linear systems and so on. Programmers also don't care about strictly respecting some properties that certain number sets must mathematically have, for example integers along with addition are mathematically a [group](group.md), however signed integers in [two's complement](twos_complement.md) aren't a group because the lowest value doesn't have an inverse element (e.g. on 8 bits the lowest value is -128 and highest 127, the lowest value is missing its partner). Programmers also allow "special" values to be parts of their number sets, especially e.g. with the common IEEE [floating point](float.md) types we see values like plus/minus [infinity](infinity.md), [negative zero](negative_zero.md) or [NaN](nan.md) ("not a number") which also break some mathematical properties and creates situations like having a number that says it's not a number, but again this really doesn't play much of a role in practical problems. Numbers in computers are represented in [binary](binary.md) and programmers themselves often prefer to write numbers in binary, hexadecimal or octal representation -- they also often meet powers of two rather than powers of ten or primes or other similar limits (for example the data type limits are typically limited by some power of two). Famously programmers start counting from 0 (they go as far as using the term "zeroth") while mathematicians rather tend to start at 1. Just as mathematicians have different sets of numbers, programmers have an analogy in numeric [data types](data_type.md) -- a data type defines a set of values and operations that can be performed with them. The following are some of the common data types and representations of numbers in computers:
While mathematicians work mostly with infinite number sets and all kind of "weird" hypothetical numbers like hyperreals and transcendentals, [programmers](programming.md) still mostly work with "normal", practical numbers and have to limit themselves to finite number sets because, of course, computers have limited memory and can only store limited number of numeric values -- computers typically work with [modulo](mod.md) arithmetic with some high power of two modulo, e.g. 2^32 or 2^64, which is a [good enough](good_enough.md) approximation of an infinite number set. Mathematicians are as precise with numbers as possible as they're interested in structures and patterns that numbers form, programmers just want to use numbers to solve problems, so they mostly use [approximations](approximation.md) where they can -- for example programmers normally approximate [real numbers](real_number.md) with [floating point](float.md) numbers that are really just a subset of rational numbers. This isn't really a problem though, computers can comfortably work with numbers large and precise enough for solving any practical problem -- a slight annoyance is that one has to be careful about such things as [underflows](underflow.md) and [overflows](overflow.md) (i.e. a value wrapping around from lowest to highest value and vice versa), limited and sometimes non-uniform precision resulting in [error](error.md) accumulation, unlinearization of linear systems and so on. Programmers also don't care about strictly respecting some properties that certain number sets must mathematically have, for example integers along with addition are mathematically a [group](group.md), however signed integers in [two's complement](twos_complement.md) aren't a group because the lowest value doesn't have an inverse element (e.g. on 8 bits the lowest value is -128 and highest 127, the lowest value is missing its partner). Programmers also allow "special" values to be parts of their number sets, especially e.g. with the common IEEE [floating point](float.md) types we see values like plus/minus [infinity](infinity.md), [negative zero](negative_zero.md) or [NaN](nan.md) ("not a number") which also break some mathematical properties and creates situations like having a number that says it's not a number, but again this really doesn't play much of a role in practical problems. Numbers in computers are represented in [binary](binary.md) and programmers themselves often prefer to write numbers in binary, hexadecimal or octal representation -- they also often meet powers of two rather than powers of ten or primes or other similar limits (for example the data type limits are typically limited by some power of two). There also comes up the question of specific number encoding, for example direct representation, sign-magnitude, [two's complement](twos_complement.md), [endianness](byte_sex.md) and so on. Famously programmers start counting from 0 (they go as far as using the term "zeroth") while mathematicians rather tend to start at 1. Just as mathematicians have different sets of numbers, programmers have an analogy in numeric [data types](data_type.md) -- a data type defines a set of values and operations that can be performed with them. The following are some of the common data types and representations of numbers in computers:
- **numeric**: Anything considered a number. In very high level languages there may be just one generic "number" type that can store any kind of number, automatically choosing best representation for it etc.
- **unsigned**: Don't allow negative values -- this is sufficient in many cases, simpler to implement and can offer higher range in the positive direction.
- **signed**: Allow also negative values which brings up the issue of what representation to use -- nowadays the most common is [two's complement](twos_complement.md).
- **[unsigned](unsigned.md)**: Don't allow negative values -- this is sufficient in many cases, simpler to implement and can offer higher range in the positive direction.
- **[signed](signed.md)**: Allow also negative values which brings up the issue of what representation to use -- nowadays the most common is [two's complement](twos_complement.md).
- **fixed size**: Most common, each number takes some fixed size in memory, expressed in [bits](bit.md) or [bytes](byte.md) -- this of course determines the maximum number of values and so for example the minimum and maximum storable number.
- **8bit**: Can store 256 value (e.g. integers from 0 to 255 or -128 to 127).
- **16bit**: Can store 65536 values.
- **32bit**: Can store 4294967296 values.
- **arbitrary size**: Can store arbitrarily high/low and/or precise value, take variable amount of memory depending on how much is needed, used only in very specialized cases, may be considerably slower.
- **integer**: Integer values, most common, usually using direct or [two's complement](twos_complement.md) representation.
- ...
- **[arbitrary size](arbitrary_size_int.md)**: Can store arbitrarily high/low and/or precise value, take variable amount of memory depending on how much is needed, used only in very specialized cases, may be considerably slower.
- **[integer](int.md)**: Integer values, most common, usually using direct or [two's complement](twos_complement.md) representation.
- **fractional**: Have higher precision than integers, allow storing fractions, are often used to [approximate](approximation.md) real numbers.
- **[fixed point](fixed_point.md)**: Are represented by a number with radix point in fixed place, have uniform precision.
- **[floating point](float.md)**: Have movable radix point which is more [complicated](bloat.md) but allows for representing both very high and very small values due to non-uniform precision.
- **[complex](complex_number.md)**: Analogous to mathematical complex numbers.
- **[quaternion](quaternion.md)**: Analogous to mathematical quaternions.
- **symbolic**: Used in some specialized mathematical software to perform symbolic computation, i.e. computation done in a human-like way, by manipulating symbols without using concrete values that would have to resort to approximation.
- ...
## Notable Numbers
@ -207,11 +211,14 @@ Here is a table of some notable numbers, mostly important in math and programmin
| |1.616255... * 10^-35 | | Planck length in meters, smallest "length" in Universe |
| one eight | 0.125 | 2^-3 | |
| one fourth | 0.25 | 2^-2 | |
| one third | 0.333333... | ...1313132 (5-adic) | |
| one half | 0.5 | 2^-1 | |
| [one](one.md) | 1 | 2^0, 0!, 0.999... | NOT a prime |
| [square root](sqrt.md) of two | 1.414213... | 2^(1/2) | irrational, diagonal of unit square, important in geom. |
|phi ([golden ratio](golden_ratio.md))| 1.618033... | (1 + sqrt(5)) / 2 | irrational, visually pleasant ratio, divine proportion |
| supergolden ratio | 1.465571... | solve(x^3 - x^2 - 1 = 0) | similar to golden ratio, bit more difficult to compute |
|phi ([golden ratio](golden_ratio.md))| 1.618033... | (1 + sqrt(5)) / 2, solve(x^2 - x - 1 = 0)| irrational, visually pleasant ratio, divine proportion |
| [two](two.md) | 2 | 2^1, 0b000010 | prime |
| [silver ratio](silver_ratio.md) | 2.414213... | 1 + sqrt(2), solve(x^2 - 2 * x - 1 = 0) | similar to golden ratio |
| [e](e.md) (Euler's number) | 2.718281... | | base of natural [logarithm](log.md) |
| [three](three.md) | 3 | 2^2 - 1 | prime, max. unsigned number with 2 bits |
| [pi](pi.md) | 3.141592... | | circle circumference to its diameter, irrational |
@ -267,7 +274,9 @@ Here is a table of some notable numbers, mostly important in math and programmin
| |18446744073709551615 | 2^64 - 1 | maximum unsigned number storable with 64 bits |
| |18446744073709551616 | 2^64 | number of values storable with 64 bits |
| | 3.402823... * 10^38 | | largest number storable in IEEE-754 32 binary float |
| | 10^80 | | approx. number of atoms in observable universe |
| [googol](googol.md) | 10^100 | | often used big number |
| [asankhyeya](asankhyeya.md) | 10^140 | | religious number, often used in [Buddhism](buddhism.md) |
| | 4.65... * 10^185 | | approx. number of Planck volumes in observable universe |
| |1.797693... * 10^308 | | largest number storable in IEEE-754 64 binary float |
| [googolplex](googolplex.md) | 10^(10^100) | 10^googol | another large number, number of genders in 21st century |
@ -278,5 +287,3 @@ Here is a table of some notable numbers, mostly important in math and programmin
| [i](i.md) (imaginary unit) | | j * k | part of complex numbers and quaternions |
| [j](j.md) | | k * i | one of quaternion units |
| [k](k.md) | | i * j | one of quaternion units |
TODO: add some p-adic

View file

@ -8,6 +8,8 @@ Instead of the word *race* the politically correct camp uses words such as *ethn
**Race can be told from the shape of the skull and one's [DNA](dna.md)**, which finds use e.g. in forensics to help solve crimes. It is officially called the *ancestry estimation*. Some idiots say this should be forbidden to do because it's "racist" lmao. Besides the obvious visual difference such as skin [color](color.md) **races also have completely measurable differences acknowledged even by modern "science"**, for example unlike other races about 90% of Asians have dry earwax, Asians also have highest bone density, Huaorani tribe has flat feet, blood type distributions are wildly different between races as well as blood pressure and also heart rate, people near the equator have measurably smaller eyeballs than those very far north, even distribution of genes associated with specific behavior was measured to differ between races. Similar absolutely measurable differences exist in height, body odor, alcohol and lactose tolerance, high altitude tolerance, vulnerability to specific diseases, hair structure, cold tolerance, risk of obesity, behavior (see e.g. the infamous *[chimp out](chimp_out.md)* behavior of black people) and others. It is known for a fact that Sherpas are greatly accustomed to living in high altitudes, that's why they work as helpers for people climbing mt. Everest, they can just do it much easier than other races. While dryness of earwax is really a minor curiosity, it is completely unreasonable to believe that race differences stop at traits we humans find "controversial" and that genetics somehow magically avoids affecting traits that are harder to measure and which our current society deems politically incorrect to exist. In fact differences in important areas such as intelligence were measured very well -- these are however either censored or declared incorrect and "debunked" by unquestionable "science" authorities, because politics.
[Fun](fun.md) fact: according to the Guinness World Record Book the tallest race are probably Tutsi whose men are on average 185 cm tall. The shortest seems to be the negroid group Onge with only few reaching over 140 cm.
{ Curiosity: in the past there was a research of the specific smell of Jews -- whether Jews do have a specific smell distinguishable by humans may be highly debatable, but it's funny -- one guy tried to start eating like a Jew to see if he would also start to smell like one :D Source book: *Race Differences* from 1935. ~drummyfish }
Pseudoleft uses cheap, logically faulty arguments to deny the existence of race; for example that there are no clear objective boundaries between races -- of course there are not, but how does that imply nonexistence of race? The same argument could also be given even e.g. for the term *species* (see e.g. ring species in which the boundaries are not clear) so as to invalidate it; yet we see no one doubting the existence of various species of animals. That's like saying that color doesn't exist because given any two distinct colors there exists a gradual transition, or that [music](music.md) and noise are the same thing because objectively no clear line can be drawn between them. If by this argument races don't exist, then movie genres, psychological disorders, emotions or political opinions also don't exist.
@ -22,7 +24,7 @@ Denying the facts regarding human race is called **[race denialism](race_deniali
There is a controversial 1994 book called *The Bell Curve* that deals with differences in intelligence between races (later followed by other books such as *The Global Bell Curve* trying to examine the situation world-wide). [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)). Online resources with a lot of information on racial differences are e.g. https://zerocontradictions.net/FAQs/race-FAQs and http://www.humanbiologicaldiversity.com/, https://en.metapedia.org/wiki/Race_and_morphology etc. Note that even if some particular resource may be fascist, biased and contain propaganda of its own, it may likely give you information the pseudoleftist mainstream such as [Wikipedia](wikipedia.md) and [Google](google.md) simply [censor](censorship.md) -- while we may of course not approve of the politics/opinions/goals/etc. of some we link to, we still link to them to provide access to censored information so that one can seek truth and form his own opinions.
**If you want a relatively objective view on races, read old (pre 1950) books.** See for example the article on *NEGRO* in 11th edition of Encyclopedia Britannica (1911), which clearly states on page 344 of the 19th volume that "mentally the negro is inferior to the white" and continues to cite thorough study of this, finding that black children were quite intelligent but with adulthood the intellect always went down, however it states that negro has e.g. better sense of vision and hearing. Even in the 90s still the uncensored information on race was still available in the mainstream sources, e.g. the 1995 *Desk Reference Encyclopedia* and 1993 *Columbia Encyclopedia* still have articles on races and their differences. Other books on races (which you can find e.g. on the Internet Archive) include e.g. *Race Differences* (1935, Klineberg) and *Races of Man* (a huge book from 1900, by Deniker).
**If you want a relatively objective view on races, read old (pre 1950) books.** In the past people weren't yet brainwashed in this area, truth could be spoken clearly, everyone knew races existed and that acknowledging this doesn't at all imply [racism](racism.md) -- even such personalities as H. G. Wells who in his *Short History of the World* draws a nice, detailed tree of human races, alongside which he also warns against adopting (real) racism. Also see for example the article on *NEGRO* in 11th edition of Encyclopedia Britannica (1911), which clearly states on page 344 of the 19th volume that "mentally the negro is inferior to the white" and continues to cite thorough study of this, finding that black children were quite intelligent but with adulthood the intellect always went down, however it states that negro has e.g. better sense of vision and hearing. Even in the 90s still the uncensored information on race was still available in the mainstream sources, e.g. the 1995 *Desk Reference Encyclopedia* and 1993 *Columbia Encyclopedia* still have articles on races and their differences. Other books on races (which you can find e.g. on the Internet Archive) include e.g. *Race Differences* (1935, Klineberg) and *Races of Man* (a huge book from 1900, by Deniker).
{ Another curiosity: many old books argue that the black race is in many aspects NOT the one closest to apes and they make many good points, for example body hair (blacks have none, whites have a lot), hair structure (again white's hair structure is closer to apes) or lips (apes don't have big lips while black races have the bigger lips). ~drummyfish }

File diff suppressed because it is too large Load diff

View file

@ -11,5 +11,6 @@ Some pressing questions about thrembo remaining to be researched are following.
- [noncomputable](computability.md) numbers
- [schizophrenic number](schizo_number.md)
- [illegal number](illegal_number.md)
- [asankhyeya](asankhyeya.md)
- [42](42.md)
- [pi](pi.md)

File diff suppressed because one or more lines are too long

View file

@ -3,16 +3,16 @@
This is an autogenerated article holding stats about this wiki.
- number of articles: 567
- number of commits: 751
- total size of all texts in bytes: 3439937
- total number of lines of article texts: 26972
- number of commits: 752
- total size of all texts in bytes: 3467341
- total number of lines of article texts: 27428
- number of script lines: 262
- occurences of the word "person": 11
- occurences of the word "nigger": 67
longest articles:
- [c_tutorial](c_tutorial.md): 104K
- [c_tutorial](c_tutorial.md): 124K
- [capitalism](capitalism.md): 64K
- [how_to](how_to.md): 56K
- [chess](chess.md): 56K
@ -35,60 +35,63 @@ longest articles:
top 50 5+ letter words:
- which (1996)
- there (1485)
- people (1328)
- other (1087)
- example (1042)
- which (2010)
- there (1498)
- people (1333)
- other (1095)
- example (1051)
- software (1027)
- number (948)
- about (900)
- their (747)
- program (722)
- called (703)
- computer (685)
- would (684)
- because (675)
- simple (637)
- being (637)
- numbers (632)
- things (626)
- language (612)
- without (598)
- programming (590)
- function (590)
- however (585)
- something (566)
- these (556)
- different (548)
- system (521)
- world (517)
- should (512)
- games (506)
- number (952)
- about (905)
- program (756)
- their (749)
- called (707)
- computer (686)
- would (685)
- because (678)
- simple (650)
- being (644)
- numbers (637)
- things (635)
- language (615)
- without (604)
- function (604)
- programming (596)
- however (587)
- something (570)
- these (563)
- different (551)
- system (525)
- world (519)
- should (515)
- games (509)
- society (503)
- point (496)
- though (487)
- doesn (484)
- memory (473)
- point (499)
- though (488)
- doesn (487)
- memory (483)
- while (462)
- drummyfish (460)
- while (455)
- using (453)
- technology (451)
- using (450)
- course (439)
- simply (438)
- still (436)
- similar (431)
- possible (429)
- computers (397)
- course (440)
- simply (439)
- still (437)
- similar (436)
- possible (430)
- computers (398)
- really (396)
- extremely (396)
- really (393)
- value (384)
- usually (383)
- always (380)
- value (386)
- usually (386)
- always (383)
latest changes:
```
Date: Tue Mar 26 14:01:34 2024 +0100
random_page.md
wiki_stats.md
Date: Tue Mar 26 13:56:03 2024 +0100
drummyfish.md
history.md
@ -113,24 +116,15 @@ Date: Mon Mar 25 22:26:49 2024 +0100
wiki_pages.md
wiki_stats.md
Date: Sun Mar 24 21:52:08 2024 +0100
ascii.md
capitalism.md
debugging.md
fascism.md
forth.md
free_culture.md
liberalism.md
libertarianism.md
lrs.md
```
most wanted pages:
- [data_type](data_type.md) (12)
- [embedded](embedded.md) (11)
- [buddhism](buddhism.md) (11)
- [array](array.md) (11)
- [meme](meme.md) (10)
- [buddhism](buddhism.md) (10)
- [array](array.md) (10)
- [quake](quake.md) (9)
- [lisp](lisp.md) (9)
- [irl](irl.md) (9)
@ -152,28 +146,28 @@ most popular and lonely pages:
- [lrs](lrs.md) (267)
- [capitalism](capitalism.md) (197)
- [c](c.md) (195)
- [bloat](bloat.md) (193)
- [bloat](bloat.md) (194)
- [free_software](free_software.md) (162)
- [game](game.md) (132)
- [game](game.md) (133)
- [suckless](suckless.md) (131)
- [proprietary](proprietary.md) (114)
- [kiss](kiss.md) (88)
- [kiss](kiss.md) (89)
- [modern](modern.md) (87)
- [minimalism](minimalism.md) (86)
- [linux](linux.md) (84)
- [computer](computer.md) (84)
- [free_culture](free_culture.md) (79)
- [programming](programming.md) (78)
- [fun](fun.md) (77)
- [math](math.md) (76)
- [fun](fun.md) (76)
- [public_domain](public_domain.md) (74)
- [gnu](gnu.md) (74)
- [foss](foss.md) (73)
- [censorship](censorship.md) (71)
- [hacking](hacking.md) (70)
- [art](art.md) (69)
- [fight_culture](fight_culture.md) (68)
- [programming_language](programming_language.md) (67)
- [fight_culture](fight_culture.md) (67)
- [shit](shit.md) (66)
- [less_retarded_society](less_retarded_society.md) (66)
- [bullshit](bullshit.md) (66)