OpenLLM-France/wikimedia huggingface dataset:
# The Way of the Java/Java IO
## Input and Output in Java
### System objects

System is the name of the built-in class that contains methods and objects used to get input from the keyboard, print text on the screen, and do file input/output (I/0).
System.out is the name of the object we have used to print text. When you invoke print and println, you invoke them on the object named System.out.
Interestingly, you can print System.out:
verbatim System.out.println (System.out); verbatim
The output is:
verbatim java.io.PrintStream@80cc0e5 verbatim
As usual, when Java prints an object, it prints the type of the object, which is PrintStream, the package in which that type is defined, java.io, and a unique identifier for the object. On my machine the identifier is 80cc0e5, but if you run the same code, you will probably get something different.
There is also an object named System.in that has type BufferedInputStream. System.in makes it possible to get input from the keyboard. Unfortunately, it does not make it easy to get input from the keyboard.

### Keyboard input

First, you have to use System.in to create a new InputStreamReader.
verbatim
verbatim
Then you use in to create a new BufferedReader:
verbatim
verbatim
The point of all this manipulation is that there is a method you can invoke on a BufferedReader, called readLine, that gets input from the keyboard and converts it into a String. For example:
verbatim
verbatim
reads a line from the keyboard and prints the result.
There is only one problem. There are things that can go wrong when you invoke readLine, and they might cause an IOException. There is a rule in Java that if a method might cause an exception, it should say so. The syntax looks like this:
verbatim
This indicates that main might ``throw an IOException. You can think of throwing an exception as similar to throwing a tantrum.

### File input

Reading input from a file is equally stupid. Here is an example:
verbatim
verbatim
This program reads each line of the named file (/usr/dict/words) into a String and then prints the line. Again, the declaration throws FileNotFoundException, IOException is required by the compiler. The object types FileReader and BufferedReader are part of the insanely complicated class hierarchy Java uses to do incredibly common, simple things. Other than that, you couldn't possibly care how this program works.
# Traditional Chinese Medicine/Xian-Salty

Xian-Salty:
* flows downward (Descends)
* softens hardness
* treats constipation & swelling

## Lists of Xian-Salty Herbs

Spicy-Cool/Cold Herbs:
* Chan Tui
Clear Blood-Heat:
* Shui Niu Jiao
* Xuan Shen
* Bai Wei
back to:
* Taste & Temperature
* TCM Materia Medica
# Traditional Chinese Medicine/Wu Zhu Yu Tang

Wu Zhu Yu Tang (Evodia Decoction)
(吴茱萸汤)
Consisting of:
* Wu Zhu Yu (吴茱萸) ﻿evodia fruit - 10gm
* She﻿ng Jiang (生姜) fre﻿sh ging﻿er﻿ - 18gm
* R﻿en She﻿n (人参) gins﻿eng - 9gm
* Da Zao (大枣) Chinese date﻿ - 10 pieces
back to :
* Prescriptions for Warming the Interior
* Prescriptions
# Traditional Chinese Medicine/Xi Jiao Di Huang Tang

The formula Xi Jiao Di Huang Tang, designed to clear away heat from the blood, remove toxic substances and dissipate stasis, consists of the following:
| No. | Pinyin | Simplified Chinese | Grams |
| 1 | Xi Jiao [or Shui Niu Jiao] | 犀角 [水牛角] | 3 [30] |
| 2 | Sheng Di Huang | 生地黄 | 30 |
| 3 | Chi Shao Yao | 赤芍药 | 9 |
| 4 | Mu Dan Pi | 牡丹皮 | 9 |
back to:
* Cooling Blood By Clearing Up Yingfen
* Prescriptions for Clearing Away Heat
* Formulas
* Formula Design
* Prescriptions
# Traditional Chinese Medicine/Xi Xin

