OpenLLM-France/wikimedia huggingface dataset:
# Fundamentals of C Programming/Lessons/The Making of an Art
## Art in the Making

The impact of the digital computer in the twentieth century is so great that the computer has become a vital component in our society. It has practically touched every aspect of our lives. it helps us in our business transactions, keeps track of products' inventories, diagnoses heart conditions, recognizes speech patterns, and provides entertainment through games, among a hundred other applications. Its impact is so great that it has revolutionized our society and made us re-examine certain basic assumptions about our own role in the universe. Computers have evolved from a scientific curiosity to an indispensable tool in virtually all areas of our lives.
However true it is that computers can solve problems efficiently and accurately and how sophisticated it can be, it still cannot think for itself—it cannot solve problems on its own. It is the human being who understands, thinks and solves problems on its own and who gives correct instruction that directs the computer to solve problems. The set or list of instructions that directs the computer on its operations is called a computer program. The person who develops a program is called a programmer. The act of developing a program is called programming.
Computer programming is not just plainly listing down lengthy steps to be communicated to the computer. It is not a matter of "just write anything and make it run". The programmer must learn to put his logic and his creativity to make his work a masterpiece. Computer programming needs to be an art!
# Futurebasic/Language/Reference/rename
## Syntax

RENAME

## Description

Changes the name of a file or folder from the name specified in oldPath$ to the name specified in newPath$. The oldPath$ and newPath$ parameters are used along with refNum% and dirID& to determine the location of the item to be renamed: see Appendix A: Specifying Files and Directories, for more information. You cannot use RENAME to move an item into a different directory: oldPath$ and newPath$ must both refer to items in the same directory.

## See Also

FOLDER; Appendix A: Specifying Files and Directories
# Futurebasic/Language/Reference/return
## Syntax

RETURN

## Revised

October 2, 2000 (Release 4)

## Description

You should include at least one RETURN statement in every subroutine that is called by a GOSUB statement. RETURN causes the subroutine to "exit"; that is, it causes execution to continue at the statement following the GOSUB that called the subroutine. You may also return to a specific location using RETURN "label". This pops the return address from the stack, then jumps to the requested address.

## See Also

GOSUB
# Futurebasic/Language/Reference/rnd
## Syntax

randomInteger%
RND(expr%)

## Description

This function returns a pseudo-random long integer uniformly distributed in the range 1 through expr&. The expr& parameter should be greater than 1, and must not exceed 65536. If the value returned is to be assigned to a 16-bit integer (randomInteger%), expr& should not exceed 32767. The actual sequence of numbers returned by RND depends on the random number generator's "seed" value; see the RANDOM statement for more information. Note that RND(1) always returns the value 1.
Example: To get a random integer between two arbitrary limits min and max, use this statement: randomInteger = RND(max - min + 1) + min - 1 (Note: max - min must be less than or equal to 65536.) To get a random fraction, greater than or equal to zero and less than 1, use this statement: frac! = (RND(65536)-1)/65536.0 To get a random long integer in the range 1 through 2,147,483,647, use this statement: randomInteger& = ((RND(65536) - 1)<<15) + RND(32767)

## See Also

RANDOM; MAYBE
# Futurebasic/Language/Reference/rem
## Syntax

REM

## Description

