OpenLLM-France/wikimedia huggingface dataset:
# XForms/Deep Copy with Insert Origin
## Motivation

You want to add a new instance or element from a template. You want to do a deep copy of complex XML from one instance to another instance within a model.

## Method

We will use the XForms xf:insert element with the origin attribute set to the source instance. We will use the nodeset attribute to indicate where the data should be copied to.

## Link to XForms Application

Load XForms Application
# XForms/Delete Confirm
## Motivation

Since users frequently spend a lot of time entering data, you want to make sure that if you allow them to delete that they didn't accidentally click on the delete or that they have selected the correct element when they do actually delete a part of the form.
This example uses the XForms switch and case statements to conditionally display a delete confirmation dialog. This many not be the most elegant way of doing this. Ideally a future version of XForms will add a confirm="yes" option to the delete trigger. But till then you can use the following example.

## Discussion

We use the XForms switch and case statements to reveal the confirmation dialog. The dialog also indicates what record is going to be deleted.
This example does not use CSS to have the dialog appear to display in a separate window above the form. This can be done by wrapping the dialog in divs and styling the divs with CSS.
In the future our hope is that a the delete tag will have a confirmation option such as
Where the message displayed would be a confirmation message.

## References

This example was suggested by Alex Bleasdale.
# XForms/Delete Confirm with CSS
## Motivation

One of the nice things about using the switch statement is that you can quickly display HTML that has absolute positioning over the current form. This is done by adding some div elements that reference a style sheet. Although this example is for a delete confirmation, it can be use in any place you need to have a model dialog with messages and a cancel button.

## Link to Example Program

Delete Confirm With CSS

## Discussion

This example appears to show a new window on top of the existing form. This is called a modal window because you can not make any further changes to the form without a confirmation or cancel action.

## Acknowledgment

This example program was contributed by a CSS guru who wishes to remain anonymous till he has more time to make the example better.
# XForms/Disable Buttons
## Motivation

You want to remove a delete button to prevent removal of the last item of a list.

## Method

Create a binding rule in the model that only allows the button to be displayed if there are two or more elements.
This is very common when you have a "Delete" button that must not be visible if there is only one item in a list left.
One approach is to use the "ref" attribute of each trigger to only display if there are more than one item:
This would count the number of classifiers and display the "delete" button.
Here is an example of this rule:
The above uses the XPath count function with the greater than operator. But since it must be escaped you must use the "&gt;" instead of ">".
Or alternatively the delete button is only visible if the second person record exists in the instance.
This gets around having to count all the elements and doing a comparison. So it is a little bit more efficient for longs lists of items.
This creates a rule call "triggerDisplay" that pin relevancy to an XForms instance.

## Link to XForms Application

Load XForms Application

## Using the Context attribute

You can also use the context attribute of the trigger to tell it when to fire.

## Context

XForms 1.1 Specification
Optional XPath expression used to change the in-scope evaluation context for the delete element. This attribute is ignored if the bind attribute is provided. If the attribute is not given, then the default delete context is the in-scope evaluation context. Otherwise, the XPath expression is evaluated using the in-scope evaluation context, and the first node rule is applied to obtain the delete context. The delete action is terminated with no effect if the delete context is the empty node-set or if the context attribute is not given and the Node Set Binding node-set is empty.

## Example of Min and Max

The following disables both the Delete and Add triggers when the number of items approaches the minimum and maximum range.
In this case the XML Schemas for the Person element was the follows:
# Super Mario Bros./Characters/Princess Toadstool

Princess Toadstool is the leader of the Mushroom Kingdom.
# Super Mario Bros./Coin Rooms
## Coin Room A

File:SMB1 Map Coin A.png

## Coin Room B

File:SMB1 Map Coin B.png
* The last block, right above the pipe entrance, has 10 coins hidden inside.

## Coin Room C

File:SMB1 Map Coin C.png
* There is a power up hidden among the top row of bricks, just left of center.
** Because this coin room is exclusive to World 3-1, you should successfully collect the mushroom before coming down here.
* To access the coins at the top, break the bottom two blocks in either the right most or left most columns.

## Coin Room D

File:SMB1 Map Coin D.png
* Super Mario can access the coins along the bottom just like regular Mario can. You just need a running start from the left, and push down to make Mario slide.
* You can also use a running start to pick up a Fire Flower, but don't smash any of the highest level of the ceiling/floor before this.

## Coin Room E

