OpenLLM-France/wikimedia huggingface dataset:
# Geometry for Elementary School/Concepts

In this section, we will learn about the basic concepts of geometry.

## Before you start

Ask yourself these questions:
* What is geometry?
* What are the most basic things I have learnt about geometry?

## Table of contents

In this section, we will talk about a lot of things. This is the most tedious unit as well as the most important one; once you get over it, everything else will seem easy. This is because in this unit we will talk about the basic concepts, the foundation that you must build before getting to the more interesting parts. We will talk about points, lines, angles, plane and solid figures. Then we will go through some basic measurements we need to know. We'll put that as brief as possible. Then we go through some tougher things: parallel lines, symmetry, transformation, and coordinates.
* Points
* Lines
* Angles
* Plane shapes
* Solids
* Measurements
* Parallel lines
* Symmetry
* Transformation
* Coordinates
# Geometry for Elementary School/Congruence

In this chapter, we will start the discussion of congruence and congruence theorems. We say the two figures are congruent if they have the same shape and size. Congruent figures have three things in common: corresponding sides (corr. sides), corresponding angles (corr. ∠s) and corresponding points (corr. points). We will only talk about congruent triangles.

## Congruent triangles

The triangles $\triangle ABC$ and $\triangle DEF$ are congruent if and only if all the following conditions hold:
* The side ${\overline {AB}}$ equals ${\overline {DE}}$. (Corresponding sides)
* The side ${\overline {BC}}$ equals ${\overline {EF}}$. (Corresponding sides)
* The side ${\overline {AC}}$ equals ${\overline {DF}}$. (Corresponding sides)
* The angle $\angle ABC$ equals $\angle DEF$. (Corresponding angles)
* The angle $\angle BCA$ equals $\angle EFD$. (Corresponding angles)
* The angle $\angle CAB$ equals $\angle FDE$. (Corresponding angles)
Note that the order of vertices is important. It is possible that $\triangle ABC$ and $\triangle ACB$ are not congruent even though both refer to the same triangle. Remember that the place where corresponding points are must be the same on both triangles.
Congruence theorems give a set of the fewest conditions that are sufficient in order to show that two triangles are congruent. They are SSS, SAS, ASA, AAS and RHS. We will talk about them later on.

## Finding the value of unknowns in triangles whose congruence is given

Let's say we have two triangles, $\triangle ABC$ and $\triangle DEF$, and they are congruent. AB=3, ∠F=90° and ∠E=60°. We need to find DE and ∠A. Here's how:
${\begin{aligned}\angle F+\angle E+\angle D&=180^{\circ }{\text{}\angle {\text{ sum of }}\triangle {\text}}\\90^{\circ }+60^{\circ }+\angle D&=180^{\circ }\\\angle D&=180^{\circ }-90^{\circ }-60^{\circ }\\&=30^{\circ }\end{aligned}}$
${\begin{aligned}\because \triangle ABC&\cong \triangle DEF{\text{ (given)}}\\\therefore DE&=AB{\text{ (corr. sides, }}\cong \triangle {\text{s)}}\\DE&=3\\\And \angle A&=\angle D{\text{ (corr. }}\angle {\text{s, }}\cong \triangle {\text{s)}}\\\angle A&=30^{\circ }\end{aligned}}$
# Geometry for Elementary School/Conventions

This appendix summarises the conventions used in this book. There is also a British-American English differences table provided.

## Language

All the language in this book uses simple British English. Alternative names in American English are listed below.

## Notation

This appendix summarises the notation used in the book. An effort was made to use common conventions in the notation. However, since many conventions exist the reader might see a different notation used in other books.

### Point

A point will be named by an uppercase letter in italics, as in the point A. In some equations though, it will look like this: $A$.

### Line segment

We will use the notation ${\overline {AB}}$ for the line segment that starts at A and ends at B. Note that we don't care about the segment direction and therefore ${\overline {AB}}$ is similar to ${\overline {BA}}$.

### Angles

We will use the notation $\angle {ABC}$ for the angle going from the point B, the intersection point of the segments ${\overline {BA}}$ and ${\overline {BC}}$. Sometimes the angle may also be represented by a lowercase letter or even a number, but this is only used in the main text for ease and not in the exercises.

### Triangles

A triangle whose vertices are A, B and C will be noted as $\triangle ABC$. Note that for the purpose of triangles' congruence, the order of vertices is important and $\triangle ABC$ and $\triangle BCA$ are not necessarily congruent.