Xi-Slender
Xin-Spicy or hot in flavor
(Chinese: 细辛)
Asarum, Chinese Wild Ginger
Taste & Temperature:
* Xin-Spicy
* Wen-Warm
Channels:
* Hand Tai Yin of Lung (b/c Xin-Spicy?)
* Foot Shao Yin of Kidney
Actions & Indications:
* disperse Wind-Cold (Warm & Spicy)
* Stop headache
* Shao Yin headache (teeth/cold)
* warm the Lung, transform Phlegm
* very good analgesic
* open nasal orifices
Contraindications:
* Qi & Yin deficiency causing excessive sweating
* profuse sweating due to Qi deficiency
* headache due to Blood deficiency
* cough due to Yin deficiency
Caution:
* Yin syndrome
* Blood deficiency
* chronic skin infection
* renal problem
Antagonize:
* Shan Zhu Yu
* Huang Qi
Counteract:
Dosage:
back to:
* TCM Materia Medica
* Xin Wen Jie Biao

## Notes

* ↑ Shao-Qing Cai, Jie Yu, Xuan Wang, Rui-Qing Wang, Fu-Xiang Ran, Ming-Ying Shang, Jing-Rong Cui, Katsuko Komatsu, Tsuneo Namba. "Cytotoxic activity of some Asarum plants", Fitoterapia, Volume 79, Issue 4, June 2008, Pages 293-297.
# Traditional Chinese Medicine/Xia Ku Cao

Name Means:
* Xia-Summer
* Ku-Withered
* Cao-Grass/Weed
English Name:
* prunella
* selfheal spike
Chinese Name:
Latin Name:
Modern Research
* Xia Ku Cao is "one of the most important herbal medicines in the treatment of pulmonary tuberculosis, mastitis, infectious hepatitis, and hypertension".
* It contains several active components including "triterpenic acids and their glycosidic derivatives, phenolic acids, and saponins". Among these components, triterpenic acids "have demonstrated antiinflammatory, diuretic, antitumor, hepatoprotective, and anti-HIV properties".
Taste & Temperature:
* Ku-Bitter
* Xin-Spicy
* Han-Cold
Channels:
* Foot Shao Yang of Gall Bladder
* Foot Jue Yin of Liver
Actions & Indications:
* Clear Heat & Drain Fire
* Clear Liver Heat, brighten eyes
* clear Heat and dissipate nodules
* treat hypertension due to Liver Fire, Liver Yang Rising
* treat hypertension
Contraindications:
Caution:
Dosage:
back to:
* Qing Re Xia Huo
* TCM Materia Medica

## References

* ↑ Hong-Xiang Sun, Feng Qin, Yuan-Jiang Pan, "In vitro and in vivo immunosuppressive activity of Spica Prunellae ethanol extract on the immune responses in mice", Journal of Ethnopharmacology, Volume 101, Issues 1-3, 3 October 2005, Pages 31-36
* ↑ Mi Kyoung Lee, Young Min Ahn, Kang Ro Lee, Jee H. Jung, Ok-Sang Jung, Jongki Hong: "Development of a validated liquid chromatographic method for the quality control of Prunellae Spica: Determination of triterpenic acids", Analytica Chimica Acta, Volume 633, Issue 2, 9 February 2009, Pages 271-277.
* ↑ Y.P. Zhu, "Chinese Materia Medica: Chemistry, Pharmacology and Applications", Harwood Academic Publishers, Amsterdam, 1998, pp668.
* ↑ M.E. Alvarez, A.E. Rotelli, L.E. Pelzer, J.R. Saad, O. Giordano, Il. Farmaco 55 (2000) pp502.
# Traditional Chinese Medicine/Xiang Sheng Po Di Wan

The formula Xiang Sheng Po Di Wan, designed to stop cough by astringing the lungs, consists of the following:
| No. | Pinyin | Simplified Chinese | Grams |
| 1 | Jie Geng | 桔梗 | 6 |
| 2 | Sheng Gan Cao | 生甘草 | 6 |
| 3 | Lian Qiao | 连翘 | 6 |
| 4 | Bo He | 薄荷 | 9 |
| 5 | Sheng Da Huang | 生大黄 | 3 |
| 6 | Chuan Xiong | 川芎 | 3 |
| 7 | Suo Sha Ren | 縮砂仁 | 3 |
| 8 | He Zi | 诃子 | 3 |
| 9 | Er Cha | 儿茶 | 6 |
back to :
* Stopping Cough By Astringing The Lung
* Formula Design
* Prescriptions
# Traditional Chinese Medicine/Xiao Chai Hu Jie Gen Shi Gao Tang

