OpenLLM-France/wikimedia huggingface dataset:
# Ada Programming/Attributes/'Restriction Set
## Description

This attribute allows compile time testing of restrictions that are currently in effect. It is primarily intended for specializing code in the run-time based on restrictions that are active (e.g. don’t need to save fpt registers if restriction No_Floating_Point is known to be in effect), but can be used anywhere.
There are two forms:
In the case of the first form, the only restriction names allowed are parameterless restrictions that are checked for consistency at bind time. For a complete list see the subtype System.Rident.Partition_Boolean_Restrictions.
The result returned is True if the restriction is known to be in effect, and False if the restriction is known not to be in effect. An important guarantee is that the value of a Restriction_Set attribute is known to be consistent throughout all the code of a partition.
This is trivially achieved if the entire partition is compiled with a consistent set of restriction pragmas. However, the compilation model does not require this. It is possible to compile one set of units with one set of pragmas, and another set of units with another set of pragmas. It is even possible to compile a spec with one set of pragmas, and then WITH the same spec with a different set of pragmas. Inconsistencies in the actual use of the restriction are checked at bind time.
In order to achieve the guarantee of consistency for the Restriction_Set pragma, we consider that a use of the pragma that yields False is equivalent to a violation of the restriction.
So for example if you write
And the result is False, so that the else branch is executed, you can assume that this restriction is not set for any unit in the partition. This is checked by considering this use of the restriction pragma to be a violation of the restriction No_Floating_Point. This means that no other unit can attempt to set this restriction (if some unit does attempt to set it, the binder will refuse to bind the partition).
Technical note: The restriction name and the unit name are intepreted entirely syntactically, as in the corresponding Restrictions pragma, they are not analyzed semantically, so they do not have a type.
# Ada Programming/Attributes/'Safe Large
## Description

The Safe_Large attribute is provided for compatibility with Ada 83. See the Ada 83 reference manual for an exact description of the semantics of this attribute.
# Ada Programming/Attributes/'Safe Last
## Description

Returns upper bound of the safe range.
Yields the upper bound of the safe range (see 3.5.7) of the type T. If the Numerics Annex is not supported, the value of this attribute is implementation defined. The value of this attribute is of the type universal_real.
# Ada Programming/Attributes/'Result
## Description

Within a postcondition expression for F, denotes the return object of the function call for which the postcondition expression is evaluated.
Within a postcondition expression for F, denotes the return object of the function call for which the postcondition expression is evaluated. The type of this attribute is that of the result subtype of the function or access-to-function type except within a Post'Class postcondition expression for a function with a controlling result or with a controlling access result; in those cases the type of the attribute is described above as part of the Name Resolution Rules for Post'Class.
# Ada Programming/Attributes/'Rounding
## Description

X'Rounding(Y) is an Ada attribute where X is any floating-point type and Y is any instance of that type. This attribute represents the closest integer value to Y. If Y is exactly between two integer values (e.g. 1.5), then the result is the number farthest away from zero (e.g. 1.5 => 2.0, -1.5 => -2.0).

## See also
### Wikibook

* Ada Programming
* Ada Programming/Attributes
* Ada Programming/Attributes/'Ceiling
* Ada Programming/Attributes/'Floor
* Ada Programming/Attributes/'Unbiased_Rounding

### Ada Reference Manual

* 13.3 Operational and Representation Attributes (Annotated)
* Annex K Language-Defined Attributes (Annotated)
# Ada Programming/Attributes/'Round
## Description

Fixed-point value obtained by rounding X (away from 0, if X is midway between two values).
The function returns the value obtained by rounding X (away from 0, if X is midway between two values of the type of S).
# Ada Programming/Attributes/'Safe Emax
## Description

The Safe_Emax attribute is provided for compatibility with Ada 83. See the Ada 83 reference manual for an exact description of the semantics of this attribute.
# Ada Programming/Attributes/'Safe First
## Description

Returns lower bound of the safe range.
Yields the lower bound of the safe range (see 3.5.7) of the type T. If the Numerics Annex is not supported, the value of this attribute is implementation defined.
The value of this attribute is of the type universal_real.
# C++ Programming/Code/Standard C Library/Functions/setvbuf
## setvbuf

