OpenLLM-France/wikimedia huggingface dataset:
# Algorithm Implementation/Sorting/Bubble sort
## Bubble Sort

The bubble sort is also known as the ripple sort. The bubble sort is probably the first, reasonably complex module that any beginning programmer has to write. It is a very simple construct which introduces the student to the fundamentals of how sorting works.
A bubble sort makes use of an array and some sort of "swapping" mechanism. Most programming languages have a built-in function to swap elements of an array. Even if a swapping function does not exist, only a couple of extra lines of code are required to store one array element in a temporary field in order to swap a second element into its place. Then the first element is moved out of the temporary field and back into the array at the second element's position.
Here is a simple example of how a bubble sort works: Suppose you have a row of children's toy blocks with letters on them. They are in random order and you wish to arrange them in alphabetical order from left to right.
    Step 1. Begin with the first block. In this case, the letter G. (Fig. 1.)
    Step 2. Look at the block just to the right of it.
    Step 3. If the block to the right should come before the block on the left, swap them so that they are in order (Fig. 2.)
    If you were doing this by hand, you might just pick the blocks to be moved with one in each hand and cross your arms to swap them. Or you might move the first one out of its position temporarily, move the second one in its place, then move the first one to the now empty position (this is the difference between having a single function to do the swap, or writing some code to do it).
    Step 4. Compare the next block in line with the first, and repeat step 3. Do this until you run out of blocks. Then begin step one again with the second block. (Fig. 3,4,5,6)

### Why is it called a bubble sort?

The bubble sort gets its name because elements tend to move up into the correct order like bubbles rising to the surface.

### C++

C++ can use the C bubble sort above, or use this for random-access iterators of generic containers and a generic comparison operator:

### Ada

Sorts an array of integers.

### AutoIt

Sorts an array of variant data types

### Go

Go implementation with package sort

### OCaml

This version checks for changes in a separate step for simplicity.

### Pascal

A simplified version:

### Rust

Rust function for generic types that implement Copy and PartialOrd traits (e.g. numeric types or strings).

### VBA

see discussion for possible mistake

### COBOL

If you are dealing with a large volume of data, use the COBOL SORT using sequential files. For sorting a WORKING STORAGE table, the following example assumes that the table is already loaded. The literals "a" indicates the size of the row, and "b" how many rows in the table.
# Algorithm Implementation/Sorting/Cocktail sort
## C++

Follow the Java example above, but replace the first line with

## Dual Cocktail Shaker Sort

A variant of Cocktail Shaker Sort that sorts from both ends of the array simultaneously, improving performance.
# Algorithm Implementation/Simulation

Simulation algorithms are used to model a mathematical problem. These algorithms do not necessarily fit under other types of algorithms, but may borrow elements from the algorithm categories..
Simulations may appear as either iterative processes, as a brute-force search for every possibility, a randomized search, or as a more complex process. Unlike other systems, there may not be an specific correct answer and might only be determined by running the algorithm.
* Life
* Conway's Game of Life
* Monty Hall problem
# Algorithm Implementation/Sorting

Before we get into the gritty details of various sorting algorithms, let me point out: We usually don't build an automobile engine from scratch. Instead, we usually use an off-the-shelf automobile engine already built into the automobile we are using. Likewise, we usually don't write yet another sort function. Instead, we usually use an off-the-shelf sort function already supplied with the API we are using.
* Binary Tree Sort
* Bogosort
* Bubble sort
* Bucket sort
* Check sort
* Cocktail sort
* Comb sort
* Counting sort
* Gnome sort
* Heapsort
* Insertion sort
* Introsort
* Library sort
* Merge sort
* Patience sort
* Pigeonhole sort
* Quicksort
* Radix sort
* Rapid sort
* Schwartzian transform
* Selection sort
* Shell sort
* Smoothsort
** Some proofs

## Further reading

