This commit is contained in:
Miloslav Ciz 2022-04-09 20:51:52 +02:00
parent 2a3b06eb67
commit 3abdc93103
17 changed files with 160 additions and 24 deletions

7
ai.md Normal file
View file

@ -0,0 +1,7 @@
# Artificial Intelligence
Artificial intelligence (AI) is an area of [computer science](compsci.md) whose effort lies in making computers simulate thinking of humans and possibly other biologically living beings. This may include making computers play [games](game.md) such as [chess](chess.md), understand and processing audio, images and text on high level of [abstraction](abstraction.md) (e.g. translation between natural languages), making predictions about complex systems such as stock market or weather or even exhibit a general human-like behavior. Even though today's focus in AI is on [machine learning](machine_learning.md) and especially [neural networks](neural_network.md), there are many other usable approaches and models such as "hand crafted" state tree searching algorithms that can simulate and even outperform the behavior of humans in certain specialized areas.
There's a concern that's still a matter of discussion about the dangers of developing a powerful AI, as that could possibly lead to a [technological singularity](tech_singularity.md) in which a super intelligent AI might take control over the whole world without humans being able to seize the control back. Even though it's still likely a far future and many people say the danger is not real, the question seems to be about *when* rather than *if*.
By about 2020, "AI" has become a [capitalist](capitalism.md) [buzzword](buzzword.md). They try to put machine learning into everything just for that AI label -- and of course, for a [bloat monopoly](bloat_monopoly.md).

View file

@ -80,6 +80,6 @@ And we get:
And so on until we get all the derivatives.
Once we have them, we multiply them all by some value (**learning rate**, a distance by which we move in the computed direction) and substract them from the current weights by which we perform the gradient descent and lower the total error.
Once we have them, we multiply them all by some value (**learning rate**, a distance by which we move in the computed direction) and subtract them from the current weights by which we perform the gradient descent and lower the total error.
Note that here we've only used one training sample, i.e. the error *E* was computed from the network against a single desired output. If more example are used in a single update step, they are usually somehow averaged.
Note that here we've only used one training sample, i.e. the error *E* was computed from the network against a single desired output. If more example are used in a single update step, they are usually somehow averaged.

View file

