OpenLLM-France/wikimedia huggingface dataset:
# Digital Electronics/Logic Gates/Logic NAND
## Logic NAND

NAND gates are one of the two basic logic gates (the other being NOR logic) from which any other logic gates can be built. Due to this property, NAND and NOR gates are sometimes called "universal gates". However, modern integrated circuits are not constructed exclusively from a single type of gate. Instead, EDA tools are used to convert the description of a logical circuit to a netlist of complex gates (standard cells) or transistors (full custo] approach).

## NOT

A NOT gate is made by joining the inputs of a NAND gate. Since a NAND gate is equivalent to an AND gate followed by a NOT gate, joining the inputs of a NAND gate leaves only the NOT part.
Truth Table :
| Desired Gate | NAND Construction |
| Truth Table Input AOutput Q 01 10 ||

## AND

An AND gate is made by following a NAND gate with a NOT gate as shown below. This gives a NOT NAND, i.e. AND.
Truth Table :
| Desired Gate | NAND Construction |
| Truth Table Input AInput BOutput Q 000 010 100 111 ||

## OR

If the truth table for a NAND gate is examined or by applying De Morgan's Laws, it can be seen that if any of the inputs are 0, then the output will be 1. However to be an OR gate, if any input is 1, the output must also be 1. Therefore, if the inputs are inverted, any high input will trigger a high output.
Truth Table :
| Desired Gate | NAND Construction |
| Truth Table Input AInput BOutput Q 000 011 101 111 ||

## NOR

A NOR gate is simply an OR gate with an inverted output:
Truth Table :
| Desired Gate | NAND Construction |
| Truth Table Input AInput BOutput Q 001 010 100 110 ||

## XOR

An XOR gate is made by connecting four NAND gates as shown below. This effectively represents the formula: "(A NAND (A NAND B)) NAND (B NAND (A NAND B))".
Truth Table :
| Desired Gate | NAND Construction |
| Truth Table Input AInput BOutput Q 000 011 101 110 ||

## XNOR

An XNOR gate is simply an XOR gate with an inverted output:
Truth Table :
| Desired Gate | NAND Construction |
| Truth Table Input AInput BOutput Q 001 010 100 111 ||
# Digital Electronics/Logic Gates Summary

The table below summarize all the Basic Digital Gates and their characteristics
    Basic Logic GatesSymbolMathmatical FormulaTruth TableConstructions BufferQ = AA Q 0 0 1 1 NOTQ = NOT AA Q 0 1 1 0 ANDQ = A . BA B Q 0 0 0 0 1 0 1 0 0 1 1 1 NANDQ =NOT (A . B)A B Q 0 0 1 0 1 1 1 0 1 1 1 0 ORQ = A + BA B Q 0 0 0 0 1 1 1 0 1 1 1 1 NORQ = NOT (A + B)A B Q 0 0 1 0 1 0 1 0 0 1 1 0 XORQ = A + BA B Q 0 0 0 0 1 1 1 0 1 1 1 0 XNORQ = A + BA B Q 0 0 0 0 1 1 1 0 1 1 1 1
# Digital Electronics/Mathematic and Logic Operations

* Digital Adder
* Digital Subtractor
* Digital Decoder
* Digital Encoder
# Digital Electronics/Mathematic and Logic Operations/Digital Decoder
## Digital Decoder

Digital Decoder is a Digital Device that use Control Lines to select Output Lines

## Configuration

    Gate level circuit diagram of a single bit 4-to-2 line encoder
| I$_3$ | I$_2$ | I$_1$ | I$_0$ | O$_1$ | O$_0$ |
| 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 | 1 |
| 0 | 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 0 | 0 | 1 | 1 |
# Digital Electronics/Mathematic and Logic Operations/Digital Encoder
## Digital Encoder

Digital Encoder is a Digital Device that use binary number of certain bits to reprepresent information .

## Examples
### Example 1

Using two bit binary number we have 4 2 bits binary numbers
    00
    01
    10
    11
Let
    00 --- 0
    01 --- 1
    10 --- 2
    11 --- 3
Then decimal number from 0 to 3 can be coded as 2 bit binary number .

### Example 2

Similarly, with 4 bit binary number can be used to code decimal numbers from 0 to 15 as shown below
    0000 --- 0
    0001 --- 1
    0010 --- 2
    0011 --- 3
    0100 --- 4
    0101 --- 5
    0110 --- 6
    0111 --- 7
    1000 --- 8
    1001 --- 9
    1010 --- 10
    1011 --- 11
    1100 --- 12
    1101 --- 13
    1110 --- 14
    1111 --- 15