| Syntax | #include <cstdio> int setvbuf( FILE *stream, char *buffer, int mode, size_t size ); |
The function setvbuf sets the buffer for stream to be buffer, with a size of size. mode can be one of:
* _IOFBF, which indicates full buffering
* _IOLBF, which means line buffering
* _IONBF, which means no buffering

### Related topics

    fflush - setbuf
# C++ Programming/Code/Standard C Library/Functions/sin
#### sin

| Syntax | #include <cmath> double sin( double arg ); |
If you don't want cmath you can write sin function it is;
* include <iostream>
using namespace std;
double sin(double x) //sin function {return x-((x*x*x)/6.)+((x*x*x*x*x)/120.);}
int main {
return 0;}
The function sin returns the sine of arg, where arg is given in radians. The return value of sin will be in the range [-1,1]. If arg is infinite, sin will return NAN and raise a floating-point exception.

##### Related topics

    acos - asin - atan - atan2 - cos - cosh - sinh - tan - tanh
# C++ Programming/Code/Standard C Library/Functions/scanf
#### scanf

| Syntax | #include <cstdio> int scanf( const char *format, ... ); |
The scanf function reads input from stdin, according to the given format, and stores the data in the other arguments. It works a lot like printf. The format string consists of control characters, whitespace characters, and non-whitespace characters. The control characters are preceded by a % sign, and are as follows:
| Control Character | Explanation |
| %c | a single character |
| %d | a decimal integer |
| %i | an integer |
| %e, %f, %g | a floating-point number |
| %lf | a double |
| %o | an octal number |
| %s | a string |
| %x | a hexadecimal number |
| %p | a pointer |
| %n | an integer equal to the number of characters read so far |
| %u | an unsigned integer |
| % | a set of characters |
| %% | a percent sign |
scanf reads the input, matching the characters from format. When a control character is read, it puts the value in the next variable. Whitespace (tabs, spaces, etc.) are skipped. Non-whitespace characters are matched to the input, then discarded. If a number comes between the % sign and the control character, then only that many characters will be converted into the variable. If scanf encounters a set of characters, denoted by the % control character, then any characters found within the brackets are read into the variable. The return value of scanf is the number of variables that were successfully assigned values, or EOF if there is an error.
This code snippet uses scanf to read an int, float, and a double from the user. Note that the variable arguments to scanf are passed in by address, as denoted by the ampersand (&) preceding each variable:

##### Related topics

    fgets - fscanf - printf - sscanf
# C++ Programming/Code/Standard C Library/Functions/setjmp
## setjmp

| Syntax | #include <csetjmp> int setjmp( jmp_buf env ); |
The function setjmp stores the current execution status in env, and returns 0. The execution state includes basic information about which code is being executed in preparation for the longjmp function call. If and when longjmp is called, setjmp will return the parameter provided by longjmp - however, on the second return, variables that were modified after the initial setjmp call may have an undefined value.
The buffer is only valid until the calling function returns, even if it is declared statically.
Since setjmp does not understand constructors or destructors, it has been superseded with the C++ exception system, which uses the throw and catch keywords.

### Related topics

    longjmp
# C++ Programming/Code/Standard C Library/Functions/sqrt
#### sqrt

| Syntax | #include <cmath> double sqrt( double num ); |
The sqrt function returns the square root of num. If num is negative, a domain error occurs.

##### Related topics

    exp - log - pow
# C++ Programming/Code/Standard C Library/Functions/setbuf
## setbuf

| Syntax | #include <cstdio> void setbuf( FILE *stream, char *buffer ); |
The setbuf function sets stream to use buffer, or, if buffer is NULL, turns off buffering. This function expects that the buffer be BUFSIZ characters long - since this function does not support specifying the size of the buffer, buffers larger than BUFSIZ will be partly unused.

### Related topics

    fclose - fopen - setvbuf
# C++ Programming/Code/Standard C Library/Functions/setlocale
#### setlocale