The formula Xiao Chai Hu Jie Gen Shi Gao Tang, designed to harmonise the functions of the shaoyang system, reduce fever, relieve sore throat and evacuate pus, consists of the following:
| No. | Pinyin | Simplified Chinese | Grams |
| 1 | Chai Hu | 柴胡(北柴胡) | 9 |
| 2 | Huang Qin | 黄芩 | 9 |
| 3 | Ren Shen | 人参 | 3 |
| 4 | Ban Xia | 半夏 | 6 |
| 5 | Zhi Gan Cao | 炙甘草 | 6 |
| 6 | Sheng Jiang | 生姜 | 3 |
| 7 | Da Zao | 大枣 | 3 |
| 8 | Jie Geng | 桔梗 | 3 |
| 9 | Sheng Shi Gao | 生石膏 | 9 |
back to:
* Treating Shaoyang Disease By Mediation
* Formula Design
* Prescriptions
# Traditional Chinese Medicine/Wu Wei Xiao Du Yin

The formula Wu Wei Xiao Du Yin, consists of the following:
| No. | Pinyin | Simplified Chinese | Grams |
| 1 | Jin Yin Hua | 金银花(忍冬) | 15 |
| 2 | Ye Ju Hua | 野菊花 | 15 |
| 3 | Zi Hua Di Ding | 紫花地丁 | 15 |
| 4 | Pu Gong Ying | 蒲公英 | 15 |
| 5 | Zi Bei Tian Kui | 紫背天葵 | 15 |
back to:
* Subduing Swelling And Dissolving Lumps By Clearing Away Heat And Removing Poison
* Formula Design
* Prescriptions
# Traditional Chinese Medicine/Xiang Ru

nickname: "Summer Ma Huang"
(Chinese name: 香薷)
Latin name: Herba Elsholtziae
Taste & Temperature:
* Xin-Spicy
* slightly Wen-Warm
* Xiang-Aromatic
Channels:
* Lung
* Stomach
Actions & Indications:
* expel summerheat and dampness
* disperse Wind-Cold (Warm & Spicy)
* expel Summer Heat, transform Damp
* promote urination, reduce swelling
Contraindications:
* Qi & Yin deficiency causing excessive sweating
* sweating due to Wei Qi deficiency
Caution:
* Yin syndrome
* Blood deficiency
* chronic skin infection
* may cause vomiting if taken hot
Dosage:
Cooking:
back to:
* TCM Materia Medica
* Xin Wen Jie Biao
# Traditional Chinese Medicine/Xian Fang Huo Ming Yin

Xian Fang Huo Ming Yin is composed of:
* Jin Yin Hua (Flos Lonicerae Japonicae) : 9g
* Fang Feng (Radix Saposhnikoviae) : 3g
* Bai Zhi (Radix Angelicae Dahuricae) : 3g
* Dang Gui Wei (Extremitas Radix Angelicae Sinensis) : 3g
* Chi Shao (Radix Paeoniae Rubra) : 3g
* Ru Xiang (Gummi Olibanum) : 3g
* Mo Yao (Myrrha) : 3g
* Bei Mu (Bulbus Fritillariae) : 3g
* Tian Hua Fen (Radix Trichosanthis) : 3g
* Chuan Shan ]ia (Squama Manis), zhi (fried with liquid) : 3g
* Zao Jiao Ci (Spina Gleditsiae), chao (dry-fried) : 3g
* Chen Pi (Pericarpium Citri Reticulatae) : 9g
* Gan Cao (Radix et Rhizoma Glycyrrhizae) : 3g
Note:
back to:
* Formulations That Treat Abscesses And Sores
* Classification Of Prescriptions
# The Sway Reference Manual/Lazy Evaluation