## Binary Coding
### 4 bit binary coded decimal

4 bit binary coded decimal (BCD) is a digital device that use 4 bit binary numbers to represent decimal number from 0 to 15

### 7 bit binary coded decimal

7 bit binary coded decimal (ASCII) is a digital device that use 7 bit binary numbers to represent decimal number from 0 to 9 alphabets a to z, A to Z
# Digital Electronics/Logic Operations
## Logic Operation

    Logic BUFFER perform a logic operation on a input . Output is the same as Input
    Logic NOT perform a logic operation on a input . Output is the invert of Input
    Logic AND perform a logic operation on two input to yield a result at the output. Output is High only when both Inputs are High
    Logic OR perform a logic operation on two input to yield a result at the output. Output is Low only when both Inputs are Low
    Logic XOR perform a logic operation on two input to yield a result at the output. Output is Low only when both Inputs are the same and Output is High only when both Inputs are different

## Digital Logic Equation

If A and B is Input and Y as Output then
    Logic BUFFER → Y = A
    Logic NOT → Y = NOT A
    Logic AND → Y = A AND B
    Logic OR → Y = A OR B
    Logic XOR → Y = A XOR B

## Digital Truth Table

The logic operation of any logic above can be summarized in a table called a truth table.
If High is 1 and Low is 0 then

## Digital Gates Construction

Each Logic can be constructed from electronic components to form a circuit of a device called Digital Gates to perform the logic operation
# C++ Language/Std/Stl/Adapters

A "STL adapter" exposes a theoretical data structure, with its storage being internally implemented by the usage of some existing collection class.
* Stack
* Queue
* Binary-Heap
# C++ Language/Std/Stl/Adapters/BinaryHeap

A "binary-heap" data structure maintains the theoretical "heap-property" in a "shaped-tree" whose maximum-item is always at the tree's root. This std::priority_queue<int> binary-heap is useful if you need to be able to frequently identify and remove the largest item in a collection, without that collection having been linearly-sorted.
Additional information about binary-heaps (includes interactive examples)
# C++ Language/Std/Stl/Adapters/Queue

By default, std::queue<int> uses a STL deque as its underlying collection class. This "queue" supports theoretical operations push(123) (essentially just a re-naming of push_back) and pop (essentially just a re-naming of pop_front).
Additional information about queues (includes interactive examples)
# C++ Language/Std/Stl/Algorithms/ApplyingItemByItem

Some STL algorithms apply the same action over and over again, once per item in the collection.
* Processing Item-by-Item
* Ignoring Prior Values
* Item-by-Item Combination of Two Collections
# C++ Language/Std/Stl/Algorithms/ApplyingItemByItem/IgnoringPriorValues

Unlike the DoubleEach example, this function ignores existing item-values: int Compute99 { return 99; }. The algorithm to use it is std::generate(v.begin, v.end, Compute99).
Additional information about item-by-item processing that ignores prior values (includes interactive examples)
# C++ Language/Std/Stl/Algorithms/ApplyingItemByItem/ItemByItemCombinationOfTwoCollections

The std::transform algorithm combines two collections, item-by-item.
Additional information about algorithms that combine two collections (includes interactive examples)
# C++ Language/Std/Stl/Algorithms/ApplyingItemByItem/ProcessingItemByItem

If you have a function like void DoubleEach(int& x) { x *= 2; }, then you can repeatedly apply that same callable-object, once per collection item. The algorithm to do so is std::for_each(v.begin, v.end, DoubleEach).
Additional information about item-by-item processing (includes interactive examples)
# C++ Language/Std/Stl

The main purpose of the Standard Template Library (STL) is to provide a "collection class" for nearly any item-type.
* CollectionClasses
* Iterators
* Adapters
* Callable-Objects
* Algorithms
# C++ Language/Std/Stl/Adapters/Stack

By default, std::stack<int> uses a STL vector as its underlying collection class. This "stack" supports theoretical operations push(123), pop, and peeking (named top).
Additional information about stacks (includes interactive examples)
# C++ Language/Std/Stl/Algorithms

In the context of STL, an "algorithm" is a function that has been designed to process data that's in some kind of STL collection.
* Usage with a C-Array
* Querying
* Applying Item-by-Item
* Modifying
# Cryptography/Diffie-Hellman

