master
Miloslav Ciz 1 month ago
parent 491c5ff885
commit b9fd8d7532

@ -8,5 +8,6 @@ If you make a 42 reference in front of a TBBT fan, he will shit himself.
## See Also
- [bazinga](bazinga.md)
- [thrembo](thrembo.md)
- [foo](foo.md) (similarly overplayed "joke")

@ -6,6 +6,7 @@ Bullshit (BS) is nonsense, arbitrary unnecessary [shit](shit.md) and/or somethin
Some things that are bullshit include:
- anti[cheat](cheating.md)
- [antiviruses](antivirus.md)
- [army](army.md)
- [bureaucracy](bureaucracy.md)
@ -40,6 +41,7 @@ Some things that are bullshit include:
- [states](state.md)
- [UML](uml.md)
- [unions](union.md)
- [wars](war.md)
- ...
OK then, what's not bullshit? Well, things that matter, for example [food](food.md), health, [education](education.md), [love](love.md), [fun](fun.md), [art](art.md), [technology](technology.md), knowledge about the world, [science](science.md), [morality](morality.md), exploration, ...

@ -18,6 +18,18 @@ There are tools for detecting undefined behavior, see e.g. [clang](clang.md)'s U
**No specific [endianness](endian.md) or even encoding of numbers is specified**. Nowadays little endian and [two's complement](twos_complement.md) is what you'll encounter on most platforms, but e.g. [PowerPC](ppc.md) uses big endian ordering.
**Unlike with global variables, values of uninitialized local variables are not defined**. Global variables are automatically initialized to 0 but not local ones -- this can lead to nasty bugs as sometimes local variables WILL be initialized with 0 but stop being so e.g. under different optimization level, so watch out. Demonstration:
```
int a; // auto initialized to zero
int main(void)
{
int b; // undefined value!
return 0;
}
```
**Order of evaluation of operands and function arguments is not specified**. I.e. in an expression or function call it is not defined which operands or arguments will be evaluated first, the order may be completely random and the order may differ even when evaluating the same expression at another time. This is demonstrated by the following code:
```
@ -114,10 +126,26 @@ Of course this applies to other languages as well, but C is especially known for
## Other
Watch out for **operator precedence**! Bracket expressions if unsure, or just to increase readability for others.
Basic things: `=` is not `==`, `|` is not `||`, `&` is not `&&`, array indices start at 0 (not 1) and so on. There are also some deeper gotchas like `a/*b` is not `a / *b` (the first is comment).
Also watch out for this one: `!=` is not `=!` :) I.e. `if (x != 4)` and `if (x =! 4)` are two different things, the first means *not equal* and is usually what you want, the latter is two operations, `=` and `!`, the tricky thing is it also compiles and may work as expected in some cases but fail in others, leading to a very nasty bug. Same thing with `-=` vs `=-` and so on. See also [downto](downto.md) operator.
Another common, mostly beginner mistake is a semicolon after if or while condition -- this compiles but doesn't work correctly. Notice the difference between these two if statements:
```
if (a == b);
puts("aaa"); // will print always
if (a == b)
puts("aaa"); // will print only if a == b
```
Beginners similarly often forget breaks in switch statement, which works but usually not as you want -- thankfully compilers warn you about this.
Watch out for **operator precedence**! C infamously has weird precedence with some special operators, bracket expressions if unsure, or just to increase readability for others. Also nested ifs with elses can get tricky -- again, use curly brackets for clarity in your spaghetti code.
**[Preprocessor](preprocessor.md) can give you headaches** if you use it in overcomplicated ways -- ifdefs and macros are fine, but too many nesting can create real mess that's super hard to debug. It can also quite greatly slow down compilation. Try to keep the preprocessing code simple and flat.
Also watch out for this one: `!=` is not `=!` :) I.e. `if (x != 4)` and `if (x =! 4)` are two different things, the first means *not equal* and is usually what you want, the latter is two operations, `=` and `!`, the tricky thing is it also compiles and may work as expected in some cases but fail in others, leading to a very nasty bug.
Watch out for **[macro](macro.md) arguments**, always bracket them because they get substituted on text level. Consider e.g. a macro `#define divide(a,b) a / b`, and then doing `divide(3 + 1,2)` -- this gets expanded to `3 + 1 / 2` while you probably wanted `(3 + 1) / 2`, i.e. the macro should have been defined as `#define divide(a,b) (a) / (b)`.
This is not really a pitfall, rather a headscratcher, but don't forget to link math library with `-lm` flag when using using the `math.h` library.

@ -10,6 +10,19 @@ This tutorial focuses on teaching pure C, i.e. **mostly just command line text-o
If you do two chapters a day (should take like half and hour), in a week you'll know some basic C.
Potentially supplemental articles to this tutorial are:
- [C](c.md)
- [algorithm](algorithm.md)
- [programming tips](programming_tips.md)
- [programming style](programming_style.md)
- [debugging](debugging.md)
- [exercises](exercises.md)
- [C pitfalls](c_pitfalls.md)
- [memory management](memory_management.md)
- [optimization](optimization.md)
- ...
## About C And Programming
[C](c.md) is
@ -2131,6 +2144,8 @@ This code is almost a bare minimum template for SDL that doesn't even perform an
We haven't nearly covered the whole of C, 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?). Try to develop some consistent programming style/formatting -- see our [LRS programming style](programming_style.md) you may adopt (it's better than trying to make your own really).
See also supplemental articles at the beginning of this tutorial.
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), ...). As an advanced programmer you should definitely know a bit about [memory management](memory_management.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).

@ -6,7 +6,7 @@ Demoscene is a bit of a bittersweet topic: on one side it's awesome, full of bea
Besides "digital graffiti" the scene is also perhaps a bit remotely similar to the culture of street rap in its underground and competitive nature, but of course it differs by lack of improvisation and in centering on groups rather than individuals. Nevertheless the focus is on competition, originality, style etc. But demos should show off technological skills as the highest priority -- trying to "win by content" rather than programming skills is sometimes frowned upon. Individuals within a demogroup have roles such as a [programmer](programmer.md), visual artist, music artist, director, even [PR](pr.md) etc. The whole mindset and relationship to technology within demoscene is much different from the mainstream; for example it's been stated that while mainstream sees computers just as a tool that should just make happen what we imagine, a demoscener puts technology first, he doesn't see computing platforms in terms of better or worse e.g. for its raw computational power, he rather sees a rich world of unique computing platforms, each one with specific personality and feel, kind of like a visual artist sees different painting styles.
A demo isn't a [video](video.md), it is a non-[interactive](interactive.md) [real time](real_time.md) executable that produces the same output on every run (even though categories outside of this may also appear). [Viznut](viznut.md) has noted that this "static nature" of demos may be due to the established culture in which demos are made for a single show to the audience. Demos themselves aren't really limited by resource constraints (well, sometimes a limit such as 4 MB is imposed), it's where the programmers can show off all they have. However compos are often organized for **intros**, demos whose executable size is limited (i.e. NOT the size of the source code, like in [code golfing](golf.md), but the size of the compiled binary). The main categories are 4Kib intros and 64Kib intros, rarely also 256Kib intros (all sizes are in [kibibytes](memory_units.md)). Apparently even such categories as 256 [byte](byte.md) intro appear. Sometimes also platform may be specified (e.g. [Commodore 64](c64.md), [PC](pc.md) etc.). The winner of a compo is decided by voting.
A demo isn't a [video](video.md), it is a non-[interactive](interactive.md) [real time](real_time.md) executable that produces the same output on every run (even though categories outside of this may also appear). [Viznut](viznut.md) has noted that this "static nature" of demos may be due to the established culture in which demos are made for a single show to the audience. Demos themselves aren't really limited by resource constraints (well, sometimes a limit such as 4 MB is imposed), it's where the programmers can show off all they have. However compos are often organized for **intros**, demos whose executable size is limited (i.e. NOT the size of the source code, like in [code golfing](golf.md), but the size of the compiled binary). The main categories are 4 KB intros and 64 KB intros, rarely also 256 KB intros. Apparently even such categories as 256 [byte](byte.md) intro appear. Sometimes also platform may be specified (e.g. [Commodore 64](c64.md), [PC](pc.md) etc.). The winner of a compo is decided by voting.
Some of the biggest demoparties are or were Assembly (Finland), The Party (Denmark), The Gathering (Norway), Kindergarden (Norway) and Revision (Germany). A guy on https://mlab.taik.fi/~eye/demos/ says that he has never seen a demo [female](female.md) programmer and that females often have free entry to demoparties while men have to pay because there are almost no women anyway xD Some famous demogroups include Farbrausch (Germany, also created a tiny 3D shooter game [.kkrieger](kkrieger.md)), Future Crew (Finland), Pulse (international), Haujobb (international), Conspiracy (Hungary) and [Razor 1911](razor_1911.md) (Norway). { Personally I liked best the name of a group that called themselves *Byterapers*. ~drummyfish } There is an online community of demosceners at at https://www.pouet.net.

@ -119,7 +119,7 @@ UU U_U (U_U) U-U (U-U) U~U (U~U) U.U (U.U) UvU (UvU) UwU (UwU) UoU
salutations: o/ \o o7 \o/
8====D {|} ,,|,, (. (. )
8====D {|} ,,|,, (. (. ) ( . Y . )
@}->-- <3 </3
```

@ -1,21 +1,77 @@
# Exercises
**THIS IS CURRENTLY HIGHLY WORK IN PROGRESS**
Here there should be a set of exercise problems for those wishing to pursue [LRS](lrs.md) in any way.
{ Hmmm, it's hard to figure out exactly what to put here. ~drummyfish }
## Programming Projects
Here you will find suggestions for programming projects depending on your skill level.
See also [needed projects](needed.md).
Here you will find suggestions for programming projects, roughly sorted by their difficulty (in each level projects will be sorted roughly by difficulty too). You can use this to practice what you've learned in [c tutorial](c_tutorial.md), try to follow the [LRS](lrs.md) principles. We are kind of assuming you'll be programming these projects in [C](c.md) -- that's how we judge the difficulty etc. -- but of course no one is stopping you to make the project in another language if you so desire :)
**LRS programming challenge!** If you want you can treat this as a [game](game.md), kind of achievements you can collect. You can even make a git repo for your solutions so others can see and admire them { Pls send me the repo if you make it. ~drummyfish } Here are the rules:
- Award yourself points like this:
- 1 point for a completed project in level 0.
- 4 points for a completed project in level 1.
- 16 points for a completed project in level 2.
- 64 points for a completed project in level 3.
- If you complete all projects in level *N*, you can automatically consider all projects of all lower levels completed as well, i.e. if you complete level 2, count yourself whole level 1 and 0 as well.
- A project is considered completed only if you really complete all the requirements! It is not enough to say "mmm, I could do this if I wanted" -- no, you have to REALLY DO IT to count. If the requirement is to make a complete game, a buggy demo doesn't count. Also if you just use some cheat, use 100 libraries to do everything for you, you know you didn't really complete it :) Just be honest with yourself.
- You CANNOT award yourself partial points, i.e. if you meet 90% of requirements for some project, you CANNOT give yourself 90% points for it, not even one point. Complete it 100%, then get 100% points. Again, it doesn't count to say "mmm, I could finish this if I wanted" -- no, until you finish it, it's not finished. This is part of the challenge and insisting on it also makes you potentially make a nice, tidy program that will increase good in the world ;)
- You may reuse your own code without it counting as third party library, i.e. if you write 3D renderer in one project, you can use it in writing 3D game as another project, with it counting as if you wrote everything from scratch just for that project.
- Don't [cheat](cheating.md), you're only cheating yourself :)
### Level 0: Trivial, *Piece Of Cake*
1. **hello world**: Make a program that outputs `hello world`.
2. **counting**: Make a program that outputs numbers from 1 up to 100.
3. **guess a number**: Make a game in which the computer secretly thinks a number from 0 to 9 and the player guesses the number. The computer then says if the player won and what the secret number what.
4. **password generator**: Make a program which when run outputs randomly generated password (the password must be different each time you run the program of course). The password must be at least 10 characters long, contain at least one decimal digit and one special character.
### Level 1: Easy, *I'm Too Young To Die*
1. **[fizzbuzz](fizzbuzz.md)**: Write the classic fizzbuzz program.
2. **number [encyclopedia](encyclopedia.md)**: Make a program that writes number from 0 to 1000 (including both) and about each of which it writes some facts. These facts have to include at least the number's square, square root, sum of its decimal digits, its [binary](binary.md) representation, prime factorization and whether the number is [prime](prime.md), perfect number and [Fibonacci](fibonnaci.md) number.
3. **[brainfuck](brainfuck.md) interpreter**: Make a program that interprets brainfuck. You may choose to read the input program either from standard input or from a file (the file may have some hardcoded name, e.g. your program will just look for a file `program.bf` in the same directory). If the brainfuck program is invalid or runtime error occurs in it, you may just write out `error` and halt your interpreter. Thumbs up for making the interpreter nicer, e.g. allowing to pass input file name as a CLI argument, reporting more details about errors (e.g. its position in source code) and so on.
4. **[game of life](game_of_life.md)**: Make a program that simulates game of life on a finite *N * N* grid, with wrapping (i.e. a cell on the very left of the grid is considered a neighbor of the cell on the very right in the same row, same thing with top and bottom). Make *N* configurable at least as a compile time option, draw the world as [ASCII art](ascii_art.md) to terminal, make the user step forward by pressing some key. You can initialize the grid values randomly, but thumbs up for allowing setting the initial world state (e.g. reading it from a file or something).
5. **text adventure**: Make an interactive [CLI](cli.md) text adventure that will take an average player at least 10 minutes to finish. Part of game mechanics must involve inventory, i.e. picking up items, carrying them around and using them.
6. **calculator**: Make an interactive calculator -- it can be a purely [command line](cli.md) program into which user types expressions and your program evaluates them. The functionality must be at least on the level of the most plain physical calculators, i.e. it doesn't have to parse whole complex expressions, but it should be able to add, subtract, multiply, divide and find square roots. Results can be approximate, showing just 3 fractional decimal digits. Thumbs up for more features like handling expressions with brackets, converting between bases and so on.
### Level 2: Mid, *Hurt Me Plenty*
1. **[chess](chess.md) without AI**: Make a program that allows two human players to play chess, AI is not required. It can be just a CLI program that draw the chessboard to terminal and reads moves by having players type the squares. Of course the program mustn't allow illegal moves, it must know if the game ended, who won (or if it's a draw) and so on. Implement all rules correctly, i.e. don't forget en passant, castling rights and so on. Time controls are not required at all. Thumbs up for some basic recording of games, undos, showing playable squares or even having some kind of stupid AI (can just make random moves).
2. **2D game**: Make a complete 2D game in which you control a character, with at least 5 levels. Genre is up to you, recommended is e.g. platformer or top-down shooter. Sounds are not required but thumbs up if you have them.
3. **[gopher](gopher.md) browser**: Write interactive gopher browser -- it can be a purely [command line](cli.md) browser. It has to be able to follow links and go back at least one page. The program must include some basic help and ability to save files to disk.
4. **simple text [compression](compression.md)**: Write a program that can compress and decompress plain [ASCII](ascii.md) text files using some very simple technique like [run length encoding](rle.md) (RLE) or dictionary methods (you can even use a fixed dictionary, e.g. have a list of common English words that you will represent by some shorter symbols). You can assume input characters will only have 7bit ASCII codes, so you can compress the text also by dropping the 8th unused bit. You don't have to achieve great compression ratio (you can even enlarge some files), but you must pass the following test: take the program's source code, this article's plain text and Wikipedia main page plain text, your program must compress at least two of these to a smaller size (and of course successfully decompress them into identical files). The program must work as a [filter](filter.md), i.e. it mustn't load the whole file into memory, it has to use approximately same amount of RAM for input of any size.
4. **stupid chatbot**: Make an entertaining chatbot that can react to basic sentences like "how are you?", "are you a robot?" and so on. It must give a human-like answer to at least 20 different sentences. It has to deal with typos and text variability a little bit and has to have some kind of memory (for example it can remember the name of its chatting partner). Test the bot by having it chat with itself.
5. **arbitrary size numbers**: Make a library that allows working with arbitrary size [fixed point](fixed_point.md) [numbers](number.md), i.e. you will provide a data type in which it is possible to store a binary number with any number of bits before and after the radix point -- size of the number will only be limited by amount of RAM your program can use. Each number will dynamically allocate as much memory as it needs. Additionally implement these operations with the numbers: converting to/from the language's native numbers (with rounding), printing and/or converting the number to string, addition, subtraction, multiplication and dividing.
6. **image to [ASCII art](ascii_art.md)**: Make a program that takes an RGB bitmap image and renders it with ASCII characters (i.e. prints it out to console). You can support loading the image from just one file format of your choice, possibly something simple like PPM, BMP or Farbfeld. The program must support resizing the image and it must allow to just set one dimension with keeping the aspect ratio.
### Level 3: Hard, *Ultra Violence*
1. **non-trivial [programming language](programming_language.md)**: Design language *L* and make an interpreter for it. *L* must be [Turing complete](turing_complete.md) and you have to provide mathematical proof of it. *L* must allow [recursive](recursion.md) function calls. It must not support native [OOP](oop.md). *L* must be usable for programming very basic things -- show it is so by writing [bubble sort](bubble_sort.md) in it. Write [quine](quine.md) in it.
2. **radiation hardened quine**: Without looking it up, write radiation hardened [quine](quine.md) in some language. Quine is a program that outputs its own source code (don't cheat, you can't read it from the source file), radiation hardened quine is a quine that remains a quine if you remove any single character from the program.
3. **3D game**: Make a complete game with 3D graphics from 1st or 3rd man perspective that will have at least half an hour worth of gameplay time -- the gameplay can really be 2D (e.g. like [wolf3D](wolf3d.md)) but the graphics must be judged as 3D by average guy who sees the game. If your platform allows it at all, it must have basic sounds (no need for music, but e.g. shooting should at least make beeps and so on). The genre is up to you, it can be a shooter, platformer, RPG or anything where you control a character moving through 3D world. For the 3D graphics you can either use a 3D library, in which case you HAVE TO implement textured graphics (the textures may be [procedural](procgen.md) if you want), or you can write your own renderer. If you write custom renderer, then if it's a "true 3D", it can have just flat, untextured graphics; if it's a "[pseudo 3D](pseudo3d.md)" (like raycasting or BSP, ...), it must have at least some texturing (e.g. walls).
4. **textured 3D [software renderer](software_rendering.md)**: Make 3D software renderer that rasterizes triangles (just like for example [OpenGL](ogl.md)), with texturing. Affine texture mapping (i.e. the easier, incorrect texturing by linear interpolation of texturing coordinates in screen space) will pass, but thumbs up for perspective correct texture mapping. Implement some basic [shading](shading.md) like, e.g. Goraud with ambient and diffuse light. You have to handle visibility even of non-convex shapes, e.g. with z-buffer or at least approximately by sorting triangles. It's enough if you can display some textured model with setting camera position and rotation somehow. You don't have to handle any 3D formats, 3D models can just be passed as arrays of numbers. It is enough if you output static images e.g. to a file, but thumbs up for being able to handle real-time rendering, animation and having extra features like transparency, scene graph and so on. Extra thumbs up for not using [float](float.md).
5. **[regular expression](regex.md) library**: Make a library for working with regular expressions. Implement at least the following operations: search of regular expression, substitution of regular expressions WITH capture groups and generating random strings by regular expression.
6. **[chess](chess.md) [AI](ai.md)**: Use any sane approach to write a chess engine of reasonable strength. No, you can't just fork stockfish, write it from scratch. It has to support xboard or UCI interface, the strength must be such that it beats [smolchess](smallchesslib.md), Maia 1500, GNU chess, Dreamer, Stockfish or similar engine in a 10 game match with both engines having equivalent settings (search depth, time for move etc.); alternatively it can pass by getting stable rating over 1600 on lichess or by beating someone with FIDE rating over 1500 in a 10 game match. You get the idea.
7. **Bitmap image editor**: [GIMP](gimp.md) is bloated! You have to save us by writing a GUI image editor that's at least a bit more advanced than the original MS paint. It has to be able to save and load images (supporting just one format is enough), draw basic shapes (at least a line, rectangle and circle), copy/paste parts of the image (with rectangle select), resize the image as a whole (with scaling it), have fill bucket and adjust brightness and contrast of the whole image. It should be reasonably user friendly, i.e. upon quitting it should ask if you want to save the work etc. Thumbs up for extra features like filters (blur, invert, edge detect, ...), layers and so on.
8. **64K intro**: Make an impressive [demoscene](demoscene.md)-style 3D intro with music that's at least 1 minute long and fits into 64 KB. It has to be good enough so that an average demoscener would approve it as not completely laughable.
### Easy
### Level 4: God Tier, *!Nightmare!*
- TODO
1. **3D [physics engine](physics_engine.md) without [floating point](float.md)**: Warm up for the god tier by making a 3D physics engine without using floating point, usable in real time. It must support complex shapes, i.e. not just plain spheres ;) The engine can use rigid body or soft body physics, or both. It doesn't have to be physically accurate but should produce results that an average observer will judge realistic enough for a game.
2. **[operating system](operating_system.md)**: Make a whole [self hosted](self_hosting.md) operating system with your own custom kernel, with basic [GUI](gui.md) and tools such as a text editor, file browser and programming language compiler. Throw in some games because without them your OS will be boring. Run the OS on real hardware. It doesn't have to support networking, sound, USB and similar bloat, but thumbs up if you manage even that.
3. **[MMORPG](mmorpg.md)**: Make both client and server for an MMORPG game. The game has to support 3D graphics (but can also have 2D frontends) and have some basic lore that makes sense. Remember, it is MASSIVELY multiplayer game, so you have to be able to handle at least 1000 players connected at the same time on some kind of affordable computer. There must be chat, PvP and PvE combat. Thumbs up for releasing it all under [CC0](cc0.md).
4. **[Python](python.md)**: Implement the Python programming language, INCLUDING its whole standard library. Bonus points for finishing before the version you are implementing stops being supported.
5. **ruin [bitcoin](bitcoin.md)**: Make a program that can mine one bitcoin by running for at most one minute on any consumer laptop released before year 2010. Warning: this is probably unsolvable, but if you solve it you may help save the planet :P
### Medium
TODO: text editor, demo, tetris, voice synth?, snake, JPG like compression, quadratic equation, compression, 2D raycasting, fourier transform, primes, image library, web browser, arbitrary size int, diff, MD parser, sudoku solver/generator, bytebeat, markov chain, grep, some kinda server, chatbot, function plotter, raytracer, pi digits, 2D physics engine, encryption?, procedural MIDI, machine translation?, language recognizer, search engine, AI?, ...
- TODO
-
### Hard
## Quiz
- TODO
TODO: some questions + answers here

@ -14,7 +14,9 @@ Despite the extremely bad situation not all hope is lost. At least in the world
- Generally just avoiding the hyped "modern" "feature-rich" ([bloated](bloat.md)) technology arising from the consumerist market.
- ...
Please take a look at the table below that hopefully shows some sort of a pattern repeating in software development [history](history.md):
Just **think**. To see how likely your program is to die in short time just ponder for a while: what parts is it composed of and how likely is each of them to continue functioning and be fixed if it breaks? It's really like with a house or car. Notice that probability of breaking increases with complexity and probability of fixing decreases with complexity (because a fix has a higher cost -- it needs more time, energy, skill and so on). Is your program written in a simple language for which there already exist 10 compilers and which can be implemented again in a month if needed? Then the program is not likely to die by compiler or anything that may kill a compiler, such as a different operating or a new CPU architecture. Is it written in a 5 year old language that's still changing under your hands, has a single compiler and which itself relies on 100 highly complex libraries? Chances of death are great, it is certain your program will break with the next update of the language, or the one after that, you'll have to be around to fix it, and then a month later and then another month and so on until you die, for every program you have written in this language. Does your program only need two libraries, both of which can easily be replaced by something else by only rewriting 10 lines of code? Then your program likely won't die because of these libraries! Does your program use 10 very convenient but complex libraries, each of which additionally uses 10 other libraries itself? In a simplified way you can see your program depending on 100 other libraries now, if a chance of one such library breaking during one year is 1%, the chance of your program breaking in one year is 1 - 0.99^100 ~= 63%; if it doesn't break this year, then the next or the one after that -- yeah, someone will likely fix a library that breaks, but maybe not, projects get abandoned out of burnout, boredom, in favor of new ones etc., and a fix of your dependency may also come with the need for you to be around and update your own program because of API change. Does your program depend on piece of consumerism hardware that in 2 years will stop being supported? Or some specific operating system or Internet service posing similar dangers? This is additional thing on your list to watch, else your program dies. If your program is broken without you being around, how likely will it be fixed by someone? How many people in the world will be capable and willing to fix it? If the program is simple, likely any average programmer will be able to fix it and if the fix takes 10 minutes of time, someone will most likely do it just out of boredom. If your program is 100 thousands lines of code long, requires knowledge of 10 specific framework APIs and its inner architecture just to modify anything of importance, average programmer won't be able to fix it, he won't even attempt it -- if there is someone able to do the job, he won't fix it unless someone pays him a lot of money. Your program is basically dead.
Please take a look at the table below, maybe you'll be able to extract some patterns repeating in software development [history](history.md):
| technology | description | born | dead |
| ------------------- | --------------------------------------------------------------------------------------------------- | -------------- | ----------------------------- |

@ -161,6 +161,7 @@ This is a summary of some main guidelines on how an LRS supporter should behave
- **NEVER, NEVER go into debt**: Even if you should live under a bridge, if you aren't in debt you're still good -- better than most people probably. Debt is how the system enslaves you, so never take any loans or make unplanned children you would be obliged to pay for etc., it will force you to bow to the system, take unethical jobs, forget your morals. If you're already in debt, make it number one priority to pay it off ASAP. If you're in debt that would take too long or forever to pay off, your only option is just to burn your ID and run off to the woods, the system will now see you as a free slave, someone who can be forced to labor without sleep or just killed, you can no longer rely on any help from it.
- PRO TIP: A great [heuristic](heuristic.md) for making life decisions is to **usually do the exact opposite of what the society tells you to do** -- it works because society only wants to exploit you, so it pushes you towards bad decisions. This doesn't hold always, of course, don't just blindly act in opposites (there may be "double bluffs" also..., but mostly there aren't as most people just follow direct orders), but it's a good decision helper in about 99% cases. For example if society tells you "increase your social media presence", you should really completely leave social media, if it tells you "boost your carrier", you should stop working, if it tells you "go vote", you shouldn't go vote etcetc.
- PRO TIP: **Get yourself [banned](ban.md) on toxic platforms** like [Wikipedia](wikipedia.md), [GitHub](github.md), [Steam](steam.md), [4chan](4chan.md) etcetc., it has many advantages -- you gain [freedom](freedom.md) (no longer having to care about platform you are banned on), the platform loses one user/slave (you), you stop being abused by the platform, it's also [fun](fun.md) (just find some creative way to get banned, possibly cause uprising on the platform, make mods angry and waste their time on cleaning up your mess), it will make you become more self sufficient and you help decentralize the Internet again (can't edit Wikipedia? Just make your own :-]), it will make you find better places, you may also help bring the toxic platform down (others will see the platform utilizes censorship, some may follow you in leaving...) etcetc.
- **Accept [death](death.md)** -- no, don't kill yourself, just accept death will come, maybe tomorrow, maybe in one hour, for you or for anyone you love. Constantly live with thought of death and get comfortable about it, you have to be ready to die at any moment and stop being too adraid of it, then you become really [free](freedom.md). Nowadays most people have panic fear of death which is similar to e.g. having panic phobia of germs -- no one wants go get sick, but if you're so gravely scared of catching any disease, you're enslaved, crippled, your life is limited, you can't do what you'd like to do. With death it's the same: try to live but don't let death scare you so much as to limit you in what you can say or do. Take a look at men who firmly stood behind their beliefs such as [Einstein](einstein.md), Seneca or Socrates, they all accepted death when it came and took it even if they could have avoided it; they are examples of highest mental freedom. Again, do NOT fucking kill yourself, that's a bad idea, just be ready for death and don't get dreadfully scared of it, it's not far away, it is probably just behind the next corner. { Regularly watching gore videos helps with this a bit. ~drummyfish }
- ...
### How To Look

@ -12,6 +12,8 @@ In the past JavaScript was only a **[client](client.md) side** scripting languag
[jQuery](jquery.md) is a very popular [library](library.md) that's often used with JavaScript. It's kind of a universal library to do things one often wants to do. We mention it because everyone around JavaScript just supposes you'll be using it.
**Why is it called JavaScript if it has nothing to do with Java?** Simply put the name was chosen because back then Java was the big thing and they wanted to show that JavaScript is kind of similar but complementary, the developers of the languages were associated with each other and they thought it would be good [marketing](marketing.md) to associate the languages through naming, but of course the languages are completely different.
TODO: some more shit
## JavaScript Fun
@ -77,7 +79,7 @@ function go()
</html>
```
TODO: some JS nonsense like below
TODO: some JS nonsense like below (https://wtfjs.com/)
```
"11" + 1 // "111"

File diff suppressed because one or more lines are too long

@ -2,4 +2,24 @@
*What if [pseudocode](pseudocode.md) was actually code?*
TODO
Python (name being a reference to Monty Python) is an exceptionally [bloated](bloat.md), extremely popular [high level](abstraction.md) [interpreted](interpreter.md) [programming language](programming_language.md). Its priority is readability and making it easy and fast to bash together some code for anyone with at least one brain hemisphere, so it is eminently popular among beginners, children, [women](woman.md), non-programmers such as scientists and unqualified [soydevs](soydev.md) who can't handle real languages like [C](c.md). Python [just werks](just_werks.md) and is comfortable, but any program written in it is doomed to be bloated, slow, ugly, big and will unavoidably die without [maintenance](maintenance.md) for Python's updates purposefully break [backwards compatibility](backwards_compatibility.md). At this moment it is the language most frequently used for programming "neural net [AI](ai.md)s".
Python was conceived in 1991 by a Dutchman Guido van Rossum who announced it on [Usenet](usenet.md). Version 1.0 was released in 1994 and version 2.0 in 2000. A very important version was 2.7 released in 2010 -- this was used and supported for a long time but the support was ended in 2020 in favor of Python 3. As of writing this the latest version is 3.9.
**Can [we](lrs.md) use python?** There are certain use cases for it, mostly writing [throwaway scripts](throwaway_script.md) and other quick, temporary code. Python can easily help you get into programming as well, so it may well serve as an educational language, however be sure to transition to a better language later on. Remember, **python mustn't ever be used for a serious program**.
The reference implementation, *CPython*, is at the same time the one in most widespread use; it is written in [C](c.md) and python itself. There also exist different implementations such as *MicroPython* (for [embedded](embedded.md)), PyPy (alternative implementation, often faster), Jython and so on.
What follows is a summary of the python language:
- Emphasis is on **"readability"** and comfort, with a bit of stretch the aim is to create a "runnable [pseudocode](pseudocode.md)". To this end is sacrificed performance, elegance, maintainability and other important aspects.
- It is **[interpreted](interpreter.md) and highly dynamic**, i.e. data types of variables are dynamic, [lists](list.md), [strings](string.md) and [dictionaries](dict.md) are dynamic, since new versions there are even **arbitrary size integers** by default. There is automatic **[garbage collection](garbage_collection.md)**, code can be modified at run time and so on. All this of course makes the language **slow**, with big memory footprint.
- There is **class-based [OOP](oop.md)** which can at least be avoided, it is not enforced.
- Python **revolves around [dictionaries](dictionary.md)** (a [data type](data_type.md) capable of storing *key:value* pairs), i.e. most things are internally implemented with dictionaries.
- It **doesn't keep backwards compatibility**, i.e. new versions of Python won't generally be able to run programs written in old versions of Python. This is so that the devs can eliminate things that turned out to be a bad idea (probably happens often), but of course on the other hand you have to [keep rewriting](maintenance.md) your programs to keep them working (python provides scripts that help automatize this).
- Quite retardedly **indentation is part of syntax**, that's a [shitty](shit.md) design choice that complicates programming (one liners, minification, compact code, [code golf](golf.md), temporary debugging indentation, ...).
- There is **no specification** per se -- but at least there is online reference (*The Python Language Reference*) that kind of serves as one.
- It has a **gigantic standard library** which handles things such as [Unicode](unicode.md), [GUI](gui.md), [databases](database.md), [regular expressions](regex.md), [email](email.md), [html](html.md), [compression](compression.md), communication with operating system, [networking](network.md), [multithreading](multithreading.md) and much, much more. This means it's almost impossible to implement Python in all its entirety without 100 programmers working full time for at least 10 years.
- There are many other **smaller fails**, e.g. inconsistent/weird naming of built-in commands, absence of switch statement (well, in new versions there is one already, but only added later and looks kinda shitty) etc.
TODO: code, compare to C

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -3,12 +3,12 @@
This is an autogenerated article holding stats about this wiki.
- number of articles: 569
- number of commits: 755
- total size of all texts in bytes: 3502006
- total number of lines of article texts: 27660
- number of commits: 756
- total size of all texts in bytes: 3524906
- total number of lines of article texts: 27775
- number of script lines: 262
- occurences of the word "person": 8
- occurences of the word "nigger": 67
- occurences of the word "nigger": 71
longest articles:
@ -35,60 +35,77 @@ longest articles:
top 50 5+ letter words:
- which (2018)
- there (1505)
- people (1335)
- other (1098)
- which (2028)
- there (1517)
- people (1339)
- other (1105)
- example (1058)
- software (1032)
- software (1035)
- number (954)
- about (915)
- their (759)
- program (756)
- called (713)
- about (918)
- program (786)
- their (761)
- called (714)
- because (688)
- computer (687)
- would (685)
- because (683)
- simple (658)
- being (650)
- things (639)
- numbers (639)
- language (618)
- without (610)
- would (686)
- simple (661)
- being (657)
- things (643)
- numbers (640)
- language (630)
- without (614)
- function (609)
- programming (600)
- however (587)
- something (573)
- these (568)
- different (558)
- system (526)
- world (525)
- games (522)
- should (516)
- point (509)
- programming (608)
- however (588)
- something (577)
- these (572)
- different (562)
- world (531)
- system (529)
- games (523)
- should (518)
- point (511)
- society (504)
- doesn (494)
- though (491)
- doesn (488)
- memory (483)
- drummyfish (464)
- while (463)
- memory (485)
- while (466)
- drummyfish (466)
- using (456)
- technology (454)
- still (444)
- simply (442)
- similar (440)
- course (440)
- still (445)
- course (445)
- simply (443)
- similar (443)
- possible (434)
- really (400)
- really (407)
- computers (398)
- extremely (394)
- usually (390)
- value (386)
- basically (385)
- https (396)
- extremely (395)
- usually (391)
- value (388)
latest changes:
```
Date: Sun Mar 31 20:21:22 2024 +0200
3d_model.md
acronym.md
anarch.md
bootstrap.md
duke3d.md
emoticon.md
openarena.md
physics_engine.md
random_page.md
shit.md
suckless.md
usa.md
wiki_pages.md
wiki_stats.md
wikipedia.md
wow.md
Date: Sat Mar 30 22:07:31 2024 +0100
compression.md
determinism.md
@ -107,33 +124,12 @@ Date: Sat Mar 30 22:07:31 2024 +0100
wiki_stats.md
youtube.md
Date: Sat Mar 30 00:11:50 2024 +0100
4chan.md
ascii_art.md
bullshit.md
c_tutorial.md
communism.md
diogenes.md
distrohopping.md
dog.md
emoticon.md
encyclopedia.md
free_software.md
history.md
infinity.md
interesting.md
internet.md
kwangmyong.md
lmao.md
love.md
main.md
minigame.md
number.md
```
most wanted pages:
- [data_type](data_type.md) (12)
- [embedded](embedded.md) (11)
- [data_type](data_type.md) (13)
- [embedded](embedded.md) (12)
- [buddhism](buddhism.md) (11)
- [array](array.md) (11)
- [quake](quake.md) (10)
@ -155,18 +151,18 @@ most wanted pages:
most popular and lonely pages:
- [lrs](lrs.md) (267)
- [lrs](lrs.md) (269)
- [c](c.md) (200)
- [capitalism](capitalism.md) (197)
- [c](c.md) (196)
- [bloat](bloat.md) (196)
- [bloat](bloat.md) (197)
- [free_software](free_software.md) (162)
- [game](game.md) (133)
- [game](game.md) (134)
- [suckless](suckless.md) (131)
- [proprietary](proprietary.md) (114)
- [kiss](kiss.md) (91)
- [modern](modern.md) (87)
- [minimalism](minimalism.md) (86)
- [computer](computer.md) (85)
- [computer](computer.md) (86)
- [linux](linux.md) (84)
- [programming](programming.md) (79)
- [free_culture](free_culture.md) (79)
@ -175,17 +171,18 @@ most popular and lonely pages:
- [public_domain](public_domain.md) (74)
- [gnu](gnu.md) (74)
- [foss](foss.md) (73)
- [censorship](censorship.md) (71)
- [censorship](censorship.md) (72)
- [hacking](hacking.md) (70)
- [art](art.md) (69)
- [programming_language](programming_language.md) (68)
- [fight_culture](fight_culture.md) (68)
- [programming_language](programming_language.md) (67)
- [shit](shit.md) (67)
- [less_retarded_society](less_retarded_society.md) (67)
- [shit](shit.md) (66)
- [bullshit](bullshit.md) (66)
- [float](float.md) (63)
- [open_source](open_source.md) (61)
- [chess](chess.md) (62)
- ...
- [trusting_trust](trusting_trust.md) (4)
- [trump](trump.md) (4)
- [tom_scott](tom_scott.md) (4)
- [speech_synthesis](speech_synthesis.md) (4)
@ -207,7 +204,6 @@ most popular and lonely pages:
- [gigachad](gigachad.md) (4)
- [gaywashing](gaywashing.md) (4)
- [f2p](f2p.md) (4)
- [exercises](exercises.md) (4)
- [dungeons_and_dragons](dungeons_and_dragons.md) (4)
- [dick_reveal](dick_reveal.md) (4)
- [deferred_shading](deferred_shading.md) (4)

@ -1,7 +1,9 @@
# Yes They Can
*"The bigger the lie, the more it will be believed."* --[Joseph Goebbels](goebbels.md), NSDAP minister of propaganda
*"The bigger the lie, the more it will be believed."* --[Joseph Goebbels](goebbels.md), [NSDAP](nazism.md) minister of propaganda
If you think [they](they.md) can't do something, you are wrong; unless it is directly violating a law of physics, they can do it. For example you may think "haha they can't start selling air, people would revolt", "hahaaa, they can't make people believe 1 + 1 equals 2000, it's too obvious of a lie" or "hahaaa they can't lie about history when there is a ton of direct evidence for the contrary freely accessible on the internet, they can't censor something that's all over the internet and in billions of books" -- yes, they can do all of this. With enough [capitalism](capitalism.md) you can make people believe a circle to be square, they have already made people desire their everyday torture, they made people believe colors and offensive statistics are just culturally constructed hallucinations, feminists have already made people widely believe a woman can beat an adult man -- a naive man of the past would likely believe this to be impossible as well. Well, we see under capitalism it is quite possible.
If you think [they](they.md) can't do something, you are wrong; unless it is directly violating a law of physics, they can do it. For example you may think "haha they can't start selling air, people would revolt", "hahaaa, they can't make people believe 1 + 1 equals 2000, it's too obvious of a lie" or "hahaaa they can't lie about [history](history.md) when there is a ton of direct evidence for the contrary freely accessible on the Internet, they can't [censor](censorship.md) something that's all over the Internet and in billions of books" -- yes, they can do all of this. With enough [capitalism](capitalism.md) you can make people believe a circle to be square, they have already made people desire their everyday torture, they made people believe colors and offensive statistics are just culturally constructed hallucinations, [feminists](feminism.md) have already made people widely believe a woman can beat an adult man -- a naive man of the past would likely believe this to be impossible as well. Well, we see under capitalism it is quite possible.
Resisting overlords is always futile in the end, the only hope is to establish [society without overlords](anarchism.md). You think "hahaha, if we create this super encrypted/decentralized computer network, we can simply communicate and they can do nothing about it, BAZINGA" -- well, no you can't. How can they stop this? They will simply ban computers you idiot, in fact you have only given them the reason to. You say "hahaha but I can have this calculator in my basement hidden" -- well, how many people will participate in your network if revealing such participation is punished not only by death sentence, but death sentence for you whole family; if even people who know about you participating in the network and not reporting you face the same punishment (already the case in some pseudocommunist countries)? If in addition people have no free time, if they don't have electricity at home, no will to live and there are also government signal jammers everywhere just in case? Enjoy your guerrilla resistance network with three people. You say "bbbb...but that cant happen ppl would revolt" -- NO. Have you seen chicken at chicken farm revolt? (Except in that one movie lol). "BBBb...BUT... people are not chicken". NO. People are literally physically chicken (to a stupid argument you get stupid counterargument).
Resisting overlords is always futile in the end, the only hope is to establish [society without overlords](anarchism.md). You think "hahaha, if we create this super encrypted/decentralized computer network, we can simply communicate and they can do nothing about it, BAZINGA" -- well, no you can't. How can they stop this? They will simply ban [computers](computer.md) you idiot, in fact you have only given them the reason to. You say "hahaha but I can have this calculator in my basement hidden" -- well, how many people will participate in your network if revealing such participation is punished not only by death sentence, but death sentence for you whole family; if even people who know about you participating in the network and not reporting you face the same punishment (already the case in some pseudocommunist countries)? If in addition people have no free time, if they don't have electricity at home, no will to live and there are also government signal jammers everywhere just in case? Enjoy your guerrilla resistance network with three people armed with calculators. You say "bbbb...but that cant happen ppl would revolt" -- NO. Have you seen chicken at chicken farm revolt? (Except in that one movie lol). "BBBb...BUT... people are not chicken". NO. People are literally physically chicken (to a stupid argument you get stupid counterargument).
They can also kill you, take all your money, rape you, lobotomize you, take your identity and all property and just do anything they please. No, it doesn't matter it's illegal, are you really naive like a 5 year old that hasn't seen the real world for 1 second yet?

@ -4,7 +4,7 @@ YouTube (also JewTube { Lol jewtube.com actually exists. ~drummyfish} or just YT
{ https://www.vidlii.com seems alright though, at least as a curiosity. Anyway if you need to watch YouTube, do not use their website, it's shitty as hell and you will die of ad cancer, rather use something like invidious or youtube-dl. Here is an **awesome hack I discovered to search only old videos on youtube**! The new shit is just unwatchable, there's clickbait, sponsors, propaganda, SJW shit everywhere, thankfully you can just exclude any year from the search with with "-year" (at least for now), for example: https://yewtu.be/search?q=free+software+-2023+-2022+-2021+-2020+-2019+-2018+-2017+-2016+-2015+-2014+-2013+-2012+-2011+-2010+-2009&page=1&date=none&type=video&duration=none&sort=relevance. Enjoy. ~drummyfish }
**What are the alternatives to YouTube?** We'll only leave a brief paragraph here for wannabe YouTube alternatives come and go faster than a [zoomer](zoomer.md) changes genders. Best alternative to watching videos is reading [books](books.md) or watching clouds in the sky, but we'll stick to "watching videos on the Internet" here. Also bear in mind that if you have to watch YouTube, use alternative YouTube [frontends](frontend.md), which are normally [FOSS](foss.md) -- e.g. Invidious, HookTube or FreeTube -- these let you access YouTube's videos via less [bloated](bloat.md) and more "privacy-friendly" interface, also filtering out ads and so on, more hardcore people use [CLI](cli.md) tools such as [youtube-dl](youtube_dl.md) to directy download the videos and watch them in native players. Likely the most notable [FOSS](foss.md) alternative to YouTube is **[PeerTube](peertube.md)**, a [federated](federation.md) [P2P](p2p.md) video platform, however for intended use it requires [JavaScript](javascript.md) (there is a way to download videos without JS but it's discouraged) and there are other issues that make it unusable ([SJW](sjw.md) censorship, videos load extremely slowly, ...). If you use PeerTube, don't use the lesbian instances, look up the uncensored ones. Mainstream proprietary alternative to YouTube is Vimeo, Bitchute is the "rightist" YouTube alternative (quite shitty TBH). [Internet Archive](internet_archive.md) has many video, especially old ones -- this is quite nice alternative. Vidlii is proprietary but oldschool site that tries to replicate old YouTube for the nostalgia, it has its own videos and small, dedicated community and very low censorship, it is pretty nice, with 360p videos and all; a site very similar to Vidlii it Bitview.
**What are the alternatives to YouTube?** We'll only leave a brief paragraph here for wannabe YouTube alternatives come and go faster than a [zoomer](zoomer.md) changes genders. Best alternative to watching videos is reading [books](books.md) or watching clouds in the sky, but we'll stick to "watching videos on the Internet" here. Also bear in mind that if you have to watch YouTube, use alternative YouTube [frontends](frontend.md), which are normally [FOSS](foss.md) -- e.g. Invidious, piped, HookTube or FreeTube -- these let you access YouTube's videos via less [bloated](bloat.md) and more "privacy-friendly" interface, also filtering out ads and so on, more hardcore people use [CLI](cli.md) tools such as [youtube-dl](youtube_dl.md) to directy download the videos and watch them in native players. Likely the most notable [FOSS](foss.md) alternative to YouTube is **[PeerTube](peertube.md)**, a [federated](federation.md) [P2P](p2p.md) video platform, however for intended use it requires [JavaScript](javascript.md) (there is a way to download videos without JS but it's discouraged) and there are other issues that make it unusable ([SJW](sjw.md) censorship, videos load extremely slowly, ...). If you use PeerTube, don't use the lesbian instances, look up the uncensored ones. Mainstream proprietary alternative to YouTube is Vimeo, Bitchute is the "rightist" YouTube alternative (quite shitty TBH). [Internet Archive](internet_archive.md) has many video, especially old ones -- this is quite nice alternative. Vidlii is proprietary but oldschool site that tries to replicate old YouTube for the nostalgia, it has its own videos and small, dedicated community and very low censorship, it is pretty nice, with 360p videos and all; a site very similar to Vidlii it Bitview.
In November 2021 YouTube removed the dislike count on videos so as to make it impossible to express dislike or disagreement with their propaganda as people naturally started to dislike the exponentially skyrocketing shit and immorality of content [corporations](corporation.md) and [SJWs](sjw.md) started to force promote on YouTube (such as that infamous Lord of the Rings series with ["afro american"](nigger.md) dwarves that got like a billion dislikes [lmao](lmao.md)). In other words capitalism has made it to the stage of banning disagreement when people started to dislike the horse shit they're being force fed. This was met with a wave of universal criticism but of course YouTube told people to shut up and keep consuming that horse excrement -- of course [zoomers](zoomer.md) are just brainless zombies dependent on YouTube like a street whore on heroin so they just accepted that recommendation. Orwell would definitely be happy to see this.

Loading…
Cancel
Save