Many functional languages feature delayed (or lazy) evaluation of function arguments, Unlike applicative order evaluation (used by C and Java), where function arguments are evaluated before they are bound to formal parameters, lazy evaluation delays evaluation until the actual values are needed. This is accomplished by passing the argument as a thunk, which is a data structure containing the actual expression forming the argument and the environment in which the argument would have been evaluated under applicative order.
Sway allows the programmer to decide whether or not lazy evaluation should be used. To signify lazy evaluation, the formal parameter is named starting with a dollar sign ($). When the actual value of the argument is needed, the force function is used to evaluate the argument expression in the thunk. Here is an example:
When this code is executed, we get the output:
Contrast this with the output of the following code, where the formal parameter is named normally:
When this new code is executed, we get the output:
This is because the println must be evaluated before its result is bound to the formal parameter x.
← Exceptions · Variadic Functions →
# The Sway Reference Manual/Introduction
## Sway and the Sway Interpreter

Consider a computer program designed to help people read an essay. The simplest task one might ask of this program is the meaning of a word. For example, one might ask the program the meaning of the word 'expeditious' to which the program might reply, 'adjective: characterized by quickness'. An online dictionary is an example of such a program. By analogy, one could imaging a similar program designed for people learning how to program. In this case, one would ask the meaning of a word or phrase in a programming language, rather than a human language. Such a program is known as an interpreter because it translates phrases from a 'foreign' language (the programming language) to their meanings (which presumably, we will understand). The Sway interpreter can answer those types of requests quite easily: To see that this is so, one starts up the Sway interpreter by issuing the command sway in response to the system prompt.
Here, the % sway represents a command to get the Sway interpreter going. The interpreter signals its readiness to handle requests by issuing the Sway prompt sway>. Consider someone typing the number 3 and then a semicolon at the Sway prompt:
In the remainder of the text, the person who started up the Sway interpreter (or is running a Sway program) is known as the user. The user has just asked the Sway interpreter to evaluate or give the meaning of 3. The semicolon after the 3 can be thought of as a signal to the interpreter that the request has been completed, much like the period at the end of a sentence. The interpreter reads in the request and responds with the phrase INTEGER: 3. In this text, requests to the interpreter will, in general, be preceded by the Sway prompt. Responses by the interpreter will, in general, follow requests. Sometimes, when the response by the interpreter is not of interest, the response will be omitted.
The response of the interpreter is two-fold; first the type of the result is displayed (in this case INTEGER) and then the meaning or value of the result (in this case 3). This is much like looking up a word in a dictionary. First the type of word (or part of speech) is given (e.g. noun, verb, adjective) followed by the meaning of the word. Unlike a dictionary, a word in Sway always has one meaning. Sway, as with most programming languages, has a small number of simple types: integers, real, numbers, strings, and symbols.
The Sway interpreter, in general, evaluates expressions. As a rule, one signals the end of an expression using the semicolon. In response to an expression, the interpreter determines its value. As will be seen, the Sway interpreter can evaluate much more complicated expressions than integers.
Starting Up →
# The Sway Reference Manual/Exceptions

Exceptions occur when the interpreter detects an error in the code. These errors could be syntax errors or semantic errors. You've seen the aftermath of exceptions before: undefined variable exceptions, divide by zero exceptions, and so on.
When an exception is generated, it is said to be raised or thrown. Unless the exception is caught, it terminates processing of the current function call, then propagates upward, terminating the processing of the function that made the call, and so on and so on.
Unless the exception is caught (see the next section), the exception eventually terminates the Sway interpreter if executing a file. If Sway is running interactively, the processing terminates up to, but not including, the prompt-read-eval loop (the one with the sway> and more> prompts).

## Handling exceptions

It is possible to stop the propagation of an exception by using the catch function. The sole argument to catch is an expression that may generate an exception. The catch function evaluates its argument and, if no exception was raised, returns the value of the evaluated expression. If an exception was raised, catch converts the exception into an error object.
Here is a typical use of catch:
Note that if you catch an exception but it turns out you don't wish to handle it, you can rethrow it with the throw function.

## Throwing exceptions

You can generate your own exceptions with a different use of the throw function. This use of throw requires two arguments. These arguments can be anything, but, by convention, the first argument is a symbol and the second is a string giving more explanation concerning the error. For example, suppose you wish raise an exception if a variable is supposed to be even and it's not:

## Try catch blocks

