Update
This commit is contained in:
parent
3631b726e5
commit
d52544f211
9 changed files with 1722 additions and 1671 deletions
2
bloat.md
2
bloat.md
|
@ -38,6 +38,8 @@ One of a very frequent questions you may hear a noob ask is **"How can bloat lim
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Yes, **bloat is also unecological** and no, it cannot be fixed by replacing fossil fuel cars with cars that run on grass and plastic computers by computers made from recycled cardboards mixed with composted horse shit. It is the immense volume of human ACTIVITY that's required by the bloated technology all around the globe that's inherently unecological by wasting so much effort, keeping focus on maximalism, growth and preventing us from frugality and minimizing resource waste. Just as any other [bullshit](bullshit.md) that requires immense resources to just keep maintaining -- great complexity is just absolutely incompatible with ecology and as much as you dislike it, to achieve truly eco-friendly society we'll have to give up what we have now in favor of something orders of magnitude more simple and if you think otherwise, you are just yet too unexperienced (or remained purposefully ignorant) to have seen the big picture already. Consider that your program having bullshit dependencies such as [Python](python.md), [JavaScript](js.md), [C++](cpp.md), [Java](java.md), [OpenGL](opengl.md), [Vulkan](vulkan.md), [GPU](gpu.md), [VR](vr.md) sets, gigabytes of [RAM](ram.md) etcetc. requires having the inherently unecological system up, it needs millions of people doing bullshit jobs that are inherently wasting resources, increasing CO2 and making them not focus on things that have to be done -- yes, even if we replace plastic straws with [paper straws](greenwashing.md). All those people that make the thousand pages standards that are updated every year, reviews of those standards, writing tons and tons of tests for implementations of those standards, electing other people to make those standards, testing their tests, implementing the standards themselves, optimizing them, all of that collectively needing many billions of lines of code and millions of hours of non-programming activities, it all requires complex bureaucracy, organization and management (complex [version control systems](vcs.md), wikis, buildings, meeting spaces, ...) and communication tools and tons of other bullshit recursively spawning more and more waste -- all of these people require cars to go to work every day (even if some work from home, ultimately only a few can work from home 100% of the time and even so millions others need to physically go to factories to make all those computers, electricity, chair, food and other things those people need), they require keeping a high bandwidth 100% uptime global Internet network maintained, all of this requiring extra buildings, offices, factories, roads, buildings for governments overseeing the building of those buildings, maintenance of those roads etcetc. A newbie programmer (99.99999% programmers in the field nowadays) just don't see all this because they lack the big picture, a woman forced into programming has hard time comprehending an if statement, how do you expect her to see the deep interconnections between technology and society -- she may know that OpenGL is "something with graphics" and it's just there on every computer by default, she can't even picture the complexity that's behind what she sees on the screen. Hence the overall retardation. You just cannot have people living ecologically and at the same time have what we have now. So yes, by supporting and/or creating bloat you are killing the planet, whether you agree with it or not. No, you can't find excuses out of this, no, paper straws won't help, just admit you love point and click "programming without math" of your own shitty Minecraft clones in Godot even for the price of eliminating all life on Earth, that's fine (no it's not but it's better to just not bullshit oneself).
|
||||||
|
|
||||||
{ Fucking hell this shit has gone too far with the newest supershit gayme called Cities Skyline II, I literally can't anymore, apparently the game won't run smoothly even on Earth's most advanced supercomputer because, as someone analyzed, the retarddevs use billion poly models for pedestriangs without any [LOD](lod.md), I bet they don't even know what it is, they probably don't even know what a computer is, these must be some extra retarded soy idiots making these games now. Though I knew it would come to this and that it will be getting yet much worse, I am always still surprised, my brain refuses to believe anyone would let such a piece or monstrous shit to happen. This just can't be real anymore. ~drummyfish }
|
{ Fucking hell this shit has gone too far with the newest supershit gayme called Cities Skyline II, I literally can't anymore, apparently the game won't run smoothly even on Earth's most advanced supercomputer because, as someone analyzed, the retarddevs use billion poly models for pedestriangs without any [LOD](lod.md), I bet they don't even know what it is, they probably don't even know what a computer is, these must be some extra retarded soy idiots making these games now. Though I knew it would come to this and that it will be getting yet much worse, I am always still surprised, my brain refuses to believe anyone would let such a piece or monstrous shit to happen. This just can't be real anymore. ~drummyfish }
|
||||||
|
|
||||||
## Typical Bloat
|
## Typical Bloat
|
||||||
|
|
|
@ -6,7 +6,7 @@ LRS wiki was started by [drummyfish](drummyfish.md) on November 3 2021 as a way
|
||||||
|
|
||||||
Over time, being written solely by drummyfish without much self censorship and "language filtering", the wiki also became something like drummyfish's raw brain dump with all the thoughts and moods averaged over the time span of writing the wiki -- reading through it makes you see relatively faithfully how drummyfish internally thinks (e.g. you see anticapitalist rants everywhere because these annoying thoughts are just constantly bothering drummyfish, whatever he's thinking about) -- this can make many people vomit but it's a kind of experiment and some even liked it, so it stays up. No one is forced to read it and CC0 ensures anyone can shape it into anything better hopefully.
|
Over time, being written solely by drummyfish without much self censorship and "language filtering", the wiki also became something like drummyfish's raw brain dump with all the thoughts and moods averaged over the time span of writing the wiki -- reading through it makes you see relatively faithfully how drummyfish internally thinks (e.g. you see anticapitalist rants everywhere because these annoying thoughts are just constantly bothering drummyfish, whatever he's thinking about) -- this can make many people vomit but it's a kind of experiment and some even liked it, so it stays up. No one is forced to read it and CC0 ensures anyone can shape it into anything better hopefully.
|
||||||
|
|
||||||
The wiki can also additionally be seen as a dirty collection of drummyfish's cheatsheets, links, code snippets, [jokes](jokes.md), attempts at [ASCII art](ascii_art.md), vent rants etcetc. So the whole thing is like a digital swamp that one might see as a kind of retarded art that combines many things together: technical, cultural, personal, objective and subjective, beautiful and ugly. It's just its own thing.
|
The wiki can also additionally be seen as a dirty collection of drummyfish's cheatsheets, links, code snippets, [jokes](jokes.md), attempts at [ASCII art](ascii_art.md), vent rants etcetc. So the whole thing is like a digital swamp that one might see as a kind of retarded [art](art.md) that combines many things together: technical, cultural, personal, objective and subjective, beautiful and ugly. It might also be viewed as a shitpost or [meme](meme.md) taken too far. It's just its own thing.
|
||||||
|
|
||||||
The wiki is similar to other wikis, for example in its topics and technical aspects it is similar to the earliest (plain HTML) versions of [Wikipedia](wikipedia.md) and [wikiwikiweb](wikiwikiweb.md) (by which it was partly inspired). In tone and political incorrectness it is similar to [Encyclopedia Dramatica](dramatica.md), but unlike Dramatica LRS is a "serious" project.
|
The wiki is similar to other wikis, for example in its topics and technical aspects it is similar to the earliest (plain HTML) versions of [Wikipedia](wikipedia.md) and [wikiwikiweb](wikiwikiweb.md) (by which it was partly inspired). In tone and political incorrectness it is similar to [Encyclopedia Dramatica](dramatica.md), but unlike Dramatica LRS is a "serious" project.
|
||||||
|
|
||||||
|
|
18
make_html.sh
18
make_html.sh
|
@ -15,9 +15,25 @@ cp ./*.css ./html/
|
||||||
DATE=`date +"%D"`
|
DATE=`date +"%D"`
|
||||||
FILECOUNT=`ls *.md | wc -l`
|
FILECOUNT=`ls *.md | wc -l`
|
||||||
FILELIST="wiki_pages"
|
FILELIST="wiki_pages"
|
||||||
HEADER="<html><head><link rel=\"stylesheet\" href=\"style.css\"><title>LRS Wiki</title></head><body><h1>less_retarded_wiki</h1><a href=\"main.html\">main page</a>, <a class=\"notdead\" href=\"$FILELIST.html\">file list ($FILECOUNT)</a>, <a class=\"notdead\" href=\"https://git.coom.tech/drummyfish/less_retarded_wiki/archive/master.zip\">source</a>, <a class=\"notdead\" href=\"report.html\">report abuse</a>, <a class=\"notdead\" href=\"wiki_stats.html\">stats</a>, <a class=\"notdead\" id=\"fancylink\" href=\"pimp_my_lrs.html?p=main.html&s=style_fancy.css\">consoomer version</a>, wiki last updated on $DATE<hr />"
|
RANDPAGE="random_page"
|
||||||
|
HEADER="<html><head><link rel=\"stylesheet\" href=\"style.css\"><title>LRS Wiki</title></head><body><h1>less_retarded_wiki</h1><span class=\"nav\"><a href=\"main.html\">main page</a>, <a class=\"notdead\" href=\"$FILELIST.html\">file list ($FILECOUNT)</a>, <a class=\"notdead\" href=\"https://git.coom.tech/drummyfish/less_retarded_wiki/archive/master.zip\">source</a>, <a class=\"notdead\" href=\"report.html\">report abuse</a>, <a class=\"notdead\" href=\"wiki_stats.html\">stats</a>, <a class=\"notdead\" href=\"$RANDPAGE.html\">random article</a>, <a class=\"notdead\" id=\"fancylink\" href=\"pimp_my_lrs.html?p=main.html&s=style_fancy.css\">consoomer version</a>, wiki last updated on $DATE</span><hr />"
|
||||||
FOOTER="<hr/><p>All content available under <a class=\"notdead\" href=\"https://creativecommons.org/publicdomain/zero/1.0/\">CC0 1.0</a> (public domain). Send comments and corrections to drummyfish at disroot dot org. </p></body></html>"
|
FOOTER="<hr/><p>All content available under <a class=\"notdead\" href=\"https://creativecommons.org/publicdomain/zero/1.0/\">CC0 1.0</a> (public domain). Send comments and corrections to drummyfish at disroot dot org. </p></body></html>"
|
||||||
|
|
||||||
|
rm $RANDPAGE.md
|
||||||
|
|
||||||
|
ls *.md > tmp.txt
|
||||||
|
ls *.md >> tmp.txt
|
||||||
|
ls *.md >> tmp.txt
|
||||||
|
cat tmp.txt | shuf > tmp2.txt
|
||||||
|
|
||||||
|
printf "# Random Article\n\nPlease kindly click random link.\n\n" >> $RANDPAGE.md
|
||||||
|
|
||||||
|
while read f; do
|
||||||
|
echo "[*]($f)" >> $RANDPAGE.md
|
||||||
|
done <tmp2.txt
|
||||||
|
|
||||||
|
rm tmp.txt tmp2.txt
|
||||||
|
|
||||||
printf "# Wiki Files\n\nThis is an autogenerated page listing all pages.\n\n" > $FILELIST.md
|
printf "# Wiki Files\n\nThis is an autogenerated page listing all pages.\n\n" > $FILELIST.md
|
||||||
|
|
||||||
firstFile=true
|
firstFile=true
|
||||||
|
|
|
@ -29,9 +29,41 @@ Mandelbrot set (also M-set) is a famous two dimensional [fractal](fractal.md), a
|
||||||
| ':::' |
|
| ':::' |
|
||||||
| : |
|
| : |
|
||||||
|___________________________________________________[0.5,-1]|
|
|___________________________________________________[0.5,-1]|
|
||||||
|
___________________________________________________________
|
||||||
|
| ''.:.:'::::: '' :.'..::'::.:''.::.::: .:''' :'.::'.:'':':|
|
||||||
|
|: ::.''.':'::::.' :.'::::'::::.:::..' .:::: : ::'::::'::::|
|
||||||
|
|::' . :::: ' ::. : :' :.'::.' .:::''.'::'.: ':.:.':':':.'|
|
||||||
|
|'::: .'.':.' '':. ..'.'::::':.':::' ..:'::'. ':::'.':::'|
|
||||||
|
| ::::..'::'.'.'.'.: : :: ::::': .:. :''..::.::... :..':::::|
|
||||||
|
|:'::: ':.:::... ':''.: ..::::'::':::': :'::'':: '': :.':'.|
|
||||||
|
|:::.:':::':. :::.':...::: : . ''.'.: .:. '.:::: .::' :|
|
||||||
|
|:::::'.'' .::':. :..:.::.::..' .::. ::'' :'' |
|
||||||
|
|:::::: :.::''''. ::. .:'::::. .':''. ' . ...': :|
|
||||||
|
|:::''''' :'' :''::: '.':'' : . . '':':'.'.|
|
||||||
|
|':''':::.. ::'::.::.' . ' :':::::.:::: .:::|
|
||||||
|
|:. .:.::.. '': ' ::. '::: . '':::'..::' :.'.|
|
||||||
|
|:: : :. ' '..:: ' ::: : .':::.:::::'::::|
|
||||||
|
|..::.::' . ...:'':.' ::.'.':'': ':':'.:.:'':::..:|
|
||||||
|
|.:::::::: ': .'''.....:: ::.'::.:.....'. |
|
||||||
|
|:::::::::. .' . ' ':.::::.. :':.' : ': ' |
|
||||||
|
|:::::::::.' :':. ''.':::. .:: :.. .:':. '|
|
||||||
|
|:.::::'':': .:.:: ::'':. .'::'.::'.:. '.: '|
|
||||||
|
|:..''''': :.::::'. ::. : :'''':':: .::|
|
||||||
|
| ::: '. . .. '':'::::: '.:: :.:'. ..''' :.. ':'.|
|
||||||
|
|: :::' ::... :..::.::::.::::': .::'':.:'::::: . :|
|
||||||
|
|'.. . '.. '' .: ::::: '::::::.':.:..:.::. ' .:.'|
|
||||||
|
|::.... ' . ' :: '.'::::::.:..'':. ''::' .' '|
|
||||||
|
|:':.:::. ..'..'': :..:''' .. :' ' .':|
|
||||||
|
| .':::: :. . . ':::::.:.'::..' . .:::: :. .|
|
||||||
|
| .::.:: '..:'. :''.::':::''::'..:: ' ' ::''|
|
||||||
|
|:'' .:'::. ': ::''::''. ..:'' :: :::::.:::. ' ':|
|
||||||
|
|::.:.' .''' .::::::::..':.''': ':...::''.:: .' ..|
|
||||||
|
| :':' ' . :::::':':..::::::..'.:::':'::'':' ' |
|
||||||
|
|'': . '::''::: ::::::'.:.::: : . '' ' '|
|
||||||
|
|___________________________________________________________|
|
||||||
```
|
```
|
||||||
|
|
||||||
*Simple ASCII rendering of Mandelbrot set.*
|
*Simple ASCII rendering of Mandelbrot set, below a zoomed-in detail.*
|
||||||
|
|
||||||
**Definition**: we use [complex numbers](complex_number.md) to define the set. Consider the following series of complex numbers *z[n]*:
|
**Definition**: we use [complex numbers](complex_number.md) to define the set. Consider the following series of complex numbers *z[n]*:
|
||||||
|
|
||||||
|
@ -39,11 +71,13 @@ Mandelbrot set (also M-set) is a famous two dimensional [fractal](fractal.md), a
|
||||||
|
|
||||||
Mandelbrot set is the set of all points *p* for which the [absolute value](abs.md) ("length") of *z[n]* stays bounded (i.e. doesn't grow beyond any limits) as *n* goes towards infinity.
|
Mandelbrot set is the set of all points *p* for which the [absolute value](abs.md) ("length") of *z[n]* stays bounded (i.e. doesn't grow beyond any limits) as *n* goes towards infinity.
|
||||||
|
|
||||||
|
NOTE: here is the series equation rewritten to just work with *x* and *y* coordinates. Checking the point *[px,py]*, your series will be *x[n + 1] = x[n]^2 - y[n]^2 + px* and *y[n + 1] = 2 * x[n] * y[n] + py*.
|
||||||
|
|
||||||
I.e. taking any point *p* in the complex plane (whose real and imaginary parts we see as the *x* and *y* coordinates), plugging it into the above equation and iterating the series infinitely many times, if the absolute value of *z[n]* stays bounded under some finite value (even very large, just not infinitely large), the number belongs to the set, otherwise not (if the absolute value diverges towards infinity). I.e. in other words the Mandelbrot set is a set of kind of "well behaved" points that don't shoot away to infinity when we keep applying some operation to them over and over. Of course computers cannot evaluate infinitely many iterations of the series so they cannot compute the set 100% accurately, but we may very well [approximate](approximation.md) by performing many iterations (let's 100000) and seeing if the value we get is "very large" (let's say 1000000000) when we stop -- this will work correctly for most points and those few points near the set borders where we make a wrong guess won't really be noticed unless we zoom in very close -- in such cases we can simply perform more iterations to increase precision. To add **[colors](color.md)** to the visualization (so that we don't observe just the borders but also some kind of structure inside and outside of the set) we may simply assign different colors to the points depending e.g. on how big the absolute value is at the time we stop the evaluation, or how many iterations it took for the absolute value to exceed given limit (for points outside the set). Also note that for nice pictures we should apply [antialiasing](antialiasing.md). Additional fancy filters and [shaders](shader.md) such as some kind of postprocessing or fake 3D can also be applied to make the result even more impressive.
|
I.e. taking any point *p* in the complex plane (whose real and imaginary parts we see as the *x* and *y* coordinates), plugging it into the above equation and iterating the series infinitely many times, if the absolute value of *z[n]* stays bounded under some finite value (even very large, just not infinitely large), the number belongs to the set, otherwise not (if the absolute value diverges towards infinity). I.e. in other words the Mandelbrot set is a set of kind of "well behaved" points that don't shoot away to infinity when we keep applying some operation to them over and over. Of course computers cannot evaluate infinitely many iterations of the series so they cannot compute the set 100% accurately, but we may very well [approximate](approximation.md) by performing many iterations (let's 100000) and seeing if the value we get is "very large" (let's say 1000000000) when we stop -- this will work correctly for most points and those few points near the set borders where we make a wrong guess won't really be noticed unless we zoom in very close -- in such cases we can simply perform more iterations to increase precision. To add **[colors](color.md)** to the visualization (so that we don't observe just the borders but also some kind of structure inside and outside of the set) we may simply assign different colors to the points depending e.g. on how big the absolute value is at the time we stop the evaluation, or how many iterations it took for the absolute value to exceed given limit (for points outside the set). Also note that for nice pictures we should apply [antialiasing](antialiasing.md). Additional fancy filters and [shaders](shader.md) such as some kind of postprocessing or fake 3D can also be applied to make the result even more impressive.
|
||||||
|
|
||||||
TODO: example on specific point
|
There are further **[optimizations](optimization.md)** we may apply to calculate the set faster. The set itself also lies in the circle centered at [0,0] with radius 2, so points outside this area can be safely marked as lying outside the set. Furthermore it's proven that if absolute value of *z[n]* ever gets greater than 2, the point won't lie in the set (because getting absolute value greater than 2 basically means we start checking a point that inevitably lies outside the circle with radius 2 inside which the whole set lies, so we know the point won't lie in the set). A quick [bailout](bailout.md) check (not requiring square roots etc.) here can therefore be e.g. checking if either the real of imaginary component absolute value exceeds 2 (which implies the whole vector length must exceed 2 as well), or checking if the sum of squares of the components exceeds 4 (i.e. we squared both sides of the equation and got rid of the square root). [Symmetry](symmetry.md) of the set can also be used to skip computing some points. Further more complex optimizations exist, based e.g. on estimating distance of any given point to the set border etc.
|
||||||
|
|
||||||
There are further [optimizations](optimization.md) we may apply to calculate the set faster, for example it's proven that if absolute value of *z[n]* ever gets greater than 2, the point won't lie in the set. The set itself also lies in the circle centered at [0,0] with radius 2, so points outside this area can be safely marked as lying outside the set.
|
**Quick example**: does point *[-0.75,1]* lie in the Mandelbrot set? Taking the above *x* and *y* coordinate equations we set *px = -0.75* and *py = 1*, our starting values are also these, i.e. *x[0] = -0.75* and *y[0] = 1*. Now *x[1] = x[0]^2 - y[0]^2 + px = (-0.75)^2 - 1^2 - 0.75 ~= -1.1875*, *y[1] = 2 * x[0] * y[0] + py = 2 * -0.75 * 1 + 1 ~= -0.5*. So after first iteration we got to approximately *[-1.1875,-0.5]*, the length of this vector is *sqrt((-1.1875)^2 + (-0.5)^2) ~= 1.28*, so we're still in the game. Now we repeat this all with these new coordinates, getting *x[2] ~= 0.4101* and *y[2] ~= 2.1875*, with length of the vector *sqrt(0.4101^2 + 2.1875^2) ~= 2.2256*. This value surpassed 2, so by the mentioned optimization we now know iterating further the value will only be getting higher and higher until infinity, so we conclude the original point *[-0.75,1]* does NOT lie in the Mandelbrot set.
|
||||||
|
|
||||||
As an alternative to drawing the set in the traditional plane with *x*/*y* axes correspond to the *real*/*imaginary* parts of the complex number, we may utilize different mappings, for example [polar coordinates](polar_coords.md) or the "inversion mode" (swapping zero and infinity) used in xaos. These may offer yet different angles of view of the set.
|
As an alternative to drawing the set in the traditional plane with *x*/*y* axes correspond to the *real*/*imaginary* parts of the complex number, we may utilize different mappings, for example [polar coordinates](polar_coords.md) or the "inversion mode" (swapping zero and infinity) used in xaos. These may offer yet different angles of view of the set.
|
||||||
|
|
||||||
|
@ -71,11 +105,11 @@ As the set is being studied and explored a lot, some even started to make maps o
|
||||||
- Point [0.372138,0.0903982] shows an infinitely zoomable point from which circular arms stem.
|
- Point [0.372138,0.0903982] shows an infinitely zoomable point from which circular arms stem.
|
||||||
- ...
|
- ...
|
||||||
|
|
||||||
**Generalizations and modifications**: mentioned [Julia sets](julia_set.md) are very similar to the Mandelbrot set. **[Multibrot](multibrot.md)** sets are sets similar to the Mandelbrot which we define by requiring *abs(z[n])* to not surpass some given value *T* under inifinite iteration, i.e. Mandelbrot set is one of Multibrot sets, that in which we set *T = 2* (because as mentioned above, reaching 2 always leads to divergence towards infinity); for different values of *T* we'll get similar but different Multibrot fractal sets. We may also modify the iterative equation from quadratic to cubic (replace *z[n]^2* with *z[n]^3*), or a different power (or modify the equation in similar ways) to again get sets similar to the Mandelbrot. Using [quaternions](quaternion.md) instead of complex numbers generalized Mandelbrot from 2D to 4D.
|
**Generalizations and modifications**: mentioned [Julia sets](julia_set.md) are very similar to the Mandelbrot set. **[Multibrot](multibrot.md)** sets are sets similar to the Mandelbrot which we define by requiring *abs(z[n])* to not surpass some given value *T* under inifinite iteration, i.e. Mandelbrot set is one of Multibrot sets, that in which we set *T = 2* (because as mentioned above, reaching 2 always leads to divergence towards infinity); for different values of *T* we'll get similar but different Multibrot fractal sets. We may also modify the iterative equation from quadratic to cubic (replace *z[n]^2* with *z[n]^3*), or a different power (or modify the equation in similar ways) to again get sets similar to the Mandelbrot. Using [quaternions](quaternion.md) instead of complex numbers generalized Mandelbrot from 2D to 4D. [Buddhabrot](buddhabrot.md) is another famous fractal (which looks like Buddha) and is related to Mandelbrot set.
|
||||||
|
|
||||||
## Code
|
## Code
|
||||||
|
|
||||||
The following code is a simple [C](c.md) program that renders the Mandelbrot set into terminal (for demonstrative purposes, it isn't efficient or do any [antialiasing](antialiasing.md)).
|
The following code is a simple [C](c.md) program that renders the Mandelbrot set into terminal (for demonstrative purposes, it isn't efficient or do any [antialiasing](antialiasing.md), also using [float](float.md) for simplicity but keep in mind [fixed point](fixed_point.md) can be easily used as well).
|
||||||
|
|
||||||
```
|
```
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -90,13 +124,13 @@ unsigned int mandelbrot(double x, double y)
|
||||||
{
|
{
|
||||||
double cx = x, cy = y, tmp;
|
double cx = x, cy = y, tmp;
|
||||||
|
|
||||||
for (int i = 0; i < 1000; ++i)
|
for (int i = 0; i < 1000; ++i) // 1000 iterations
|
||||||
{
|
{
|
||||||
tmp = cx * cx - cy * cy + x;
|
tmp = cx * cx - cy * cy + x;
|
||||||
cy = 2 * cx * cy + y;
|
cy = 2 * cx * cy + y;
|
||||||
cx = tmp;
|
cx = tmp;
|
||||||
|
|
||||||
if (cx * cx * cy * cy > 1000000000)
|
if (cx * cx + cy * cy > 4) // optimization
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,6 +165,10 @@ int main(void)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note on the optimization above: a naive line checking the divergence of the series would look e.g. like `if (sqrt(cx * cx + cy * cy) > 1000000000)`. However, as said above, it is enough to check if the value exceeds 2, as it's proven that then the series will surely diverge, so we can change it to `if (sqrt(cx * cx + cy * cy) > 2)`. Furthermore we can get rid of the [square root](sqrt.md) by squaring both sides of the inequality, so we get `if (cx * cx + cy * cy > 4)`. Hopefully this is one small example of why [math](math.md) is important for programming.
|
||||||
|
|
||||||
## See Also
|
## See Also
|
||||||
|
|
||||||
|
- [fractal](fractal.md)
|
||||||
|
- [Julia set](julia_set.md)
|
||||||
- [Buddhabrot](buddhabrot.md)
|
- [Buddhabrot](buddhabrot.md)
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
*Not to be confused with [Niger](niger.md).*
|
*Not to be confused with [Niger](niger.md).*
|
||||||
|
|
||||||
Nigger (also nigga, niBBa, N-word or chimp) is a [forbidden word](newspeak.md) that refers to a member of the [black](black.md) [race](race.md), [SJWs](sjw.md) call the word a [politically incorrect](political_correctness.md) "slur". Its counterpart targeted on white people is *[cracker](cracker.md)*. To Harry Potter fans the word may be compared to the word *Voldemort* which everyone is afraid to say out of fear of being [cancelled](cancel_culture.md). Nigger is not to be confused with [negro](negro.md) (which is a human [race](race.md) of only SOME black people, specifically those in central Africa).
|
Nigger (also nigga, niBBa, nigra, N-word or chimp) is a [forbidden word](newspeak.md) that refers to a member of the [black](black.md) [race](race.md), [SJWs](sjw.md) call the word a [politically incorrect](political_correctness.md) "slur". Its counterpart targeted on white people is *[cracker](cracker.md)*. To Harry Potter fans the word may be compared to the word *Voldemort* which everyone is afraid to say out of fear of being [cancelled](cancel_culture.md). Nigger is not to be confused with [negro](negro.md) (which is a human [race](race.md) of only SOME black people, specifically those in central Africa).
|
||||||
|
|
||||||
Let us remind new readers that we, [LRS](lrs.md), love all living beings, even black people <3 But we do not support [political correctness](political_correctness.md).
|
Let us remind new readers that we, [LRS](lrs.md), love all living beings, even black people <3 But we do not support [political correctness](political_correctness.md).
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ The word is used in a number of projects and works, e.g.:
|
||||||
|
|
||||||
{ LOL take a look at this https://encyclopediadramatica.online/Nigger, another take at https://wiki.soyjaks.party/Nigger. Another website: http://niggermania.com. Also https://www.chimpout.com. Another one: http://www.nigrapedia.com. ~drummyfish }
|
{ LOL take a look at this https://encyclopediadramatica.online/Nigger, another take at https://wiki.soyjaks.party/Nigger. Another website: http://niggermania.com. Also https://www.chimpout.com. Another one: http://www.nigrapedia.com. ~drummyfish }
|
||||||
|
|
||||||
**Pool's closed!** A famous [meme](meme.md) connected to the ape people was born as a part of now iconic raid of an MMO game called Habbo Hotel in which the bros creates shitton of african american characters with afros and blocked the access to the hotel pool with the statement that "pool's closed due to [aids](aids.md)". This spawned an entire wiki: http://www.nigrapedia.com.
|
**Pool's closed!** A famous [meme](meme.md) connected to the ape people was born as a part of now iconic raid of an MMO game called Habbo Hotel in which the bros creates shitton of african american characters with afros and blocked the access to the hotel pool with the statement that "pool's closed due to [aids](aids.md)". This spawned an entire wiki: http://www.nigrapedia.com. Similar themed raids have been happening in other games, for example in [World of Warcraft](wow.md) anons coordinated a raid in which they created dozens of black human characters, then gathered them at the Stormwind auction house and performed a public slave auction :D
|
||||||
|
|
||||||
[LMAO](lmao.md) they're even censoring art and retroactively changing classical works of art to suit this [newspeak](newspeak.md), just like all previous oppressive regimes. E.g. Agatha Christie's book *Ten Little Niggers* was renamed to *And Then There Were None*. Are they also gonna repaint Mona Lisa when it somehow doesn't suit their liking?
|
[LMAO](lmao.md) they're even censoring art and retroactively changing classical works of art to suit this [newspeak](newspeak.md), just like all previous oppressive regimes. E.g. Agatha Christie's book *Ten Little Niggers* was renamed to *And Then There Were None*. Are they also gonna repaint Mona Lisa when it somehow doesn't suit their liking?
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ These are mainly for [C](c.md), but may be usable in other languages as well.
|
||||||
- **Avoid branches (ifs)** if you can (remember [ternary operators](ternary_operator.md), loop conditions etc. are branches as well). They break prediction in CPU pipelines and instruction preloading and are often source of great performance losses. Don't forget that you can many times compare and use the result of operations without using any branching (e.g. `x = (y == 5) + 1;` instead of `x = (y == 5) ? 2 : 1;`).
|
- **Avoid branches (ifs)** if you can (remember [ternary operators](ternary_operator.md), loop conditions etc. are branches as well). They break prediction in CPU pipelines and instruction preloading and are often source of great performance losses. Don't forget that you can many times compare and use the result of operations without using any branching (e.g. `x = (y == 5) + 1;` instead of `x = (y == 5) ? 2 : 1;`).
|
||||||
- **Use iteration instead of [recursion](recursion.md)** if possible (calling a function costs something).
|
- **Use iteration instead of [recursion](recursion.md)** if possible (calling a function costs something).
|
||||||
- **Use [good enough](good_enough.md) [approximations](approximation.md) instead of completely accurate calculations**, e.g. taxicab distance instead of Euclidean distance, capsule shape to represent the player's collision shape rather than the 3D model's mesh etc. With a physics engine instead of running the simulation at the same FPS as rendering, you may just run it at half and [interpolate](interpolation.md) between two physics states at every other frame. Nice examples can also be found in [computer graphics](graphics.md), e.g. some [software renderers](sw_rendering.md) use perspective-correct texturing only for large near triangles and cheaper affine texturing for other triangles, which mostly looks OK.
|
- **Use [good enough](good_enough.md) [approximations](approximation.md) instead of completely accurate calculations**, e.g. taxicab distance instead of Euclidean distance, capsule shape to represent the player's collision shape rather than the 3D model's mesh etc. With a physics engine instead of running the simulation at the same FPS as rendering, you may just run it at half and [interpolate](interpolation.md) between two physics states at every other frame. Nice examples can also be found in [computer graphics](graphics.md), e.g. some [software renderers](sw_rendering.md) use perspective-correct texturing only for large near triangles and cheaper affine texturing for other triangles, which mostly looks OK.
|
||||||
- **Use quick opt-out conditions**: many times before performing some expensive calculation you can quickly check whether it's even worth performing it and potentially skip it. For example in physics [collision detections](collision_detection.md) you may first quickly check whether the bounding spheres of the bodies collide before running an expensive precise collision detection -- if bounding spheres of objects don't collide, it is not possible for the bodies to collide and so we can skip further collision detection.
|
- **Use quick [bailout](bailout.md) conditions**: many times before performing some expensive calculation you can quickly check whether it's even worth performing it and potentially skip it. For example in physics [collision detections](collision_detection.md) you may first quickly check whether the bounding spheres of the bodies collide before running an expensive precise collision detection -- if bounding spheres of objects don't collide, it is not possible for the bodies to collide and so we can skip further collision detection.
|
||||||
- **Operations on static data can be accelerated with accelerating structures** ([look-up tables](lut.md) for functions, [indices](indexing.md) for database lookups, spatial grids for collision checking, various [trees](tree.md) ...).
|
- **Operations on static data can be accelerated with accelerating structures** ([look-up tables](lut.md) for functions, [indices](indexing.md) for database lookups, spatial grids for collision checking, various [trees](tree.md) ...).
|
||||||
- **Use powers of 2** (1, 2, 4, 8, 16, 32, ...) whenever possible, this is efficient thanks to computers working in [binary](binary.md). Not only may this help nice utilization and alignment of memory, but mainly multiplication and division can be optimized by the compiler to mere bit shifts which is a tremendous speedup.
|
- **Use powers of 2** (1, 2, 4, 8, 16, 32, ...) whenever possible, this is efficient thanks to computers working in [binary](binary.md). Not only may this help nice utilization and alignment of memory, but mainly multiplication and division can be optimized by the compiler to mere bit shifts which is a tremendous speedup.
|
||||||
- **Memory alignment usually helps speed**, i.e. variables at "nice addresses" (usually multiples of the platform's native integer size) are faster to access, but this may cost some memory (the gaps between aligned data).
|
- **Memory alignment usually helps speed**, i.e. variables at "nice addresses" (usually multiples of the platform's native integer size) are faster to access, but this may cost some memory (the gaps between aligned data).
|
||||||
|
|
3284
random_page.md
3284
random_page.md
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
|
@ -3,8 +3,8 @@
|
||||||
This is an autogenerated article holding stats about this wiki.
|
This is an autogenerated article holding stats about this wiki.
|
||||||
|
|
||||||
- number of articles: 557
|
- number of articles: 557
|
||||||
- number of commits: 691
|
- number of commits: 692
|
||||||
- total size of all texts in bytes: 2999344
|
- total size of all texts in bytes: 2999431
|
||||||
|
|
||||||
longest articles:
|
longest articles:
|
||||||
|
|
||||||
|
@ -24,6 +24,15 @@ longest articles:
|
||||||
latest changes:
|
latest changes:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
Date: Wed Feb 14 21:56:29 2024 +0100
|
||||||
|
css.md
|
||||||
|
feminism.md
|
||||||
|
flatland.md
|
||||||
|
often_confused.md
|
||||||
|
random_page.md
|
||||||
|
wiki_pages.md
|
||||||
|
wiki_stats.md
|
||||||
|
wiki_style.md
|
||||||
Date: Tue Feb 13 21:57:06 2024 +0100
|
Date: Tue Feb 13 21:57:06 2024 +0100
|
||||||
ascii.md
|
ascii.md
|
||||||
assembly.md
|
assembly.md
|
||||||
|
@ -44,20 +53,6 @@ Date: Tue Feb 13 17:12:51 2024 +0100
|
||||||
100r.md
|
100r.md
|
||||||
c.md
|
c.md
|
||||||
game_of_life.md
|
game_of_life.md
|
||||||
history.md
|
|
||||||
how_to.md
|
|
||||||
internet.md
|
|
||||||
langtons_ant.md
|
|
||||||
mandelbrot_set.md
|
|
||||||
pedophilia.md
|
|
||||||
pi.md
|
|
||||||
programming_language.md
|
|
||||||
random_page.md
|
|
||||||
resnicks_termite.md
|
|
||||||
wiki_pages.md
|
|
||||||
wiki_stats.md
|
|
||||||
xxiivv.md
|
|
||||||
Date: Mon Feb 12 20:36:38 2024 +0100
|
|
||||||
```
|
```
|
||||||
|
|
||||||
most wanted pages:
|
most wanted pages:
|
||||||
|
|
Loading…
Reference in a new issue