OpenLLM-France/wikimedia huggingface dataset:
# Programming Fundamentals/Compiler Directives

A general explanation of pre-processor directives and how they are evaluated by the compiler. Discussed are include and define. Note that this discussion is specific to C, C++, and similar languages. Java and Python do not use a preprocessor.

## General Discussion

A compiler directive is an instruction to the compiler to complete a task before formally starting to compile the program, thus they are sometimes called pre-processor directives. Among other items, during the pre-processor step the compiler is looking for compiler directives and processes them as they are encountered. After completing the tasks as directed, the compiler proceeds to its second step where it checks for syntax errors (violations of the rules of the language) and converts the source code into an object code that contains machine language instructions, a data area, and a list of items to be resolved when he object file is linked to other object files.
Within C++ the pound symbol or # as the first character of a line indicates that the next word is a directive (or command word) to be evaluated. The two most common compiler directives are:
* include – with the item following include being the name of a file that is to be inserted at that place in the file. The files are often called "Header Files" because the include directive is normally inserted toward the top of the file (at the head) as one of the first items.
* define – with the item followed by an identifier name and a value. This identifier name and value is stored by the compiler and when it encounters the identifier name in the program it substitutes the value for the identifier name.
In the following example the include directive is inserting a file that contains code from the Input-Output Stream library. This file contains necessary code to use cout and cin for sending data to the monitor or getting data from the keyboard.
In the next example the define directive is being used to handle a constant (called a defined constant).

### Example 1: Substituting PI in C++

Of note, compiler directives in C++ do not have a semi-colon after them. Within C++ programming instructions or statements end with a semi-colon, but not compiler directives.

### Example 2: Importing PI in Java

Java uses the java.lang.Math.PI library.

### Example 3: Importing PI in Python

Python uses the math.pi library.

## Definitions
### compiler directive

    An instruction to the compiler to complete a task before formally starting to compile the program.

### include

    A compiler directive to insert the contents of a file into the program.

## References

* ↑ Oracle: static import
* ↑ Python.org: math
# Programming Fundamentals/Boolean Data Type
## Overview

A Boolean data type has one of two possible values (usually denoted true and false), intended to represent the two truth values of logic and Boolean algebra. It is named after George Boole, who first defined an algebraic system of logic in the mid 19th century. The Boolean data type is primarily associated with conditional statements, which allow different actions by changing control flow depending on whether a programmer-specified Boolean condition evaluates to true or false.

## Discussion

The Boolean data type is also known as the logical data type and represents the concepts of true and false. The name “Boolean” comes from the mathematician George Boole; who in 1854 published: An Investigation of the Laws of Thought. Boolean algebra is the area of mathematics that deals with the logical representation of true and false using the numbers 0 and 1. The importance of the Boolean data type within programming is that it is used to control programming structures (if then else, while loops, etc.) that allow us to implement “choice” into our algorithms.
When implemented in hardware, the 0 and 1 are switches, where 0 is open and 1 is close. The Boolean data type has the same attributes and acts or behaves similarly in all programming languages. However, while all languages recognize false as 0, some languages define true as -1 rather than 1. This is the result of storing the Boolean values as an integer and using a one’s complement representation that negates all bits rather than only the rightmost bit. To simplify processing, most programming languages recognize any non-zero value as being true.
| Language | Reserved Word | True | False |
| C++ | bool | true | false |
| C# | bool or Boolean | true | false |
| Java | bool | true | false |
| JavaScript | Boolean | true | false |
| Python | bool | True | False |
| Swift | Bool | true | false |

## Key Terms
### Boolean

    A data type representing the concepts of true or false.

### Ones' complement

    The value obtained by inverting all the bits in the binary representation of a number (swapping 0s for 1s and vice versa).

## References

* cnx.org: Programming Fundamentals – A Modular Structured Approach using C++
* ↑ Wikipedia: Boolean data type
# Programming Fundamentals/C++ Reserved Keywords