### Circles

We use the notation $\circ A,{\overline {BC}}$ for the circle whose center is the point A and its radius length equals that of the segment ${\overline {BC}}$.
Note that in other sources, a circle is described by any 3 points on its circumference, ABC. The center, radius notation was chosen since it seems to be more suitable for constructions.

### External links

If you are interested seeing an example of past notation, you might be interested in Byrne's edition of Euclid's Elements. See for example the equilateral triangle construction.
# Geometry for Elementary School/Bisecting an angle

BISECT ANGLE $\angle ABC$
* Use a compass to find points D and E, equidistant from the vertex, point B.
* Draw the line ${\overline {DE}}$.
* Construct an equilateral triangle on ${\overline {DE}}$ with third vertex F and get $\triangle DEF$. (Lines DF and EF are equal in length).
* Draw the line ${\overline {BF}}$.

## Claim

* The angles $\angle ABF$, $\angle FBC$ equal to half of $\angle ABC$.

## The proof

* ${\overline {DE}}$ is a segment from the center to the circumference of $\circ B,{\overline {BD}}$ and therefore equals its radius.
* Hence, ${\overline {BE}}$ equals ${\overline {BD}}$.
* ${\overline {DF}}$ and ${\overline {EF}}$ are sides of the equilateral triangle $\triangle DEF$.
* Hence, ${\overline {DF}}$ equals ${\overline {EF}}$.
* The segment ${\overline {BF}}$ equals to itself
* Due to the Side-Side-Side congruence theorem the triangles $\triangle ABF$ and $\triangle FBC$ congruent.
* Hence, the angles $\angle ABF$, $\angle FBC$ equal to half of $\angle ABC$.

## Note

We showed a simple method to divide an angle to two. A natural question that rises is how to divide an angle into other numbers. Since Euclid's days, mathematicians looked for a method for trisecting an angle, dividing it into 3. Only after years of trials it was proven that no such method exists since such a construction is impossible, using only ruler and compass.

## Exercise

* Find a construction for dividing an angle to 4.
* Find a construction for dividing an angle to 8.
* For which other number you can find such constructions?
# Geometry for Elementary School/Congruence and similarity

In this section, we will talk about congruence and similarity, which are related to figures that look the same.

## Before you start

Ask yourself these questions:
* How can one construct a triangle given only three dimensions?
* What are vertically opposite angles?
* How many conditions are there for two lines to be parallel?
If your answer to any of these questions is no, you should check out the previous chapters before you advance any further.

## Table of contents

* Congruence
** The Side-Side-Side congruence theorem
** The Side-Angle-Side congruence theorem
** The Angle-Side-Angle congruence theorem
** The Side-Angle-Angle congruence theorem
** The Right angle-Hypotenuse-Side congruence theorem
** Corresponding Parts of Congruent Triangles are Congruent (CPCTC)
* Similarity
# Geometry for Elementary School/Bisecting a segment

In this chapter, we will learn how to bisect a segment. Given a segment ${\overline {AB}}$, we will divide it to two equal segments ${\overline {AC}}$ and ${\overline {CB}}$. The construction is based on book I, proposition 10.

## The construction

* Construct the equilateral triangle $\triangle ABD$ on ${\overline {AB}}$.
* Bisect an angle on $\angle ADB$ using the segment ${\overline {DE}}$.
* Let C be the intersection point of ${\overline {DE}}$ and ${\overline {AB}}$.

## Claim

* Both ${\overline {AC}}$ and ${\overline {CB}}$ are equal to half of ${\overline {AB}}$.

## The proof

* ${\overline {AD}}$ and ${\overline {BD}}$ are sides of the equilateral triangle $\triangle ABD$.
* Hence, ${\overline {AD}}$ equals ${\overline {BD}}$.
* The segment ${\overline {DC}}$ equals to itself.
* Due to the construction $\angle ADE$ and $\angle EDB$ are equal.
* The segments ${\overline {DE}}$ and ${\overline {DC}}$ lie on each other.
* Hence, $\angle ADE$ equals to $\angle ADC$ and $\angle EDB$ equals to $\angle CDB$.
* Due to the Side-Angle-Side congruence theorem the triangles $\triangle ADC$ and $\triangle CDB$ congruent.
* Hence, ${\overline {AC}}$ and ${\overline {CB}}$ are equal.
* Since ${\overline {AB}}$ is the sum of ${\overline {AC}}$ and ${\overline {CB}}$, each of them equals to its half.
# Introduction

