From b5006e62e5b96d873fc750a14c98831a62daa0cc Mon Sep 17 00:00:00 2001 From: Miloslav Ciz Date: Sun, 1 Jan 2023 14:58:49 +0100 Subject: [PATCH] Update --- apple.md | 4 +++- assembly.md | 4 ++-- bill_gates.md | 2 +- binary.md | 33 +++++++++++++++++++-------- capitalism.md | 2 +- chess.md | 3 ++- coc.md | 2 +- copyleft.md | 7 +++--- faq.md | 2 +- float.md | 2 ++ intellectual_property.md | 4 +++- line.md | 49 ++++++++++++++++++++++++++++++++++++++++ linux.md | 12 ++++++++-- microsoft.md | 2 +- nigger.md | 2 +- open_source.md | 2 +- patent.md | 21 +++++++++++++++++ twos_complement.md | 4 +++- unix_philosophy.md | 2 ++ 19 files changed, 131 insertions(+), 28 deletions(-) create mode 100644 line.md create mode 100644 patent.md diff --git a/apple.md b/apple.md index f5df366..512fc7f 100644 --- a/apple.md +++ b/apple.md @@ -1,3 +1,5 @@ # Apple -Apple is a [terrorist](terrorism.md) organization and one of the biggest [American](usa.md) computer fashion [corporations](corporation.md), infamously founded by [Steve Jobs](steve_jobs.md), it creates and sells overpriced, abusive, highly consumerist electronic devices. \ No newline at end of file +Apple is a [terrorist](terrorism.md) organization and one of the biggest [American](usa.md) computer fashion [corporations](corporation.md), infamously founded by [Steve Job$](steve_jobs.md), it creates and sells overpriced, abusive, highly consumerist proprietary electronic devices. + +Take a look e.g. at [Apple's Dark Side at Techrights](http://techrights.org/wiki/Apple%27s_Dark_Side). \ No newline at end of file diff --git a/assembly.md b/assembly.md index 40e1f01..3c51a4b 100644 --- a/assembly.md +++ b/assembly.md @@ -1,8 +1,8 @@ # Assembly -*GUYS I AM NOT SUCH GREAT AT ASSEMBLY, correct my errors* +*GUYS I AM NOT SO GREAT AT ASSEMBLY, correct my errors* -Assembly is, for any given hardware platform ([ISA](isa.md)), the unstructured, lowest levels language -- it maps 1:1 to [machine code](machine_code.md) (the actual CPU instructions) and only differs from actual binary machine code by utilizing a more human readable form. Assembly is compiled by [assembler](assembler.md) into the the machine code. Assembly is **not** a single language, it differs for every architecture, and is therefore not [portable](portability.md)! +Assembly is, for any given hardware platform ([ISA](isa.md)), the unstructured, lowest levels [programming language](programming_language.md) -- it maps (mostly) 1:1 to [machine code](machine_code.md) (the actual binary CPU instructions) and basically only differs from the actual machine code by utilizing a more human readable form. Assembly is compiled by [assembler](assembler.md) into the the machine code. Assembly is **not** a single language, it differs for every architecture, and is therefore not [portable](portability.md)! ## Typical Assembly Language diff --git a/bill_gates.md b/bill_gates.md index aca5868..74f5482 100644 --- a/bill_gates.md +++ b/bill_gates.md @@ -1,6 +1,6 @@ # Bill Gate$ -William "Bill" Gates (28.10.1955 -- TODO) is a [mass murderer and rapist](entrepreneur.md) (i.e. [capitalist](capitalism.md)) who established and led the terrorist organization [Micro$oft](microsoft.md). +William "Bill" Gates (28.10.1955 -- TODO) is a [mass murderer and rapist](entrepreneur.md) (i.e. [capitalist](capitalism.md)) who established and led the terrorist organization [Micro$oft](microsoft.md). He is one of the most rich and evil individuals in history who took over the world by force establishing the [malware](malware.md) operating system [Window$](windows.md) as the common operating system, nowadays being dangerous especially by hiding behind his "charity organization" (see [charitywashing](charitywashing.md)) which has been widely criticized (even by such mainstream media as [Wikipedia](wikipedia.md)) but which nevertheless makes him look as someone doing "public good" in the eyes of the naive brainless NPC masses. He is really dumb, only speaks one language and didn't even finish university. He also has no moral values, but that goes without saying for any rich businessman. He was owned pretty hard in [chess](chess.md) by Magnus Carlsen on some shitty TV show. diff --git a/binary.md b/binary.md index 4aac7d1..6659162 100644 --- a/binary.md +++ b/binary.md @@ -2,26 +2,39 @@ The word binary in general refers to having two choices; in [computer science](compsci.md) binary refers to the base 2 numeral system, i.e. a system of writing numbers with only two symbols, usually [1](one.md)s and [0](zero.md)s. We can write any number in binary just as we can with our everyday [decimal](decimal.md) system, but binary is more convenient for computers because this system is easy to implement in [electronics](electronics.md) (a switch can be on or off, i.e. 1 or 0; systems with more digits were tried but unsuccessful, they failed miserably in reliability). The word *binary* is also by extension used for non-textual computer [files](file.md) such as native [executable](executable.md) programs or asset files for games. -One binary digit can be used to store exactly 1 [bit](bit.md) of [information](information.md). So the number of places we have for writing a binary number (e.g. in computer memory) is called a number of bits or bit **width**. A bit width *N* allows for storing 2^N values (e.g. with 2 bits we can store 4 values: 0, 1, 2 and 3). +One binary digit can be used to store exactly 1 [bit](bit.md) of [information](information.md). So the number of places we have for writing a binary number (e.g. in computer memory) is called a number of bits or bit **width**. A bit width *N* allows for storing 2^N values (e.g. with 2 bits we can store 4 values: 0, 1, 2 and 3, in binary 00, 01, 10 and 11). -At the basic level binary works just like the [decimal](decimal.md) (base 10) system we're used to. While the decimal system uses powers of 10, binary uses powers of 2. +At the basic level binary works just like the [decimal](decimal.md) (base 10) system we're used to. While the decimal system uses powers of 10, binary uses powers of 2. Here is a table showing a few numbers in decimal and binary: -For **example** let's have a number that's written as 10135 in decimal. The first digit from the right (5) says the number of 10^(0)s (= 1) in the number, the second digit (3) says the number of 10^(1)s (= 10), the third digit (1) says the number of 10^(2)s (= 100) etc. Similarly if we now have a number **100101** in binary, the first digit from the right (1) says the number of 2^(0)s (= 1), the second digit (0) says the number of 2^(1)s (= 2), the third digit (1) says the number of 2^(2)s (=4) etc. Therefore this binary number can be **converted to decimal** by simply computing 1 * 2^0 + 0 * 2^1 + 1 * 2^2 + 0 * 2^3 + 0 * 2^4 + 1 * 2^5 = 1 + 4 + 32 = **37**. +| decimal | binary | +| ------- | ------ | +| 0 | 0 | +| 1 | 1 | +| 2 | 10 | +| 3 | 11 | +| 4 | 100 | +| 5 | 101 | +| 6 | 110 | +| 7 | 111 | +| 8 | 1000 | +| ... | ... | -To **convert from decimal** to binary we can use a simple [algorithm](algorithm.md) that's derived from the above. Let's say we have a number *X* we want to write in binary. We will write digits from right to left. The first (rightmost) digit is the remainder after integer division of *X* by 2. Then we divide the number by 2. The second digit is again the remainder after division by 2. Then we divide the number by 2 again. This continues until the number is 0. For example let's convert the number 22 to binary: first digit = 22 % 2 = **0**; 22 / 2 = 11, second digit = 11 % 2 = **1**; 11 / 2 = 5; third digit = 5 % 2 = **1**; 5 / 2 = 2; 2 % 2 = **0**; 2 / 2 = 1; 1 % 2 = **1**; 1 / 2 = 0. The result is **10110**. +**Conversion to decimal**: let's see an example that utilizes the facts mentioned above. Let's have a number that's written as 10135 in decimal. The first digit from the right (5) says the number of 10^(0)s (1s) in the number, the second digit (3) says the number of 10^(1)s (10s), the third digit (1) says the number of 10^(2)s (100s) etc. Similarly if we now have a number **100101** in binary, the first digit from the right (1) says the number of 2^(0)s (1s), the second digit (0) says the number of 2^(1)s (2s), the third digit (1) says the number of 2^(2)s (4s) etc. Therefore this binary number can be converted to decimal by simply computing 1 * 2^0 + 0 * 2^1 + 1 * 2^2 + 0 * 2^3 + 0 * 2^4 + 1 * 2^5 = 1 + 4 + 32 = **37**. + +To **convert from decimal** to binary we can use a simple [algorithm](algorithm.md) that's again derived from the above. Let's say we have a number *X* we want to write in binary. We will write digits from right to left. The first (rightmost) digit is the remainder after integer division of *X* by 2. Then we divide the number by 2. The second digit is again the remainder after division by 2. Then we divide the number by 2 again. This continues until the number is 0. For example let's convert the number 22 to binary: first digit = 22 % 2 = **0**; 22 / 2 = 11, second digit = 11 % 2 = **1**; 11 / 2 = 5; third digit = 5 % 2 = **1**; 5 / 2 = 2; 2 % 2 = **0**; 2 / 2 = 1; 1 % 2 = **1**; 1 / 2 = 0. The result is **10110**. TODO: operations in binary -In binary it is very simple and fast to divide and multiply by (powers of) 2, just as it is simply to divide and multiple by (powers of) 10 in decimal (we just shift the radix point, e.g. the binary number 1011 multiplied by 4 is 101100, we just added two zeros at the end). This is why as a programmer **you should prefer working with powers of two**. +In binary it is very simple and fast to divide and multiply by powers of 2 (1, 2, 4, 8, 16, ...), just as it is simply to divide and multiple by powers of 10 (1, 10, 100, 1000, ...) in decimal (we just shift the radix point, e.g. the binary number 1011 multiplied by 4 is 101100, we just added two zeros at the end). This is why as a programmer **you should prefer working with powers of two** (your programs can be faster if the computer can perform basic operations faster). -Binary can be very easily converted to and from [hexadecimal](hexadeciaml.md) and [octal](octal.md) because 1 hexadecimal (octal) digit always maps to exactly 4 (3) binary digits. E.g. the hexadeciaml number F0 is 11110000 in binary. +**Binary can be very easily converted to and from [hexadecimal](hexadeciaml.md) and [octal](octal.md)** because 1 hexadecimal (octal) digit always maps to exactly 4 (3) binary digits. E.g. the hexadeciaml number F0 is 11110000 in binary (1111 is always equaivalent to F, 0000 is always equivalent to 0). This doesn't hold for the decimal base, hence programmers often tend to avoid base 10. -We can work with the binary representation the same way as with decimal, i.e. we can e.g. write negative numbers such as -110101 or [rational numbers](rational_number.md) such as 1011.001101. However in a computer memory there are no other symbols than 1 and 0, so we can't use extra symbols such as *-* or *.* to represent such values. So if we want to represent more numbers than non-negative integers, we literally have to only use 1s and 0s and choose a specific **representation**, or **format** of numbers -- there are several formats for representing e.g. [signed](signed.md) (potentially negative) or rational numbers, each with pros and cons. The following are the most common number representations: +We can work with the binary representation the same way as with decimal, i.e. we can e.g. write negative numbers such as -110101 or [rational numbers](rational_number.md) (or even [real numbers](real_number.md)) such as 1011.001101. However in a computer memory there are no other symbols than 1 and 0, so we can't use extra symbols such as *-* or *.* to represent such values. So if we want to represent more numbers than non-negative integers, we literally have to only use 1s and 0s and choose a specific **representation**/**format**/encoding of numbers -- there are several formats for representing e.g. [signed](signed.md) (potentially negative) or rational (fractional) numbers, each with pros and cons. The following are the most common number representations: - **[two's complement](twos_complement.md)**: Allows storing integers, both positive, negative and zero. It is **probably the most common representation** of integers because of its great advantages: basic operations (+, -, *) are performed exactly the same as with "normal" binary numbers, and there is no negative zero (which would be an inconvenience and waste of memory). Inverting a number (from negative to positive and vice versa) is done simply by inverting all the bits and adding 1. The leftmost bit signifies the number's sign (0 = +, 1 = -). -- **[sign-magnitude](sign_magnitude.md)**: Allows storing integers, both positive, negative and zero. It's pretty straightforward: the leftmost bit in a number serves as a sign, 0 = +, 1 = -, and the rest of the number is the distance from zero in "normal" representation. So e.g. 0011 is 3 while 1011 is -3. The disadvantage is there are two values for zero (positive, 0000 and [negative](negative_zero.md), 1000) which wastes a value and presents a computational inconvenience, and operations with these numbers are more complicated and slower (checking the sign requires extra code). -- **[one's complement](ones_complement.md)**: Allows storing integers, both positive, negative and zero. The leftmost bit signifies a sign, in the same way as with sign-magnitude, but numbers are inverted differently: a positive number is turned into negative (and vice versa) by inverting all bits. So e.g. 0011 is 3 while 1100 is -3. The disadvantage is there are two values for zero (positive, 0000 and [negative](negative_zero.md), 1111) which wastes a value and presents a computational inconvenience, and some operations with these numbers may be more complex. -- **[fixed point](fixed_point.md)**: Allows storing [rational numbers](rational_number.md) (fractions), i.e. numbers with a radix point (such as 1101.011), which can also be positive, negative or zero. It works by supposing a radix point at some fixed position in the binary representation, e.g. if we have an 8 bit number, we may consider 5 leftmost bits to represent the whole part and 3 rightmost bits to be the fractional part (so e.g the number 11010110 represents 11010.110). The advantage here is extreme simplicity (we can use normal integer numbers as fixed point simply by imagining a radix point). The disadvantage may be low precision and small range of representable values. +- **[sign-magnitude](sign_magnitude.md)**: Allows storing integers, both positive, negative and zero. It's pretty straightforward: the leftmost bit in a number serves as a sign (0 means +, 1 means -) and the rest of the number is the distance from zero in "normal" representation. So e.g. a 4 bit number 0011 is 3 while 1011 is -3 (note that we have to know the bit width of the number here, e.g. on 8 bits -3 would be 10000011). The disadvantage is there are two values for zero (positive, 0000 and [negative](negative_zero.md), 1000) which wastes a value and presents a computational inconvenience, and operations with these numbers are more complicated and slower (checking the sign requires extra code). +- **[one's complement](ones_complement.md)**: Allows storing integers, both positive, negative and zero. The leftmost bit signifies a sign, in the same way as with sign-magnitude, but numbers are inverted differently: a positive number is turned into negative (and vice versa) by inverting all bits. So e.g. 0011 is 3 while 1100 is -3 (again, bit width matters). The disadvantage is there are two values for zero (positive, 0000 and [negative](negative_zero.md), 1111) which wastes a value and presents a computational inconvenience, and some operations with these numbers may be more complex. +- **[fixed point](fixed_point.md)**: Allows storing [rational numbers](rational_number.md) (fractions), i.e. numbers with a radix point (such as 1101.011), which can also be positive, negative or zero. It works by imagining a radix point at some fixed position in the binary representation, e.g. if we have an 8 bit number, we may consider 5 leftmost bits to represent the whole part and 3 rightmost bits to be the fractional part (so e.g the number 11010110 represents 11010.110). The advantage here is extreme simplicity (we can use normal integer numbers as fixed point simply by imagining a radix point). The disadvantage may be low precision and small range of representable values. - **[floating point](float.md)**: Allows storing [rational numbers](rational_number.md) in great ranges, both positive, negative and zero, plus some additional values such as [infinity](infinity.md) and *[not a number](nan.md)*. It allows the radix point to be shifted which gives a potential for storing extremely big and extremely small numbers at the same time. The disadvantage is that float is extremely complex, [bloated](bloat.md), wastes some values and for fast execution requires a special hardware unit (which most "normal" computers nowadays have, but are missing e.g. in some [embedded systems](embedded.md)). As anything can be represented with numbers, binary can be used to store any kind of information such as text, images, sounds and videos. See [data structures](data_structure.md) and [file formats](file_format.md). diff --git a/capitalism.md b/capitalism.md index ced058a..b0b2939 100644 --- a/capitalism.md +++ b/capitalism.md @@ -4,7 +4,7 @@ Capitali$m is the worst (not only) economic system we've yet seen in [history](history.md),^[source](logic.md) literally based on pure greed and artificially sustained conflict between people (so called [competition](competition.md)), abandoning all morals and putting money and profit (so called [capital](capital.md)) above everything else including preservation of life itself, capitalism fuels the worst in people and forces them to compete and suffer for basic resources, even in a world where abundance of resources is already possible to achieve. Capitalism goes against progress (see e.g. [antivirus paradox](antivirus_paradox.md)), [good technology](lrs.md), freedom, it supports immense waste of resources, wars, abuse of people, destruction of environment, decline of morals, invention of [bullshit](bullshit.md) (bullshit jobs, bullshit laws, ...), [torture](marketing.md) of people and animals and much more. Nevertheless, it's been truthfully stated that "it is now easier to imagine the end of all life than any substantial change in capitalism." Another famous quote is that "capitalism is the belief that the worst of men driven by the nastiest motives will somehow work for the benefit of everyone", which is quite correct. -**Capitalism is fundamentally flawed** -- capitalists build on the idea that competition will drive society, that market will be self sustaining, however capitalism itself works for instating the rule of the winners who eliminate their competition, capitalism is self destabilizing, i.e. the driving force of capitalism is completely unsustainable and leads to catastrophic results as those who get ahead in working competition are also in advantage -- as it's said: money makes money, therefore money flow from the poor to the rich and create a huge imbalance in which competition has to be highly forced, eventually completely arbitrarily and in very harmful ways (invention of bullshit jobs, creating artificial needs and hugely complex laws). It's as if we set up a race in which those who get ahead start to also go faster -- expecting a sustained balance in such a race is just insanity. Society tries to "[fight](fight_culture.md)" this emerging imbalance with various laws and rules of market, but this effort is like trying to fight math itself -- the system is mathematically destined to be unstable, pretending we can win over laws of nature themselves is just pure madness. +**Capitalism is fundamentally flawed and cannot be fixed** -- capitalists build on the idea that competition will drive society, that market will be self sustaining, however capitalism itself works for instating the rule of the winners who eliminate their competition, capitalism is self destabilizing, i.e. the driving force of capitalism is completely unsustainable and leads to catastrophic results as those who get ahead in working competition are also in advantage -- as it's said: money makes money, therefore money flow from the poor to the rich and create a huge imbalance in which competition has to be highly forced, eventually completely arbitrarily and in very harmful ways (invention of bullshit jobs, creating artificial needs and hugely complex laws). It's as if we set up a race in which those who get ahead start to also go faster -- expecting a sustained balance in such a race is just insanity. Society tries to "[fight](fight_culture.md)" this emerging imbalance with various laws and rules of market, but this effort is like trying to fight math itself -- the system is mathematically destined to be unstable, pretending we can win over laws of nature themselves is just pure madness. Capitalism produces the [worst imaginable technology](capitalist_software.md) and rewards people for [being cruel to each other](entrepreneur.md). It points the direction of society towards a [collapse](collapse.md) and may very likely be the [great filter](great_filter.md) of civilizations; in capitalism people de-facto own nothing and become wholly dependent on corporations which exploit this fact to abuse them as much as possible. This is achieved by [slowly boiling the frog](slowly_boiling_the_frog.md). No one owns anything, products become [services](saas.md) (your car won't drive without Internet connection and permission from its manufacturer), all independency and decentralization is lost in favor of a highly fragile and interdependent economy and infrastructure of services. Then only a slight break in the chain is enough to bring the whole civilization down in a spectacular domino effect. diff --git a/chess.md b/chess.md index 511185d..ef7326b 100644 --- a/chess.md +++ b/chess.md @@ -171,4 +171,5 @@ Chess is only mildly [bloated](bloat.md) but what if we try to unbloat it comple ## See Also - [hexapawn](hexapawn.md) -- [checkers](checkers.md) \ No newline at end of file +- [checkers](checkers.md) +- [backgammon](backgammon.md) \ No newline at end of file diff --git a/coc.md b/coc.md index 8fc4d3f..1b2ebf9 100644 --- a/coc.md +++ b/coc.md @@ -1,6 +1,6 @@ # Code of Conduct -Code of conduct (COC) is a shitty invention of [SJW](sjw.md) fascists that dictates how development of specific software should be conducted, generally pushing toxic woke concepts such as forced inclusivity or use of politically correct language. COC is typically placed in the software repository as a `CODE_OF_CONDUCT` file. In practice COCs are used to kick people out of development because of their political opinions expressed anywhere, inside or outside the project, and to push political opinions through software projects. +Code of conduct (COC), also Code of coercion, is a shitty invention of [SJW](sjw.md) fascists that dictates how development of specific software should be conducted, generally pushing toxic woke concepts such as forced inclusivity or use of politically correct language. COC is typically placed in the software repository as a `CODE_OF_CONDUCT` file. In practice COCs are used to kick people out of development because of their political opinions expressed anywhere, inside or outside the project, and to push political opinions through software projects. **[LRS](lrs.md) must never include any COC**, with possible exceptions of anti-COC (such as NO COC) or parody style COCs, not because we dislike genuine inclusivity, but because we believe COCs are bullshit and mostly harmful as they support bullying, censorship and exclusion of people. diff --git a/copyleft.md b/copyleft.md index 8ee3596..dc149c3 100644 --- a/copyleft.md +++ b/copyleft.md @@ -1,6 +1,6 @@ # Copyleft -Copyleft (also share-alike) is a concept of sharing something on the condition that others will share it under the same terms; this is practically always used by a subset of [free (as in freedom) software](free_software.md) to legally ensure this software and its modifications will always remain free. This kind of [hacks](hack.md) [copyright](copyright.md) to de-facto remove copyright by its own power. +Copyleft (also share-alike) is a concept of sharing something on the condition that others will share it under the same terms; this is practically always used by a subset of [free (as in freedom) software](free_software.md) and [culture](free_culture.md) to legally ensure this software/art and its modifications will always remain free. This kind of [hacks](hack.md) [copyright](copyright.md) to de-facto remove copyright by its own power. Copyleft has been by its mechanisms likened to a virus because once it is applied to certain software, it "infects" it and will force its conditions on any descendants of that software, i.e. it will spread itself (in this case the word virus does not bear a negative connotation, at least to some, they see it as a good virus). @@ -12,7 +12,8 @@ In the [FOSS](foss.md) world there is a huge battle between the copyleft camp an In the great debate of copyleft vs permissive free licenses we, as technological anarchists, stand on the permissive side. Here are some reasons for why we reject copyleft: -- By adopting copyleft one is **embracing and supporting the copyright laws** ("marrying the lawyers") because copyleft relies on and uses copyright laws. Copyleft chooses to play along with the capitalist bullshit [intellectual property](intellectual_property.md) game and threatens to use force and bullying in order to enforce *correct* usage of information. +- By adopting copyleft one is **embracing and supporting the copyright laws and perpetuating the [capitalist](capitalism.md) ways** ("marrying the lawyers") because copyleft relies on and uses copyright laws. Copyleft chooses to play along with the capitalist bullshit [intellectual property](intellectual_property.md) game and threatens to use force and bullying in order to enforce *correct* usage of information. - In a way it is **[bloat](bloat.md)**. Copyleft introduces **legal complexity**, [friction](friction.md) and takes programmers' [head space](head_space.md), especially when copyleft is probably mostly ineffective as **detecting its violation and actual legal enforcement is difficult, expensive and without a guaranteed positive outcome** ([FSF](fsf.md) encourages programmers to hand over their copyright to them so they can defend their programs which just confirms existence and relevance of this issue). Sure, corporations can probably "abuse" permissive (non-copyleft) software easier, but we argue that this is a problem whose roots lie in the broken basic principles of our society ([capitalism](capitalism.md)) and so the issue should be addressed by improving our socioeconomic system rather than by bullshit legal techniques that just imperfectly and many times completely ineffectively try to cure the symptoms. - **The scope of copyleft is highly debatable** (which is why we have different kind of copyleft such as *strong*, *weak*, *network* etc.). I.e. it can't be objectively said what exactly should classify as violation of copyleft AND increasing copyleft scope leads to copylefted software being practically unusable. Consider this **example**: [Linux](linux.md) is copylefted which means we can't create a proprietary version of Linux, nevertheless we can create a proprietary operating system of which Linux is part (e.g. [Android](android.md) in which its proprietary app store makes it de-facto owned by [Google](google.md)), and so Linux is effectively used as a part of proprietary software -- the copyleft is bypassed. One might try to increase the copyleft scope here by saying *"everything Linux ever touches has to be free software"* which would however render Linux unusable on practically any computer as most computers contain at least some small proprietary software and hardware. The restriction would be too great. -- In practice, **copyleft licenses have to be complex and ugly** because they have to strictly describe the copyleft scope and include lots of legal [boilerplate](boilerplate.md) in order to make them well defendable in court -- and as we know, complexity comes with bugs, vulnerabilities and other burden. Indeed, we see this in practice: the only practically used copyleft licenses are the various versions of GPL of which all are ugly and have historically shown many faults (which is again evident from e.g. looking at GPL v1 vs v2 vs v3). Permissive licenses on the other hand are simple, clear and well understandable. +- In practice, **copyleft licenses have to be complex and ugly** because they have to strictly describe the copyleft scope and include lots of legal [boilerplate](boilerplate.md) in order to make them well defendable in court -- and as we know, complexity comes with bugs, vulnerabilities and other burden. Indeed, we see this in practice: the only practically used copyleft licenses are the various versions of GPL of which all are ugly and have historically shown many faults (which is again evident from e.g. looking at GPL v1 vs v2 vs v3). This introduces great license compatibility issues and similar bullshit. Permissive licenses on the other hand are simple, clear and well understandable. +- **Copyleft prevents not only inclusion in proprietary software but also in permissive FREE software.** I.e. as a consequence of denying code to corporations collateral damage is done by also denying code to ethical free software that wishes to be distributed without copyleft conditions. Similarly to how proprietary software forces free software programmers to reinvent wheels by rewriting software as free, copyleft forces permissive free software programmers to reinvent wheels and rewrite copylefted code as permissive. diff --git a/faq.md b/faq.md index a7e53df..f20face 100644 --- a/faq.md +++ b/faq.md @@ -6,7 +6,7 @@ ### Is this a joke? Are you trolling? -No. +No. Jokes are [here](jokes.md). ### What the fuck? diff --git a/float.md b/float.md index ab8e6a2..24a4c39 100644 --- a/float.md +++ b/float.md @@ -2,6 +2,8 @@ Floating point arithmetic (normally just *float*) is a method of computer representation of [fractional](rational_number.md) numbers and approximating [real numbers](real_number.md), i.e. numbers with higher than [integer](integer.md) precision (such as 5.13), which is more complex than e.g. [fixed point](fixed_point.md). The core idea of it is to use a radix ("decimal") point that's not fixed but can move around so as to allow representation of both very small and very big values. Nowadays floating point is the standard way of [approximating](approximation.md) [real numbers](real_number.md) in computers (floating point types are called *real* in some programming languages, even though they represent only [rational numbers](rational_number.md), floats can't e.g. represent [pi](pi.md) exactly), basically all of the popular [programming languages](programming_language.md) have a floating point [data type](data_type.md) that adheres to the IEEE 754 standard, all personal computers also have the floating point hardware unit (FPU) and so it is widely used in all [modern](modern.md) programs. However most of the time a simpler representation of fractional numbers, such as the mentioned [fixed point](fixed_point.md), suffices, and weaker computers (e.g. [embedded](embedded.md)) may lack the hardware support so floating point operations are emulated in software and therefore slow -- for these reasons we consider floating point [bloat](bloat.md) and recommend the preference of fixed point. +Floating point can also get tricky, it works most of the time but a danger lies in programmers relying on this kind of [magic](magic.md) too much, some new generation programmers may not even be very aware of how float works. One possible pitfall is working with big and small numbers at the same time -- due to differing precision at different scales small values simply get lost when mixed with big numbers and sometimes this has to be worked around with tricks (see e.g. [this](http://the-witness.net/news/2022/02/a-shader-trick/) devlog of The Witness where a float time variable sent into [shader](shader.md) is periodically reset so as to not grow too large and cause the mentioned issue). + Is floating point literal evil? Well, of course not, but it is extremely overused. You may need it for precise scientific simulations, e.g. [numerical integration](numerical_integration.md), but as our [small3dlib](small3dlib.md) shows, you can comfortably do even [3D rendering](3d_rendering.md) without it. So always consider whether you REALLY need float. You mostly do not. ## How It Works diff --git a/intellectual_property.md b/intellectual_property.md index 91e7e0f..7228e14 100644 --- a/intellectual_property.md +++ b/intellectual_property.md @@ -1,6 +1,8 @@ # Intellectual Property -Intellectual property (IP, not to be confused with [IP address](ip_address.md)) is a toxic [capitalist](capitalism.md) idea that says that people should be able to own [information](information.md) (such as ideas or songs) and that it should be treated in ways very similar to physical property. For example [patents](patent.md) are one type of intellectual property which allow an inventor of some idea to *own* that idea and be able to limit its use and charge money to people using that idea. [Copyright](copyright.md) is probably the most harmful of IP today, and along with patents the most relevant one in the area of technology. However, IP encompasses many other subtypes of this kind of "property" such as [trademarks](trademark.md), trade dress, plant varieties etc. +Intellectual property (IP, not to be confused with [IP address](ip_address.md)) is a toxic [capitalist](capitalism.md) idea that says that people should be able to own [information](information.md) (such as ideas, presentation style, songs or text) and that it should be treated in ways very similar to physical property. For example [patents](patent.md) are one type of intellectual property which allow an inventor of some idea to *own* that idea and be able to limit its use and charge money to people using that idea, or prevent people from using that idea altogether. [Copyright](copyright.md) is probably the most harmful of IP today, and along with patents the most relevant one in the area of technology. However, IP encompasses many other subtypes of this kind of "property" such as [trademarks](trademark.md), trade dress, plant varieties etc. IP is an arbitrarily invented grant of monopoly on information, i.e. something that is otherwise naturally free. + +Most people with brain oppose this idea, see e.g. http://harmful.cat-v.org/economics/intellectual_property/. IP exists to benefit corporations, it artificially limits the natural [freedom of information](information_freedom.md) and tries to eliminate freedom and competition, it fuels consumerism (for example a company can force deletion of old version of its program in order to force users to buy the new version), it helps keep malicious features in programs (by forbidding any study and modifications) and forces reinventing wheels which is extremely energy and resource wasting. Without IP, everyone would be able to study, share, improve and remix and combine existing technology and art. diff --git a/line.md b/line.md new file mode 100644 index 0000000..866dc65 --- /dev/null +++ b/line.md @@ -0,0 +1,49 @@ +# Line + +Line is one of the most basic geometric shapes, it is straight, continuous, infinitely long and infinitely thin. A finite continuous part of a line is called **line segment**, though in practice we sometimes call line segments also just *lines*. Shortest path between any two points always lies on a line. { At least I hope :D ~drummyfish } + +Line is a one [dimensional](dimension.md) shape, i.e. any of its points can be identified by a single straightforward number (signed distance from a certain point on the line). But of course a line itself may exist in more than one dimensional spaces (just as a two dimensional sheet of paper can exist in our three dimensional space etc.). + +``` + / | \ + / ________ | \ + / | \ +/ | \ +``` + +*some lines, in case you haven't see one yet* + +## Equations + +Mathematically lines can be defined by equations with space coordinates (see [analytic geometry](analytic_geometry.md)) -- this is pretty important for example for [programming](programming.md) as many times we need to compute intersections with lines; for example [ray casting](ray_casting.md) is a method of 3D rendering that "shoots lines from camera" and looks at which objects the lines intersect. Line equations can have different "formats", the two most important are: + +- **point-slope**: This equation only works in 2D space (in 3D this kind of equation will not describe a line but rather a [plane](plane.md)) and only for lines that aren't completely vertical (lines close to vertical may also pose problems in computers with limited precision numbers). The advantage is that we have a single, pretty simple equation. The equation is of form *y = k * x + q* where *x* and *y* are space coordinates, *k* is the [slope](slope.md) of the line and *q* is an offset. See examples below for more details. +- **parametric**: This is a system of *N* equations, where *N* is the number of dimensions of the space the line is in. This way can describe any line in any dimensional space -- obviously the advantage here is that we can can use this form in any situation. The equations are of form *Xn = Pn + t * Dn* where *Xn* is *n*th coordinate (*x*, *y*, *z*, ...), *Pn* is *n*th coordinate of some point *P* that lies on the line, *Dn* is *n*th coordinate of the line's direction [vector](vector.md) and *t* is a variable parameter (plugging in different numbers for *t* will yield different points that lie on the line). DON'T PANIC if you don't understand this, see the examples below :) + +As an equation for line segment we simply limit the equation for an infinite line, for example with the parametric equations we limit the possible values of *t* by an interval that corresponds to the two boundary points. + +**Example**: let's try to find equations of a line in 2D that goes through points *A = [1,2]* and *B = [4,3]*. + +Point-slope equation is of form *y = k * x + q*. We want to find numbers *k* (slope) and *q* (offset). Slope says the line's direction (as dy/dx, just as in [derivative](derivative.md) of a function) and can be computed from points *A* and *B* as *k = (By - Ay) / (Bx - Ax) = (3 - 2) / (4 - 1) = 1/3* (notice that this won't work for a vertical line as we'd be dividing by zero). Number *q* is an "offset" (different values will give a line with same direction but shifted differently), we can simply compute it by plugging in known values into the equation and working out *q*. We already know *k* and for *x* and *y* we can substitute coordinates of one of the points that lie on the line, for example *A*, i.e. *q = y - k * x = Ay - k * Ax = 2 - 1/3 * 1 = 5/3*. Now we can write the final equation of the line: + +*y = 1/3 * x + 5/3* + +This equation lets us compute any point on the line, for example if we plug in *x = 3*, we get *y = 1/3 * 3 + 5/3 = 8/3*, i.e. point *[3,8/3]* that lies on the line. We can verify that plugging in *x = 1* and *x = 4* gives us *[1,2]* (*A*) and *[4,3]* (*B*). + +Now let's derive the parametric equations of the line. It will be of form: + +*x = Px + t * Dx* + +*y = Py + t * Dy* + +Here *P* is a point that lies on the line, i.e. we may again use e.g. the point *A*, so *Px = Ax = 1* and *Py = Ay = 2*. *D* is the direction [vector](vector.md) of the line, we can compute it as *B - A*, i.e. *Dx = Bx - Ax = 3* and *Dy = By - Ay = 1*. So the final parametric equations are: + +*x = 1 + t * 3* + +*y = 2 + t * 1* + +Now for whatever *t* we plug into these equations we get the *[x,y]* coordinates of a point that lies on the line; for example for *t = 0* we get *x = 1 + 0 * 3 = 1* and *y = 2 + 0 * 1 = 2*, i.e. the point *A* itself. As an exercise you may try substituting other values of *t*, plotting the points and verifying they lie on a line. + +## Line Drawing Algorithms + +TODO \ No newline at end of file diff --git a/linux.md b/linux.md index b9bcbc8..7f334dc 100644 --- a/linux.md +++ b/linux.md @@ -6,7 +6,7 @@ Linux is written in the [C](c.md) language, specifically the old C89 standard, Linux is typically combined with a lot of [GNU](gnu.md) software and the [GNU](gnu.md) project (whose goal is to create a [free](free_software.md) OS) uses Linux as its official kernel, so in the wild we usually encounter the term [GNU/Linux](gnu_linux.md). Some people just can't be bothered to acknowledge the work of GNU and just call GNU/Linux systems "Linux" (without GNU/). Fuck them. Of course people are like "it's just a name bruh, don't be so mad about it" -- normally this may be true, however let's realize that GNU mustn't be forgotten, it is one of the few projects based on ethics while "Linux" is a shitty fascist tranny software hugely leaning to the business/open-source side. For the sake of showing our preference between those sides we at LRS often choose to call the system just GNU, i.e. by its original name. -Linux is sometimes called [free as in freedom](free_software.md), however it is hardly deserving the label, it is more of an [open-source](open_source.md) or [FOSS](foss.md) project. **Linux is in many ways bad**, especially lately. Some reasons for this are: +Linux is sometimes called [free as in freedom](free_software.md), however it is hardly deserving the label, it is more of an "[open-source](open_source.md)" or [FOSS](foss.md) project. **Linux is in many ways bad**, especially lately. Some reasons for this are: - It actually includes [proprietary](proprietary.md) software in the form of [binary blobs](blob.md) ([drivers](drivers.md)). The [Linux-libre](linux_libre.md) project tries to fix this. - It is [tranny software](tranny_software.md) and has a fascist [code of conduct](coc.md) (`linux/Documentation/process/code-of-conduct.rst`). @@ -44,4 +44,12 @@ On 25 August 1991 he made the famous public announcement of Linux on [Usenet](us On 14 March 1994 Linux 1.0 -- a fully functional version -- was released. -TODO: moar \ No newline at end of file +TODO: moar + +## See Also + +- [Hurd](hurd.md) +- [GNU](gnu.md) +- [BSD](bsd.md) +- [Linux-libre](linux_libre.md) +- [Linux for niggers](linux_for_niggers.md) \ No newline at end of file diff --git a/microsoft.md b/microsoft.md index e4104dc..ec7db6b 100644 --- a/microsoft.md +++ b/microsoft.md @@ -1,6 +1,6 @@ # Micro$oft -Micro$soft (officially Microsoft, MS) is a terrorist organization, [software](software.md) [corporation](corporation.md) named after its founder's dick -- it is, along with [Google](google.md), [Apple](apple.md) [et al](et_al.md) one of the biggest organized crime groups in history, best known for holding the world captive with its highly abusive "[operating system](os.md)" called [Windows](windows.md), as well as for leading an aggressive war on [free software](free_software.md) and utilizing many unethical and/or illegal business practices such as destroying any potential competition with the [*Embrace Extend Extinguish*](eee.md) strategy or practicing heavy [openwashing](openwashing.md). +Micro$soft (officially Microsoft, MS) is a terrorist organization, [software](software.md) [corporation](corporation.md) named after [its founder](bill_gates.md)'s dick -- it is, along with [Google](google.md), [Apple](apple.md) [et al](et_al.md) one of the biggest organized crime groups in history, best known for holding the world captive with its highly abusive "[operating system](os.md)" called [Windows](windows.md), as well as for leading an aggressive war on [free software](free_software.md) and utilizing many unethical and/or illegal business practices such as destroying any potential competition with the [*Embrace Extend Extinguish*](eee.md) (actual terminology internally used at Microsoft) strategy or lately practicing heavy [openwashing](openwashing.md). Microsoft is unfortunately among the absolutely most powerful entities in the world (that sucks given they're also among the most hostile ones) -- likely more powerful than any government and most other corporations, it is in their power to **immediately destroy any country** with the push of a button, it's just a question of when this also becomes their interest. This power is due to them having **complete control over almost absolute majority of personal computers in the world** (and therefore by extension over all devices, infrastructure, organization etc.), through their [proprietary](proprietary.md) ([malware](malware.md)) "[operating system](os.md)" [Windows](windows.md) that has built-in [backdoor](backdoor.md), allowing Microsoft immediate access and control over practically any computer in the world. The backdoor "feature" isn't even hidden, it is officially and openly admitted (it is euphemistically called [auto updates](autoupdate.md)). Microsoft prohibits studying and modification of Windows under threats including physical violence (tinkering with Windows violates its [EULA](eula.md) which is a lawfully binding license, and law can potentially be enforced by police using physical force). Besides legal restrictions Microsoft applies high [obfuscation](obfuscation.md), [bloat](bloat.md), [SAASS](saass.md) and other techniques preventing user freedom and defense against terrorism, and forces its system to be installed in schools, governments, power plants, hospitals and basically on every computer anyone buys. Microsoft can basically (for most people) turn off the [Internet](internet.md), electricity, traffic control system etc. Therefore every hospital, school, government and any other institution has to bow to Microsoft. diff --git a/nigger.md b/nigger.md index 2ab3831..144c901 100644 --- a/nigger.md +++ b/nigger.md @@ -4,7 +4,7 @@ Nigger (also nigga, niBBa, N-word, negro or chimp) is a forbidden word that refers to a member of the [black](black.md) [race](race.md), [SJWs](sjw.md) call it a [politically incorrect](political_correctness.md) "slur". Its counterpart targeted on white people is *cracker*. -The word's used in a number of projects, e.g. in [niggercoin](niggercoin.md) [cryptocurrency](crypto.md) or [+NIGGER](plusnigger.md) license modifier that uses this politically incorrect term to prevent corporations from adopting free projects. +The word's used in a number of projects, e.g. [Linux for niggers](linux_for_niggers.md), [niggercoin](niggercoin.md) [cryptocurrency](crypto.md) or [+NIGGER](plusnigger.md) license modifier that uses this politically incorrect term to prevent corporations from adopting free projects. [LMAO](lmao.md) they're even censoring art and retroactively changing classical works of art to suit this propaganda, just like the fascist communists did. 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? diff --git a/open_source.md b/open_source.md index f006e4e..f1f5a4d 100644 --- a/open_source.md +++ b/open_source.md @@ -2,7 +2,7 @@ *"[Micro$oft](microsoft.md) <3 open $ource"* -Open source (OS) is a [capitalist](capitalism.md) movement forked from the [free software movement](free_software.md); it is advocating "openness", sharing and collaboration in software and hardware development and though legally it is mostly identical to free (as in freedom) software, in practice and in spirit it is very different by **abandoning the goal of freedom and ethics in favor of business** (to which ethics is an obstacle), due to which we see open source as inherently [evil](evil.md) and recommend following the free software way instead. [Richard Stallman](rms.md), the founder of free software, distances himself from the open source movement. Fascist organizations such as Microsoft and Google, on the other hand, embrace open source (while restraining from using the term *free software*) and slowly shape it towards their goals. The term [FOSS](foss.md) is sometimes used to refer to both free software and open source without expressing any preference. +Open source (OS) is a [capitalist](capitalism.md) movement/brand forked from the [free software movement](free_software.md); it is advocating "openness", sharing and collaboration in software and hardware development and though legally it is mostly identical to free (as in freedom) software, in practice and in spirit it is very different by **abandoning the goal of freedom and ethics in favor of business** (to which ethics is an obstacle), due to which we see open source as inherently [evil](evil.md) and recommend following the free software way instead. [Richard Stallman](rms.md), the founder of free software, distances himself from the open source movement. Fascist organizations such as Microsoft and Google, on the other hand, embrace open source (while restraining from using the term *free software*) and slowly shape it towards their goals. The term [FOSS](foss.md) is sometimes used to refer to both free software and open source without expressing any preference. Open source is unfortunately (but unsurprisingly) becoming more prevalent than free software, as it better serves [capitalism](capitalism.md) and abuse of people, and its followers are more and more hostile towards the free software movement. This is very dangerous, ethics and focus on actual user freedom is replaced by shallow legal definitions that can be bypassed, e.g. by [capitalist software](capitalist_software.md) and [bloat monopoly](bloat_monopoly.md). In a way open source is capitalism reshaping free software so as to weaken it and eventually make its principles of freedom ineffective. Open source tries to shift the goal posts: more and more it offers only an illusion of some kind of ethics and/or freedom, it pushes towards mere partial openness ("open source" for proprietary platforms), towards high complexity, inclusion of unethical business-centered features ([autoupdates](autoupdate.md), [DRM](drm.md), ...), high interdependency, difficulty of utilizing the rights granted by the license, exclusion of developers with "incorrect" political opinions or bad brand image etc. In practice open source has become something akin a mere **brand** which is stick to a piece of software to give users with little insight a feeling they're buying into something good -- this is called **[openwashing](openwashing.md)**. This claim is greatly supported by the fact that corporations such as [Microsoft](microsoft.md) and [Google](google.md) widely embrace open source ("Microsoft <3 open source", the infamous [GitHub](github.md) acquisition etc.). diff --git a/patent.md b/patent.md new file mode 100644 index 0000000..d0e37dd --- /dev/null +++ b/patent.md @@ -0,0 +1,21 @@ +# Patent + +Patent is a form of extreme "[intellectual property](intellectual_property.md)" that allows owning useful ideas, oppressing and bullying people and preventing others from using ideas -- software patents are especially harmful to society and [technology](tech.md). Patents are currently along with [copyright](copyright.md) likely the most [harmful](harmful.md) kind of "intellectual property" -- even though copyright is probably a more pressing issue at the moment because it is the most common form of IP oppression, patents can be just as harmful in individual cases. Of course we're not even talking about the whole gigantic bullshit bureaucracy and business connected to patents that just wastes man centuries of effort. Examples of patents in software are minigames on loading screens in games (this patent has already expired), [shadow volume](shadow_volume.md) algorithm for rendering shadows, [mp3](mp3.md) format (also expired), various [compression](compression.md) techniques, even such broad ideas as **public key encryption** (yes, the whole idea that's the basis of [cryptography](cryptography.md) was patented and unusable until 1977) etc. + +There is an article on software patents at https://www.gnu.org/philosophy/software-patents.en.html. There is even a site and initiative dedicated to ending software patents at https://wiki.endsoftwarepatents.org/wiki/Main_Page. + +Patents are kind of similar to but also very different from copyright ([Richard Stallman](rms.md) stressed the differences and says it is dangerous to think of copyright and patents as similar): while copyright applies to [art](art.md) and is granted automatically, patents apply to ideas (which should ideally be new inventions but in practice can be just any trivially stupid ideas), have to be registered and are kept recorded somewhere. Patents also last a shorter time than copyright (generally 20 years as opposed to copyright's lifetime plus 70 years) and are territorial, i.e. not world-wide. These facts make patents a bit less disastrous than copyright, however they still cause a great deal of damage -- not only do they prevent technological progress (a new ideas such as a new efficient [algorithm](algorithm.md) is simply prohibited to be used by anyone but it's "owner" and those who the owner sells a license), they also allow so called **patent trolling** (patent scams) -- patent trolling takes advantage of the fact that it is practically impossible to safely check if some idea is not patented, i.e. safe to use. There exist troll companies whose sole business is to register trivial patents and then sue random people who unknowingly implement this idea in their projects (there is e.g. a famous video about how this happened to the developer of X-plane, trolled by Uniloc company that had patented the idea of using a "play store" to distribute programs) -- the companies often bully developers to off court settlement for paying a lower free but this includes a contract that **prevents the affected developers from talking about this**. + +Granting and checking patents is also becoming progressively more difficult, expensive and sometimes basically impossible, as any new filed patent has to be checked for how "innovative" it is. This means someone has to literally go through all ideas ever invented in computer science (impossible even for the biggest brain on the planet) and check if the new submited idea is really new -- given that computer science progresses by lightning speed, every day it is becoming more and more difficult to check patents. As time for checking a patent is limited, the result is many false positives, errors and grants of patents on trivial or non-innovative ideas, which has disastrous consequences. And of course, we're not even talking about corruption -- patents are highly lucrative and it would be naive to believe there are no cases of someone just buying a patent grant. + +Many (probably most) [free software](free_software.md) proponents, and just many programmers in general, including for example [Richard Stallman](rms.md), [John Carmack](john_carmack.md) or [Donald Knuth](knuth.md), have highly criticized the existence of software patents. [Richard Stallman](rms.md) himself has been warning of the dangers and has likened the world of patents to a **mine field** because when you're programming, you have no idea whether an idea you get and implement in your program isn't in fact "owned" by anyone, programming itself poses risk of stepping on mines (patents). + +As a good [free software](free_software.md) developer you should **use [licenses](license.md)/[waivers](waiver.md) to get rid of patents!** Similarly to copyright, your software should come with a license or waiver that ensure patents won't prevent others from exercising the four essential freedom rights, i.e. there should be a legal document that says you grant others rights to any of your patented ideas hiding in your source code so that others are safe from you suing them if they reuse your potentially patent-infected code (still, there may unfortunately be hiding patents from third parties which cannot be addressed). Some licenses, such as [GPL](gpl.md) or [Apache](apache_license.md) include patent grants, however others such as [MIT](mit.md) or [CC0](cc0.md) don't or have to be slightly modified to do so. This is an issue because there is for example no nice way of dedicating one's work completely to the [public domain](public_domain.md) complete with patent grants, as [CC0](cc0.md), [Unlicense](unlicense.md) and [WTFPL](wtfpl.md) don't address the patent issue -- with these an extra patent waiver has to be manually added! Unlike with copyright, patent waivers aren't always completely necessary, it is very possible that in many simple and non-innovative projects there are no patented ideas, however one can never be sure, so it is better to use a patent waiver just in case, one can never go wrong by including it. + +**Which patent waiver to use?** You may for example copy-paste the waiver from [our own wiki](wiki_rights.md). + +## See Also + +- [intellectual property](intellectual_property.md) +- [copyright](copyright.md) +- [trademark](trademark.md) \ No newline at end of file diff --git a/twos_complement.md b/twos_complement.md index 1c708ec..460a313 100644 --- a/twos_complement.md +++ b/twos_complement.md @@ -14,7 +14,9 @@ TODO: disadvantages? *N* bit number in two's complement can represent numbers from *-(2^N) / 2* to *2^N / 2 - 1* (including both). For example with 8 bits we can represent numbers from -128 to 127. -**How does it work?** EZ: the highest (leftmost) bit represents the sign: 0 is positive (or zero), 1 is negative. To negate a number negate all its bits and add 1 to the result (with possible overflow). (There is one exception: negating the smallest possible negative number will give the same number as its positive value cannot be represented.) +**How does it work?** EZ: the highest (leftmost) bit represents the sign: 0 is positive (or zero), 1 is negative. To negate a number negate all its bits and add 1 to the result (with possible overflow). (There is one exception: negating the smallest possible negative number will give the same number as its positive value cannot be represented.) + +In other words given *N* bits, the positive values representable by two's complement with this bit width are the same as in normal unsigned representation and any representable negative value *-x* corresponds to the value *2^N - x*. **Example:** let's say we have a 4 bit number `0010` (2). It is positive because the leftmost bit is 0 and we know it represents 2 because positive numbers are the same as the straightforward representation. To get number -2, i.e. multiply our number by -1, we negate the number, which gives `1101`, and add 1, which gives `1110`. We see by the highest 1 bit that this number is negative, as we expected. As an exercise you may try to negate this number back and see we obtain the original number. Let's just now try adding 2; we expect that adding 2 to -2 will give 0. Sure enough, `1110` + `0010` = `0000`. Etcetc. :) diff --git a/unix_philosophy.md b/unix_philosophy.md index 4b6be09..0d90c69 100644 --- a/unix_philosophy.md +++ b/unix_philosophy.md @@ -30,6 +30,8 @@ In the command the pipes (`|`) chain multiple programs together so that the outp Compare this to the opposite [Window philosophy](windows_philosophy.md) in which combining programs into collaborating units is not intended or even purposefully prevented, and therefore very difficult, slow and impractical to do -- such programs are designed for manually performing some predefined actions, e.g. painting pictures with a mouse, but aren't made to collaborate or be automatized, they can rarely be used in unintended, inventive ways needed for [hacking](hacking.md). +**Watch out! Do not misunderstand Unix philosophy.** There are many extremely dangerous cases of misunderstanding Unix philosophy by [modern](modern.md) wannabe programmers. One example is the hilarious myth about "[React](react.md) following Unix philosophy" ([LMAO this](http://img.stanleylieber.com/src/20872/img/small.1527773532.png)), supposedly the "devs" think that having billion of dependencies or focusing on doing one huge thing ([GUI](gui.md)) somehow implies Unix philosophy -- **nothing based on [JavaScript](js.md) can ever follow Unix philosophy!** Unix philosophy can NOT be built on top of non-unix philosophy technology, and focusing on a very broad goal does not mean doing one thing. + { One possible practical interpretation of Unix philosophy I came up with is this: there's an upper but also lower limit on complexity. "Do one thing" means the program shouldn't be too complex, we can simplify this to e.g. "Your program shouldn't surpass 10 KLOC". "Do it well" means the programs shouldn't bee too trivial because then it is hardly doing it well, we could e.g. say "Your program shouldn't be shorter than 10 LOC". E.g. we shouldn't literally make a separate program for printing each ASCII symbol, such programs would be too simple and not doing a thing well. We rather make a [cat](cat.md) program, that's neither too complex nor too trivial, which can really print any ASCII symbol. By this point of view Unix philosophy is really about balance of triviality and huge complexity, but hints that the right balance tends to be much closer to the triviality than we humans are tempted to intuitively choose. Without guidance we tend to make programs too complex and so the philosophy exists to remind us to force ourselves to rather minimize our programs to strike the correct balance. ~drummyfish } ## See Also