From d5b436647502e99e98a939f9ececec74539123a8 Mon Sep 17 00:00:00 2001 From: Miloslav Ciz Date: Sat, 2 Dec 2023 16:47:02 +0100 Subject: [PATCH] Update --- anarchism.md | 2 +- coding.md | 2 +- fourier_transform.md | 186 ++++++++++++++++++++++++++++++++++++++++++- game.md | 2 +- how_to.md | 1 + portability.md | 9 ++- procgen.md | 2 +- teletext.md | 1 + wikiwikiweb.md | 2 + www.md | 2 +- 10 files changed, 199 insertions(+), 10 deletions(-) diff --git a/anarchism.md b/anarchism.md index e612592..2b855c5 100644 --- a/anarchism.md +++ b/anarchism.md @@ -1,6 +1,6 @@ # Anarchism -Anarchism (from Greek *an*, no and *archos*, ruler) is a [socialist](socialism.md) political philosophy rejecting any social hierarchy and oppression. **Anarchism doesn't mean without rules, but without rulers**; despite popular misconceptions anarchism is not [chaos](chaos.md) -- on the contrary, it strives for a stable, ideal society of equal people that live in peace. It means order without power. The symbols of anarchism include the letter A in a circle and a black flag that for different branches of anarchism is diagonally split from bottom left to top right and the top part is filled with a color specific for that branch. +Anarchism (from Greek *an*, no and *archos*, ruler) is a [socialist](socialism.md) political philosophy rejecting any social hierarchy and oppression. **Anarchism doesn't mean without rules, but without rulers**; despite popular misconceptions anarchism is not [chaos](chaos.md) -- on the contrary, it strives for a stable, ideal society of equal people that live in peace. It means order without power. Let's also stress that **anarchism is ALWAYS incompatible with and strongly opposes [capitalism](capitalism.md)**, as it's sadly heard too many times from the mouth of common people they think anarchism to be something akin "true capitalism" -- NO, capitalism and formal government are an anarchist's two most opposed ideas (and please do not be mislead by attempts at deception e.g. by so called "[anarcho capitalists](ancap.md)"; such a term just tries to merge two fundamentally incompatible ideas, like for example "militant pacifist" or "communist capitalist"). The symbols of anarchism include the letter A in a circle and a black flag that for different branches of anarchism is diagonally split from bottom left to top right and the top part is filled with a color specific for that branch. A great many things about anarchism are explained in the text *An Anarchist FAQ*, which is [free licensed](free_culture.md) and can be accessed e.g. at https://theanarchistlibrary.org/library/the-anarchist-faq-editorial-collective-an-anarchist-faq-full. diff --git a/coding.md b/coding.md index 84b123e..17f59ea 100644 --- a/coding.md +++ b/coding.md @@ -1,6 +1,6 @@ # Coding -Coding nowadays means low quality attempt at [programming](programming.md), usually practiced by [soydevs](soydev.md) and barely qualified coding monkeys. +Coding nowadays means low quality attempt at [programming](programming.md), usually practiced by [soydevs](soydev.md) and barely qualified coding monkeys. Coder is to programmer what a bricklayer is to architect. Traditionally it means encoding and decoding of information as in e.g. video coding -- this is the only non-gay meaning of the word diff --git a/fourier_transform.md b/fourier_transform.md index cb3eb5f..7efc4cc 100644 --- a/fourier_transform.md +++ b/fourier_transform.md @@ -8,7 +8,7 @@ For newcomers FT is typically not easy to understand, it takes time to wrap one' FT is actually just one of many so called **[integral transforms](integral_transform.md)** that are all quite similar -- they always transform the signal to some other domain and back, they use similar equation but usually use a different kind of [function](function.md). Other integral transforms are for example **[discrete cosine transformation](dct.md)** (DCT) or **[wavelet transform](wavelet_transform.md)**. DCT is actually a bit simpler than FT, so if you are having hard time with FT, go check out DCT. -**If you know [linear algebra](linear_algebra.md), this may help you understand what (D)FT really does:** Imagine the signal we work with is a POINT (we can also say a [vector](vector.md)) in many [dimensional](dimension.md) space; if for example we have a recorded sound that has 1000 samples, it is really a 1000 dimensional vector, a point in 1000 dimensional space, expressed as an "array" of 1000 numbers (vector components). A short note: since we consider a finite number of discrete samples here, we are actually dealing with what's called DISCRETE FT here, not the "vanilla" FT, but for now let's not diverge. (D)FT does nothing more than transforming from one vector [basis](basis.md) ("system of coordinates", "frame of reference") to another basis; i.e. by default the signal is expressed in time domain (our usual vector basis), the numbers in the sound "array" are such because we are viewing them from the time "frame of reference" -- (D)FT will NOT do anything with to the signal itself (it is a vector/point in space, which will stay where it is, the recorded sound itself will not change), it will merely express this same point/vector from a different "point of view"/"frame of reference" (set of basis vectors) -- that of frequencies. That's basically how all the integral transforms work, they just have to ensure the basis they are transforming to is orthogonal (i.e. kind of legit, "usable") of course. +**If you know [linear algebra](linear_algebra.md), this may help you understand what (D)FT really does:** Imagine the signal we work with is a POINT (we can also say a [vector](vector.md)) in many [dimensional](dimension.md) space; if for example we have a recorded sound that has 1000 samples, it is really a 1000 dimensional vector, a point in 1000 dimensional space, expressed as an "array" of 1000 numbers (vector components). A short note: since we consider a finite number of discrete samples here, we are actually dealing with what's called DISCRETE FT here, not the "vanilla" FT, but for now let's not diverge. (D)FT does nothing more than transforming from one vector [basis](basis.md) ("system of coordinates", "frame of reference") to another basis; i.e. by default the signal is expressed in time domain (our usual vector basis), the numbers in the sound "array" are such because we are viewing them from the time "frame of reference" -- (D)FT will NOT do anything with to the signal itself (it is a vector/point in space, which will stay where it is, the recorded sound itself will not change), it will merely express this same point/vector from a different "point of view"/"frame of reference" (set of basis vectors) -- that of frequencies. That's basically how all the integral transforms work, they just have to ensure the basis they are transforming to is orthogonal (i.e. kind of legit, "usable") of course. In addition the FT equation is nothing complex, it literally just uses a **[dot product](dot_product.md)** of the whole input signal with each checked frequency wave to find out how similar the signal is to that particular frequency, as dot product simply says "how similar two vectors are" -- really, think about the equation and you will see it's really doing just that. ## Details @@ -22,4 +22,186 @@ First let's make clearer the whole terminology around FT: - **Discrete Fourier Transform (DFT)** (not to be confused with DTFT!): Uses DFS to transform a FINITE DISCRETE signal to a FINITE DISCRETE spectrum (with the same period as the input) by simply "pretending" the finite input signal is actually repeating over and over and then, after the transform, only leaving in the first period of the result (since the rest is just repeating). **This is actually what programmers usually mean by Fourier Transform** because in computers we practically always only deal with finite discrete signals (i.e. [arrays](array.md) of data). - **Fast Fourier Transform (FFT)**: Computes DFT (NOT FT!) that's faster than the [naive](naive.md) implementation, i.e. computing the equation that defines DFT as it's written has time complexity O(n^2) while FFT improves this to O(n * log(n)). -TODO: equations, more, code, pictures etc. \ No newline at end of file +From now on we will implicitly be talking about DFT of a real function (we'll ignore the possibility of complex input), the most notable transform here. + +The input to DFT is a real function, i.e. the time domain representation of the signal. The output is a complex valued function of frequency, i.e. the spectrum -- for each frequency it says a complex number whose magnitude and phase say the magnitude and phase of that frequency (a sine wave) in the signal (many programs will visualize just the magnitude part as that's usually the important thing, however keep in mind there is always also the phase part as well). + +The general equations defining DFT and IDFT, for signal with *N* samples, are following + +``` + ___ N - 1 + \ +DFT[k] = /__ x[n] * e^(-2 * i * pi * k * n / N) + n = 0 + ___ N - 1 + \ +IDFT[k] = 1/N * /__ x[n] * e^(2 * i * pi * k * n / N) + n = 0 +``` + +OK, this is usually where every noob ragequits if he hasn't already because of all the [pi](pi.md)s and [e](e.md)s and just generally ununderstable mess of weird symbols etc. What the heck does this all mean? As said above, it's doing nothing else than [dot product](dot_product.md) or vectors really: one vector is the input signal and the other vectors are the individual frequencies (sine waves) we are trying to discover in the signal -- this looks so complicated because here we are actually viewing the general version for a possible [complex](complex_number.md) input signal, the *e to something* part is actually the above mentioned complex exponential, it is the exponential way of writing a complex number (see e.g. [Euler's identity](eulers_indentity.md)). Anyway, considering only real input signal, we can simplify this to a more programmer friendly form: + +``` +DFT: + init DFT_real and DFT_imag to 0s + + for k = 0 to N - 1 + for n = 0 to N - 1 + angle = -2 * i * pi * k * n / N + DFT_real[k] += x[n] * cos(angle) + DFT_imag[k] += x[n] * sin(angle) + +IDFT: + init data to 0s + + for k = 0 to N - 1 + for n = 0 to N - 1 + angle = 2 * i * pi * k * n / N + data[k] += DFT_real[n] * cos(angle) - DFT_imag[n] * sin(angle) + + data[k] /= N +``` + +**Example**: take a look at the following array of 8 kind of arbitrary values and what their DFT looks like: + +``` + # # + # # # + # # # # + # # # # + # # # # # + # # # # # # +data: 5.00 4.71 6.00 6.54 1.00 2.29 0.00 -0.54 + +DFT: + # + # + # + # # # + # # # + # # # # # + magn.: 25.00 12.74 1.00 7.33 1.00 7.33 1.00 12.74 + phase: 0.00 -1.52 -1.57 -0.10 -3.14 0.10 1.57 1.52 + ----- + real: 25.00 0.70 0.00 7.30 -1.00 7.30 -0.00 0.70 + imag.: 0.00 -12.72 -1.00 -0.72 -0.00 0.72 1.00 12.72 + +restored: +data: 5.00 4.71 6.00 6.54 1.00 2.29 0.00 -0.54 +``` + +At the top we have the input data: notice the data kind of looks similar to a low-frequency sine wave, so the frequencies in the spectrum below are mostly low, but there's also some high frequency noise that's deforming the wave. For convenience here we show the spectrum values in both formats (magnitude/phase and real/imaginary part), but keep in mind it's just different formats of the same complex number values; for analysis we are mostly interested in the magnitude of the complex numbers as that shows as the amplitude of the frequency, i.e. the "amount" of the frequency in the signal. Here we notice the greatest peak is at frequency 0 -- this is a "constant" component, the lowest possible frequency that just represents a constant vertical offset of the signal (a constant number added to all samples); this component here is so big because our input signal doesn't really oscillate around the value 0 as it doesn't even go to negative values -- DFT sees this as our signal being shifted quite a lot "up". Frequencies 1 and 7 are the second biggest here: DFT is telling us the signal looks mostly like an addition of a sine wave with very low frequency and very high frequency (which it does), it doesn't see many middle value frequencies here. At the end we also see the original values computed back using IDFT, just to check everything is working as expected. + +Here is the [C](c.md) code that generates the above, you may use it as a snippet and/or to play around with different inputs to see what their spectra look like (for "readability" we commit the sin of using [floating point](float.md) numbers here, implementation of DFT [without floats](fixed_point.md) is left as an exercise :]): + +``` +#include +#include + +#define PI 3.141592 +#define N (sizeof(data) / sizeof(double)) // size of input data +#define NUM_FORMAT "%6.2lf" +#define STR_FORMAT "%-10s" +#define DRAW_HEIGHT 6 + +double data[] = // enter input data here + {5.00, 4.71, 6.00, 6.54, 1.00, 2.29, 0.00, -0.54}; + // output DFT: +double dftR[N]; // real part of DFT +double dftI[N]; // imaginary part of DFT + // just for printing: +double dftM[N]; // magnitude of DFT +double dftA[N]; // argument (angle/phase) of DFT + +void printArray(double *array) +{ + for (int i = 0; i < N; ++i) + printf(" " NUM_FORMAT,array[i]); + + putchar('\n'); +} + +void drawArray(double *array, double scale) +{ + for (int y = 0; y < DRAW_HEIGHT; ++y) + { + printf(" "); + + for (int x = 0; x < N; ++x) + { + printf(" "); + putchar(((int) array[x] * scale) >= (DRAW_HEIGHT - y) ? '#' : ' '); + } + + putchar('\n'); + } +} + +void printDft(void) +{ + printf(STR_FORMAT," magn.:"); printArray(dftM); + printf(STR_FORMAT," phase:"); printArray(dftA); + puts(" -----"); + printf(STR_FORMAT," real:"); printArray(dftR); + printf(STR_FORMAT," imag.:"); printArray(dftI); +} + +void dft(void) +{ + for (int i = 0; i < N; ++i) + { + dftR[i] = 0; + dftI[i] = 0; + } + + for (int k = 0; k < N; ++k) + { + for (int n = 0; n < N; ++n) + { + double angle = (-2 * PI * k * n) / N; + dftR[k] += data[n] * cos(angle); + dftI[k] += data[n] * sin(angle); + } + + // just for printing also precompute magnitudes and phases + dftM[k] = sqrt(dftR[k] * dftR[k] + dftI[k] * dftI[k]); + dftA[k] = atan2(dftI[k],dftR[k]); + } +} + +void idft(void) +{ + for (int i = 0; i < N; ++i) + data[i] = 0; + + for (int k = 0; k < N; ++k) + { + for (int n = 0; n < N; ++n) + { + double angle = (2 * PI * k * n) / N; + data[k] += dftR[n] * cos(angle) - dftI[n] * sin(angle); + } + + data[k] /= N; + } +} + +int main(void) +{ + drawArray(data,1); + printf(STR_FORMAT,"data:"); printArray(data); + + puts("\nDFT:"); + dft(); + drawArray(dftM,0.25); + printDft(); + idft(); + + puts("\nrestored:"); + printf(STR_FORMAT,"data:"); printArray(data); + + return 0; +} +``` + +TODO: pictures, 2D version \ No newline at end of file diff --git a/game.md b/game.md index 33e7850..16eddfb 100644 --- a/game.md +++ b/game.md @@ -1,6 +1,6 @@ # Game -Most generally game is a form of play which is restricted by certain rules, the goal of which is typically [fun](fun.md), providing challenge and/or [competition](competition.md) (and sometimes more, e.g. [education](education.md), training etc.). A game may have various combinations of mathematical/mental elements (e.g. competitive mental calculations, mathematically defined rules, ...), physical elements (based in [real life](irl.md) physics, e.g. [football](football.md), [marble racing](marble_racing.md), ...) and even other types of elements (e.g. social, psychological, ...); nowadays very popular games are [computer](computer.md) games, or video games (also gaymes or vidya, e.g. [Anarch](anarch.md), [minesweeper](minesweeper.md), [Doom](doom.md), ...), which are played with the help of a computer. An entity (human, computer, animal, ...) playing a game is called a player and his ability to play it well is called [skill](skill.md); however some games may involve pure [randomness](randomness.md) and chance which may limit or even eliminate the need of skill (e.g. [rock paper scissors](rock_paper_scissors.md)). *Game* is also a [mathematical](math.md) term in [game theory](game_theory.md) which studies games and competition rigorously. +Most generally game is a form of play which is restricted by certain rules, the goal of which is typically [fun](fun.md), providing challenge and/or [competition](competition.md) (and sometimes more, e.g. [education](education.md), training etc.). A game may have various combinations of mathematical/mental elements (e.g. competitive mental calculations, mathematically defined rules, ...), physical elements (based in [real life](irl.md) physics, e.g. [football](football.md), [marble racing](marble_racing.md), ...) and even other types of elements (e.g. social, psychological, ...); nowadays very popular games are [computer](computer.md) games, a type of video games (also gaymes or vidya, e.g. [Anarch](anarch.md), [minesweeper](minesweeper.md), [Doom](doom.md), ...), which are played with the help of a computer. An entity (human, computer, animal, ...) playing a game is called a player and his ability to play it well is called [skill](skill.md); however some games may involve pure [randomness](randomness.md) and chance which may limit or even eliminate the need of skill (e.g. [rock paper scissors](rock_paper_scissors.md)). *Game* is also a [mathematical](math.md) term in [game theory](game_theory.md) which studies games and competition rigorously. A fun take at the very concept of a game is [Nomic](nomic.md), a game in which changing the game rules is part of the game. It leads to all kinds of mindfucks. diff --git a/how_to.md b/how_to.md index 249d6be..4da751d 100644 --- a/how_to.md +++ b/how_to.md @@ -92,6 +92,7 @@ This is a summary of some main guidelines on how an LRS supporter should behave - If you want, **get in contact with like minded people**, for example [us](lrs.md) :) It's OK not to, not everyone is social, but it's nice to be part of a group where people understand each other, support each other, inspire each other, ... Even lurking helps many times. **Where to find such people?** Definitely not on mainstream platforms, they are mostly in the [underground](underground.md): as a tech minimalist search for "platforms" you would yourself use -- that's where you will likely find people like yourself. Good places to start are for example [gopher](gopher.md), [wiby](wiby.md), [suckless](suckless.md), [IRC](irc.md), [mailing lists](mailing_list.md), obscure online libre [games](game.md) etc. If you set up a website (or gopher hole) where you publish nice stuff, people will find you and contact you themselves. { I found many friends in [Xonotic](xonotic.md) and [OpenArena](openarena.md), as well as thanks to writings and programs I put on the internet. ~drummyfish } - **Do NOT [fight](fight_culture.md)**, do NOT say you fight something. Fighting and rhetoric centered around "fighting something" is part of harmful [fight culture](fight_culture.md), most people don't even realize they take part in it. It is important to unlearn this. We do not want to defeat anyone, we want to convince by means of rationality, nonviolence and love. However note that what is unacceptable to do to a living being may be completely acceptable to do to non living object (for example destroying a corporation is OK, in fact it is very desirable). We often take actions that common people would call a "fight" (for example we may organize a strike), however it is important that we don't call it a fight -- a point of view is sometimes as important as the action itself as it will determine our future direction. Remember that [naming is important](name_is_important.md). **Watch out for [A/B fails](fail_ab.md)**. - **Do NOT worship or create [heroes](hero_culture.md), don't become one**. Watch out for [cult of personality](cult_of_personality.md). It is another common mistake to for example call [Richard Stallman](rms.md) a "hero of free software" and to even worship him as a celebrity. The concept of a hero is [harmful](harmful.md), rightist concept that is connected to war mentality, it goes against [anarchist](anarchism.md) principles, it creates social hierarchy and given some people a power to deceive. People are imperfect and make mistake -- only ideas can be perfect. Respect people but don't make anyone your moral compass, you should rather subscribe to specific ideas, i.e. rather than worshipping Stallman subscribe to and promote his idea of [free software](free_software.md). +- **Do not [identify](identity.md) with specific groups and organizations** -- this one is tricky because there is a fine line between many people together agreeing on an idea (good) and those people creating a formal hierarchical group which sooner or later inevitably becomes [fascist](fascism.md) or at the very least corrupt, eventually to the degree of betraying its original beliefs (bad). Remember principles of [anarchism](anarchism.md): loosely associate with others but do not create power structures and hierarchies. An example here may be supporting [free software](free_software.md) (good) vs supporting the (now greatly corrupt) [Free Software Foundation](fsf.md) (bad). Free software as an idea is pure and good, in merely supporting the idea we will not create any hierarchy of people, power structures or attach other unrelated ideas to ride on the free software wave (e.g. that of [political correctness](political_correctness.md) now promoted by the FSF). They say there is strength in unity, that is true, but there are different kinds of unity, and if perhaps one kind of unity (the bad one) is momentarily stronger, it is so because it's the "dark side of the force": yes, it may be stronger, but it is evil. Resist this urge. For this we also don't want to start any formal [LRS](lrs.md) group. - **CREATE, Do NOT waste your life on bullshit, do NOT get too obsessed with tools and hopping** such as [distrohopping](distrohopping.md), [githopping](githopping.md) [audiophilia](audiophilia.md), hardware consumerism, 100% minimalist perfectionism etc. Remember, the goal of your life is to create something new and better; too many people just get stuck doing nothing but switch distros, rant about which editor is best, making sure their OS has zero bloat and zero proprietary code etc. This is completely useless, your life is completely wasted. Dedicate time to creating art that will last, e.g. programming [LRS](lrs.md) (creating source code text) or making free cultural art -- it doesn't matter whether you create it with Ubuntu or Gentoo. - **Lead an example**, this is the best way to spread our values, however be also extremely careful not to become a worshipped [authority](hero_culture.md). Know the difference between a humble intellectual authority and an authoritative self-centered celebrity who uses his fame for deception. The more famous you are, the more humble you should become. - **Be [loving](love.md), even towards opposition** -- remember: hate and revenge towards people perpetuates the endless circle. [Love](love.md) leads to more love, understanding, good deeds, friendship, happiness, collaboration and all the other positive things. Do not confuse love with [political correctness](political_correctness.md). You may get angry or frustrated, just don't get violent against, rather try to break something, write your anger out, play some video game etc. diff --git a/portability.md b/portability.md index 84914a9..d65fe6b 100644 --- a/portability.md +++ b/portability.md @@ -10,9 +10,9 @@ In connection to software the word *portable* also has one other meaning used ma In short: use [abstraction](abstraction.md) to not get tied to any specific platform (separate [frontend](frontend.md) and [backend](backend.md)), [keep it simple](kiss.md), minimize [dependencies](dependency.md) (minimize use of [libraries](library.md) and requiring hardware such as [floating point](float.md) unit or a [GPU](gpu.md), have [fallbacks](fallback.md)), write efficient, [simple](kiss.md) code (lower hardware demands will support more platforms), avoid platform-specific features (don't write in [assembly](assembly.md) as that's specific to each CPU, don't directly use [Linux](linux.md) [syscalls](syscall.md) as these are specific to Linux etc.). -Remember, portability is about making it easy for a programmer to take your program and make it run elsewhere, so portability is kind of a mindset, it is about constantly putting oneself in the shoes of someone else with a very different computer and asking questions such as "how hard will it be to make this work if this library isn't available?". Even things that are supposed or commonly expected to be present on all platforms, such as a file system or a raster screen, may not be present on some computers -- always remember this. +Remember, portability is about **making it easy for a programmer to take your program and make it run elsewhere**, so portability is kind of a mindset, it is about constantly putting oneself in the shoes of someone else with a very different computer and asking questions such as "how hard will it be to make this work if this library isn't available?". Even things that are supposed or commonly expected to be present on all platforms, such as a file system or a raster screen, may not be present on some computers -- always remember this. -**Do NOT use big frameworks/engines** -- it is one of the greatest misconceptions among many inexperienced programmers to think portable software is created with big frameworks, such as the [Godot](godot.md) engine or the [QT](qt.md) framework, which can "single click" export/deploy software to different platforms. This will merely achieve creating a badly [bloated](bloat.md) multiplatform program that's completely dependent on the framework itself which drags along hundreds of [dependencies](dependency.md) and wastes computing resources (RAM, CPU, storage, ...) which are all factors directly contradicting portability. If you for example create a snake game in Godot, you won't be able to port it to [embedded](embedded.md) devices or devices without an operating system even though the snake game itself is simple enough to run on such devices -- the game drags along the whole Godot engine which is so huge, complex and hardware demanding that it prevents the simple game from running on simple hardware. +**Do NOT use big [frameworks](framework.md)/engines** -- it is one of the greatest misconceptions among many inexperienced programmers to think portable software is created with big frameworks, such as the [Godot](godot.md) engine or the [QT](qt.md) framework, which can "single click" export/deploy software to different platforms. This will merely achieve creating a badly [bloated](bloat.md) multiplatform program that's completely dependent on the framework itself which drags along hundreds of [dependencies](dependency.md) and wastes computing resources (RAM, CPU, storage, ...) which are all factors directly contradicting portability. If you for example create a snake game in Godot, you won't be able to port it to [embedded](embedded.md) devices or devices without an operating system even though the snake game itself is simple enough to run on such devices -- the game drags along the whole Godot engine which is so huge, complex and hardware demanding that it prevents the simple game from running on simple hardware. **The same goes for languages and [libraries](library.md)**: do NOT use big/bloated languages such as [Python](python.md), [Java](java.md) or [JavaScript](javascript.md) -- your program would immediately become dependent on a hugely complex ecosystem of such language. For portability you should basically **only write in [C](c.md)** (the best established, time tested, relatively simple language supported basically by every platform) or in [C++](cpp.md) at worst, and even with these languages do NOT use the newer standards as these hugely limit the number of compliant compilers that will be able to compile your program. The best is to write in C89 or C99 standard of C. **Minimize the number of libraries you use**, even if it is the standard library of your language -- not all compilers fully adhere to standards and some don't have the standard library even if the should. @@ -158,4 +158,7 @@ You'll get the stdlib version. If you compile it as gcc -DFRONTEND_SDL -lSDL2 main.c ``` -You'll get the SDL version. \ No newline at end of file +You'll get the SDL version. + +A great example of this kind of portable design can be seen e.g. in well written **[compilers](compiler.md)** that separate their architecture into an frontend and backend -- imagine we are writing for example a [C](c.md) compiler. The parser of C syntax can be easily written in a portable way, we simply write functions that work with text, however we find difficulty in asking what [instruction set](isa.md) we will compile to. If we choose one, such as [x86](x86.md), then we will not only write an x86 specific code generator, but also e.g. an x86 specific [optimizer](optimization.md); the part of the compiler that may get so complex that it ends up being bigger than the rest of the code. What if then we also want to support another ISA such as [Arm](arm.md) or [RISC-V](risc_v.md), will we have to rewrite our painstakingly written optimizer for those architectures from scratch? The solution is the same as explained above in regards to I/O: we make an abstraction above the instruction set, here called an [intermediate representation](intermediate_representation.md), usually some [bytecode](bytecode.md), i.e. the compiler first translates C to the abstract bytecode, then we may perform all the complex optimizations on this bytecode, and only then, in the last moment, we relatively simply translate this bytecode to whatever specific instruction set. + diff --git a/procgen.md b/procgen.md index 9c90525..8614366 100644 --- a/procgen.md +++ b/procgen.md @@ -1,6 +1,6 @@ # Procedural Generation -Procedural generation (procgen) refers to creation of data, such as [art](art.md) assets in [games](game.md) or test data for data processing software, by using [algorithms](algorithm.md) and mathematical formulas rather than creating the data manually or measuring it in the real world (e.g. by taking photographs). This can be used for example for automatic generation of [textures](texture.md), texts, [music](music.md), game levels or 3D models but also practically anything else, e.g. test [databases](database.md), animations or even computer programs. Procedural art currently doesn't reach qualities and creativity of a skilled human artist, but it can be [good enough](good_enough.md) or even necessary (e.g. for creating extremely large worlds), it may be preferred e.g. for its extreme save of storage memory, it can help add detail to human work, be a good filler, a substitute, an addition to or a basis for manually created art. Procedural generation has many advantages such as saving space (instead of large data we only store small code of the algorithm that generates it), saving time (once we have an algorithm we can generate a lot data extremely quickly), increasing resolution practically to infinity or extending data to more dimensions (e.g. [3D textures](3d_texture.md)). Procedural generation can also be used as a helper and guidance, e.g. an artist may use a procedurally generated game level as a starting point and fine tune it manually, or vice versa, procedural algorithm may create a level by algorithmically assembling manually created building blocks. +Procedural generation (procgen) refers to creation of data, such as [art](art.md) assets in [games](game.md) or test data for data processing software, by using [algorithms](algorithm.md) and mathematical formulas rather than creating the data manually or measuring it in the real world (e.g. by taking photographs). This can be used for example for automatic generation of [textures](texture.md), texts, [music](music.md), game levels or 3D models but also practically anything else, e.g. test [databases](database.md), animations or even computer programs. Such data are also called *synthetic*. Procedural art currently doesn't reach qualities and creativity of a skilled human artist, but it can be [good enough](good_enough.md) or even necessary (e.g. for creating extremely large worlds), it may be preferred e.g. for its extreme save of storage memory, it can help add detail to human work, be a good filler, a substitute, an addition to or a basis for manually created art. Procedural generation has many advantages such as saving space (instead of large data we only store small code of the algorithm that generates it), saving time (once we have an algorithm we can generate a lot data extremely quickly), increasing resolution practically to infinity or extending data to more dimensions (e.g. [3D textures](3d_texture.md)). Procedural generation can also be used as a helper and guidance, e.g. an artist may use a procedurally generated game level as a starting point and fine tune it manually, or vice versa, procedural algorithm may create a level by algorithmically assembling manually created building blocks. As neural [AI](ai.md) approaches human level of creativity, we may see computers actually replacing many artists in near future, however it is debatable whether AI generated content should be called procedural generation as AI models are quite different from the traditional hand-made algorithms -- AI art is still seen as a separate approach than procedural generation. For this we'll only be considering the traditional approach from now on. diff --git a/teletext.md b/teletext.md index 2e2f484..a848b70 100644 --- a/teletext.md +++ b/teletext.md @@ -10,4 +10,5 @@ The pages allowed fixed-width text and some very blocky graphics, both could be ## See Also +- [videotex](videotex.md) - [world broadcast](world_broadcast.md) \ No newline at end of file diff --git a/wikiwikiweb.md b/wikiwikiweb.md index 7d9c48a..d1c04ee 100644 --- a/wikiwikiweb.md +++ b/wikiwikiweb.md @@ -14,6 +14,8 @@ There are other wikis that work in similar spirit, e.g. CommunityWiki (https://c These are some interesting pages found on the Wiki. +{ NOTE: To see all pages in given category go to the category page and CLICK THE PAGE TITLE. ~drummyfish } + - **CategoryCategory**: List of categories of pages. - **CategoryHumor**: Humorous pages. - **ComputerGame** diff --git a/www.md b/www.md index 654aaba..87ed7d3 100644 --- a/www.md +++ b/www.md @@ -51,7 +51,7 @@ Mainstream web is quite literally unusable nowadays. { 2023 update: whole web is ## History -World Wide Web was invented by an English computer scientist [Tim Berners-Lee](berners_lee.md). In 1980 he employed [hyperlinks](hyperlink.md) in a notebook program called ENQUIRE, he saw the idea was good. On March 12 1989 he was working at [CERN](cern.md) where he proposed a system called "web" that would use [hypertext](hypertext.md) to link documents (the term hypertext was already around). He also considered the name *Mesh* but settled on *World Wide Web* eventually. He started to implement the system with a few other people. At the end of 1990 they already had implemented the [HTTP](http.md) protocol for client-server communication, the [HTML](html.md), language for writing websites, the first web server and the first [web browser](browser.md) called *WorldWideWeb*. They set up the first website http://info.cern.ch that contained information about the project. +World Wide Web was invented by an English computer scientist [Tim Berners-Lee](berners_lee.md). In 1980 he employed [hyperlinks](hyperlink.md) in a notebook program called ENQUIRE, he saw the idea was good. On March 12 1989 he was working at [CERN](cern.md) where he proposed a system called "web" that would use [hypertext](hypertext.md) to link documents (the term hypertext was already around). He also considered the name *Mesh* but settled on *World Wide Web* eventually. He started to implement the system with a few other people. At the end of 1990 they already had implemented the [HTTP](http.md) protocol for client-server communication, the [HTML](html.md), language for writing websites, the first web server and the first [web browser](browser.md) called *WorldWideWeb*. They set up the first website http://info.cern.ch that contained information about the project (still accessible as of writing this). In 1993 CERN made the web [public domain](public_domain.md), free for anyone without any licensing requirements. The main reason was to gain advantage over competing systems such as [Gopher](gopher.md) that were [proprietary](proprietary.md). By 1994 there were over 500 web servers around the world. WWW Consortium ([W3M](w3m.md)) was established to maintain standards for the web. A number of new browsers were written such as the text-only [Lynx](lynx.md), but the [proprietary](proprietary.md) [Netscape Navigator](netscape_navigator.md) would go to become the most popular one until [Micro$oft](microsoft)'s [Internet Explorer](internet_explorer.md) (see [browser wars](browser_wars.md)). In 1997 [Google](google.md) search engine appeared, as well as [CSS](css.md). There was a economic bubble connected to the explosion of the Web called the [dot-comm boom](dot_com_boom.md).