| Syntax | #include <clocale> char *setlocale( int category, const char * locale ); |
The setlocale function is used to set and retrieve the current locale. If locale is NULL, the current locale is returned. Otherwise, locale is used to set the locale for the given category.
category can have the following values:
| Value | Description |
| LC_ALL | All of the locale |
| LC_TIME | Date and time formatting |
| LC_NUMERIC | Number formatting |
| LC_COLLATE | String collation and regular expression matching |
| LC_CTYPE | Regular expression matching, conversion, case-sensitive comparison, wide character functions, and character classification. |
| LC_MONETARY | For monetary formatting |
| LC_MESSAGES | For natural language messages |

##### Related topics

    (Standard C String & Character) strcoll
# C++ Programming/Code/Standard C Library/Functions/sinh
#### sinh

| Syntax | #include <cmath> double sinh( double arg ); |
The function sinh returns the hyperbolic sine of arg.

##### Related topics

    acos - asin - atan - atan2 - cos - cosh - sin - tan - tanh
# C++ Programming/Code/Standard C Library/Functions/sprintf
#### sprintf

| Syntax | #include <cstdio> int sprintf( char *buffer, const char *format, ... ); |
The sprintf function is just like printf, except that the output is sent to buffer. The return value is the number of characters written. For example:
Note that sprintf does the opposite of a function like atoi -- where atoi converts a string into a number, sprintf can be used to convert a number into a string.
For example, the following code uses sprintf to convert an integer into a string of characters:
This code is similar, except that it converts a floating-point number into an array of characters:

##### Related topics

    fprintf - printf (Standard C String and Character) atof - atoi - atol
# C++ Programming/Code/Standard C Library/Functions/signal
## signal

| Syntax | #include <csignal> void (*signal( int sig, void (*handler)(int)) )(int) |
The signal function takes two parameters - the first is the signal identifier, and the second is a function pointer to a signal handler that takes one parameter. The return value of signal is a function pointer to the previous handler (or SIG_ERR if there was an error changing the signal handler).
By default, most raised signals are handled either by the handlers SIG_DFL (which is the default signal handler that usually shuts down the program), or SIG_IGN (which ignores the signal and continues program execution.)
When you specify a custom handler and the signal is raised, the signal handler reverts to the default.
While the signal handlers are superseded by throw and catch, some systems may still require you to use these functions to handle some important events. For example, the signal SIGTERM on Unix-based systems indicates that the program should terminate soon.

### Related topics

    raise
# Canadian Criminal Sentencing/Offences/Contempt of Court
## Legislation

   Contempt 708. (1) A person who, being required by law to attend or remain in attendance for the purpose of giving evidence, fails, without lawful excuse, to attend or remain in attendance accordingly is guilty of contempt of court.
   Punishment (2) A court, judge, justice or provincial court judge may deal summarily with a person who is guilty of contempt of court under this section and that person is liable to a fine not exceeding one hundred dollars or to imprisonment for a term not exceeding ninety days or to both, and may be ordered to pay the costs that are incident to the service of any process under this Part and to his detention, if any.
   ... R.S., 1985, c. C-46, s. 708; R.S., 1985, c. 27 (1st Supp.), s. 203.
   – CCC
# Canadian Criminal Sentencing/Offences/Criminal Harassment
## Legislation

   Criminal harassment 264. (1) No person shall, without lawful authority and knowing that another person is harassed or recklessly as to whether the other person is harassed, engage in conduct referred to in subsection (2) that causes that other person reasonably, in all the circumstances, to fear for their safety or the safety of anyone known to them. ... Punishment (3) Every person who contravenes this section is guilty of
       (a) an indictable offence and is liable to imprisonment for a term not exceeding ten years; or
       (b) an offence punishable on summary conviction.
   Factors to be considered (4) Where a person is convicted of an offence under this section, the court imposing the sentence on the person shall consider as an aggravating factor that, at the time the offence was committed, the person contravened
       (a) the terms or conditions of an order made pursuant to section 161 or a recognizance entered into pursuant to section 810, 810.1 or 810.2; or
       (b) the terms or conditions of any other order or recognizance made or entered into under the common law or a provision of this or any other Act of Parliament or of a province that is similar in effect to an order or recognizance referred to in paragraph (a).
   Reasons (5) Where the court is satisfied of the existence of an aggravating factor referred to in subsection (4), but decides not to give effect to it for sentencing purposes, the court shall give reasons for its decision.
   R.S., 1985, c. C-46, s. 264; R.S., 1985, c. 27 (1st Supp.), s. 37; 1993, c. 45, s. 2; 1997, c. 16, s. 4, c. 17, s. 9; 2002, c. 13, s. 10.
   – CCC