Diffie-Hellman, named for creators Whitfield Diffie and Martin Hellman, was the first (publicly known, at least) public key algorithm and was published in 1976. Its security relies on the discrete logarithm problem, which is still thought to be difficult.
Diffie-Hellman is generally used to generate a unique key by two (or more) parties with which they may then encrypt and exchange another key. This is similar to the use of the RSA algorithm within PGP.
Alice and Bob select a large prime number n, which will be the modulus. They then select another number c that is primitive mod n, which will be the base. These two numbers may be broadcast far and wide. At this point Bob and Alice both select large, random integers (a and b, respectively) in secret, and exchange the result of the exponentiation:
Alice performs $A=c^{a}mod\ n$ and sends A to Bob in the clear.
Bob then performs $B=c^{b}mod\ n$ and sends B to Alice in the clear.
At which point Alice knows a and B, so she computes:
$K_{2}=B^{a}\ mod\ n$
while Bob, knowing A and b, computes:
$K_{1}=A^{b}\ mod\ n$
and,
$K_{1}\ =\ K_{2}$
This is simply based on the commutative property of multiple exponents
$(x^{y})^{z}\ =\ (x^{z})^{y}$.
An eavesdropper can get A and B, but cannot easily calculate the key.
# Cryptography/Differential Cryptanalysis

Differential Cryptanalysis is decrypting a cyphertext with two different potential keys and comparing the difference. Sometimes, this can provide insight into the nature of the cryptosystem. Modern cryptosystems like AES are designed to prevent these kinds of attacks.
# Cryptography/Expectations of Normal Users

DRAFT:
Cryptography affects us every day through a variety of subtle means. Cryptography protects our credit card number when it is sent over the phone lines, it protects your bank card pin from unauthorized access, and it keeps passwords safe from unauthorized access. As a society, we have become more dependent upon computers for our everyday lives. Right now, your health history, driving record, and financial information are probably computerized. The Internet is a fairly uncontrolled media, everything that is given access to the Internet is vulnerable to unauthorized access by hackers or other ne'er-do-wells, and therefore must be protected.
You are probably already familiar with one form of protection, a password. It is a secret phrase that only you and the trusted party know. To authenticate yourself to the trusted party (the site with your information in the case of a bank or a doctors office), you give the password. It would not be very secure to have a list of passwords written on a sheet of paper by the counter (or just laying around in plaintext on a computer) in order to authenticate every client. The solution comes in the form of a cryptographic hash, typically Argon2. The trusted party stores a hash of your password instead of the plaintext version. If someone were to steal the hashed version of your password (assuming the office in question used salting and a secure hash algorithm) it would be nearly useless to them. When you give your password, the office would compute the hash of it and compare that hash to the hash they have on record. Since one of the properties of a hash is that it does not collide (that is for any given input there is one unique output which is not equal to any other input. Of course there is no fixed length hash which can completely comply with that requirement over an infinite length input; most passwords are between 8 and 14 characters therefore for our purposes MD5 will suffice) if the two hashes are identical, then the ciphertexts were identical, so the user is authenticated. This process goes on almost every time you enter a password on a computer (Which is why most of the time you are given the option to reset your password not retrieve it because Argon2 is a one-way hash. There are two-way cryptographic "hashes," but I will not discuss them here.).
Even though we know that collisions theoretically exist, cryptographic hashes -- even MD5 -- are designed to make it infeasible to actually find a value that would produce the same hash value as your password.
# Cryptography/Faults

The strength of your encryption method is based not only on your encryption method, but also on your ability to use it effectively. A perfect encryption method which is finicky to use and hard to get right is not likely to be useful in building a high quality security system.
For example, the One-Time Pad cypher is the only known provably unbreakable algorithm (in the very strong sense of a more effective than brute force search attack being impossible), but this proof applies ONLY if the key used is completely randomly chosen (there is currently no known method for making such a choice nor is there any known method for demonstrating that any particular choice is random), if the key is a long as the plaintext, if the key is never reused, and if the key never becomes known to the enemy. These conditions are so difficult to ensure that the One-Time Pad is almost never used in actual practice, whatever its theoretical advantages.
Any use of the One-Time Pad violating those assumed requirements is insecure, sometimes trivially so. For instance, statistical analysis techniques may be immediately applicable, under certain kinds of misuse.
This page or section of the Cryptography book is a stub. You can help Wikibooks by expanding it.
# Cryptography/ElGamal