* When we discuss the details of these algorithms, we assume you are already familiar with Data Structures.
* Optimizing C++/General optimization techniques/Sorting—explains how to use the standard, off-the-shelf sorting algorithm implementations in the standard template library (STL)
* c2: SortingAlgorithms
# Algorithm Implementation/Simulation/Conway's Game of Life

Conway's Game of Life is a cellular automaton with two states for each cell. The following implementation(s) calculate the next generation.
# Algorithm Implementation/Sorting/Bogosort

The algorithm bogosort (also random sort, shotgun sort or monkey sort) is a particularly ineffective sorting algorithm. Its only use is for educational purposes, to contrast it with other more realistic algorithms. If bogosort were used to sort a deck of cards, it would consist of checking if the deck were in order, and if it were not, one would throw the deck into the air, pick the cards up at random, and repeat the process until the deck is sorted. Its name comes from the word bogus.

## Description of the algorithm

Following is a description of the algorithm in pseudocode.

## Implementations in different programming languages
### Perl 5

Or, for a deck of cards:

### Perl 6

Or, for a deck of cards:

### Smalltalk

Various other implementations in C++ are available, including an STL-style algorithm, which was inspired by discussions on the ACCU General mailing list.

## References

* H. Gruber, M. Holzer and O. Ruepp: Sorting the Slow Way: An Analysis of Perversely Awful Randomized Sorting Algorithms, 4th International Conference on Fun with Algorithms, Castiglioncello, Italy, 2007, Lecture Notes in Computer Science 4475, pp. 183–197.
* Jargon File entry for bogo-sort, "the archetypal perversely awful algorithm"

## External links

* http://c2.com/cgi/wiki?BogoSort
* Bogosort: an implementation that runs on Unix-like systems, similar to the standard sort program.
* Bogosort and jmmcg::bogosort: Simple, yet perverse, C++ implementations of the bogosort algorithm.
# Algorithm Implementation/Simulation/Monty Hall problem
## R