| bad | good |
| Introduction | Organic Chemistry/Introduction |
| Overview of Functional Groups | Organic Chemistry/Overview of Functional Groups |
| Authors | Organic Chemistry/Authors |
# Mega Man Battle Network/Walkthroughs/Mega Man Battle Network 5 Team ProtoMan

Welcome to the Wikibooks Team ProtoMan walkthrough. This guide will help you get through the story part of Team ProtoMan.

## Table of Contents

* Scenario 1 - Meet ProtoMan
* Liberation Mission 1
* Scenario 2 - Meet MagnetMan
* Liberation Mission 2
* Scenario 3 - Meet GyroMan
* Liberation Mission 3
* Scenario 4 - Meet NapalmMan
* Liberation Mission 4
* Scenario 5 - Meet SearchMan
* Liberation Mission 5
* Scenario 6 - Meet Meddy
* Liberation Mission 6
* Scenario 7 - The Final Showdown
* Nebula Area
* Liberation Mission 7
* Liberation Mission 8
* Liberation Mission 9

## Miscellaneous

* Map
* Mystery Data locations
* Shop list
* Side quests
* Extras

## See also

* Mega Man Battle Network/Liberation Guide - our guide on basic liberation mission strategies.
* Mega Man Battle Network/Navi Customizer Guide - our guide on using the Navi Customizer.
* Mega Man Battle Network/Soul Unison Guide - our guide on using DoubleSoul and Chaos Unisons.
# Mega Man X

The Mega Man X series was created in part by Japanese video game designer Keiji Inafune of Capcom in 1993 for the Super Nintendo (named Super Famicom in Japan). The series chronologically begins in the century following the events of the Mega Man series (roughly 90 years later) in the 22nd century (21XX time period), but spans into the 23rd century (22XX time period). The games released in the series range from traditional 2D side-scrollers reminiscent of the original games, 3D action-adventures, and even role playing games.

## Contents

* Storyline
* Timeline
* Humans
* Reploids

## References

* 1.) Mega.Man.X.Online
* 2.) The Mega Man Homepage
* 3.) Game FAQs
* 4.) Rockman Perfect Memories, ISBN 4575163546
# Const auto_ptr
### Intent

To prevent transfer of ownership of a held resource. Note: auto_ptr has been deprecated and is replaced by shared_ptr, unique_ptr and weak_ptr in C++11, thereby this idiom is no longer suggested.

### Motivation

Often it is desirable to enforce a design decision of non-transferable ownership in code and enforce it with the help of compiler. Ownership in consideration here is of any resource such as memory, database connections and so on. const auto_ptr idiom can be used if we don't want ownership of the acquired resource to be transfered outside the scope or from one object to the another.
auto_ptr without any cv-qualifier (fancy name for const and volatile) has move semantics as described in the Move Constructor idiom. It basically means that ownership of memory is unconditionally transferred from right hand side object to the left hand side object of an assignment, but it ensures that there is always a single owner of the resource. const auto_ptr can prevent the transfer.

### Solution and Sample Code

Declare the auto_ptr holding memory resource as const.
Compiler issues a warning here because the copy-constructor of yptr is not really a copy-constructor but in fact it is a move constructor, which takes a non-const reference to an auto_ptr, as given in Move Constructor idiom. A non-const reference can't bind with a const variable and therefore, compiler flags an error.

### Consequences

* An undesirable consequence of const auto_ptr idiom is that compiler can't provide a default copy-constructor to a class that has a const auto_ptr member in it. This is because the compiler generated copy-constructor always takes a const RHS as a parameter, which can't bind with a non-const move constructor of auto_ptr. The solution is to use Virtual Constructor idiom or use boost::scoped_ptr, which explicitly prohibits copying by denying access to assignment and copy-constructor.

### Related Idioms

* Move Constructor

### References

* http://www.gotw.ca/publications/using_auto_ptr_effectively.htm
* http://www.boost.org/libs/smart_ptr/scoped_ptr.htm
# Concrete Data Type
### Intent

To control object's scope and lifetime by allowing or disallowing dynamic allocation using the free store (heap)

### Motivation