The REM statement (and its variations) provide a way for you to insert remarks into the source code which are ignored by the compiler. Remarks have absolutely no effect on how your program runs, but they can be very useful in helping readers to understand how your code works. If you use the REM keyword, or the apostrophe (') or double-slash (//) token, everything following it on the same line is treated as a remark; therefore, it's not possible to put a non-remark statement after remarks on the same line. The apostrophe and double-slash variations work identically to each other. In the FB Editor, remarks that begin with the apostrophe, the double-slash, or the "/*" token are automatically tabbed to the Remarks column of the Editor window if they're preceded by a statement. Remarks that begin with REM are not tabbed. When you use the "/*" and "*/" tokens, the "/*" indicates the beginning of the remarks, and the "*/" indicates the end of remarks. Because it uses two tokens, this variation allows you to do some things you can't do with other variations. Specifically: You can write remarks that span multiple lines, using only one pair of tokens.
For example: /* This is the first line of remarks. The remarks continue on this line. This is the last line of remarks. */ One disadvantage of using the "/*" and "*/" tokens is that you have to make sure you don't inadvertently include a "*/" token in the middle of your remarks. If you do, the compiler will assume that the remarks end there. For example: /* This is the first line of remarks. We have /*accidentally*/ put a remark-closing token in the middle of the remarks. When the compiler encounters this, it interprets the "*/" token following "accidentally" as the end of the remarks, and it attempts to compile the remainder of that line and the following line, leading to compile errors.
Note: You cannot put remarks after a DATA statement on the same line. Everything following the DATA keyword on the same line is considered part of the DATA statement.

## See Also

DATA
# Futurebasic/Language/Reference/reset
## Syntax

RESET

## Description

This statement closes all files and devices that have been opened with the OPEN statement. RESET is functionally identical to using the CLOSE statement without any parameters.

## See Also

OPEN; CLOSE
# Futurebasic/Language/Reference/restore
## Syntax

RESTORE

## Description

This statement is used in conjunction with the DATA and READ statements. It resets an internal pointer which tells FB where to find the next DATA item to read. This allows your program to READ the same DATA item(s) more than once if necessary. If you omit the expr parameter, the DATA pointer is reset to point to the first item in the first DATA statement. If you specify expr, the DATA pointer is reset to point to the item immediately following the expr-th item. Thus RESTORE 1 points to the second item; RESTORE 2 points to the third item; and so on.
Example: DATA Able, Baker DATA Kane, Dread DATA Echo FOR i = 1 to 5
NEXT PRINT RESTORE 3 READ x$, y$ PRINT x$, y$ program output: AbleBaker KaneDreaEcho Dread Echo

## See Also

READ; DATA
# Futurebasic/Language/Reference/rightstring
## Syntax

subString$
RIGHT$(string$,numChars)
subContainer$$
RIGHT$$(container$$,numChars)

## Revised

May 30, 2000 (Release 3)

## Description

This function returns a string or container consisting of the rightmost numChars characters of string$ or container$$. If numChars is greater than the length of string$ or container$$, the entire string$ or container$$ is returned. If numChars is less than 1, an empty (zero-length) string is returned.
Note: You may not use complex expressions that include containers on the right side of the equal sign. Instead of using: c$$ = c$$ + RIGHT$$(a$$,10) Use: c$$ += RIGHT$$(a$$,10)
Example: PRINT RIGHT$ ("Nebraska", 3) program output: ska

## See Also

LEFT$; MID$; INSTR
# Futurebasic/Language/Reference/route
## Syntax

To re-route text and graphics:
ROUTE [#]_toPrinter
ROUTE [#]_toScreen
ROUTE [#]_toBuffer [+ 0... 4 ]
To re-route text:
ROUTE [#]serialPort
ROUTE [#]fileID

## Revised

May, 2001 (Release 5)

## Description

This statement causes text printed by subsequent PRINT statements to be sent to the indicated device. If you specify _toScreen or _toPrinter, subsequent drawing commands are also sent to the indicated device. If you specify _toBuffer, only text printing commands are sent to the indicated device.
Using ROUTE_toPrinter:
Note: To actually put out the current printer page, use the CLEAR LPRINT statement after sending text and drawing commands to the printer.
Using ROUTE_toScreen:
Note: Statements which affect the appearance of text and graphics, such as TEXT, PEN and COLOR, apply separately to the screen window and to the printer. The settings in one device don't affect the settings in the other, except when you first open a new print job.
Using ROUTE serialPort and ROUTE fileID:
ROUTE deviceID PRINT itemList1 PRINT itemList2: PRINT itemListN
ROUTE _toScreen has the same effect as this group of statements: PRINT #deviceID, itemList1
PRINT #deviceID, itemList2: PRINT #deviceID, itemListN
Using ROUTE_toBuffer:
ROUTE _toBuffer + 2, PRINT "Hello" PRINT "Goodbye" ROUTE _toScreen
When this snippet has been executed, gFBbuffer(2) will contain a handle that points to a moveable block of 14 bytes: Hello<CR>Goodbye<CR> Note that carriage returns are added or suppressed in writing to a buffer just as they would be in writing to a file or to the screen. If you want to dispose of a buffer, use DEF DISPOSEH.
DEF DISPOSEH(gFBbuffer(2)) FB Lite behavior:
Note: The WINDOW statement and the WINDOW OUTPUT statement implicitly execute a ROUTE _toScreen statement. Also, any user action which activates a screen window (such as clicking on its title bar) will implicitly cause a ROUTE _toScreen. If you want to make sure that output is not inadvertently directed to the screen window, you should check for _wndActivate events in your dialog-event handling routine, and re-direct the output as necessary.

## See Also

OPEN; PRINT; PRINT#; CLEAR LPRINT; CLOSE LPRINT; TEXT; PEN; COLOR; LONG COLOR; BOX; CIRCLE; PLOT; ON DIALOG; Inside Macintosh: Imaging with QuickDraw
# Discrete Mathematics/Axiom of choice

Axiom of choice:
If $f:A\rightarrow B$ is a surjective map, then there exists a map $g:B\rightarrow A$ such that $f\circ g$ is the identity (trivial) map.
Lemma: Every set can be well-ordered.
# Discrete Mathematics/Combinatory logic

Two of the basic principles of combinatory logic in discrete mathematics are the Sum principle and the Multiplication principle.
The sum principle holds true in a given partitioned set X where partition Xi intersected with Xj is the empty set unless i is equal to j. The principle states that in such a partitioned set, the sum of the elements of each partition is equal to the number of elements in the set X.
# Discrete Mathematics/Cellular automata

A cellular automaton is a collection of "colored" cells on a grid of specified shape that evolves through a number of discrete time steps according to a set of rules based on the states of neighboring cells. The rules are then applied iteratively for as many time steps as desired
# Discrete Mathematics/Godel's incompleteness theorem

There's no mathematical system with consistent axiom.
# Discrete Mathematics/Axiomatic set theory

See also: Topology/Set Theory
# Discrete Mathematics/Finite state automata

Formally, a Deterministc Finite Automaton (DFA) is a 5-tuple $D=(Q,\Sigma ,\delta ,s,F)$ where:
* Q is the set of all states.
* $\Sigma$ is the alphabet being considered.
* $\delta$ is the set of transitions, including exactly one transition per element of the alphabet per state.
* $s$ is the single starting state.
* F is the set of all accepting states.
For a DFA, $\delta$ can be viewed as a function from $Q\times \Sigma \to Q$.
Example: Consider the DFA ${A}=(\{p,q\},\{a,b\},\delta ,p,\{q\})$ with transitions given by table:
| $\delta$ | a | b |
| p | q | p |
| q | p | q |
It is easy to verify that this DFA accepts the input "aaa".
Similarly, the formal definition of a Nondeterministic Finite Automaton is a 5-tuple $N=(Q,\Sigma ,\delta ,s,F)$ where:
* Q is the set of all states.
* $\Sigma$ is the alphabet being considered.
* $\delta$ is the set of transitions, with $\epsilon$ transitions and any number of transitions for any particular input on every state.
* $s$ is the single starting state.
* F is the set of all accepting states.
For a NFA, $\delta$ can be viewed as a function from $Q\times (\Sigma \cup \{\epsilon \})\to P(Q)$ where $P(Q)$ is the power set of $Q$.
Note that for both a NFA and a DFA, $s$ is not a set of states. Rather, it is a single state, as neither can begin at more than one state. However, a NFA can achieve similar function by adding a new starting state and epsilon-transitioning to all desired starting states.
The difference between a DFA and an NFA being the delta-transitions are allowed to contain epsilon-jumps(transitions on no input), unions of transitions on the same input, and no transition for any elements in the alphabet.
For any NFA $N$, there exists a DFA $D$ such that $L(N)=L(D)$
# GCSE Science/Movement

< Forces
How can we describe the way things move?
Motion has two basic properties, direction and speed.
Objects in our universe travel in three fundamental directions. We usually describe these directions, or axes, using the letters x, y and z. When we are describing motion close to, or with respect to, the Earth's surface we usually align the axes such that the z direction points vertically. Most people will then choose the x axis to point right and the y axis to point forwards (right-handed co-ordinate System). Motion in any other direction is the same as simultaneously moving in any of these three directions.
Speed is how fast an object covers a particular distance per unit of time. The units of distance are most commonly specified in meters or some power of ten multiple of meters (millimeter, kilometer, etc.), but other imperial units, such as inches and miles are sometimes used. Nearly everyone uses seconds, minutes, and hours as the unit of time. In scientific reports, seconds are used exclusively.
Together these two ideas form the notion of velocity, directed motion.
The language we use to describe motion in our universe is the vector, which exists in three dimensions. A vector is similar to an arrow in three dimensional space (i.e. it has a direction associated with it.) You will learn more about this in maths.
# GCSE Science/Organic Chemistry
## Organic Chemistry

Organic chemistry is the branch of chemistry which studies properties, structures, reactions of organic compounds. Note: It is not necessary that a molecules of a compound should contain carbon atoms to be organic (substrate). eg: CO$_2$.

## Elemental Carbon

Carbon (atom) is a unique element which is capable of covalently bonding with four other atoms of monovalent elements as its valency is four and also bonding covalently with itself through single, double, or triple bonds leading to long chains of carbon atoms where each carbon atom can be bonded with other elements(long chain compounds) or carbon atom which is being bonded to other elements(branched chain compounds). In short, Carbon atom being able to form covalent bonds due to its tetravalency leads to the formation of compounds having various types structures.
# GCSE Science/Introduction
## Standards

This book is intended to cover science as taught in schools to 14 - 16 year old pupils. It is called GCSE science because the first draft is intended to cover the GCSE (General Certificate of Secondary Education) standard as taught in schools in the UK, but generally in Scotland. Having said that if you are not in the UK and wish to include material to bring it up to another similar standard feel free to do so. (Note: It would be appreciated if you could use the British way of spelling words (e.g. colour)!

## Additional resources

There will be teacher notes added in time with worksheets, experiments and additional questions. There will also be a study help desk set up so that students can ask questions.

## Contributing to this book

If you spot any errors in the texts, just go ahead and edit them out (click the link that says edit this page and start typing). If you wish to help writing any of the modules, either click on any red module and start typing, or if you need help drop me a line on my talk page Theresa knott

## Authors

Add your name to this section if you have contributed content to this book (i.e. not copyediting).
* Theresa Knott first draft of electricity module
* Bodil
* Wykis, adding different content (mostly writing not started articles, based on Wikipedia)
* Andy, adding content on Global Warming
Go to contents >>
# GCSE Science/Metals

There are several main points within the metals topic, which are: Alkali and Transition Metals, The Reactivity Series, Displacement Reactions, Metal Extraction from their Ores, The pH Scale Indicators and Neutralisation, and Salts.

## Alkali and Transition Metals

The alkali metals are Group one of the periodic table, except for Hydrogen, which is not an alkali metal. They are the most reactive metals on the periodic table, and they get more reactive as the periodic table goes down. This is because the number of electron shells increases, meaning that the forces of attraction between the outermost electron and the atoms neuclei are weakened, since the shells in between the neucleus and the furthest shell have a shielding effect on the forces of attraction. (This is to do with Covalent Bonding).

## The pH Scale Indicatiors and Neutralisation

The pH Scale goes from 0 to 14.
1 2 3 4 5 6 7 8 9 10 11 12 13 13
An indicator is just a dye that changes colour depending on the level of the pH of the solution. For example, if the solution is a weak acid than the indicator would change to a orange colour (4 on the pH scale).
The strongest acid has a pH of 0 and the strongest alkali has the pH 14. A neutral substance has the pH 7 (e.g. pure water).
# GCSE Science/Momentum

Momentum is the tendency for objects at rest to stay at rest, and for objects in motion to stay in motion.
The greater the mass of an object, the greater its resistance to changes in motion. Also, intuitively, the greater the velocity of an object, the greater the momentum it possesses. Therefore, the momentum of an object can be quantified mathematically as p=mv, or as mass x velocity.
The greatest usefulness of the concept of momentum lies in the fact that the total momentum of a system of objects is always conserved, i.e., in isolation the total momentum always stays the same. This knowledge allows the solution of many problems in physics with great elegance. For example, in rocket propulsion; the mass of propellant a rocket carried multiplied by the exhaust velocity of the engine, will be equal to the final forward velocity of the empty rocket multiplied by its empty mass. Without understanding the principle of conservation, finding the final velocity of the rocket would be very puzzling; but applying the simple equation mv = m’v’, and rearranging to v’=mv/m’, finding the velocity becomes a very simple calculation.
The principle of conservation of momentum applies to all states of matter, i.e., solids, liquids, gases, and plasma (and subatomic particles), and with all forms of interaction through all forces, such as gravity, magnetism, direct contact, electrostatic force, etc. etc., so the scope and range of application of this principle is vast. It is easily one of the most important concepts to understand in solving problems involving motion.
The concept of momentum can also be applied to rotating objects, in which case the momentum possessed by such rotating objects is called 'angular momentum'. Angular momentum is also conserved.
# Newton's Second Law
## Momentum

A motion of a body is described by its momentum. Momentum is the product of a body's mass and its velocity. Momentum has both magnitude and direction. Newton showed that bodies only change their motion when a force is applied, Newtons first law. The change in the momentum is equal to the applied force.

## Derivation of Newton's second law

Consider a snooker ball of mass m moving with a velocity v$_1$. The ball hits the cushion and bounces off, it now has a velocity v$_2$. The change in momentum is mv$_1$ − mv$_2$ = m(v$_1$ − v$_2$). The change in velocity is the acceleration, and so the change in momentum and hence force F is mass times acceleration, F = ma. Thus Action and Reaction are equal but opposite in direction.
# GCSE Science/Magnetic effects of a current

When a current flows down a wire it creates a magnetic field. To see this, place a small plotting compass near the wire and turn the current on. The compass needle will deflect. The shape of the magnetic field around a wire is circular. Look at the diagram on the right. The wire is coming straight out of the screen so you only see it's cross section (the red circle) The plotting compasses show how the field wraps around the wire.

## Creating an electromagnet

Solenoids are made by coiling wire. The magnetic field of a solenoid looks like the field of an ordinary bar magnet.
A solenoid makes a pretty weak bar magnet on its own, but if a piece of iron is put inside the solenoid, the field becomes much much stronger.
Try the following experiment:
* Wrap a piece of plastic coated wire around a pencil.Remove the pencil then connect to a power supply set at 1V DC current. Sprinkle iron filings around the coil of wire. Put a plotting compass near the wire. Try to pick up a paper clip.
* Wrap a piece of plastic coated wire around a large nail. Repeat all of the above experiments
You will find that the solenoid with the iron core is much much stronger than the one with the air core.
Q1) Why is it important to use plastic-coated wire?

### Making the field stronger

To make the field stronger we can:
* Use a soft iron core
* Increase the amount of current flowing in the wire
* Increase the number of turns on the solenoid.

### Reversing the field

To make the north pole and south pole swap positions we can:
* Reverse the direction of the current by swapping the positive and negative leads on the power pack.
* Wind the wire the other way round. {So if you wound it clockwise, take it off and wind it counterclockwise.
Speaking of north and south poles, there is a little trick to help find out which end is the north pole and which is the south.
Look down the solenoid and work out which way the current is flowing. Remember, current flows from the positive to the negative terminal on the power pack. If the current is flowing clockwise, the end will be a south pole. If it is going counterclockwise, the end will be a north pole. The easy way to remember this is to put arrows on the end of a capital N and S like this:
If you do not understand how to determine the pole using the clockwise and anti-clockwise way you can use the right hand grip rule
# GCSE Science/Osmosis in potato slices coursework

Osmosis is a type of diffusion involving water molecules and a semi-permeable membrane. They move from areas of "high water concentration", such as dilute solutions of say, sugar, to areas of "low water concentration", such as concentrated solutions of sugar, until there is an equal concentration of water molecules on both sides. There are three types of solution (and, thus, osmosis):
Water concentration outside the cell is equal to concentration inside the cell. Water still passes through the cell membrane, but the net movement is 0.
Water concentration outside the cell is greater than concentration inside the cell. Water passes into the cell.
Water concentration inside the cell is greater than concentration outside the cell. Water leaves the cell.