A brief explanation and list of C++ reserved keywords for use in a programming fundamentals course.
All programming languages have "reserved words". There are usually less than 50 of these reserved words in any given programming language. They are reserved because they have been pre-assigned a specific meaning within that programming language, thus the compiler recognizes those words to mean a specific thing or action. Within C++ the reserved words are also known as "keywords".
Programmers use identifier names for a variety of items, to include: functions, variables, named constants, alias names, etc. But, they can't use as identifier names the words that are "reserved to the language".
For the C++ language all "reserved keywords" are typed in lower case. The list that follows includes the American National Standards Institute (ANSI) and the International Organization for Standardization (ISO) lists of reserved words for the C++ programming language. The ISO reserved words may not be implemented in the compiler that you are using, however they may be adopted in future releases of C++ compilers. Wisdom dictates to avoid using them at this point so that there will not be a problem compiling your source code in future releases of compilers. There has been no distinction made in the ANSI or ISO reserved word lists. A search of the Internet for C++ reserved words will reveal several different lists. Some are more unique to a specific compiler. Some will be incomplete because the list has been enlarged. The table that follows should work for any beginning programming course using C++. The reserved keywords are:
TABLE 1 :
| and | double | not_eq | throw |
| and_eq | dynamic_cast | operator | true |
| asm | else | or | try |
| auto | enum | or_eq | typedef |
| bitand | explicit | private | typeid |
| bitor | extern | protected | typename |
| bool | false | public | union |
| break | float | register | unsigned |
| case | for | reinterpret-cast | using |
| catch | friend | return | virtual |
| char | goto | short | void |
| class | if | signed | volatile |
| compl | inline | sizeof | wchar_t |
| const | int | static | while |
| const-cast | long | static_cast | xor |
| continue | mutable | struct | xor_eq |
| default | namespace | switch | |
| delete | new | template | |
| do | not | this | |
# Programming Fundamentals/Call by Value vs Call by Reference
## Overview

In call by value, a parameter acts within the function as a new local variable initialized to the value of the argument (a local (isolated) copy of the argument). In call by reference, the argument variable supplied by the caller can be affected by actions within the called function.

## Discussion
### Call by Value

Within most current programming languages, parameters are passed by value by default, with the argument as a copy of the calling value. Arguments are isolated, and functions are free to make changes to parameter values without any risk of impact to the calling function. Consider the following pseudocode:

#### Output

In English, the Main function assigns the value 100 to the variable fahrenheit, displays that value, and then calls ChangeFahrenheit passing a copy of that value. The called function displays the argument, changes it, and displays it again. Execution returns to the calling function, and Main displays the value of the original variable. With call by value, the variable fahrenheit in the calling function and the parameter fahrenheit in the called function refer to different memory addresses, and the called function cannot change the value of the variable in the calling function.

### Call by Reference

If a programming language uses or supports call by reference, the variable in the calling function and the parameter in the called function refer to the same memory address, and the called function may change the value of the variable in the calling function. Using the same code example as above, call by reference output would change to:
Programming languages that support both call by value and call by reference use some type of key word or symbol to indicate which parameter passing method is being used.
| Language | Call By Value | Call by Reference |
| C++ | default | use &parameter in called function |
| C# | default | use ref parameter in calling and called functions |
| Java | default | applies to arrays and objects |
| JavaScript | default | applies to arrays and objects |
| Python | default | applies to arrays (lists) and mutable objects |
Arrays and objects are covered in later chapters.

## Key Terms
### call by reference

    Parameters passed by calling functions may be modified by called functions.

### call by value

    Parameters passed by calling functions cannot be modified by called functions.

## References

* Wikiversity: Computer Programming
* ↑ Wikipedia: Parameter (computer programming)
# Programming Fundamentals/Character Data Type

An introduction to the character data type.

## Overview of the Character Data Type

The character data type basically represents individual or single characters. Characters comprise a variety of symbols such as the alphabet (both upper and lower case) the numeral digits (0 to 9), punctuation, etc. All computers store character data in a one byte field as an integer value. Because a byte consists of 8 bits, this one byte field has 28 or 256 possibilities using the positive values of 0 to 255.
Most microcomputers use the ASCII (stands for American Standard Code for Information Interchange and is pronounced "ask-key") Character Set which has established values for 0 to 127. For the values of 128 to 255 they usually use the Extended ASCII Character Set. When we hit the capital A on the keyboard, the keyboard sends a byte with the bit pattern equal to an integer 65. When the byte is sent from the memory to the monitor, the monitor converts the integer value of 65 to into the symbol of the capital A to display on the monitor.
The character data type attributes include:
TABLE 1 :
| C++ Reserved Word | char |
| Represent | Single characters |
| Size | 1 byte |
| Normal Signage | Unsigned (positive values only) |
| Domain (Values Allowed) | Values from 0 to 127 as shown in the standard ASCII Character Set, plus values 128 to 255 from the Extended ASCII Character Set |
| C++ syntax rule | Single quote marks – Example: 'A' |

## Demonstration Program in C++
### Creating a Folder or Sub-Folder for Source Code Files

Depending on your compiler/IDE, you should decide where to download and store source code files for processing. Prudence dictates that you create these folders as needed prior to downloading source code files. A suggested sub-folder for the Bloodshed Dev-C++ 5 compiler/IDE might be named:
* Demo_Programs
If you have not done so, please create the folder(s) and/or sub-folder(s) as appropriate.

### Download the Demo Program

Download and store the following file(s) to your storage device in the appropriate folder(s). Following the methods of your compiler/IDE, compile and run the program(s). Study the soruce code file(s) in conjunction with other learning materials.
Download from Connexions: Demo_Character_Data_Type.cpp