C++ provides two ways of controlling lifetime of an object and binding it with a program level identifier (variable). First is a scoped variable and an object, which are destroyed immediately after the scope ends (e.g., function scope integers). Second is a scoped variable (often a pointer) and a dynamically allocated object in the free store. In this case, at the end of the scope of the variable, the variable ceases to exist but the object's lifetime continues (e.g., singletons, a window object). It is possible to force the choice of the lifetime of an object either first way or the second using the Concrete Data Type idiom.

### Solution and Sample Code

This idiom simply uses class level access modifiers (private, protected) to achieve the goal. The following code shows how a MouseEventHandler class forces dynamic allocation.
Another way to force dynamic allocation is to prevent direct access to the constructor and instead provide a static function instance to return a dynamically allocated object. It is in many ways similar to the Singleton design pattern. Moreover, it is not strictly necessary to use polymorphic delete to reclaim memory. A member function destroy can serve the purpose saving the space required for a v-table pointer.
An opposite extreme of this idiom is to force scoped variable (a.k.a. automatic variable) only. It can be achieved using a private new operator.
ScopedLock object can't be allocated dynamically with standard uses of new operator, nothrow new, and the placement new.

### References

* Concrete Data Type - J. Coplien.
# Clear-and-minimize
### Intent

Clear a container and minimize the capacity of the container.

### Also Known As

This is sometimes called the swap with temporary idiom.

### Motivation

Standard library containers often allocate more memory than the actual number of elements in them. Such a policy results in an optimization of saving some allocations when a container grows in size. On the other hand, when the size of the container reduces, there is often leftover capacity in the container. The leftover capacity of the container can be unnecessary wastage of memory resources. The clear-and-minimize idiom has been developed to clear a container and reduce the extra capacity to a minimum of zero, thereby saving memory.

### Solution and Sample Code

Implementing the Clear-and-minimize idiom is as simple as the one given below.
The first half of the statement, std::vector<int>, creates a temporary vector<int> guaranteed to allocate either zero raw memory or an implementation minimum. The second half of the statement swaps the temporary with v using the Non-throwing swap idiom, which is efficient. After swapping, the temporary created by the compiler goes out of scope and the chunk of memory originally held by v is released.

### Solution in C++11

Since C++11, some containers declare the function shrink_to_fit, like vector, deque and basic_string. shrink_to_fit is a non-binding request to reduce capacity to size. Thus, using clear and shrink_to_fit is a non-binding request to clear-and-minimize.

### Related Idioms

* Shrink-to-fit
* Non-throwing swap

### References

* C++ draft standard.
# Coercion by Member Template
### Intent

To increase the flexibility of a class template's interface by allowing the class template to participate in the same implicit type conversions (coercion) as its parameterizing types enjoy.

### Motivation

It is often useful to extend a relationship between two types to class templates specialized with those types. For example, suppose that class D derives from class B. A pointer to an object of type D can be assigned to a pointer to B; C++ supports that implicitly. However, types composed of these types do not share the relationship of the composed types. That applies to class templates as well, so a Helper<D> object normally cannot be assigned to a Helper<B> object.
There are cases where such conversions are useful, such as allowing conversion from std::unique_ptr<D> to std::unique_ptr<B>. That is quite intuitive, but isn't supported without using the Coercion by Member Template Idiom.

### Solution and Sample Code

Define member template functions, in a class template, which rely on the implicit type conversions supported by the parameter types. In the following example, the templated constructor and assignment operator work for any type U, for which initialization or assignment of a T * from a U * is allowed.
Another use for this idiom is to permit assigning an array of pointers to a class to an array of pointers to that class' base. Given that D derives from B, a D object is-a B object. However, an array of D objects is-not-an array of B objects. This is prohibited in C++ because of slicing. Relaxing this rule for an array of pointers can be helpful. For example, an array of pointers to D should be assignable to an array of pointers to B (assuming B's destructor is virtual). Applying this idiom can achieve that, but extra care is needed to prevent copying arrays of pointers to one type to arrays of pointers to a derived type. Specializations of the member function templates or SFINAE can be used to achieve that.
The following example uses a templated constructor and assignment operator expecting Array<U *> to only allow copying Arrays of pointers when the element types differ.
Many smart pointers such as std::unique_ptr, std::shared_ptr employ this idiom.

### Caveats

A typical mistake in implementing the Coercion by Member Template Idiom is failing to provide the non-template copy constructor or copy assignment operator when introducing the templated copy constructor and assignment operator. A compiler will automatically declare a copy constructor and a copy assignment operator if a class does not declare them, which can cause hidden and non-obvious faults when using this idiom.