File:SMB1 Map Coin E.png
* The right most block above the pipe entrance has 10 coins hidden inside.
* To access the coins above the bricks, jump on the right most block, and then jump left to cross the ceiling. From the ceiling, jump to the top of the left wall, and then take a small hop to the right, in to the gap.
* If you are super-sized, it is also possible to break the wall on the right of the boxed coins. Do this if you can't jump from the left as described in the step above.

## Coin Heaven A

File:SMB1 Map Heaven A.png
* Hop on top of the flat cloud platform, and jump forward to collect the coins. If you accidentally fall off, accelerate to pass the cloud, and jump on from the right.
* This Heaven has a 41 coin potential.

## Coin Heaven B

File:SMB1 Map Heaven B.png
* Once you reach the small clouds at the end, the best way to get all of the coins is to use the B button. If you accelerate, you won't fall through.
* This Heaven has a 52 coin potential.

## Coin Heaven C

File:SMB1 Map Heaven C.png
* The only difference between Coin Heaven B and C is the size of the platform that carries you through the area. Coin Heaven C's platform is shorter.
* Just like Coin Heaven B, this one has a 52 coin potential.

## Swim Area A

File:SMB1 Map Swim A.png
* The two platforms descend and could possibly push you down, so you need to move quickly!

## Swim Area B

File:SMB1 Map Swim B.png
* The only difference between Swim Area A and B is the size of the platforms that fall through the water. Swim Area B's platforms are shorter.
* You will not get trapped by the platforms if they move down too low.

## Warp Zone

File:SMB1 Map Warp.png
* This is the Warp Zone that you access through the vine found in World 4-2. From here, you can warp to Worlds 6, 7, or 8. In Vs. Super Mario Bros. you can only warp to World 6.
# Super Mario Bros./Versions

A number of different versions of Super Mario Bros. have been made.
In 1986, Nintendo released a special version of the game in to the arcades called Vs. Super Mario Bros., which contains mostly modified levels, as well as a few new ones. The game has been reproduced on the Super Nintendo with enhanced 16-bit graphics as part of Super Mario All-Stars, on the Game Boy Color as Super Mario Bros. Deluxe (Its new features are documented on its own Wikibook), and the original NES version was re-released for the Game Boy Advance as part of the Classic NES Series. Super Mario Bros. was also released for the Virtual Console on the Wii, Nintendo 3DS, and Wii U, as well as the Nintendo Switch Online service.
The Game & Watch: Super Mario Bros. was a major dedicated retro revival handheld released in 2020, and contained a version of the original Super Mario Bros. as one of its three games.
# US Criminal Law/Preliminary offenses

* Conspiracy and incitement
* A conspiracy involves an agreement to commit an unlawful act, and an act in furtherance of that unlawful act. A person found guilty of conspiracy to engage in a crime is generally less-harshly punished than one found guilty of that crime in itself. For example, robbery may be a second-degree felony where conspiracy to commit robbery would be a third-degree felony. In this way, conspiracies are like attempt crimes, which are also generally of a lesser degree.
* Conspiracy to commit a crime (an agreement + an act infurtherance of unlawful act) causes the conspirator to be culpable for the completed act unless there is a clear expression of a withdrawal from the conspiracy. Thus, in a conspiracy to commit murder where, for example, a car is provided to the co-conspirator, with the knowledge that the co-conspirator is going to commit the murder is sufficient for both to be sentenced for murder.
Due process
Due process is a legal concept that when followed helps protect the people's fundamental rights in their dealings with the legal system. Due process is guaranteed by the Fifth Amendment and Fourteenth Amendment. Both state that:
No person shall be deprived of life, liberty, or property, without due process of law.
* "Due process" includes:
* the right to be notified of charges or proceedings
* the right to be tried by an impartial judge, magistrate or jury
* the right to defend oneself in a court of law
* the right to a trial under the established procedures and
* the right to be cleared of charges if not convicted.
* Additionally, due process requires that a person cannot be charged under a law that does not exist. The Bill of Rights defines the minimum standards of due process that is required of the government.
* Due process ensures that a person receives a fair trial and helps protect the innocent from being wrongly convicted.
# US Criminal Law/Search and seizure