ElGamal is one of the simplest cryptosystems based on the discrete logarithm problem. A quick reminder of the discrete logarithm problem - given $g,h\in G$, such that $h=g^{x}$, find $x$. This is a hard problem when dealing with finite sets. ElGamal has a set of public parameters which can be shared by a number of users of the system. These are referred to as the domain parameters. These parameters are:
The domain parameters create a public group $G$ with a prime order $q$ and a generator $g$. In other words, we create a large but finite group, and a method of ordering that group (the generator), and we know that it will contain a prime number of elements. These are the properties we are after. These parameters are public, and the security of the system depends on the public and private key pair, which we shall generate next.
The private key $x$ is a randomly-chosen integer. The public key is $h=g^{x}(modp)$.
In order to encrypt a message $m$ we generate a random ephemeral key $k$, and calculate: $c_{1}=g^{k}c_{2}=m*h^{k}$
This gives us the ciphertext $c=(c_{1},c_{2})$.
In order to decrypt a ciphertext we compute: ${\frac {c_{2}}{c_{1}^{x}}}={\frac {m*h^{k}}{g^{x*k}}}={\frac {m*g^{x*k}}{g^{x*k}}}=m$
As you can see from the decryption method, the message 0 will encrypt to itself, so not a good choice of message. In addition to this, as a result of using the ephemeral key $k$, which will change every time you can see that the same message $m$ will encrypt to many different ciphertexts.
Since the ciphertext is expressed as 2 integers of the same length as the message, we end up with ciphertexts being twice as large as the message they're encrypting.
# Chess/Computer Chess/Star Wars Chess/Gameplay
## Plot

The story takes place sometime between the start and end of the Galactic Civil War between the Rebel Alliance and the Galactic Empire. The two forces establish an uneasy truce and decide to settle this with a game of chess in order to determine who holds the future for the galaxy.

## Gameplay

Many characters from the Star Wars Trilogy are playable chessmen:
| Rank | Rebels as white (blue pieces when setting up the game) playing first | Dark side as black (red pieces when setting up the game) |
| King | Luke Skywalker | Emperor Palpatine |
| Queen | Princess Leia | Darth Vader |
| Bishops | C-3PO | Boba Fett |
| Knights | Chewbacca | Tusken Raiders |
| Rooks | Yoda | AT-ST's |
| Pawns | R2-D2 | Stormtroopers |
Normal rules of chess apply, but at least in the DOS version, a pawn reaching the opposite end may become a queen only. Inspired by Battle Chess published by Interplay since 1988, one chess piece taking an opposing one gets a brief battle scene. The player may turn it off to speed the game, especially if the computer is slow. Sega CD and Windows 3.x, not DOS, feature checkmating scenes, plus a large tube descending from above to vacuum some defeated characters.
Han Solo frozen in carbonite also appears in PC version only as a non-playable character.
Sample moves →

## References

* ↑ "Star Wars Chess: Battles". Wookieepedia. Fandom. Retrieved 7 May 2021.{{cite web}}: CS1 maint: url-status (link)
# Chess/Famous Games

Throughout the history of chess there have been many famous games between the masters that many serious players are familiar. These games stand out because they contain unusual positions, feature brilliant sacrifices, or some other reason that sets them apart from average chess games. By studying and analysing these games, you can not only gain more appreciation for chess, but improve your strategy as well.
This section is intended for readers with some knowledge of basic chess strategy. The games are provided with commentary to explain critical moves and point out strategy concepts.

#### 19th Century: The Era of Gambits and Sacrifices

* Anderssen vs. Kieseritzky, 1851: The Immortal Game
* Anderssen vs. Dufresne, 1852: The Evergreen Game
* Morphy vs. Duke Karl and Count Isouard, 1858: The Opera Game

#### Early 20th Century: Steinitz, Lasker, and Capablanca

* Alekhine vs. Nimzowitsch 1930

#### Later 20th Century: From Fischer to Kasparov

* Byrne vs. Fischer, 1956: The Game of the Century
* Caruana vs. Wojtkiewicz, 2002, Fabiano Caruana (10 years old) is the youngest player to defeat a GM

#### Modern Era: Man and Machine

* Deep Blue vs. Garry Kasparov, 1996: Game One
* Kasparov vs. the World, 1999

## References