If you include the basics library, you can use the 'try function, which simplifies the catching and processing of exceptions. Here is a version of the typical usage shown previously:
The try function requires that a variable be passed as the first argument; it will set this variable to the caught exception, should an exception occur.

## Returns are exceptions

The return function generates a special exception of type :return, so the expression
is equivalent to:
Since a return is ultimately an exception, encountering a return causes an immediate end to the processing of the body of a function.
This exception, however, is caught by the part of the interpreter that sets up the function call and is not allowed to propagate further.
← Inheritance · Lazy Evaluation →
# Trigonometry/Areas of Triangles

The area of a triangle is half the base times the height

## Formula for Area

The statement in the blue box gives us a way to get the area of any triangle. The 'base' of the triangle is any side you choose to make the base, i.e. whichever side you choose to have at the bottom of the diagram. The height is then the distance measured at right angles to that to the apex, the point of the triangle not on the base. The diagrams below show how the height and base are measured.
Notice particularly how the height and base are measured for the second triangle.

## With Right-Triangles

Before we show why the formula works for all triangles we're going to look at the simpler case of right triangles.
For right triangles we can easily show that the formula is true provided the 'base' is one of the shorter sides. Because we can make a rectangle out of two copies of a right triangle the area of a right triangle is just half the area of the resulting rectangle, i.e half of the product of the lengths of the two shorter sides of the triangle. Here are some diagrams that show this:

## Dividing other triangles into Right Triangles

Now that we have established how to calculate the area of a right triangle we can establish the formula for the area of any triangle by dividing it up into right triangles. Here we show that the triangle can be divided into two right triangles. We have 'h' is the height of the triangle, a and b are sides of the two smaller triangle, and together a+b is the length of the base.
The area of the two smaller triangles are ${\frac {ah}{2}}$ and ${\frac {bh}{2}}$ . The area of the whole triangle is the sum of these, i.e.
    ${\frac {ah}{2}}+{\frac {bh}{2}}={\frac {ah+bh}{2}}={\frac {(a+b)h}{2}}={\frac {(a+b)}{2}}h$
which is half the base times the height.
We do need to be careful however, since we could have a triangle with an obtuse angle. One way to deal with that is to allow the length a or b to be a negative number. However, to be on the safe side it is better to draw out a diagram for an obtuse angle triangle and check it separately.
In this diagram we now have that the length of the base is a-b and the area of the triangle is got by subtracting the area of the smallest right triangle from the largest right triangle.
    ${\frac {ah}{2}}-{\frac {bh}{2}}={\frac {ah-bh}{2}}={\frac {(a-b)h}{2}}={\frac {(a-b)}{2}}h$
Since the base has length a-b we again get that the area is half the base times the height.
The area of a triangle is half the base times the height
| previous module: "Proof: Angles sum to 180" | • Table of Contents | next module: "Heron's Formula" |
# Trigonometry/Book 2 Introduction

In Book 1 we used algebraic formulas to work with triangles.
This book deepens the understanding of the many relationships between triangles and circles. It also shows how to tackle some harder trigonometric function identities. Apart from more algebra, the main additional mathematical tool we use and develop is vectors in 3D.

## Starting with Vectors

A point $\displaystyle P$ in 3D space is given by three coordinates, $\displaystyle P=(x,y,z)$. This isn't that different from points in 2D, where the points are $\displaystyle (x,y)$.
If we have two points, $\displaystyle P$ and $\displaystyle Q$, we may use a different notation to indicate their coordinates. $\displaystyle P_{x},P_{y},P_{z}$ for $\displaystyle P$, and $\displaystyle Q_{x},Q_{y},Q_{z}$ for $\displaystyle Q$.
When we are more interested in the relative displacement between two points, we tend to use $\displaystyle V$ and $\displaystyle W$ as our names, and we call $\displaystyle V$ and $\displaystyle W$ vectors.
What has this to do with trigonometry?
If we have vectors $\displaystyle V$ and $\displaystyle W$ trigonometry comes in when we calculate the following quantity, which is called 'the dot product' and written $\displaystyle V\cdot W$
    $\displaystyle V\cdot W=V_{x}W_{x}+VyW_{y}+V_{z}W_{z}$