## Ancillary Orders

* DNA Order
# Canadian Criminal Sentencing/Offences/Carrying a Concealed Weapon
## Legislation

   90. ... Punishment (2) Every person who commits an offence under subsection (1)
       (a) is guilty of an indictable offence and liable to imprisonment for a term not exceeding five years; or
       (b) is guilty of an offence punishable on summary conviction.
   – CCC

## Ancillary Orders

* Weapons forfeiture
* Weapons prohibition

## Recommended Probationary Terms

* Weapons Prohibition
* Counselling/Treatment (if underlying treatable issue)
* Contact Provision (if facts concern a potential victim)
# Canadian Criminal Sentencing/Offences/Causing a Disturbance
## Legislation

   Causing disturbance, indecent exhibition, loitering, etc. 175. (1) Every one who
          (a) not being in a dwelling-house, causes a disturbance in or near a public place,
             (i) by fighting, screaming, shouting, swearing, singing or using insulting or obscene language,
             (ii) by being drunk, or
             (iii) by impeding or molesting other persons,
          (b) openly exposes or exhibits an indecent exhibition in a public place,
          (c) loiters in a public place and in any way obstructs persons who are in that place, or
          (d) disturbs the peace and quiet of the occupants of a dwelling-house by discharging firearms or by other disorderly conduct in a public place or who, not being an occupant of a dwelling-house comprised in a particular building or structure, disturbs the peace and quiet of the occupants of a dwelling-house comprised in the building or structure by discharging firearms or by other disorderly conduct in any part of a building or structure to which, at the time of such conduct, the occupants of two or more dwelling-houses comprised in the building or structure have access as of right or by invitation, express or implied,
   is guilty of an offence punishable on summary conviction.
   Evidence of peace officer
       (2) In the absence of other evidence, or by way of corroboration of other evidence, a summary conviction court may infer from the evidence of a peace officer relating to the conduct of a person or persons, whether ascertained or not, that a disturbance described in paragraph (1)(a) or (d) or an obstruction described in paragraph (1)(c) was caused or occurred.
   – CCC

## Ancillary Orders

* Discretionary 110 Weapons Order
* Forfeiture of any weapons under 491

## Recommended Probationary Terms

* Counselling/Treatment
* Alcohol Conditions (if a factor to the offence)
* Boundary Conditions
* Contact Conditions
# Canadian Criminal Sentencing/Offences/Criminal Negligence
## Legislation

   s. 219
   (1) Every one is criminally negligent who
       (a) in doing anything, or
       (b) in omitting to do anything that it is his duty to do,
   shows wanton or reckless disregard for the lives or safety of other persons.
   (2) For the purposes of this section, “duty” means a duty imposed by law.
   220. Every person who by criminal negligence causes death to another person is guilty of an indictable offence and liable
       (b) ...to imprisonment for life.
   – CCC
# Canadian Criminal Sentencing/Offences/Defamatory Libel
## Legislation

   Defamatory Libel
   Punishment of libel known to be false 300. Every one who publishes a defamatory libel that he knows is false is guilty of an indictable offence and liable to imprisonment for a term not exceeding five years.
   R.S., c. C-34, s. 264.
   Punishment for defamatory libel 301. Every one who publishes a defamatory libel is guilty of an indictable offence and liable to imprisonment for a term not exceeding two years.
   R.S., c. C-34, s. 265.
   Extortion by libel 302. (1) Every one commits an offence who, with intent
       (a) to extort money from any person, or
       (b) to induce a person to confer on or procure for another person an appointment or office of profit or trust,
   publishes or threatens to publish or offers to abstain from publishing or to prevent the publication of a defamatory libel.
   Idem (2) Every one commits an offence who, as the result of the refusal of any person to permit money to be extorted or to confer or procure an appointment or office of profit or trust, publishes or threatens to publish a defamatory libel.
   Punishment (3) Every one who commits an offence under this section is guilty of an indictable offence and liable to imprisonment for a term not exceeding five years.
   R.S., c. C-34, s. 266.
   – CCC