* The Fourth Amendment to the United States Constitution states that:
* The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue; but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.
* The courts in interpreting this have determined that searches conducted with a search warrant are assumed to be reasonable and searches without a search warrant are assumed to be unreasonable and therefore illegal. However, the courts have also determined several exceptions to the requirement of a search warrant. For a warrant to issue, there must be these five requirements:
* Probable cause
* Oath or affirmation of probable cause
* Particularly describing places to be searched, and what is to be searched for and/or seized
* Signed by the Judicial Branch (a judge, essentially)
* Executed by the Executive Branch (the police, in general)
* Further Reading
* With a warrant
* Without a warrant
# Trigonometry/For Enthusiasts/Pythagorean Triples
## Pythagorean Triples

A Pythagorean triple has three positive integers a, b, and c, such that a$^2$ + b$^2$ = c$^2$. In other words, a Pythagorean triple represents the lengths of the sides of a right triangle where all three sides have integer lengths. Evidence from megalithic monuments on the Northern Europe shows that such triples were known before the discovery of writing. Such a triple is commonly written (a, b, c).

## Generating Pythagorean Triples

The integers
    $a=m^{2}-n^{2},\ \,b=2mn,\ \,c=m^{2}+n^{2}$
always form a Pythagorean triple, that is
    $\displaystyle a^{2}+b^{2}=c^{2}$
* Show it works
* (easy) Show that the formula is true whatever integer value we put for m and n.
* How was it discovered?
* (hard) How would someone find such a formula for generating Pythagorean Triples in the first place?
* Don't worry if you don't come up with an answer to this. Just investigating the question will help you practice with algebra.

## Examples of Pythagorean Triples

Some well-known examples are (3, 4, 5) and (5, 12, 13).
A primitive Pythagorean triple is one in which a, b and c are coprime (the greatest common divisor of a, b and c is 1).
The following is a list of primitive Pythagorean triples with values less than 100:
9:(3, 4, 5), (5, 12, 13), (7, 24, 25), (8, 15, 17), (9, 40, 41), (11, 60, 61), (12, 35, 37), (13, 84, 85), (16, 63, 65), (20, 21, 29), (28, 45, 53), (33, 56, 65), (36, 77, 85), (39, 80, 89), (48, 55, 73), (65, 72, 97)
* Are they all generated?
* Does the formula for generating Pythagorean Triples generate all the triples shown?
* Fermat's last theorem
* What is Fermat's Last Theorem?
* What goes wrong if you try to use and adapt the formula for Pythagorean Triples for it?

## References

* ↑ Needs a reference
# Trigonometry/For Enthusiasts/The Distance from New York to Tokyo

If we assume for simplicity that the Earth is a perfect sphere, it is possible to calculate the shortest distance between any two points on its surface. The shortest path is along the great circle through the two points. A great circle is so called because its radius equals the radius of the sphere, the largest possible radius for a circle on a sphere; it is the intersection of a plane passing through the centre of the sphere and the sphere's surface. The two points and the centre define a unique plane (unless the points are at opposite ends of a diameter of the sphere) hence the great circle through them is unique.
Worked Example: Distance between New York and Tokyo
The Earth
Earth's Radius: 6,371 km
Latitude
Longitude
Tokyo
35°42′N
139°42′E
New York
40°43′N
74°0′W :
Exercise: Promontorium Laplace to Crater Clavius
Crater Clavius
Moon's Radius: 1737 km
Latitude
Longitude
Promontorium Laplace
46°00′N
25°48′W﻿
Crater Clavius
58°24′S
14°24′W﻿ :
* Exercise: Where you live to Auckland
* Use the internet to find the latitude and longitude of where you live and of Auckland (New Zealand) and then work out the distance.
* If you live in Auckland (New Zealand), work out the distance to Auckland (California).
# Trigonometry/For Enthusiasts/Erdős–Mordell inequality

In Euclidean geometry, the Erdős–Mordell inequality states that for any triangle ABC and point O inside ABC, the sum of the distances from O to the sides is less than or equal to half of the sum of the distances from O to the vertices. It is named after Paul Erdős and Louis Mordell. Erdős (1935) posed the problem of proving the identity; a proof was provided two years later by Mordell and D. F. Barrow (1937). This solution was however not very elementary. Subsequent simpler proofs were then found by Kazarinoff (1957), Bankoff (1958), and Alsina & Nelson (2007).
In absolute geometry, the Erdős–Mordell inequality is equivalent to the statement that the sum of the angles of a triangle is at most 2$\pi$ (Pambuccian 2008).

## References