@ -40,7 +40,7 @@ Now we can just start experimenting and invent new music by fiddling with the fo
General tips/tricks and observations are these:
- Outputting the variable `i` creates a periodical saw-shaped beat, **multiplication/division decreases/increases the speed, addition/substraction shifts the phase backward/forward**.
- Outputting the variable `i` creates a periodical saw-shaped beat, **multiplication/division decreases/increases the speed, addition/subtraction shifts the phase backward/forward**.
- Squaring (and other powers) create a **wah-wah effect**.
- Crazier patterns can be achieved by **using the variable in places of numerical constants**, e.g. `i << ((i / 512) % 8)` (shifting by a value that depends on the variable).
- Modulo (`%`) increases the frequency and **decreases volume** (limits the wave peak).
@ -65,4 +65,4 @@ The following more complex examples come from the [LRS](lrs.md) game [Anarch](an
- distortion guitar rhythmical beat: `~((((i >> ((i >> 2) % 32)) | (i >> ((i >> 5) % 32))) & 0x12) << 1) | (i >> 11)`
- electronic/techno: `((0x47 >> ((i >> 9) % 32)) & (i >> (i % 32))) | (0x57 >> ((i >> 7) % 32)) | (0x06 >> ((i >> ((((i * 11) >> 14) & 0x0e) % 32)) % 32))`
- main theme, uses an extra variable: `(((i) & 65536) ? (a & (((i * 2) >> 16) & 0x09)) : ~a)`, where `uint32_t a = ((i >> 7) | (i >> 9) | (~i << 1) | i)`
- main theme, uses an extra variable: `(((i) & 65536) ? (a & (((i * 2) >> 16) & 0x09)) : ~a)`, where `uint32_t a = ((i >> 7) | (i >> 9) | (~i << 1) | i)`

View file

@ -530,7 +530,7 @@ x--; // same as: x = x - 1;
// etc.
```
The last two constructs are called **[incrementing](increment.md)** and **[decrementing](decrement.md)**. This just means adding/substracting 1.
The last two constructs are called **[incrementing](increment.md)** and **[decrementing](decrement.md)**. This just means adding/subtracting 1.
In C there is a pretty unique operator called the **[ternary operator](ternary_operator.md)** (ternary for having three [operands](operand.md)). It can be used in expressions just as any other operators such as `+` or `-`. Its format is:
@ -1157,6 +1157,18 @@ We see the `#if` directive has to have a corresponding `#endif` directive that t
#endif
```
Let us talk about one more thing that doesn't fall under the preprocessor language but is related to constants: **enumerations**. Enumeration is a data type that can have values that we specify individually, for example:
```
typedef enum
{
APPLE,
PEAR,
TOMATO
} Fruit;
```
This creates a new data type `Fruit`. Variables of this type may have values `APPLE`, `PEAR` or `TOMATO`, so we may for example do `Fruit myFruit = APPLE;`. These values are in fact integers and the names we give them are just nicknames, so here `APPLE` is equal to 0, `PEAR` to 1 and `TOMATO` to 2.
## Pointers
@ -1337,7 +1349,7 @@ Now let's talk about arrays -- these are a bit special. The important thing is t
Arrays and pointer are kind of a duality -- we can also use array indexing with pointers. For example if we have a pointer declared as `int *x;`, we can access the value `x` points to with a dereference (`*x`), but ALSO with indexing like this: `x[0]`. Accessing index 0 simply means: take the value stored in the variable and add 0 to it, then dereference it. So it achieves the same thing. We can also use higher indices (e.g. `x[10]`), BUT ONLY if `x` actually points to a memory that has at least 11 allocated places.
This leads to a concept called **[pointer arithmetic](pointer_arithmetic.md)**. Pointer arithmetic simply means we can add or substract numbers to pointer values. If we continue with the same pointer as above (`int *x;`), we can actually add numbers to it like `*(x + 1) = 10;`. What does this mean?! It means exactly the same thing as `x[1]`. Adding a number to a pointer shifts that pointer given number of *places* forward. We use the word *places* because each data type takes a different space in memory, for example `char` takes one byte of memory while `int` takes usually 4 (but not always), so shifting a pointer by *N* places means adding *N* times the size of the pointed to data type to the address stored in the pointer.
This leads to a concept called **[pointer arithmetic](pointer_arithmetic.md)**. Pointer arithmetic simply means we can add or subtract numbers to pointer values. If we continue with the same pointer as above (`int *x;`), we can actually add numbers to it like `*(x + 1) = 10;`. What does this mean?! It means exactly the same thing as `x[1]`. Adding a number to a pointer shifts that pointer given number of *places* forward. We use the word *places* because each data type takes a different space in memory, for example `char` takes one byte of memory while `int` takes usually 4 (but not always), so shifting a pointer by *N* places means adding *N* times the size of the pointed to data type to the address stored in the pointer.
This may be a lot information to digest. Let's provide an example to show all this in practice:
@ -1640,6 +1652,32 @@ The line starting with `char *inputChars = malloc(...` creates a pointer to `cha
## Debugging, Optimization
[Debugging](debugging.md) means localizing and fixing [bugs](bug.md) (errors) in your program. In practice there are always bugs, even in very short programs (you've probably already figured that out yourself), some small and insignificant and some pretty bad ones that make your program unusable or vulnerable.
There are two kinds of bugs: **[syntactic](syntax.md) errors** and **[semantic](semantics.md) errors**. A syntactic error is when you write something not obeying the C grammar, it's like a typo or grammatical error in a normal language -- these errors are very easy to detect and fix, a compiler won't be able to understand your program and will point you to the exact place where the error occurs. A semantic error can be much worse -- it's a logical error in the program; the program will compile and run but the program will behave differently than intended. The program may crash, leak memory, give wrong results, run slowly, corrupt files etc. These errors may be hard to spot and fix, especially when they happen in rare situations. We'll be only considering semantic errors from now on.
If we spot a bug, how do we fix it? The first thing is to find a way to **replicate** it, i.e. find the exact steps we need to make with the program to make the bug appear (e.g. "in the menu press keys A and B simultaneously", ...). Next we need to trace and locate which exact line or piece of code is causing the bug. This can either be done with the help of specialized [debuggers](debugger.md) such as [gdb](gdb.md) or [valgrind](valgrind.md), but there's usually a much easier way of using printing functions such as `printf`. (Still do check out the above mentioned debuggers, they're very helpful.)
Let's say your program crashes and you don't know at which line. You simply put prints such as `printf("A\n");` and `printf("B\n);` at the beginning and end of a code you suspect might be causing the crash. Then you run the program: if `A` is printed but `B` isn't, you know the crash happened somewhere between the two prints, so you shift the `B` print a little bit up and so on until you find exactly after which line `B` stops printing -- this is the line that crashes the program. IMPORTANT NOTE: the prints have to have newline (`\n`) at the end, otherwise this method may not work because of output buffering.
Of course, you may use the prints in other ways, for example to detect at which place a value of variable changes to a wrong value. ([Asserts](assert.md) are also good for keeping an eye on correct values of variables.)
What if the program isn't exactly crashing but is giving wrong results? Then you need to trace the program step by step (not exactly line by line, but maybe function by function) and check which step has a problem in it. If for example your game AI is behaving stupid, you firstly check (with prints) if it correctly detects its circumstances, then you check whether it makes the correct decision based on the circumstances, then you check whether the pathfinding algorithm finds the correct path etc. At each step you need to know what the correct behavior should be and you try to find where the behavior is broken.
Knowing how to fix a bug isn't everything, we also need to find the bugs in the first place. **[Testing](testing.md)** is the process of trying to find bugs by simply running and using the program. Remember, testing can't prove there are no bugs in the program, it can only prove bugs exits. You can do testing manually or automate the tests. Automated tests are very important for preventing so called **[regressions](regression.md)** (so the tests are called regression tests). Regression happens when during further development you break some of its already working features (it is very common, don't think it won't be happening to you). Regression test (which can simply be just a normal C program) simply automatically checks whether the already implemented functions still give the same results as before (e.g. if *sin(0) = 0* etc.). These tests should be run and pass before releasing any new version of the program (or even before any commit of new code).
[Optimization](optimization.md) is also a process of improving an already working program, but here we try to make the program more efficient -- the most common goal is to make the program faster, smaller or consume less [RAM](ram.md). This can be a very complex task, so we'll only mention it briefly.
The very basic thing we can do is to turn on automatic optimization with a compiler flag: `-O3` for speed, `-Os` for program size (`-O2` and `-O1` are less aggressive speed optimizations). Yes, it's that simple, you simply add `-O3` and your program gets magically faster. Remember that **optimizations against different resources are often antagonistic**, i.e. speeding up your program typically makes it consume more memory and vice versa. You need to choose. Optimizing manually is a great art. Let's suppose you are optimizing for speed -- the first, most important thing is to locate the part of code that's slowing down you program the most, so called **[bottleneck](bottleneck.md)**. That is the code you want to make faster. Trying to optimize non-bottlenecks doesn't speed up your program as a whole much; imagine you optimize a part of the code that takes 1% of total execution time by 200% -- your program will only get 0.5% faster. Bottlenecks can be found using [profiling](profiling.md) -- measuring the execution time of different parts of the program (e.g. each function). This can be done manually or with tools such a [gprof](gprof.md). Once you know where to optimize, you try to apply different techniques: using algorithms with better [time complexity](time_complexity.md), using [look up tables](lut.md), optimizing [cache](cache.md) behavior and so on. This is beyond the scope of this tutorial.
## Final Program
## Advanced Stuff and Where to Continue
TODO
## Where to Go Next
We haven't covered the whole of C, not even close, but you should have pretty solid basics now. Now you just have to go and write a lot of C programs, that's the only way to truly master C. WARNING: Do not start with an ambitious project such as a 3D game. You won't make it and you'll get demotivated. Start very simple (a Tetris clone perhaps?).
You should definitely learn about common [data structures](data_strucutre.md) ([linked lists](linked_list.md), [binary trees](binary_tree.md), [hash tables](hash.md), ...) and [algorithms](algorithm.md) ([sorting](sorting.md), [searching](search.md), ...). Also take a look at basic [licensing](license.md). Another thing to learn is some [version control system](vcs.md), preferably [git](git.md), because this is how we manage bigger programs and how we collaborate on them. To start making graphical programs you should get familiar with some library such as [SDL](sdl.md).
A great amount of experience can be gained by contributing to some existing project, collaboration really boosts your skill and knowledge of the language. This should only be done when you're at least intermediate. Firstly look up a nice project on some git hosting site, then take a look at the bug tracker and pick a bug or feature that's easy to fix or implement (low hanging fruit).

View file

@ -1,6 +1,6 @@
# Capitalist Software
Capitalist software is [software](software.md) that late stage [capitalism](capitalism.md) produces and is practically 100% [shitty](shit.md) [modern](modern.md) [bloat](bloat.md) and [malware](malware.md) hostile to its users, made with the sole goal of benefiting its creator (often a [corporation](corporation.md)). Capitalist software is not just [proprietary](proprietary.md) corporate software, but a lot of times "[open source](open_source.md)", [indie](indie.md) software and even [free software](free_software) that's just infected by the toxic capitalist environment and even just design principles down to the level of even [UI](ui.md) design, priorities and development practices and software behavior which have simply been shaped by the capitalist pressure on abusing the user.
Capitalist software is [software](software.md) that late stage [capitalism](capitalism.md) produces and is practically 100% [shitty](shit.md) [modern](modern.md) [bloat](bloat.md) and [malware](malware.md) hostile to its users, made with the sole goal of benefiting its creator (often a [corporation](corporation.md)). Capitalist software is not just [proprietary](proprietary.md) corporate software, but a lot of times "[open source](open_source.md)", [indie](indie.md) software and even [free software](free_software) that's just infected by the toxic capitalist environment -- this infection may come deep even into the basic design principles, even such things as [UI](ui.md) design, priorities and development practices and subtle software behavior which have simply all been shaped by the capitalist pressure on abusing the user.
Basically everyone will agree that corporate software such as [Windows](windows.md) is to a high degree abusive to its users, be it by its spying, unjustified hardware demands, forced non customizability, price etc. A mistake a lot of people make is to think that sticking a free [license](license.md) to similar software will simply make it magically friendly to the user and that therefore most [FOSS](foss.md) programs are ethical and respect its users. This is sadly not the case, a license if only the first necessary step towards [freedom](freedom.md), but not a sufficient one -- other important steps have to follow.

View file

@ -36,7 +36,7 @@ Built-in words include:
GENERAL:
+ add a b -> (a + b)
- substract a b -> (b - a)
- subtract a b -> (b - a)
* multiply a b -> (a * b)
/ divide a b -> (b / a)
= equals a b -> (-1 if a = b else 0)

34
gnu.md
View file

@ -1,6 +1,38 @@
# GNU
GNU (*GNU is Not Unix", a [recursive](recursion.md) acronym) is a project started by [Richard Stallman](rms.md), the inventor of [free as in freedom software](free_software.md), running since 1983 with the goal of creating a completely free (as in freedom) [operating system](os.md), along with other free [software](software.md) that computer users might need. The project achieved its goal of creating an operating system when a [kernel](kernel.md) named [Linux](linux.md) became part of it in the 90s as the last piece of the puzzle -- the system is now known as GNU/Linux. However, the GNU project didn't end and continues to further develop the operating system as well as a myriad of other software projects it hosts. GNU gave rise to the [Free Software Foundation](fsf.md) and is one of the most important software projects in history of computing.
GNU (*"GNU is Not Unix"*, a [recursive](recursion.md) acronym) is a large project started by [Richard Stallman](rms.md), the inventor of [free (as in freedom) software](free_software.md), running since 1983 with the goal of creating a completely free (as in freedom) [operating system](os.md), along with other free [software](software.md) that computer users might need. The project doesn't tolerate any [proprietary](proprietary.md) software. The project achieved its goal of creating a complete operating system when a [kernel](kernel.md) named [Linux](linux.md) became part of it in the 90s as the last piece of the puzzle -- the system is now known as GNU/Linux. However, the GNU project didn't end and continues to further develop the operating system as well as a myriad of other software projects it hosts. GNU gave rise to the [Free Software Foundation](fsf.md) and is one of the most important software projects in history of computing.
The GNU/Linux operating system has several variants in a form of a few GNU approved "Linux" [ditributions](distro.md) such as [Guix](guix.md), [Trisquel](trisquel.md) or [Parabola](parabola.md). Most other "Linux" distros don't meet the strict standards of GNU such as not including any proprietary software. In fact the approved distros can't even use the standard version of [Linux](linux.md) because that contains proprietary [blobs](blob.md), a modified variant called [Linux-libre](linux_libre.md) has to be used.
GNU greatly prefers [GPL](gpl.md) [licenses](license.md), i.e. it strives for [copyleft](copyleft.md), even though it accepts even projects under permissive licenses. GNU also helps with enforcing these licenses legally and advises developers to transfer their [copyright](copyright.md) to GNU so that they can "defend" the software for them.
Although GNU is great and has been one of the best things to happen in software ever, it has its flaws. For example their programs are known to be kind of a [bloat](bloat.md), at least from the strictly [suckless](suckless.md) perspective. It also doesn't mind proprietary non-functional data (e.g. assets in video games) and their obsession with copyleft also isn't completely aligned with [LRS](lrs.md).
## History
TODO
## GNU Projects
GNU has developed an almost unbelievable amount of software, it has software for all basic and some advanced needs. As of writing this there are 373 software packages in the official GNU repository (at https://directory.fsf.org/wiki/Main_Page). Below are just a few notable projects under the GNU umbrella.
- [GNU Hurd](hurd.md) (OS [kernel](kernal.md), alternative to [Linux](linux.md))
- [GNU Compiler Collection](gcc.md) (gcc, compiler for [C](c.md) and other languages)
- [GNU C Library](glibc.md) (glibc, [C](c.md) library)
- [GNU Core Utilities](gnu_coreutils.md) (coreutils, basic utility programs)
- [GNU Debugger](gdb.md) (gdb, [debugger](debugger.md))
- [GNU Binary Utilities](gnu_binutils.md) (binutils, programs for working with binary programs)
- [GNU Chess](gnu_chess.md) (strong [chess](chess.md) engine)
- [GNU Go](gnu_go.md) ([go](go.md) game engine)
- [GNU Autotools](autotools.md) ([build system](build_system.md))
- [CLISP](clisp.md) (common [lisp](lisp.md) language)
- GNU Pascal ([pascal](pascal.md) compiler)
- [GIMP](gimp.md) (image manipulation program, a "free [photoshop](photoshop.md)")
- GNU Emacs ([emacs](emacs.md) text editor)
- [GNU Octave](octave.md) ([mathematics](math.md) software, "free Matlab")
- [GNU Mediagoblin](mediagoblin.md) (decentralized file hosting on the [web](web.md))
- GNU Unifont ([unicode](unicode.md) font)
- [GNU Privacy Guard](gpg.md) (gpg, OpenPGP encryption)
## See Also

View file

@ -1,5 +1,3 @@
# History
It all started about 80000 years ago with ape-people realizing they can use small bones to help them count. It only went downwards from then. { JK but also not really. ~drummyfish }
TODO

View file

@ -1,6 +1,6 @@
# KISS
KISS (Keep It Simple, Stupid!) is a design philosophy that favors simplicity, solutions that are as as simple as possible to achieve given task, and no more. This comes from the fact that higher [complexity](complexity.md) comes with increasing negative effects such as cost of development, cost of [maintenance](maintenance.md), greater probability of bugs and security vulnerabilities. More about this in [minimalism](minimalism.md) article.
KISS (Keep It Simple, Stupid!) is a design philosophy that favors simplicity, solutions that are **as simple as possible** to achieve given task (but no more). This comes from the fact that higher [complexity](complexity.md) comes with increasingly negative effects such the cost of development, cost of [maintenance](maintenance.md), greater probability of bugs and security vulnerabilities. More about this in [minimalism](minimalism.md) article.
Apparently the term originated in the US Army plane engineering: the planes needed to be repairable by *stupid* soldiers with limited tools under field conditions.

18
linear_algebra.md Normal file
View file

@ -0,0 +1,18 @@
# Linear Algebra
In [mathematics](math.md) linear algebra is an extension of the classical elemental algebra ("operations with numbers") to [vectors](vector.md) and [matrices](matrix.md). It is a basic tool of advanced mathematics and [computer science](computer_science.md) and at least at the very basic level should be known by every [programmer](programmer.md).
## The Basics
In "normal" algebra our basic elements are [numbers](number.md); we learn to to add then, multiply then, solve equation with them etc. In linear algebra our elements are [vectors](vector.md) and [matrices](matrix.md) and we learn to perform similar operations with them, even though they sometimes behave a bit different.
Vectors are basically sequences ([arrays](array.md)) of numbers, e.g. a vector of length 3 may be [1.5, 0, -302]. A matrix can be seen as a [two dimensional](2d.md) vector (a 2D array of numbers), e.g. a 2x3 matrix may look like this:
```
|1 2.5 -10|
|24 -3 0 |
```
Why work with vectors and matrices? Because these can represent certain things we encounter in math and programming better than numbers, e.g. vectors may represent points in space and matrices may represent transformations.
With vectors and matrices we can perform similar operations as with normal numbers, i.e. addition, subtraction, multiplication, but there are also new operations and some operations may behave differently. E.g. vectors have two kinds of "multiplication": [dot product](dot_product.md) and [vector product](vector_product.md), and matrix multiplication is non-[commutative](commutativity.md). We can also solve equations with vectors and matrices.

View file

@ -1,8 +1,8 @@
# Linux
Linux is a [FOSS](foss.md) [unix-like](unix_like.md) [operating system](operating_system.md) [kernel](kernel.md), probably the most successful and famous non-[proprietary](proprietary.md) kernel. Linux is NOT a whole operating system, only its basic part -- for a whole operating system more things need to be added, such as some kind of [user interface](ui.md) and actual user programs, and this is what [Linux distributions](linux_distro.md) do (there are dozens, maybe hundreds of these) -- Linux distributions, such as [Debian](debian.md), [Arch](arch.md) or [Ubuntu](ubuntu.md) are complete operating systems (but beware, most of them are not fully [FOSS](foss.md)).
Linux is a "[FOSS](foss.md)" [unix-like](unix_like.md) [operating system](operating_system.md) [kernel](kernel.md), probably the most successful and famous non-[proprietary](proprietary.md) kernel. Linux is NOT a whole operating system, only its basic part -- for a whole operating system more things need to be added, such as some kind of [user interface](ui.md) and actual user programs, and this is what [Linux distributions](linux_distro.md) do (there are dozens, maybe hundreds of these) -- Linux distributions, such as [Debian](debian.md), [Arch](arch.md) or [Ubuntu](ubuntu.md) are complete operating systems (but beware, most of them are not fully [FOSS](foss.md)).
Linux is typically combined with a lot of [GNU](gnu.md) software and the [GNU](gnu.md) project (whose goal is to create a [free](free_software.md) OS) uses Linux as its official kernel, so in the wild we usually encounter the term [GNU/Linux](gnu_linux.md). Some people just can't be bothered to acknowledge the work of GNU and just call GNU/Linux systems "Linux" (without GNU/). **Fuck them**.
Linux is typically combined with a lot of [GNU](gnu.md) software and the [GNU](gnu.md) project (whose goal is to create a [free](free_software.md) OS) uses Linux as its official kernel, so in the wild we usually encounter the term [GNU/Linux](gnu_linux.md). Some people just can't be bothered to acknowledge the work of GNU and just call GNU/Linux systems "Linux" (without GNU/). Fuck them.
Linux is sometimes called [free as in freedom](free_software.md), however it is hardly deserving the label, it is more of an [open-source](open_source.md) or [FOSS](foss.md) project because:
@ -11,9 +11,9 @@ Linux is sometimes called [free as in freedom](free_software.md), however it is
- It doesn't really enforce it's license ([GPL](gpl.md)) legally -- we're not advocating legal battles, but the fact that they entertain a license and then don't use it indicates it may be there just for good image.
- It is [bloat](bloat.md) and in some ways [capitalist software](capitalist_software.md) (just try to fork Linux, maintain it and add/modify actual features).
Nevertheless, despite its mistakes, Linux offers a relatively comfy, powerful and (still) safe [unix](unix.md)/[POSIX](posix.md) environment which means it can be drop-in replaced for another unix-like system without this causing you many trouble, so using Linux is at this point considered OK (until Microsoft completely seizes it at which point we migrate probably to [BSD](bsd.md)). It can be made fairly [minimal](minimalism.md) and [LRS](lrs.md)/[suckless](suckless.md) friendly.
Nevertheless, despite its mistakes, Linux offers a relatively comfy, powerful and (still) safe [unix](unix.md)/[POSIX](posix.md) environment which means it can be drop-in replaced with another unix-like system without this causing you much trouble, so using Linux is at this point considered OK (until Microsoft completely seizes it at which point we migrate probably to [BSD](bsd.md)). It can be made fairly [minimal](minimalism.md) (see e.g. [KISS Linux](kiss_linux.md) and [Puppy Linux](puppy.md)) and [LRS](lrs.md)/[suckless](suckless.md) friendly.
Linux is so called monolithic kernel and is more or less [bloat](bloat.md). However it "[just works](just_works.md)" and has a great [hardware](hardware.md) support so it wins many users over alternatives such as BSD.
Linux is so called monolithic kernel and as such is more or less [bloat](bloat.md). However it "[just works](just_works.md)" and has a great [hardware](hardware.md) support so it wins many users over alternatives such as BSD.
Some alternatives to Linux are:
@ -24,4 +24,14 @@ Some alternatives to Linux are:
## History
TODOOOOOOOOOOO
{ Some history of Linux can be read in the biography of Linus Torvalds called *Just For Fun*. ~drummyfish }
Linux was created by [Linus Torvalds](linus_torvalds.md). He started the project in 1991 as a university student. He read a book about operating system design and [Unix](unix.md) and became fascinated with it. Then when he bought a new no-name PC (4 MB RAM, 33 MHz CPU), he install [Minix](minix.md) on it, a then-[proprietary](proprietary.md) [Unix-like](unix.md) operating system. He was frustrated about some features of Minix and started to write his own software such as terminal emulator, disk driver and [shell](shell.md), and he made it all [POSIX](posix.md) compliant.
Linus originally wanted to name the project *Freax*, thinking *Linux* would sound too self-centered. However the admin of an FTP server that hosted the files renamed it to *Linux*, and the name stuck.
On 25 August 1991 he made the famous public announcement of Linux on [Usenet](usenet.md) in which he claimed it was just a hobby project and that it "wouldn't be big and professional as [GNU](gnu.md)". In November 1991 Linux became [self-hosted](self_hosting.md) with the version 0.10 -- by the time a number of people were already using it and working on it. In 1992, with version 0.12, Linux became [free software](free_software.md) with the adoption of the [GPL](gpl.md) license.
On 14 March 1994 Linux 1.0 -- a fully functional version -- was released.
TODO: moar

View file

@ -1,6 +1,6 @@
# Open Console
{~drummyfish comments: Open consoles are how I got to [suckless](suckless.md) programming, they really taught me about the low-level, about optimizations and how to actually program efficiently on very limited hardware. I recommend you grab one of these.}
{~drummyfish comments: Open consoles are how I got into [suckless](suckless.md) programming, they taught me about the low-level, optimizations and how to actually program efficiently on very limited hardware. I recommend you grab one of these.}
Open consoles are tiny Gameboy-like gaming consoles powered by [free software](free_software.md) and [hardware](free_hardware.md), which have relatively recently seen a small boom. Examples include [Arduboy](arduboy.md), [Pokitto](pokitto.md) or [Gamebuino](gamebuino.md). These are **NOT** the raspberry pi handhelds that run Gameboy emulators.

View file

@ -37,4 +37,6 @@ unsigned int factorial(unsigned int x)
}
```
How do the computers practically make recursion happen? Basically they use a [stack](stack.md) to remember states on each level of the recursion. In programming languages that support recursive function calls this is hidden behind the scenes in the form of [call stack](call_stack.md). This is why an infinite recursion causes stack overflow.
How do the computers practically make recursion happen? Basically they use a [stack](stack.md) to remember states on each level of the recursion. In programming languages that support recursive function calls this is hidden behind the scenes in the form of [call stack](call_stack.md). This is why an infinite recursion causes stack overflow.
Another important type of recursion is **tail recursion** which happens when the recursive call in a function is the very last command. It is utilized in functional languages that use recursion instead of loops. This kind of recursion can be optimized by the compiler into basically the same code a loop would produce, so that e.g. stack won't grow tremendously.

View file

@ -1,6 +1,8 @@
# Slowly Boiling The Frog
*Slowly boiling the frog* is a phrase said to communicate the idea that people will tolerate a great change for the worse if that change is very gradual, even if they would absolutely not tolerate this change being made quickly. For example the amount and aggressiveness of brainwashing [ads](ad.md) and technological abuse that young people tolerate nowadays would have been absolutely unacceptable a few decades ago, but now it's the reality of life that few even question (some complete retards like that *linus tech* [faggot](faggot.md) even defend it).
*Slowly boiling the frog* is a phrase said to communicate the idea that people will tolerate a great change for the worse if that change is very gradual, even if they would absolutely not tolerate this change being made quickly. It refers to an experiment in which a frog doesn't jump out of boiling water if the water temperature is raised very gradually (even though according to "modern science" this experiment isn't real).
For example the amount and aggressiveness of brainwashing [ads](ad.md) and technological abuse that young people tolerate nowadays would have been absolutely unacceptable a few decades ago, but now it's the reality of life that few even question (some complete retards like that *linus tech* [faggot](faggot.md) even defend it).
The technique of slowly boiling the frog is used by [corporations](corporation.md), [governments](government.md), fascists and idiots to slowly take away people's freedom in small steps: each step takes away a bit of freedom while promising some reward, normally in form of additional comfort -- normal people are too braindead to see the obvious trick and are enthusiastic about the change. If you tell them that giving up [net neutrality](net_neutrality.md) or [P2P](p2p.md) encryption will eventually lead to almost complete loss of freedom, they label you a [tinfoil](tinfoil.md) or "conspiracy theorist", they tell you that "it's not a big deal". So it will go on with other and other changes and the normie is still happy because he can only see one step ahead or behind. The bad thing is that it's not only the normie who will suffer --in fact he may even be happy as a slave robot of the system -- but you will suffer as well. Normies decide the future of the environment we all have to live in.

View file

@ -2,11 +2,19 @@
*"The Industrial Revolution and its consequences have been a disaster for the human race."* --Ted Kaczynski
TODO
Ted Kaczynski, known as a *Unabomber*, is an imprisoned American [mathematician](math.md) who lived a simple life in the nature, warned of the dangers of advanced technology and killed several people by mailing them bombs in order to bring attention to his manifesto that famously starts with the words "The Industrial Revolution and its consequences have been a disaster for the human race". Besides being one of the most famous mass murderers he is very well known in the tech community.
Ted was born on May 22 1942 in Chicago. As a kid he was very shy. He was also extremely smart ([IQ](iq.md) measured at 167), skipped a few grades, graduated from Harvard at 20 years old and got a [PhD](phd.md) at 25 at the University of Michigan. Then he became a professor at the University of California, until his resignation in 1969.
Fun fact: at one point he considered a gender change surgery.
In 1971 he moved to a remote cabin in the woods in Montana where he lived in a primitive way with no electricity or running water. He grew more and more disenchanted with the society, especially with its technology and how it's enslaving and destroying humanity. The last straw may have been the moment when a road was built nearby his cabin, in the middle of the nature he loved.
He started sending hand-made bombs to various universities and airports (hence the nickname *Unabomber*, *university and airline bomber*). He managed to kill 3 people and injured dozens of others. He was arrested on April 3, 1996 in his cabin. He got life imprisonment in court.
## Manifesto
The manifesto is named *Industrial Society and Its Future*. Let's start by summarizing it:
The manifesto is named *Industrial Society and Its Future*. In it he refers to his movement as a *Freedom Club* (FC). Let's start by summarizing it:
{ The following is a sum up according to how I personally understood it, there's most likely subjective bias but I did my best. ~drummyfish }

21
unix_philosophy.md Normal file
View file

@ -0,0 +1,21 @@
# Unix Philosophy
Unix philosophy is one of the most important and essential approaches to programming which advocates great [minimalism](minimalism.md) and is best known by the saying that **a program should only do one thing and do it well**. Unix philosophy is a collective wisdom, a set of recommendations evolved during the development of one of the earliest [operating systems](os.md) called [Unix](unix.md), hence the name. Unix philosophy advocates simplicity, clarity, modularity, reusability and composition of larger programs out of smaller programs rather than designing huge monolithic programs as a whole. Unix philosophy, at least partially, lives on in many project and Unix-like operating systems such as [Linux](linux.md), has been wholly adopted by groups such as [suckless](suckless.md) and [LRS](lrs.md) (us), and is even being expanded in such projects as [plan9](plan9.md).
In 1978 [Douglas McIlroy](mcilroy.md) has written a short overview of the Unix system (*UNIX Time-Sharing System*) in which he gives the main points of the system's style; this can be seen as a summary of the Unix philosophy (the following is paraphrased):
1. **Each program should do one thing and do it well**. Overcomplicating existing programs isn't good; for new functionality create a new program.
2. **Output of a program should be easy to interpret by another program**. In Unix programs are chained by so called [pipes](pipe.md) in which one program sends its output as an input to another, so a programmer should bear this in mind. [Interactive](interactive.md) programs should be avoided if possible.
3. **Program so that you can test early, don't be afraid to throw away code and rewrite it from scratch**.
4. **Write and use tools**, even if they're [short-lived](throwaway_script.md), they're better than manual work. Unix-like systems are known for their high [scriptability](script.md).
This has later been condensed into: do one thing well, write programs to work together, make programs communicate via text streams, a universal interface.
{ I have come up with a possible interpretation of Unix philosophy: in short it says there's an upper but also lower limit on complexity. "Do one thing" means the program shouldn't be too complex, we can simplify this to e.g. "Your program shouldn't surpass 10 KLOC". "Do it well" means the programs shouldn't bee too trivial because then it is hardly doing it well, we could e.g. say "Your program shouldn't be shorter than 10 LOC". E.g. we shouldn't literally make a separate program for printing each ASCII symbol, such programs would be too simple and not doing a thing well. We rather make a [cat](cat.md) program, that's neither too complex nor too trivial, which can print any ASCII symbol. ~drummyfish }
## See Also
- [Unix](unix.md)
- [minimalism](minimalism.md)
- [suckless](suckless.md)
- [KISS](kiss.md)

View file

@ -4,4 +4,4 @@ Contributors, list yourselves here if you have made at least one contribution. T
Contributors to this wiki include:
- Miloslav Číž aka drummyfish (https://www.tastyfish.cz)
- Miloslav Číž aka [drummyfish](drummyfish.md) (https://www.tastyfish.cz)