It turns out that this dot product is the product of the lengths of the two vectors multiplied by the cosine of the angle between the two vectors. We'll try this with two vectors that are at right angles to each other.
* Example: Two Perpendicular Vectors
* We choose $\displaystyle V=(1,3,4)$ and $\displaystyle W=(6,-2,0)$ then
* $\displaystyle V\cdot W=V_{x}W_{x}+VyW_{y}+V_{z}W_{z}$
* $\displaystyle =1\times 6+3\times -2+4\times 0=6-6+0=0$
* Neither of the vectors has zero length, but the dot product is zero. That means that the cosine of the angle between the two vectors is zero, the angle between the two vectors is ninety degrees and so the two vectors are at right angles to each other.
* Exercise: Dot product of Vector with itself
* The angle 'between a vector and itself' is zero. What is the cosine of that angle?
* The dot product of two vectors is "the product of the lengths of the two vectors multiplied by the cosine of the
* angle between the two vectors." If both vectors are the same vector, how can we simplify that statement?
* We also have:
* $\displaystyle V\cdot V=V_{x}V_{x}+VyV_{y}+V_{z}V_{z}=(V_{x})^{2}+(V_{y})^{2}+(V_{z})^{2}$
* ..you can relate this to the Pythagorean theorem, in three dimensions of course. What we've just seen is that the formula for dot product is closely related to trigonometry.

## Applications

add some applications (and pictures) as for Book 1.

## About Book 2

Book 2, like book 1, only deals with aspects of trigonometry that can be handled without calculus. However, the algebra moves at a brisker pace than in Book 1. The topics are less central to understanding Trigonometry than in book 1.
# Trigonometry/Circles and Triangles/Brocard's Theorem

Brocard's Theorem is due to French mathematician Henri Brocard (1845 – 1922).
[Needs diagram]
Let ABC be any triangle. Draw three lines:
* AD where D is between B and C, and angle DAB = ω
* BE where E is between A and C, and angle EBC = ω
* CF where F is between A and B, and angle FCA = ω
Then the lines AD, BE, CF are concurrent, meeting at a Brocard point, if and only if
    cot(ω) = cot(A) + cot(B) + cot(C).
From symmetry, there is a second Brocard point, using the same angle ω, at the intersection of the three lines
* AD' where D' is between B and C, and angle D'AC = ω
* BE' where E' is between A and C, and angle E'BA = ω
* CF' where F' is between A and B, and angle F'CB = ω
# Trigonometry/Circles and Triangles/Area bisectors

Area bisectors
As already noted, the three medians of a triangle each bisect its area. So do the lines parallel to each side of the triangle dividing the other two sides in the ratio ${\sqrt {2}}+1:1$. These six lines form four concurrent triplets: the three medians and each median with the lines parallel with the two sides not cut by the median. The latter three triplets define a triangle of which the medians are the same as those of the original triangle.
# Trigonometry/Circles and Triangles/Ceva's Theorem

Ceva's Theorem is as follows:
Let ABC be the vertices of a triangle. Let D be a point on side BC, E be a point on side AC and F be a point on side AB. (The points DEF may be on the extensions of the sides rather than the sides themselves.) Then the lines AD, BE, CF are concurrent (i.e. all cross at the same point) if and only if
    $\displaystyle {AF \over FB}\times {BD \over DC}\times {CE \over EA}=1.$
It was discovered by Giovanni Ceva (1648-1734). Because of this theorem, any line joining the vertex of a triangle to a point on an opposite side is sometimes called a cevian.

## Some corollaries of Ceva's Theorem

1. The medians of a triangle are concurrent. (This is the centroid.)
2. The angle bisectors of a triangle are concurrent. (This is the incenter; this result has already been proved.)
3. The altitudes of a triangle are concurrent. (This is the orthocenter.)
4. (Gergonne's theorem) Let D, E, F be the points where the incircle touches the sides of the triangle ABC. Then the lines AD, BE and CF are concurrent. This theorem is due to Joseph Diaz Gergonne (1771-1859).
5. (Nagel's theorem) Let D, E, F be the points where the respective excircles touch the sides AB, BC and CA respectively of the triangle ABC. Then the lines AD, BE and CF are concurrent.