OpenLLM-France/wikimedia huggingface dataset:
# Chess/Variants/Chinese Chess

Xiangqi, or Chinese Chess, is an extremely popular game in the Eastern Hemisphere. It is currently played by millions (or tens of millions) in China, Taiwan, Thailand, Singapore, Vietnam, Hong Kong and other Asian countries. Xiangqi has remained in its present form for centuries. It is believed that both Xiangqi and Western Chess derive from the original Indian game of Chanturanga.
Xiang Character (xiáng) Qi Character (qí ) translates to Elephant Game. In Mandarin it is written as either Xiangqi, Xiang Qi or Hsiang-Ch`i and pronounced "Shiang-Chi". In Cantonese it is written as Jeuhng Keih and pronounced "Junk Kay".
The name Xiangqi has an interesting origin. Of China's four traditional arts—qin (music), hua (brush painting), shu (calligraphy) and qí (strategy games) -- the latter term, qi, provides the final syllable of Xiangqi. There is much literature on Xiangqi, most of it in Chinese. There are, however, a few books available in English and other languages.
Xiangqi sets can be procured from a number of sources. The most obvious of these are shops in the Chinese districts of large cities. Often, such sets are quite cheap, consisting of a paper board and flat wooden counters inscribed with red and black pictograms. These traditional Chinese symbols may appear strange to the western eye, but can easily be recognized with a minimum of practice. (For more sophisticated sets, see below.)

## The board

The Xiangqi board is made up of ten horizontal lines and nine vertical lines. The verticals are interrupted by a central-horizontal void called a river. Two palaces are positioned at opposite sides of the board. Each is distinguished by a cross connecting its four corner points.
http://www.chessvariants.org/xiangqi.dir/xiangqi1.gif
The above board shows various L-shaped markings in order to distinguish the setup points of Pawns and Cannons. These markings are not present on all commercial boards.
# Chess Guide for the Intermediate Player
## What do you need to know?

You need to understand the rules of chess. This book is for intermediate players, so we'll talk about openings, tactics, and strategy.
You also need to understand the chess notation, such as 4. Nc3!?.
If you know rules and notation, then you can read this book!

## Chess960

Here's an interesting question: What's the most unbalanced 960 position? We'll talk about Chess960 later.
Chess960 is a very popular variant of classical chess. The positions of non-pawn pieces are shuffled (on ranks 1 and 8) in the starting positions. We will analyze most such positions.

## Example Games

You can take a look at the "Example Games" chapter anytime. It is somewhat analysis for games. (Some of them, more actually, almost all of them are my own games!)

## Table of contents

* Some basics for openings
* Tactics for beginners
* More Opening Tricks
* More Tactics
* High-level Openings
* Strategy
* Hidden Tactics
* Endgame Basics
* Common checkmate patterns
* Complicated Checkmate Patterns
* Advanced Endgames
* Hidden Checkmate
* It's really hard to win!
* Chess960
* How to Analyse
* Opening Wiki
* Chess Developer: Engine Programming
* Example Games
* High-level
* Bye
# Chess/Variants/Bug House

Bug House or "Siamese Chess" is a dynamic four player variant in which teams of two players compete across two simultaneous games, one pair of players per board.
Winning is achieved by traditional checkmate as in standard chess, or via chess clock flag, as often a position results in which one game would result in mate, thus the losing player would prefer to halt his play in hopes his partner will reign in his sibling game.
Each team is comprised of one player as black, one white, competing thus in an opposite-colored game mirrored by the opposing team. The game is dynamic in that any pieces captured by one player is thus available to his partner to inject (or "drop") into his own game at will, in lieu of a regular move.
Promoted pieces, if captured, revert back to pawns. These are known as counterfeits.
Strong teams thus will communicate with each other as to which pieces are highly desirable to "feed" the leader game, or likewise to "starve" the opposing team by denying any material to be captured.

## Drop Checkings

One major division in rules for this variant is whether dropped pieces may result in checking the King or not. As may be noted in Japanese shogi, dropped pieces cannot directly check the king, however in bughouse this certainly expedites the game and its energy level.
Likewise, in this manner, the Knight becomes a highly coveted piece as its checks cannot be blocked, and should be conserved for such play where its unique abilities are maximized.

## Crazyhouse

Crazyhouse is a single board, two-player version of Bughouse.
# Chess/Variants/Crazy House

See Bug House chess variants
Two-player chess variant in which captured pieces from play are able to be re-injected into the game in lieu of standard play.
Four player (two-board) version is commonly known as Bug House or Siamese chess.
# Chess/Variants/Random Opening Chess

Computers are able to defeat even expert human Classical Chess players, partly because of their reliance on a database of openings. Fischer Random Chess is one alternative; however, computers will soon have a strong database of openings for all 960 possible starting positions. Random Opening Chess is a chess variant in which it is not possible to compile a database of openings, because there are too many possibilities, even for computers. Random Opening Chess includes all the charm of Classical Chess, save for the openings.
On the diagram at the right you can see one of the possible setups, likely set by experienced chess players with a feeling for the harmony of chess. However, you can also create much more wild and unique opening positions possible only in Random Opening Chess. Note that in this setup, both players are able to castle on both sides.
Random Opening Chess is a chess variant. It is based on Classical Chess, but has some similarities with Problem Chess and Go.
There are not many differences in the rules, you will still enjoy Random Opening Chess if you like the beauty of Classical Chess. In Random Opening Chess you use the same chess board, the same chess pieces and even the same rules as in Classical Chess. The only difference is the starting positions. A game of Random Opening Chess starts with an empty chess board.
The rules are simple. First set up an empty chess board as in Classical Chess, with a white square on the bottom right. Game play starts with white pieces. White Player puts one white piece on the empty chess board. He can choose any white piece.
* If he chooses pawn, he can put it on any square in the second, third or fourth row.
* If he chooses any other piece than a pawn (knight, bishop, rook, queen or king) he can put it on any square on the board.
Then it's black's turn. He can put his first piece on any empty square on the board.
* If he chooses pawn, he can put it on any free square in the fifth, sixth or seventh row.
* If he chooses any other piece than a pawn (knight, bishop, rook, queen or king) he can put it on any free square on the board.
* If the opposite king is already on the board, he is not allowed to attack it.
* He is not allowed to put his own king under attack.
Play continues with players alternating setting pieces. After all 32 pieces are set, the game continues as with the Classical Chess rules.
Note that:
* Bishops must be set on opposite colored squares.
* You can castle if the kings and rooks are in proper position and they didn't move (As per Classical Chess rules.)
* You can also use the en-passant rule if positioning allows it.
# Chess Guide for the Intermediate Player/Example Games/Anderssen-Kieseritzky, London 1851

(NOTE: I did not mean to do this, but it is titled "Anderssen-Kieseritzky, London 1851. It is supposed to be part of the Wikibook "Chess Guide for the Intermediate Player". Please fix this).
This Andersson-Kieseritzky game was played in 1851, and is known as the Immortal Game. It features a few large sacrifices by Anderssen, and he was able to mate with his remaining pieces.
1. e4 The King's Pawn Opening.
1...e5 Black copies White. This is called the Open Game.
2. f4 exf4 This is the King's Gambit. Anderssen gives up a pawn in exchange for rapid development.
3. Bc4 The Bishop's Gambit.
3...Qh4+ 4. Kf1 White has lost castling rights.
4...b5?! The Bryan Countergambit. This move is not too good.
(I will continue working on this soon!)
# Canadian Criminal Law/Defences/Intoxication
## General Principles

Generally, intoxication does not excuse a criminal act where the accused has the requisite intent. As it were a "drunken intent is nonetheless an intent." R. v. Canute, 1993 CanLII 403 (BCCA) at 49</ref>
The law recognizes three degrees of intoxication:
* Mild Intoxication: alcohol-induced relaxation of inhibitions and acceptable behaviour. This does not affect the mens rea of an offence
* Advanced Intoxication: intoxication to the point of the accused lacking any specific intent to an offence. There is a impairment of the accused's foresight of the consequences of his acts, raising a reasonable doubt on the requisite mens rea. This will only apply to specific intent offences.
* Extreme Intoxication: intoxication to the point of automatism-like state. This degree of intoxication negates the voluntariness of the accused's actions. It is a rare defence that only applies to non-violent offences (as per s. 33.1)
* ↑ R. v. Daley, 2007 SCC 53, [2007] 3 SCR 523 at para 41

## Offences of violence

   Self-induced Intoxication
   When defence not available 33.1 (1) It is not a defence to an offence referred to in subsection (3) that the accused, by reason of self-induced intoxication, lacked the general intent or the voluntariness required to commit the offence, where the accused departed markedly from the standard of care as described in subsection (2).
   Criminal fault by reason of intoxication (2) For the purposes of this section, a person departs markedly from the standard of reasonable care generally recognized in Canadian society and is thereby criminally at fault where the person, while in a state of self-induced intoxication that renders the person unaware of, or incapable of consciously controlling, their behaviour, voluntarily or involuntarily interferes or threatens to interfere with the bodily integrity of another person.
   Application (3) This section applies in respect of an offence under this Act or any other Act of Parliament that includes as an element an assault or any other interference or threat of interference by a person with the bodily integrity of another person.
   – CCC
Section 33.1 will exclude intoxication as a defence for general intent offences or involuntariness due to intoxication where the following conditions are met:
* the accused was intoxicated at the time of the offence;
* the intoxication was self-induced; and
* the accused departed from the standard of reasonable care generally recognized in Canadian society by interfering or threatening to interfere with the bodily integrity of another person
This section applies to any mental condition that arises directly from a state of intoxication, including toxic psychosis.
* ↑ R. v. Bouchard-Lebrun, 2011 SCC 58 (CanLII), [2011] 3 SCR 575
* ↑ Bouchard-Lebrun

## Case Digests

* R. v. Cassan (E.R.), 2012 MBCA 46
# Canadian Criminal Law/Defences/Officially Induced Error
## General Principles

A valid excuse for violating the law is on the basis of an officially induced error of law. The defence arises where the accused is given advice in error that the accused relies upon in doing the criminal act.
Officially induced error is available as a defence to prevent morally blameless individuals, who believe they are acting in a lawful manner, from being convicted.
The elements that must be proven are:
* The error was one of law or mixed law and fact
* The accused considered the legal consequences of their actions
* The advice obtained came from an appropriate official
* The advice was reasonable in the circumstances
* The advice obtained must be erroneous
* The accused must demonstrate reliance on the official advice
Each element must be proven on a balance of probabilities by the accused.
This is an exception to the principle that ignorance of the law is no excuse.
The defence arises in part out of the overly complex nature of regulation.
The purpose of the defence is to prevent injustices where the ““state approving conduct with one hand and seeking to bring criminal sanction for that conduct with the other”
A successful application will result in a stay of proceedings.
* ↑ R v Jorgensen at 28 to 37
* ↑ R. v. Jorgensen 1995 CanLII 85 (S.C.C.), (1995), 4 S.C.R. 55 R. v. Halloran, 2010 ONSC 4321
* ↑ R v Jorgensen
* ↑ R. v. Jorgensen, 1995 CanLII 85 (SCC), [1995] 4 S.C.R. 55 at para. 25 Lévis (City) v. Tétreault; Lévis (City) v. 2629-4470 Québec inc., 2006 SCC 12 (CanLII), 2006 SCC 12 at 24
* ↑ R v Jorgensen at para 30
* ↑ R v Jorgensen
# Canadian Criminal Law/Injuries
## Bodily Harm

Section 2 of the Criminal Code defines "bodily harm" as:
   s.
   “bodily harm” ...
   “bodily harm” means any hurt or injury to a person that interferes with the health or comfort of the person and that is more than merely transient or trifling in nature;

## Aggravated Assault

See also: Canadian Criminal Law/Offences/Aggravated Assault and Canadian Criminal Law/Offences/Aggravated Sexual Assault
# Canadian Criminal Law/Defences/Entrapment
## General Principles

A defence of entrapment is available when:
* the authorities provide a person with an opportunity to commit an offence without acting on a reasonable suspicion that this person is already engaged in criminal activity or pursuant to bona fide inquiries;
* although having such a reasonable suspicion or acting in the course of a bona fide inquiry, they go beyond providing an opportunity and induce the commission of an offence.
"An exception to [the rule establishing entrapment] arises when the police undertake a bona fide investigation directed at an area where it is reasonably suspected that criminal activity is occurring. When such a location is defined with sufficient precision, the police may present any person associated with the area with the opportunity to commit the particular offence. Such randomness is permissible within the scope of a bona fide inquiry."
An undercover officer who attempts to buy drugs from someone suspected of selling drugs does not constitute entrapment.
A defence of entrapment cannot be advanced until after the crown has proven all of the elements of the offence.
* ↑ R.v.Mack 1988 CanLII 24 (S.C.C.), (1988) 44 C.C.C. (3d) 513 (S.C.C.) at p.559
* ↑ R.v.Barnes 1991 CanLII 84 (S.C.C.), (1991) 63 C.C.C. (3d) 1 (S.C.C.) at pp.10-11
* ↑ Barnes v. The Queen, 1991 CanLII 84 (SCC), [1991] 1 S.C.R. 449
* ↑ R. v. Mack, 1988 CanLII 24 (SCC), [1988] 2 S.C.R. 903 considered in R. v. Bérubé, 2012 BCCA 345 (CanLII)

## Random Virtue Testing

Certain provinces have found that "random virtue testing" by police, such as randomly calling phone numbers found on a suspect's cell phone in hope of catching a drug trafficker.
Conducting a DNA canvass of suspects has been upheld as a valid investigation technique.
* ↑ R v Swan, 2009 BCCA 142 (CanLII) at para. 43
* ↑ R v Osmond, 2012 BCCA 382

## Case Digests

* R. v. Bayat, 2011 ONCA 778 -- entrapment defence overturned on appeal for luring charge
# Canadian Criminal Law/Included Offences
## Lesser included offences

A judge must consider, where the evidence does not make out a particular charged offence, whether it makes out an "included" offence. This is, a secondary offence which underlies the actual charge.
The test for whether an offence is “included” in another offence is "if its elements are embraced in the offence charged (as described in the enactment creating it or as charged in the count) or if it is expressly stated to be an included offence in the Criminal Code itself. The test is strict. It must “necessarily” be included..."
There are three ways in which an offence can be included in a charge:
* offence included by statute, e.g., those offences specified in s.662(2) to (6), and attempt provided for in s.660;
* offences included in the enactment creating the offence charged, e.g., common assault in a charge of sexual assault;
* offences which become included by the addition of apt words of description in the principle charge.

## Examples

* mischief is not included in break and enter (R. v. Robitaille, 2012 ONCJ 155)

## References

* ↑ R. v. G.R., 2005 SCC 45, at para. 25
* ↑ R v GR at para 29
# Canadian Criminal Law/Duty of Care
## Introduction

Much of the foundation of criminal law lies in the premise that the accused had a requisite "mens rea" (or guilty state of mind) when committing the offence. In principle a person should only be convicted of an offence for which they had some degree of awareness or intention when committing the criminal act. This is closely tied to the theory of moral culpability which is what criminal law is attempting to address and as such is constitutionally required under s. 7 of the Charter.
The criminal law generally does not include offences for which the accused was not subjectively aware to some degree of the offence. Further, there is no duty of precaution upon an individual to ensure that they do not perform the illegal act without their intent or knowledge. This is in contrast to regulatory offences and other forms of civil liability which generally require only an objective standard of responsibility. This is known as a "duty of care" and "standard of care". The duty of care is the legal obligation to maintain a certain standard. The standard of care is the specific standard of conduct that is imposed by law upon an individual which, if violated, could result in liability of some sort or another.

## Duty of Care

Certain criminal offences create a duty of care, where, if the standard of care is violated, will result in a criminal act. The offences that impose a duty of care include:
* unsafe storage of a firearm (86)
* Criminal negligence (219)
* dangerous operation of a motor vehicle 249

## Standard of Care

The modern foundation of duty of care in criminal law originated from the case of R v Hundal 1993 CanLII 120 (SCC), [1993] 1 S.C.R. 867. The case stated that to determine whether an act violated a standard of care requires a "modified objective test"
For any offence where the standard of care involves objectively dangerous conduct, the conduct must be shown to be a "marked departure" from the norm. Wherein a "reasonable person in the position of the accused would have been aware of the risk" and "would not have undertaken the activity". The assessment, then, is of a "reasonably prudent person in the circumstances" the accused found himself when the events occurred.
Thus, if the accused actions' show a marked departure from the standard of care described in the offence provision, he still cannot be convicted if a reasonably prudent person in the position of the accused would not have been aware of the risk or would not have been able to avoid the creating the risk.
This standard was determined to be constitutionally acceptable.
* ↑ see R. v. Hundal, 1993 CanLII 120 (SCC), [1993] 1 S.C.R. 867, at page 887
* ↑ R. v. Beatty, 2008 SCC 5, [2008] 1 S.C.R. 49
* ↑ R. v. Beatty, 2008 SCC 5, [2008] 1 S.C.R. 49 at 40
* ↑ R. v. Tayfel (M.), 2009 MBCA 124 (CanLII), <http://canlii.ca/t/273wk> at 51
* ↑ Trilogy cases on Duty of care: R. v. Hundal 1993 CanLII 120, [1993] 1 S.C.R. 867 R. v. DeSousa 1992 CanLII 80, [1992] 2 S.C.R. 944, 1992 SCC 77 R. v. Tutton and Tutton, 1989 CanLII 103, [1989] 1 S.C.R. 1392
# Canadian Criminal Law/Doctrines of Liability

The Crown must present evidence that is available to it to prove the charged offences beyond a reasonable doubt. The methods of proof are essential to that objective.

## Doctrines of Liability

* Canadian Criminal Law/Parties
* Canadian Criminal Law/Recent Possession
* Canadian Criminal Law/Included Offences
* Canadian Criminal Law/Attempts
* Canadian Criminal Law/Conspiracy

## See Also

* Canadian Criminal Law/Statutory Interpretation
# Choosing The Right File Format/Database Spreadsheet
## Databases & Spreadsheets

Databases are inherently good for long term storage of information. Because of the way they are constructed it is generally easy to extract information and reform it for restorage.
The backbone of standards compliant databases is Structured Query Language (SQL). SQL is not a format for storing database information. It is a format for storing the requests made to a database. In other words a database stores your information and SQL is the language for retrieving that information.
For a long time SQL was being developed in different places by different people and for some time the 1999 version has therefore been widely used as a safe bet. Now SQL:2003 is an ISO/IEC standard and very wisely there are "No changes or conformance requirements - Products conforming to Core SQL:1999 should conform automatically to SQL:2003".
Part of the beauty of the SQL standard is that you can extract your information together with the structural information needed to put that information into another database. The resulting file is often called an 'SQL dump'.
Recommendations
* Do not use MS Access, it is not a fully functional RDBMS and does not support standards compliant SQL queries.
* Use a database which can import and export/dump in SQL
* Check that your SQL is standard SQL:1999 or SQL:2003
* Backup the information in your database regularly as a TXT file or SQL file
References:
* Migrating from Microsoft Access to MySQL
* SQL: The Standard and the Language
* Databases in the Open Directory Project
* SQL:1999 validators
* SQL:2003 validator
* "Library of Congress: Recommended Digital Formats for Datasets and Databases".