* Alsina, Claudi; Nelsen, Roger B. (2007), "A visual proof of the Erdős-Mordell inequality", Forum Geometricorum, 7: 99–102.
* Bankoff, Leon (1958), "An elementary proof of the Erdős-Mordell theorem", American Mathematical Monthly, 65 (7): 521.
* Erdős, Paul (1935), "Problem 3740", American Mathematical Monthly, 42: 396.
* Kazarinoff, D. K. (1957), "A simple proof of the Erdős-Mordell inequality for triangles", Michigan Mathematical Journal, 4 (2): 97–98, doi:10.1307/mmj/1028988998.
* Mordell, L. J.; Barrow, D. F. (1937), "Solution to 3740", American Mathematical Monthly, 44: 252–254.
* Pambuccian, Victor (2008), "The Erdős-Mordell inequality is equivalent to non-positive curvature", Journal of Geometry, 88: 134–139, doi:10.1007/s00022-007-1961-4.
# Trigonometry/For Enthusiasts/Introductions

This section of the book "Trigonometry 1" contains additional material and exercises for enthusiasts. Like "Trigonometry 1" itself, none of the exercises in this section require calculus, complex numbers or power series. The exercises are generally harder than in the main text. None of them are part of the core material, but some of the exercises and extensions here will be of interest and fun for some students.
The 'for Enthusiasts' sections are to interest and engage the student who is racing ahead. They aren't a general dumping ground for off-syllabus topics. They are to help bright students who would otherwise be getting bored. These students may also be neglecting to practice their trig skills, so the idea is that the trig for enthusiasts will get them thinking and practising again.
We also have book 2 on the relations between circles and triangles. This book goes well off-syllabus, at least as far as most modern trig syllabi are concerned, and is intended to help these students too. Fluency with the material in it is, for example, relevant for maths contests.
# Trigonometry/For Enthusiasts/Regular Polygons

A regular polygon is a polygon with all its sides the same length and all its angles equal. A polygon can have any number (three or more) of sides so there are infinitely many different regular polygons.

## Interior Angles of Regular Polygons

To demonstrate that a square can be drawn so that each of its four corners lies on the circumference of a single circle: Draw a square and then draw its diagonals, calling the point at which they cross the center of the square. The center of the square is (by symmetry) the same distance from each corner. Consequently, a circle whose center is coincident with the center of the square can be drawn through the corners of the square.
A similar argument can be used to find the interior angles of any regular polygon. Consider a polygon of n sides. It will have n corners, through which a circle can be drawn. Draw a line from each corner to the center of the circle so that n equal apex angled triangles meet at the center, each such triangle must have an apex angle of 2π/n radians. Each such triangle is isoceles, so its other angles are equal and sum to π - 2π/n radians, that is each other angle is (π - 2π/n)/2 radians. Each corner angle of the polygon is split in two to form one of these other angles, so each corner of the polygon has 2*(π - 2π/n)/2 radians, that is π - 2π/n radians.
This formula predicts that a square, where the number of sides n is 4, will have interior angles of π - 2π/4 = π - π/2 = π/2 radians, which agrees with the calculation above.
Likewise, an equilateral triangle with 3 equal sides will have interior angles of π - 2π/3 = π/3 radians.
A hexagon will have interior angles of π - 2π/6 = 4π/6 = 2π/3 radians which is twice that of an equilateral triangle: thus the hexagon is divided into equilateral triangles by the splitting process described above.
# This Quantum World/Appendix/Exponential function
#### The exponential function

We define the function $\exp(x)$ by requiring that
    $\exp '(x)=\exp(x)$ and $\exp(0)=1.$
The value of this function is everywhere equal to its slope. Differentiating the first defining equation repeatedly we find that
    $\exp ^{(n)}(x)=\exp ^{(n-1)}(x)=\cdots =\exp(x).$
The second defining equation now tells us that $\exp ^{(k)}(0)=1$ for all $k.$ The result is a particularly simple Taylor series:
Let us check that a well-behaved function satisfies the equation
    $f(a)\,f(b)=f(a+b)$
if and only if
    $f^{(i+k)}(0)=f^{(i)}(0)\,f^{(k)}(0).$
We will do this by expanding the $f$'s in powers of $a$ and $b$ and compare coefficents. We have
    $f(a)\,f(b)=\sum _{i=0}^{\infty }\sum _{k=0}^{\infty }{\frac {f^{(i)}(0)f^{(k)}(0)}{i!\,k!}}\,a^{i}\,b^{k},$