## Definitions
### character

    A data type representing single text characters like the alphabet, numeral digits, punctuation, etc.

### ASCII

    American Standard Code for Information Interchange

### single quote marks

    Used to create character type data within the C++ programming language.
# Programming Fundamentals/Assignment vs Equality
## Overview

Assignment sets and/or re-sets the value stored in the storage location denoted by a variable name. Equality is a relational operator that tests or defines the relationship between two entities.

## Discussion

Most control structures use a test expression that executes either selection (as in the: if then else) or iteration (as in the while; do while; or for loops) based on the truthfulness or falseness of the expression. Thus, we often talk about the Boolean expression that is controlling the structure. Within many programming languages, this expression must be a Boolean expression and is governed by a tight set of rules. However, in many programming languages, each data type can be used as a Boolean expression because each data type can be demoted into a Boolean value by using the rule/concept that zero and nothing represent false and all non-zero values represent true.
Within various languages, we have the potential added confusion of the equals symbol = as an operator that does not represent the normal math meaning of equality that we have used for most of our life. The equals symbol typically means assignment. To get the equality concept of math we often use two equal symbols to represent the relational operator of equality. Let’s consider:
The test expression of the control structure will always be true because the expression is an assignment (not the relational operator of ==). It assigns the ‘y’ to the variable pig, then looks at the value in pig and determines that it is not zero; therefore the expression is true. And it will always be true and the else part will never be executed. This is not what the programmer had intended. The correct syntax for a Boolean expression is:
This example reminds you that you must be careful in creating your test expressions so that they are indeed a question, usually involving the relational operators. Some programming languages will generate a warning or an error when an assignment is used in a Boolean expression, and some do not.
Don’t get caught using assignment for equality.

## Key Terms
### assignment

    Sets or resets the value of a variable.

### equality

    Tests or defines the relationship between values.

## References

* cnx.org: Programming Fundamentals – A Modular Structured Approach using C++
* ↑ Wikipedia: Assignment (computer science)
* ↑ Wikipedia: Relational operator
# Malay

Welcome to the Malay language book. This book is designed to help you in your Malay studies. Please follow the directions given during each lesson.

## Table of Contents
### Introduction

* Introduction
* Alphabet
* Vowels
* Consonants
* Pronunciation
* Basics

### Beginner

* Beginner
* Lesson 1
* Lesson 2
* Lesson 3
* Lesson 4
* Lesson 5
* Lesson 6
* Lesson 7
* Lesson 8
# Malay/Alphabet

The Malay alphabet consists of 26 letters from the Latin alphabet, like the English alphabet, and is based of the Latin script. There are two different types of script used in Malay. One being the currently used one, and the Jawi script.
Aa as in the word “ask”,
Bb same as in English
Cc like “tch”.
Dd same as in English.
Ee as in “elevated” and also as in "taken"
Ff same as in English
Gg as in "good" and never as in "gist"
Hh as in “Hotel”
Ii as in the word “ink” never as in the word “island”
Jj same as in English “job”
Kk same as in English.
Ll like “l” in “life”.
Mm same as in English
Nn same as in English
Oo same as in English “Old” never as in “Hot” which is pronounced somehow like {hat}
Pp same as in English
Qq same as in English.
Rr same as in English
Ss same as in English
Tt same as in English but not as sharp.
Uu as in the “put”, never as in the word “cup” or “university”
Vv same as in English
Ww same as in English
Xx as “kh”, sometimes as “ks”
Yy same as in English.
Zz same as in English.
dz as “th” in “that”
kh as “ch” in “loch”
Ua as “ua”
Ny as “ñ” in the “español”
Ng as “ng” in the “sing”
Ngg as in “singing girl”
Sy as in “sh”
The names of the letters are basically the same, except for Z, which is "zed".
# Malay/Consonants

Malay Language consonants are identical to English consonants ->BCDFGHJKLMNPQRSTVWXYZ
# Malay/Beginner/Lesson 1

Good morning - selamat pagi
# Malay/Introduction

Malay is the language spoken natively by Malay people, who originated from the island of Sumatra, and is now an official language of Malaysia, Indonesia (where the official standard goes by the name of "Indonesian"), Singapore and Brunei. It was once written in an Arabic-based script called Jawi, but is now written in Latin script. The creators of this book hope you enjoy it and use it as a source for your studies, whether it is primary or secondary.

### Why Should I learn Malay?

Learning Malay can not only be a fun thing to do, but you could then also communicate with Malay people. You could learn simple phrases, it would help you out with situations such as not knowing the area and be able to communicate with Malay people if you need help.

### How this book is Designed