[from http://sas-and-r.blogspot.com/search?q=7.23]

## Ruby

Another implementation

## SAS

[from http://sas-and-r.blogspot.com/search?q=7.23]
# Annotated Republic of China Laws/Red Cross Society Act of the Republic of China/Article 20

| ←Article 15 to Article 19 | Red Cross Society Act of the Republic of China Republic of China (Taiwan) Law Article 20 | Article 13 to Article 32→ |

## First promulgated on 1954-10-18

(From http://law.moj.gov.tw/ENG/LawClass/LawSearchNo.aspx?PC=D0050098&DF=&SNo=20 retrieved on 2015-12-13)

### Article 20

    Each branch or sub-branch of the Red Cross Society of the Republic of China shall recruit members periodically once every year, and the local government shall provide assistance for the recruitment.

## Promulgated amendment on 2000-04-26
### Article 20

(May be considered unchanged in English)
# Annotated Republic of China Laws/Red Cross Society Act of the Republic of China/Article 32

| ←Article 20 to Article 31 | Red Cross Society Act of the Republic of China Republic of China (Taiwan) Law Article 32 | Article 33 to Article 34→ |

## First promulgated on 1954-10-18

(From http://law.moj.gov.tw/ENG/LawClass/LawSearchNo.aspx?PC=D0050098&DF=&SNo=32 retrieved on 2015-12-13)

### Article 32

    The personnel of the Red Cross Society of the Republic of China who follow the army to provide rescue and aid at wartime shall be treated similarly to the military civil servants, and their uniforms, unless otherwise prescribed by international treaties, shall be stipulated by the headquarters and reported to the regulating authority for registration.

## Promulgated amendment on 2000-04-26
### Article 32

(May be considered unchanged in English)
# Annotated Republic of China Laws/Road Traffic Management and Penalty Act
## History

* Promulgated on February 5, 1968. (77 Articles)
* Amendment to Articles 14, 75 and addition of Articles 76~78 and the original Articles 76, 77 are change to 79,80 on January 27, 1969.
* Promulgated on July 24, 1975. (93 Articles)
* Amendment to Articles 8, 21, 27, 31, 33, 54, 65~68, 89,and addition of Articles 37-1 on July 29, 1981.
* Promulgated on May 21, 1986. (93 Articles)
* Amendment to Articles 3, 7, 8, 12, 15~17, 24, 27, 29~31, 33, 35~38, 44, 55~57, 59, 60, 62~65, 67, 86, 87, 90 and addition of Articles 7-1, 63-1, 82-1, 83-1, 85-1 on January 22, 1997.
* Amendment to Articles 12, 14 on April 23, 1997.
* Amendment to Articles 37 on April 21, 1999.
* Amendment to Articles 8, 9, 12~14, 19, 21, 25, 28~31, 33~35, 37, 39~41, 43, 45, 47, 51~53, 55~57, 60, 61, 63, 67, 75, 78, 80~84, 87, 90, 93 and addition of Articles 18-1, 21-1, 29-1, 29-2, 31-1, 85-2~85-4, 90-1, 90-2 and deletion of Articles 64, 77, 79 promulgated on January 17, 2001.
* Amendment to Articles 4, 9, 12, 16, 21-1, 24, 29, 30, 33, 35, 37, 62, 82-1, 85-1, 85-2, 92 and addition of Articles 7-2, 9-1, 29-3, 29-4 promulgated on July 3, 2002.
* Addition of Articles 92-1 promulgated on January 2, 2003.
* Addition of Articles 61 promulgated on April 21, 2004.
* Amendment to Articles 56 promulgated on February 5, 2005.
* Amendment to Articles 68 promulgated on December 14, 2005.
* Amendment to Articles 3, 5, 7-2, 8~10, 12~16, 18, 20~26, 29, 29-2, 29-3, 30~33, 35~38, 40, 42~50, 53~55, 57~63, 65~67, 69, 71~74, 76, 78, 80, 82, 83~85-1, 85-3, 90-2, 92 and addition of Articles 31-2, 32-1, 67-1, 90-3 and deletion of Articles 28 promulgated on December 28, 2005.
* Amendment to Articles 9-1, 92 promulgated on January 29, 2007.
* Amendment to Articles 69 and addition of Articles 69-1 promulgated on July 4, 2007.
* Amendment to Articles 65 promulgated on May 28, 2008.
* Amendment to Articles 38 promulgated on May 5, 2010.
* Amendment to Articles 35 promulgated on January 19, 2011.
* Amendment to Articles 31 promulgated on May 11, 2011.
* Amendment to Articles 45, 55, 78 promulgated on May 18, 2011.
* Amendment to Articles 65, 85-3, 87 and deletion of Articles 88, 89, 90-2 promulgated on November 23, 2011.
* Amendment to Articles 3, 4, 7-2, 21, 21-1, 22, 27, 31, 31-1, 33, 35, 43, 45, 54, 85-2, 90-3, 91, 92 promulgated on May 30, 2012.
* Amendment to Articles 8, 35, 67 promulgated on January 30, 2013.
* Amendment to Articles 14, 25, 31 promulgated on May 8, 2013.
* Amendment to Articles 7-2,9,31-1,43,45,73,74 promulgated on January 8, 2014
* Amended on June 18, 2014
* Amended on January 07, 2015
* Amended on May 20, 2015
* Amendment to Articles 37 promulgated on November 9, 2016.

## Annotated by Wikibooks

* ↑ "Road Traffic Management and Penalty Act: Legislative History". Laws & Regulations Database of The Republic of China. Ministry of Justice (Taiwan). 2017-09-08. Retrieved 2017-09-19.
* 1 2 This complete amendment is in a separate page, and later partial amendments are in other separate pages per articles.
# Annotated Republic of China Laws/Red Cross Society Act of the Republic of China/Article 12

| ←Article 10 to Article 11 | Red Cross Society Act of the Republic of China Republic of China (Taiwan) Law Article 12 | Article 13 to Article 15→ |

## First promulgated on 1954-10-18

(From http://law.moj.gov.tw/ENG/LawClass/LawSearchNo.aspx?PC=D0050098&DF=&SNo=12 retrieved on 2015-12-13)

### Article 12

    In the headquarters of the Red Cross Society of the Republic of China shall be set a board of supervisors to audit the revenue and expenditure accounts of the Red Cross Society and inspect the implementation of business; in this board shall be set nine (9) supervisors, and among them three (3) are full-time supervisors assumed by the governors of the authorities in charge of finance, accounting, and auditing designated by the government, and six (6) are elected by the national member representative’s congress. And three (3) standing supervisors shall be elected by and from the supervisors to organize a board of standing supervisors to handle routine affairs. The full-time supervisors shall be appointed and recalled by the government; the tenure of elected supervisors is four (4) years, and an elected supervisor may be reappointed if he is elected again upon expiration of the tenure.

## Promulgated amendment on 2000-04-26
### Article 12

(May be considered unchanged in English)
# Annotated Republic of China Laws/Red Cross Society Act of the Republic of China/Article 6

| ←Article 1 to Article 5 | Red Cross Society Act of the Republic of China Republic of China (Taiwan) Law Article 6 | Article 7 to Article 10→ |

## First promulgated on 1954-10-18

(From http://law.moj.gov.tw/ENG/LawClass/LawSearchNo.aspx?PC=D0050098&DF=&SNo=6 retrieved on 2015-12-13)

### Article 6

The regulating authority in charge of the Red Cross Society of the Republic of China is the Ministry of the Interior, and its target businesses shall be implemented under the direction of the related ministries and commissions.

## Promulgated amendment on 2000-04-26
### Article 6

(May be considered unchanged in English)
# Annotated Republic of China Laws/Road Traffic Management and Penalty Act/Article 37

| ←Article 36 | Road Traffic Management and Penalty Act Republic of China (Taiwan) Law Article 37 | Article 37-1→ |

## Promulgated amendment on 2016-11-09

Effective 2017-01-01

### Article 37

    Any person convicted of the crime of homicide, robbery, pillage, plunder, extortion for money, kidnapping, or other crimes as specified by Articles 184, 185, and 221 to 229 of the Criminal Law; Articles 24 to 27 of the Statue for Prevention of Sexual Transactions Involving Children and Adolescents; Articles 33 to 37 of the Statue for Child and Youth Sexual Exploitation Prevention Act ;the Statue Governing the Control of Guns, Ammunition, Knives and Weapons; the Smuggling Punishment Act; or the Statue for Prevention of Narcotics; or persons given correctional penalties pursuant to the Statue Governing Seizing Mobsters shall be prohibited from applying taxi driver business registration.
    Should a taxi driver commit any of the crimes as specified in the previous paragraph during a valid taxi registration period, his/her business registration certificates shall be suspended after being ruled guilty in the first trial in court or given correctional penalties pursuant to the Statue Governing Seizing Mobsters. Any driver who has been convicted by a court or given correctional penalties shall have his/her commercial registration certificate canceled and his /her driver license shall be revoked.
    Should a taxi driver the commit crimes involving larceny, fraud, theft, obstruction of freedom, or any of the crimes specified in Articles 230 to 236 of the Criminal Law during operation and be sentenced to prison in the first trial of a court, his/her business registration certificate shall be suspended. Any driver who has been convicted by a court and sentenced to prison, his/her business registration certificate shall be canceled and his/her driver license shall be revoked.
    Should a taxi driver have his/her business registration certificate been suspended for reasons as specified in the preceding two paragraphs and fail to return said certificate to the issuing police authority, said certificate shall be canceled.
    Any taxi driver whose business registration certificate is canceled or suspended for violating the previous Article or this Article and who is subjected to take punishment from a police authority shall be exempt from the regulations said in Subparagraph 1, Paragraph 1, Article 8.
    Any canceled business registration certificate shall be detained by the police authorities.
    Regulations regarding the qualifications for a taxi driver, business registration, tests, fees for joining training courses, issuing certificates, and other binding matters shall be determined by the MOI in conjuction with the MOTC.

## Annotated by Wikibooks

See also Annotated Republic of China Case Law/Judicial Yuan Interpretation No. 584.
* ↑ "Road Traffic Management and Penalty Act: Article 37". Immigration Office (Taiwan). 2016-11-09. Retrieved 2017-09-19.
# Annotated Republic of China Laws/Red Cross Society Act of the Republic of China/Article 10

| ←Article 6 to Article 9 | Red Cross Society Act of the Republic of China Republic of China (Taiwan) Law Article 10 | Article 11 to Article 12→ |

## First promulgated on 1954-10-18

(From http://law.moj.gov.tw/ENG/LawClass/LawSearchNo.aspx?PC=D0050098&DF=&SNo=10 retrieved on 2015-12-13)

### Article 10

    In the headquarters of the Red Cross Society of the Republic of China shall be set a board of directors to take charge of reviewing the important matters handled by the Red Cross Society; under the board shall be set thirty-one (31) directors, and among them seven (7) are full-time directors assumed by the governors of the regulating authority and the related authorities in charge of target businesses designated by the government, sixteen (16) are elected by the national member representative’s congress, and eight (8) are appointed by the full-time directors or through election from the principals of national associations. Except the full-time directors shall be changed by the government, the tenure of all the other directors is four (4) years. One half of each session shall be reelected, and a director may be reappointed if he is elected again upon expiration of the tenure.

## Promulgated amendment on 2000-04-26
### Article 10

(May be considered unchanged in English)
# Annotated Republic of China Laws/Red Cross Society Act of the Republic of China/Article 34

| ←Article 32 to Article 33 | Red Cross Society Act of the Republic of China Republic of China (Taiwan) Law Article 34 | Article 35 to Article 37→ |

## First promulgated on 1954-10-18

(From http://law.moj.gov.tw/ENG/LawClass/LawSearchNo.aspx?PC=D0050098&DF=&SNo=34 retrieved on 2015-12-13)

### Article 34

    If the personnel of the Red Cross Society of the Republic of China who follow the army to provide rescue and aid at wartime need medical equipment, house, food, ship, car, horse, and aircraft in the battlefield, they may respectively request the related regulating authorities to allocate such materials and goods.

## Promulgated amendment on 2000-04-26
### Article 34

(May be considered unchanged in English)
# Annotated Republic of China Laws/Red Cross Society Act of the Republic of China/Article 15

| ←Article 12 to Article 14 | Red Cross Society Act of the Republic of China Republic of China (Taiwan) Law Article 15 | Article 16 to Article 20→ |

## First promulgated on 1954-10-18

(From http://law.moj.gov.tw/ENG/LawClass/LawSearchNo.aspx?PC=D0050098&DF=&SNo=15 retrieved on 2015-12-13)

### Article 15

    A branch may be set in a province (municipality) and a sub-branch in a county (city) of the Republic of China, which is respectively subordinate to the headquarters or a branch, supervised by the local government, and directed by the local regulating authorities according to its business.

## Promulgated amendment on 2000-04-26
### Article 15

(May be considered unchanged in English)
# Annotations to James Joyce's Ulysses/Aeolus/118
## Annotations

that brought us out of the land of Egypt and into the house of bondage Bloom misremembers (or is he being intentionally ironic?) a phrase that occurs several times in the Haggadah, the text Jews recite at the start of the feast of Passover, when they celebrate the events recounted in the Book of Exodus. The words are taken from Exodus 13:3 and 13:14.
alleluia (Latin) Praise God! This is the usual Latin form of the Hebrew command Hallelu Yah, or Hallelujah. The word occurs several times in the Haggadah, which Jews read during the celebration of Passover.
Shema Israel Adonai Elohenu (Hebrew) Hear, O Israel, the Lord is our God. These are the opening words of Deuteronomy 6:4, the Hebrew prayer known as the Shema or Shema Yisrael. This Judaic confession of faith is recited twice a day, morning and evening, by orthodox Jews as part of their daily prayer services. The Hebrew word Adonai (Lord) is substituted for the Bible's YHWH, which is never pronounced.
No, that's the other Bloom correctly remembers that the Shema is not part of the Jewish Passover ritual.

## References

* ↑ Gifford (1988) 132. Thornton (1968) 110.
* ↑ Exodus 13:3 and Exodus 13:14.
* ↑ Gifford (1988) 132. Thornton (1968) 110.
* ↑ Gifford (1988) 132. Thornton (1968) 110.
* ↑ Deuteronomy 6:4.
# Annotations to James Joyce's Ulysses/Telemachus/008
## Annotations

008.30 Sir Peter Teazle Sir_Peter_Teazle is a humorous figure in Richard Sheridan’s satire, “The School For Scandal.”
008.32 hired mute from Lalouette's In the Victorian_era, mourners were commonly hired for funerals to add to the atmosphere. These people were dressed in dull colors and stood near the entrance to the home or church, looking somber. Lalouette's, Gifford and Seidman note, was a Dublin mortuary whose rental services included mutes. Mulligan's reference would have been obvious to Daedalus, because mutes had been in common use since Elizabethan England, and Lalouette's was famous in the region.

## References

* ↑ The Joyce Project
# Annotations to James Joyce's Ulysses/Telemachus/009
## Annotations

009.13 Sassenach "Sassenach" is a Gàidhlig loanword, denoting "Saxon." It bears a disparaging meaning, and is often used in jest.
009.20-22 And no more . . . brazen cars These words are from a poem by William Butler Yeats titled Who Goes with Fergus. In the following paragraph, 'Woodshadows' and 'white breast of the dim sea' also refer to this poem. Joyce repeatedly quotes poems by Yeats, perhaps to reinforce his statement about the cracked mirror as "a symbol of Irish art" on page 007.02.

## References

* ↑ Wikipedia's page on Saxon
* ↑ Who Goes with Fergus by William Butler Yeats
* ↑ Five Ideas about Joyce
# Annotations to James Joyce's Ulysses/Telemachus/011
## Annotations

011.3 quid . . . guinea The guinea is not only more money than the twenty- shilling quid (pound), it is also more fashion- able, a gentlemanly sum of money.
011.5 kip Has various slang meanings, which Mulligan exploits in his repeated use of the word: "that which is seized or caught; the catch," and "a brothel, lodging house, lodging, or bed."
011.5 four quid Stephen's monthly wage as paid (2.222 [30:6]) is £3 12s., not £4, and while not sizable in modern terms, would still compare favorably with the salaries of in- structors in all but the wealthiest of modern pre- paratory schools.
011.8 druids priests of Celtic pagandom
011.12-17 O, won't we have . . . coronation day? One form of an English song to commemorate the coronation of King Edward VII. Its words are repeated several times through the book. It is one of many ditties which Mulligan disrespectfully sings to refer to his surroundings or situation. In this case, he may be using "coronation day" as a rough slang for "payday," because the amount could be reckoned in crowns.
011.22 Clongowes Clongowes Wood College, a Jesuit school for boys, regarded as the most fashionable Catholic school in Ireland. Stephen is a student at Clongowes in chapter 1 of A Portrait. James Joyce attended Clongowes as a student from 1888 to 1891
011.28 barbacans or barbican: an outwork of a fortified place, as a castle; a defensive outpost of any sort.

## References

* ↑ http://m.joyceproject.com/notes/010157clongowes.html
* ↑ Dictionary.com Barbican