and using the binomial expansion
    $(a+b)^{i}=\sum _{l=0}^{i}{\frac {i!}{(i-l)!\,l!}}\,a^{i-l}\,b^{l},$
we also have that
    $f(a+b)=\sum _{i=0}^{\infty }{f^{(i)}(0) \over i!}(a+b)^{i}=\sum _{i=0}^{\infty }\sum _{l=0}^{i}{\frac {f^{(i)}(0)}{(i-l)!\,l!}}\,a^{i-l}\,b^{l}=\sum _{i=0}^{\infty }\sum _{k=0}^{\infty }{\frac {f^{(i+k)}(0)}{i!\,k!}}\,a^{i}\,b^{k}.$
Voilà.
The function $\exp(x)$ obviously satisfies $f^{(i+k)}(0)=f^{(i)}(0)\,f^{(k)}(0)$ and hence $f(a)\,f(b)=f(a+b).$
So does the function $f(x)=\exp(ux).$
Moreover, $f^{(i+k)}(0)=f^{(i)}(0)\,f^{(k)}(0)$ implies $f^{(n)}(0)=[f'(0)]^{n}.$
We gather from this
* that the functions satisfying $f(a)\,f(b)=f(a+b)$ form a one-parameter family, the parameter being the real number $f'(0),$ and
* that the one-parameter family of functions $\exp(ux)$ satisfies $f(a)\,f(b)=f(a+b)$, the parameter being the real number $u.$
But $f(x)=v^{x}$ also defines a one-parameter family of functions that satisfies $f(a)\,f(b)=f(a+b)$, the parameter being the positive number $v.$
Conclusion: for every real number $u$ there is a positive number $v$ (and vice versa) such that $v^{x}=\exp(ux).$
One of the most important numbers is $e,$ defined as the number $v$ for which $u=1,$ that is: $e^{x}=\exp(x)$:
    $e=\exp(1)=\sum _{n=0}^{\infty }{1 \over n!}=1+1+{1 \over 2}+{1 \over 6}+\dots =2.7182818284590452353602874713526\dots$
The natural logarithm $\ln(x)$ is defined as the inverse of $\exp(x),$ so $\exp[\ln(x)]=\ln[\exp(x)]=x.$ Show that
    ${d\ln f(x) \over dx}={1 \over f(x)}{df \over dx}.$
Hint: differentiate $\exp\{\ln[f(x)]\}.$
# This Quantum World
## Contents

* Cover and interwiki links
* Atoms
** What does an atom look like?
*** Like this?
*** Or like this?
** Quantum states
** Fuzzy observables
* Serious illnesses require drastic remedies
** Planck
** Rutherford
** Bohr
** de Broglie
** Schrödinger
** Born
** Heisenberg
* The Feynman route to Schrödinger
** Two rules
** An experiment with two slits
*** Why product?
*** Why is the absolute value inverse proportional to the distance?
*** Why is the phase proportional to the distance?
*** Calculating the interference pattern
** Bohm's story
*** Hidden Variables
** Propagator for a free and stable particle
*** The propagator as a path integral
*** A free particle
*** A free and stable particle
*** Meaning of mass
** From quantum to classical
*** Action
*** Geodesic equations
*** Principle of least action
*** Energy and momentum
*** Lorentz force law
*** Whence the classical story?
** Schrödinger at last
* The Schrödinger equation: implications and applications
** How fuzzy positions get fuzzier
** Time independent Schrödinger equation
** Why energy is quantized
** A quantum bouncing ball
** Atomic hydrogen
** Observables and operators
** Beyond hydrogen: the Periodic Table
** Probability flux
* Entanglement (a preview)
** Bell's theorem: the simplest version
** A quantum game
** The experiment of Greenberger, Horne, and Zeilinger
* Author(s)

## Appendices

* Probability
** Basic concepts
** Some problems
* Mathematical tools
** Elements of calculus
*** A definite integral
*** Differential calculus: a very brief introduction
*** Taylor series
*** The exponential function
*** The indefinite integral
*** Sine and cosine
** Complex numbers
** Vectors
** Fields
*** Gradient
*** Curl
*** Divergence
* How to solve problems in quantum physics
* The ABCs of relativity
** The principle of relativity
** Lorentz transformations (general form)
** Composition of velocities
** Proper time
** An invariant velocity
** The case against K>0
** The case against K=0
** The actual Lorentz transformations
** Lorentz contraction and time dilation
** 4-Vectors