This book is designed to help you in your studies of Malay. It is divided into sections with Introduction, Alphabet, Pronunciation, Vowels, Consonants, Basics, Beginner Level, Intermediate Level, Advanced Level, Quick Phrases and other useful links. We hope you enjoy this book.
Please continue to next page Malay/Alphabet
# Making an Island/Moving a Floating Island
## Towing

You could have a fleet of tugboats with cables attached to a sturdy part of your island tow it to another location.
If the design is modular the modules can be moved individually, in fact they could be linked in a long chain to minimize drag for travel over long distance and then rearranged on location.

## Sails

Build a mast near the middle of your island so that you can use sails to drag your island to another location using wind. It's important that your mast is sturdy and large enough to catch enough wind to efficiently move your island, but not so big and heavy that its hard for your island to support it. Also, putting your sails too high might tip your island altogether in rough winds, so it is best to set it such that it is low enough not to let the island blow over (closer to the center of gravity), yet not so low that it gets in the way and/or is not able to catch enough wind. Making the bottom of your island more stream-line would help in reducing drag. This method should be more effective if your island is small.
# Making an Island/Plants

Plants are the most important part of a floating island as it will be extremely prone to erosion. You will have to make sure the plants you put on the island can grow in whatever environment you chose to put the island in. If you build your island in saltwater, you might need to use plants that can survive in environments that are rich in salt, such as mangrove trees. If you are growing plants that are not resistant to salt water, you need to make sure that the soil in which the plants are growing has no contact with the subterranean sea water. You might want to cover the bottom of the surface which is supporting the soil with either concrete or wooden boards.
Additionally, the roots of plants will add support and strength to the soil. Grass might be a good plant to start with, which will also improve the aesthetic condition of the island.
# Malay/Basics

Here are some survival phrases in Malay language.
| English | Malay |
| Hello | Helo! |
| Goodbye | Jumpa lagi! |
| Where is the bathroom? | Di manakah tandas? |
| What is your name? | Apakah nama kamu? |
| Do you speak English? | Adakah kamu cakap Bahasa Inggeris? |
| I'm from... | Saya dari ... |
| How are you? | Apa khabar? |
| I'm fine. | Khabar baik. |
# Principles of Economics/Preface/To The Student
## Dear Student

This text is designed to provide you with a very comprehensive and easy-to-understand introduction to economics. This text will assume no background in economics. All you really need is an open mind and an interest in learning!
Thank you,
Endless melee - Initiating Author

## Why study economics?

Those who don't study economics will say that it's boring. Those who do will say that it's dismal. The former say it's boring because they can't see the relationships so crucial to the discipline. The latter say it's dismal because many of the conclusions reached reveal saddening facts. It's not knowledge that's easy to show off, either, nor is it particularly useful in day-to-day interactions.
So why would you ever want to study economics?
Study it because it interests you. Study it because monetary policy intrigues you, because you want to know the causes of inflation, because you wonder how the market works so flawlessly (or not), because you wish to comprehend socially applied concepts of efficiency, because the concepts of supply and demand are beautiful to you, because you find the analytical tools and theories of economics graceful, because you hope to learn more about the market and the "invisible hand", because...
-- Yunzhong Hou - Primary Author and Illustrator

## Why economics?

The world is made up of billions of people, each with their own motivations and beliefs. To try to fully understand each individual would be a hopeless exercise in futility. Instead, the job of the economist is to simplify the world to the point where we can say something interesting about it. When building a model, it is always my hope that the interesting bit of information I walk away with will, by some miracle, still be useful when applied to the real world, which is anything but simple.
Note that I haven't said anything about an economy, money, or trade yet. You'll read quite a bit about those topics in this book, but they are not as essential to economics as you might think. Economics is the study of people and choice. It's a methodology. It's a way of thinking about the world. If the authors have done their job, you'll walk away from this text with a new perspective on the world and a deeper understanding of how choices are made.
Good luck!
~ BU Rob13 - Contributing author
# Principles of Economics/Perfect Competition
## Perfect competition

There are generally four types of markets that economists analyze:
* Perfect competition
* Monopoly
* Monopolistic competition
* Oligopoly.
The first one is the simplest and thus best suited to an introductory economics course; however, it is incredibly unrealistic; practically no industry operates under that system. However, it provides a variety of insights, and some industries, such as agriculture, come relatively close.
In perfect competition, the following are true:
* All producers contribute insignificantly to the market. Their own singular production levels do not change the supply curve.
* All producers are price takers. They cannot influence the market.
* Producers may enter and exit the market freely -- in other words, no barriers to entry exist in the market.
* Producers alter their quantity produced, and may enter or leave the market, to bring the market equilibrium point to the intersection between the demand and supply curve (you will learn why in the Microeconomics section).
* The goods sold by producers are standardized, meaning that the goods sold cannot be distinguished from other goods.
* There are a large amount of buyers and sellers within that market.
* Each buyer and seller is well-informed about the market prices of a given good or service.