### Known Uses

* std::unique_ptr
* std::shared_ptr

### Related Idioms

* Generic Container Idioms

### References

* std::auto_ptr Implementation
# Construct On First Use
### Intent

Ensure that an object is initialized before its first use. Specifically, ensure that non-local static object is initialized before its first use.

### Also Known As

Lazy construction/evaluation

### Motivation

Static objects that have non-trivial constructors must be initialized before they are used. It is possible to access an uninitialized non-local static object before its initialization if proper care is not exercised.
In the above code, Bar::f gets called before its constructor. It should be avoided.

### Solution and Sample Code

There are 2 possible solutions, which depends upon whether the destructor of the object in consideration has non-trivial destruction semantics. Wrap the otherwise static object in a function so that function initializes it before it is used.
* Construct on first use using dynamic allocation
If the object has a destructor with non-trivial semantics, local static object is used instead of dynamic allocation as given below.
* Construct on first use using local static

### Known Uses

* Singleton pattern implementations often use this idiom.
* ACE_TSS<T> class template in Adaptive Communication Environment (ACE) for creating and accessing objects in thread specific storage (TSS) uses this idiom.

### Related Idioms

* Nifty/Schwarz Counter
# More C++ Idioms/Contents
## Table of Contents

Note: synonyms for each idiom are listed in parentheses.
* Acyclic Visitor Pattern TODO
* Address Of
* Algebraic Hierarchy
* Attach by Initialization
* Attorney-Client
* Barton-Nackman trick
* Base-from-Member
* Boost mutant
* Calling Virtuals During Initialization
* Capability Query
* Checked delete
* Clear-and-minimize
* Coercion by Member Template
* Computational Constructor
* Concrete Data Type
* Construct On First Use
* Construction Tracker
* Copy-and-swap
* Copy-on-write
* Thread-safe Copy-on-write
* Intrusive reference counting (Counted Body)
* Covariant Return Types TODO
* Curiously Recurring Template Pattern (CRTP)
* Deprecate and Delete TODO
* Empty Base Optimization (EBO)
* enable-if
* Erase-Remove
* Execute-Around Pointer
* Exploding Return Type TODO
* Export Guard Macro TODO
* Expression-template
* Fake Vtable TODO
* Fast Pimpl TODO
* Final Class
* Free Function Allocators
* Function Object TODO
* Function Poisoning TODO
* Generic Container Idioms
* Hierarchy Generation TODO
* Implicit conversions TODO
* Include Guard Macro
* Inline Guard Macro
* Inner Class
* Int-To-Type
* Interface Class
* Iterator Pair
* Making New Friends
* Metafunction
* Move Constructor
* Multi-statement Macro
* Member Detector
* Named Constructor
* Named External Argument TODO
* Named Loop (labeled loop)
* Named Parameter
* Named Template Parameters TODO
* Nifty Counter (Schwarz Counter)
* Non-copyable Mixin
* Non-member Non-friend Function TODO
* Non-throwing swap
* Non-Virtual Interface (NVI, Public Overloaded Non-Virtuals Call Protected Non-Overloaded Virtuals)
* nullptr
* Object Generator
* Object Template TODO
* Parameterized Base Class (Parameterized Inheritance)
* Pimpl (Handle Body, Compilation Firewall, Cheshire Cat)
* Policy Clone (Metafunction wrapper)
* Policy-based Design TODO
* Polymorphic Exception
* Polymorphic Value Types
* Recursive Type Composition TODO
* Requiring or Prohibiting Heap-based Objects
* Resource Acquisition Is Initialization (RAII, Execute-Around Object, Scoped Locking)
* Resource Return
* Return Type Resolver
* Runtime Static Initialization Order Idioms
* Safe bool
* Scope Guard
* Substitution Failure Is Not An Error (SFINAE)
* Shortening Long Template Names TODO
* Shrink-to-fit
* Small Object Optimization TODO
* Smart Pointer
* Storage Class Tracker TODO
* Tag Dispatching
* Temporary Base Class
* Temporary Proxy
* The result_of technique TODO
* Thin Template
* Thread-Safe Interface TODO
* Traits
* Type Erasure
* Type Generator (Templated Typedef)
* Type Safe Enum
* Type Selection
* Virtual Constructor
* Virtual Friend Function

### Advanced idioms

These are some more advanced C++ idioms.
* Envelope Letter TODO

### Deprecated idioms

* Const auto_ptr