* ↑ ""Caruana vs Wojtkiewicz" on "Giochi Gratis Online - Partite commentate di Scacchi"".
← Tournaments · Puzzles →
← Tournaments · Chess · Puzzles →
Arranging the Board · Playing the Game · Notating the Game · Tactics · Tactics Exercises · Strategy · Basic Openings · Sample chess game · The Endgame · Variants · Tournaments · Chess Puzzles · 0x88 board representation ( v • d • e )
# Chess/Bowdler Attack

This is a mistake that allows clear equality. Black's best answer is 2. ...e6 followed by d5 at some point which easily removes White's bishop and gives Black a tempo and clear centre.
For example: 1. e4 c5 2.Bc4 e6 3. Nc3 Nc6 4. Nf3 Nf6 5. O-O d5 6. exd5 exd5 7.Bb3
Black needs to play Nc6 before d5, otherwise the king will be exposed on the a4-e8 diagonal, and therefore inviting a check from White's light square bishop.
It is analogous to some lines in the Italian Game but Black has played the move c5 which helps prevent d4 and makes b3 a less attractive place for the White Bishop (because of c4).
Interestingly, 1. e4 c5 2. Nf3 d6 3. Bc4 (as opposed to the usual 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 XXX 6. Bc4 where XXX is e6, Nc6, g6 or a6), does not allow for such shenanigans by Black who has no better option but to transpose to a main line open Sicilian where White plays Bc4. In contrast to 2. Bc4 where Black obtains immediate equality, the only real advantage of 3. Bc4 for Black is that he gets to choose his defence (Dragon, Najdorf, Scheveningen, Classical) with the knowledge that White has committed his bishop to c4. However it may confuse some unwary Black players who feel they should "prove" that White has made an "inaccurate" move.
# Chess/Computer Chess/Star Wars Chess

The Software Toolworks' Star Wars Chess is a 1993 chess-playing video game developed by The Software Toolworks, based on the Star Wars film franchise and published by Mindscape for the Sega CD home video game console and personal home computers running Windows 3.x or MS-DOS.

## Contents

* Gameplay
* Sample moves by computer vs. computer

## References

* ↑ "The Game Fan 32Bit System Shoot Out - Who Will Lead Us Into The Next Generation?". GameFan. Shinno Media. 2 (7): 146–147. June 1994. Retrieved April 14, 2021.{{cite journal}}: CS1 maint: url-status (link)
# Goals

* Introduce language used at holidays and gatherings
* Begin Present Tense
* Advance production for simple present tense phrases.
Introduction
For this unit, we will focus on the theme of holidays and celebrations.
To begin practicing, read the following three sentences, and try to identify their corresponding
English phrase. Try to find matching translations!
Warm Up Activity
Español
Inglés
A La casa es pequeña.
1 The boy celebrates.
B Las amigas preparar la cena.
2The house is small.
C El niño celebra.
3The friends prepare the dinner.
Part 1: Articles and Nouns
In Part 1 we will discuss articles and nouns, as they relate to holidays and celebrations.
Before we move into more complicated grammar components, starting off with a general
understanding of how masculine and feminine structures work in Spanish will give a great basis.
Part 1: Nouns and Articles
Articles in Spanish are classified in two sets of categories.
These two sections, gender and number, determine how nouns are treated within a sentence.
Article Description Feminine:
Number
Spanish
English
Example
Singular
La
The
La casa es roja.
Singular
Una
A
Tengo una amiga.
Plural
Las
The
Las niñas juegan.
Plural
Unas * (slang for some)
A (plural) * Some*
Unas casas son rojas, otras son verdes.
Article Description Masculine:
Number
Spanish
English
Example
Singular
El
The
El apartamento es grande.
Singular
Un
A
Tengo un amigo.
Plural
Los
The
Los niños hablan.
Plural
Unos
A *(slang for some)
Unos apartamentos son grandes, otros pequeños.
These are nouns that relate to our topic of Family Traditions. Here, we include words that relate to parties, holidays and events, as well as different types of celebrations.
General Vocabulary
Español
Inglés
comida
food
familia
family
amigo
friend
cena
dinner
casa
house
apartamento
apartment
hogar
home
restaurante
restaurant
fiesta
party
Holiday Types
Español
Inglés
Navidad
Christmas
Kwanzaa
Kwanzaa
Hanukkah
Hanukkah
Día de los Muertos
Day of the Dead
Solsticio de Invierno
Winter Solstice
Diwali (Festival de las luces)
Diwali (Festival of lights)
Pascua
Easter
Año Nuevo
New Years
Día de Independencia
Independence Day :