# Canadian Criminal Sentencing/Offences/Common Assault
## Legislation

   266. Every one who commits an assault is guilty of
       (a) an indictable offence and is liable to imprisonment for a term not exceeding five years; or
       (b) an offence punishable on summary conviction.
   – CCC

## Application

    For general principles and factors of assault-based offences, see Assaultive Offences

## Ancillary Orders

* DNA Order
* Weapons Prohibition Orders (110 on summary, 109 on indictable)
* Weapons Forfeiture
* Forfeiture of Offence-related Property

## See Also

* UK Sentencing Guidelines on Assault
# C Programming/stdio.h/feof

feof is a C standard library function declared in the header stdio.h. Its primary purpose is to distinguish between cases where a stream operation has reached the end of a file and cases where the EOF ("end of file") error code has been returned as a generic error indicator, without the end of the file's actually having been reached.

## Function prototype

The function is declared as follows:
    int feof(FILE *fp);
It takes one argument: a pointer to the FILE structure of the stream to check.

## Return value

The return value of the function is an integer. A nonzero value signifies that the end of the file has been reached; a value of zero signifies that it has not.

## Pitfalls

A common misuse of the function is trying to use feof "preemptively". However, this doesn't work correctly, as feof is only set for a descriptor after a reading function has failed.

## References

* ↑ ISO/IEC 9899:1999 specification (PDF). p. 305, § 7.19.10.2.

## External links

* C++ reference for std::feof
# C Programming/stdio.h/clearerr

Syntax:
The clearerr function resets the error flags and EOF indicator for the given stream. When an error occurs, you can use perror to figure out which error actually occurred.
# C Programming/stdio.h/fclose

fclose is a C function belonging to the ANSI C standard library, and included in the file stdio.h. Its purpose is close a stream and all the structure associated with it. Usually the stream is an open file. fclose has the following prototype:
    int fclose(FILE *file_pointer)
It takes one argument: a pointer to the FILE structure of the stream to close, eg: :fclose(my_file_pointer) This line call the function fclose to close FILE stream structure pointed by my_file_pointer.
The return value is an integer with the following meaning:
* 0 (zero): the stream was closed successfully;
* EOF: an error occurred;
One can check for an error by reading errno. fclose has undefined behavior if it attempts to close a file pointer that isn't currently assigned to a file - in many cases, this results in a program crash.
It is usually a wrapper for a close (system call).

## Example usage

The above program opens a file called myfile.txt and scans for an integer in it.
# C Programming/stdio.h/fgets

fgets is a function in the C programming language that reads a limited number of characters from a given file stream source into an array of characters. fgets stands for file get string. It is included in the C standard library header file stdio.h. The prototype of the function is as follows:
The function terminates reading either after a new-line character is found or end-of-file is reached, or after (length - 1) characters have been read. If a new-line was reached it is included in the string as the last character before the null character. The length argument includes space needed for the null character which will be appended to the end of the string. As a result, to read N characters, the length specification must be specified as N+1. The string read is returned if at least one character was read and no error occurred, otherwise a NULL-pointer is returned.
The stream argument specifies the stream from which the string be read. stdin is commonly used here, for reading from the standard input. Otherwise, a FILE * value returned by the fopen function is used.

## Sample usage

The following code reads characters from the console input and prints them out 20 in a line with the puts function until an EOF occurs.

## Use in POSIX utilities

For compliance with POSIX utility line lengths, the definition LINE_MAX (generally found in limits.h) is often used to size the character buffer.

## Limitations

The fixed buffer size imposed by fgets is cumbersome in applications which need to handle arbitrarily long lines of text.
POSIX.1-2008-conforming systems provide a function called getline (originally a GNU extension), which will read an entire line, reallocating the buffer if it is not long enough.
Advanced applications can avoid buffer limitations by using mmap.

## References

* ↑ ISO/IEC 9899:1999 specification (PDF). p. 296, § 7.19.7.2.
* ↑ http://www.gnu.org/software/libc/manual/html_node/Line-Input.html#index-getline-993
* ↑ http://pubs.opengroup.org/onlinepubs/9699919799/functions/getline.html

## External links

* C++ reference for std::fgets