OpenLLM-France/wikimedia huggingface dataset:
# Cocoa Programming

* Cocoa Programming First Steps | Objective-C basics | Memory Management | Foundation Kit | Application Kit | Web Kit
If you are a beginner, please consider Programming Mac OS X with Cocoa for Beginners

## About Cocoa

Cocoa is the name Apple Computer uses for their extended implementation of the OpenStep specification, first created by NeXT for their OPENSTEP operating system. It provides a useful set of tools to help developers create programs and user interfaces within Mac OS X. There are three implementations of the OpenStep specification, the one originally provided with the OPENSTEP operating system, but the most common ones today are the one provided by Apple, and the other by GNUstep, a free software implementation of OpenStep.
If you don't have access to an Apple Macintosh, and you would like to learn how to use the OPENSTEP frameworks, then running GNUstep is worth a consideration (and should be sufficient to let you experience the power of the OPENSTEP frameworks).

## Getting ready to program

If you are using an Apple Macintosh computer running Mac OS 10.2 or later (the latest version of Mac OS X is recommended) then you can find all the tools needed to develop Cocoa programs on the last software install CD. The tools are also available from Apple's Developer's Website. In order to download them, you need to create a free account and login. You can also find them in the "Installers" folder of your "Applications" folder (they could be outdated, make sure you run software update after the installation). The two programs you will use most extensively are Xcode (known as Project Builder in versions before 10.3) and Interface Builder.
If you are using GNUstep then you may already have the tools installed. The programs you will need to complete most of the tutorials in this book are ProjectCenter and Gorm. You will need to refer to the GNUstep website for help installing these.
Before starting any of the modules that make up this book you should have a good, basic knowledge of the C programming language. C will help you understand programming in general.
It would be advantageous for you to learn Objective-C as well, as it is the core language for developing Cocoa applications, and may help to assist in understanding the machinery behind Cocoa applications. Learning Objective-C while learning Cocoa is also possible.

## Modules

* First steps
* Objective-C basics
* Memory management
* Foundation Kit
* Application Kit
* Basics
** Commonly used items:
*** Cocoa Programming/sheets
*** Cocoa Programming/toolbars
*** Cocoa Programming/drawers
*** Cocoa Programming/progress indicators
*** Cocoa Programming/preferences
*** status items
*** Cocoa Programming/dock menus
*** Cocoa Programming/wrapping command line tools
*** multithreading
*** Cocoa Programming/vector drawings
*** Cocoa Programming/OpenGL
* Cocoa Programming/Web Kit
** Cocoa Programming/web content
# Cocoa Programming/Application Kit

* Cocoa Programming First Steps | Objective-C basics | Memory Management | Foundation Kit | Application Kit | Web Kit

## Overview

When programming in Cocoa there are two core frameworks that the developer can use:
* Foundation Framework
* Application Framework
The Application Framework is more commonly referred to as the Application Kit or just AppKit. It provides developers with APIs that simplify commonly performed programming tasks related primarily to the GUI and the elements that make up the GUI (e.g. menus, windows, icons, buttons, etc.).

## Using AppKit

To use AppKit the developer must use a programming or scripting language that is capable of interacting with the classes, functions and APIs that make up Appkit. The most obvious choice is Objective-C as this is the language in which Cocoa is written. Also natively supported is AppleScript. Other C based programming languages can also be used (with some constraints) while Python, Ruby and Tcl are three scripting languages that can be interfaced to Cocoa.

## References

* - Apple "The Cocoa Frameworks"
* - "Cocoa Language Options" by Scott Anguish, Erik Buck and Donald Yacktman
# Cocoa Programming/Foundation Kit

* Cocoa Programming First Steps | Objective-C basics | Memory Management | Foundation Kit | Application Kit | Web Kit
The Foundation Kit is one of two frameworks or large collections of classes that comprise Cocoa. It provides classes for dealing with strings, collections, memory management, communication, threading, et cetera. Most of the functionality in a Cocoa application that is independent of the application's interface can be attributed to classes residing in the Foundation framework.

## Foundation Locks

An NSLock object is provided as a less-portable alternative to using POSIX locks in the Cocoa Foundation Kit. A simpler alternative is to use the @synchronized Objective-C directive.
# Coaching Youth Middle Distance Runners/Further Reading

← Competition
# Cocoa Programming/Basics

Programming with Cocoa on Mac OS X is often done with the Integrated Development Environment Xcode. Interface Builder, a separate application, is directly connected with the Xcode development environment.
# Combinatorics/Motivating Examples and Problems

1. Picture a small town center, where the streets form an 8x8 square grid, as illustrated in the diagram. How many ways are there to travel from one corner (A) of the town center to the opposite corner (B)?
2. On a chessboard, how many ways are there to position 8 rooks in mutually non-attacking positions?
3. At least how many students must there be in a lecture class to assure that the probability of any two students having the same birthday is at least 1/2?
4. Given n letters and n addressed envelopes, in how many ways can the letters be placed in the envelopes so that no letter is in the correct envelope? (The answer is the nearest integer to ${\frac {n!}{e}}$).
5. Kirkman's schoolgirl problem: Fifteen schoolgirls walk each day in five groups of three. Arrange the girls walks for a week so that, in that time each pair of girls walks together in a group just once. (A solution is provided here.)
6. Euler's officers: Thirty six officers are given, belonging to six regiments and holding six ranks. (No two officers have the same rank and regiment, if their ranks matches then their regiments differ and vice versa). Can the officers be paraded in a 6 by 6 array so that in any line of the array each regiment and each rank occurs precisely once. (The answer is no.)
7. Ramsey's game: This 2 player game requires drawing 6 points (no 3 of which are in the same line) on a blank sheet of player and then giving the players differently colored pencils. The players now take turns to connect the points by drawing lines joining them. The first player to produce a monochromatic triangle loses. The question is: Can this game ever end in a draw? (The answer is no. See here.)

## References

* ↑ Graham, Ronald L. (1995). Handbook of Combinatorics, Volume 2. Cambridge, MA: The MIT Press. ISBN 0-262-07171-1. {{cite book}}: Unknown parameter |coauthors= ignored (|author= suggested) (help)
* ↑ G. Terry (1900–1901). "Le Probléme de 36 Officiers". Comptes Rendu de l' Association Française pour l' Avancement de Science Naturel. 1: 122–123 & 2170–2203.
# Combinatorics/Congruences

The basic facts about congruences can be found in any Number Theory book. We will merely review them here. For details please consult any standard text on number theory.
For any integer $n\geq 2$ we say that two integers a and b are congruent modulo n or $a\equiv b{\pmod {n}}$ if n divides the difference a-b.
For example, 5 and 11 are congruent modulo 3:
11≡5(mod 3) because 11 − 5 gives 6, which is divisible by 3. Or, equally, both numbers give the same remainder when divided by 3:
11 = 3×3 + 2
5 = 1×3 + 2
If a1 ≡ b1 (mod n) and a2 ≡ b2 (mod n) then a1 + a2 ≡ b1 + b2 (mod n) and a1a2 ≡ b1b2 (mod n) This turns the congruence (mod n) into an equivalence on the ring of all integers. The equivalence class of the integer a, denoted by ${\overline {a}}_{n}$, is the set $\left\{\ldots ,a-2n,a-n,a,a+n,a+2n,\ldots \right\}$. This set, consisting of the integers congruent to a modulo n, is called the congruence class or residue class of a modulo n. Another notation for this congruence class, which requires that in the context the modulus is known, is $\displaystyle [a]$.
The set of congruence classes modulo n is denoted as $\mathbb {Z} /n\mathbb {Z}$ (or, alternatively, $\mathbb {Z} /n$ or $\mathbb {Z} _{n}$) and defined by:
    $\mathbb {Z} /n\mathbb {Z} =\left\{{\overline {a}}_{n}|a\in \mathbb {Z} \right\}.$
$\mathbb {Z} /n\mathbb {Z}$ has n elements, and can be written as:
    $\mathbb {Z} /n\mathbb {Z} =\left\{{\overline {0}}_{n},{\overline {1}}_{n},{\overline {2}}_{n},\ldots ,{\overline {n-1}}_{n}\right\}.$
We can define addition, subtraction, and multiplication on $\mathbb {Z} /n\mathbb {Z}$ by the following rules:
* ${\overline {a}}_{n}+{\overline {b}}_{n}={\overline {a+b}}_{n}$
* ${\overline {a}}_{n}-{\overline {b}}_{n}={\overline {a-b}}_{n}$
* ${\overline {a}}_{n}{\overline {b}}_{n}={\overline {ab}}_{n}.$
The verification that this is a proper definition uses the properties given before.
In this way, $\mathbb {Z} /n\mathbb {Z}$ becomes a commutative ring. In fact, it turns out that $\mathbb {Z} /n\mathbb {Z}$ is a field (which is a special kind of a commutative ring) if and only if n is a prime number.
Fermat's little theorem (not to be confused with Fermat's last theorem) states that if p is a prime number, then for any integer a, $a^{p}-a$ will be evenly divisible by p. This can be expressed as follows:
    $a^{p}\equiv a{\pmod {p}}\,\!$
The totient function $\varphi (n)$ of a positive integer n is defined to be the number of positive integers less than or equal to n that are coprime to n. For example, $\varphi (9)=6$ since the six numbers 1, 2, 4, 5, 7 and 8 are coprime to 9.
Euler's theorem (also known as the Fermat-Euler theorem or Euler's totient theorem) states that if n is a positive integer and a is coprime to n, then
    $a^{\varphi (n)}\equiv 1{\pmod {n}}$
where φ(n) is Euler's totient function and "... ≡ ... (mod n)" denotes congruence modulo n.
The theorem is a generalization of Fermat's little theorem.
# Combinatorics/Counting

It might seem strange, but counting is one of the most difficult things in mathematics sometimes. In fact, it won't be far from the truth to call combinatorics the art of arranging objects and counting them. Brute force techniques, when objects are counted by enumerating all possibilities usually are doomed to fail in combinatorics and we are forced to rely on various techniques and mathematical ideas. Sometimes when even these ideas fail us we have to be content with establishing giving estimates or bounds of the objects to be counted.

## Double Counting

In combinatorics, double counting, also called two-way counting, is a proof technique that involves counting the size of a set in two ways in order to show that the two resulting expressions for the size of the set are equal. We describe a finite set X from two perspectives leading to two distinct expressions. Through the two perspectives, we demonstrate that each is to equal |X|.
Let us look at two examples. The first is called the handshaking lemma and can be stated succinctly as:
    At a convention the number of delegates who shake hands an odd number of times is even.
To see this, let $D_{1},\cdots D_{n}$ be the delegates. Let $x_{i}\,$ be the number of times $D_{i}\,$ shakes hands and $y\,$ the total number of handshakes that occur. Clearly the total number of times hands were extended is
    $\sum _{i=1}^{n}x_{i}$.
But counting another way it's just $2y\,$ - two extended hands for each handshake $y\,$. So,
    $\sum _{i=1}^{n}x_{i}=2y$.
Now how many odd $x_{i}\,$ can be there in the sum. If the number of odd $x_{i}\,$ was odd then their total must have been odd too (say 2a+1). This when added to the sum of the even $x_{i}\,$ (say 2b) would have given an odd number (2a+2b+1). But we just saw that $\sum _{i=1}^{n}x_{i}$ was even. So the number of odd $x_{i}\,$ was even. But that's just another way of saying that the number of delegates who shook hands an odd number of times was even.
Let's take a look at another example. We want to derive the formula for the sum of the first n natural numbers. Suppose we have an (n + 1)×(n + 1) square of points. The number of points on the diagonal is exactly n + 1, and clearly the number of points S that are strictly above the diagonal equals the number of points strictly below the diagonal, so the total number of points in the square is n + 1 + 2S. On the other hand, the total number of points in the square is (n + 1)$^2$, so
    $(n+1)^{2}=n+1+2S\,$,
thus
    $n(n+1)=2S\,$,
so
    $S=\sum _{k=1}^{n}{k}={\frac {n(n+1)}{2}}.$
# Combinatorics/What is Combinatorics

Combinatorics is a branch of pure mathematics concerning the study of discrete (and usually finite) objects. It is related to many other areas of mathematics, such as algebra, probability theory, ergodic theory and geometry, as well as to applied subjects in computer science and statistical physics. Aspects of combinatorics include "counting" the objects satisfying certain criteria (enumerative combinatorics), deciding when the criteria can be met, and constructing and analyzing objects meeting the criteria (as in combinatorial designs and matroid theory), finding "largest", "smallest", or "optimal" objects (extremal combinatorics and combinatorial optimization), and finding algebraic structures these objects may have (algebraic combinatorics).
Combinatorics is as much about problem solving as theory building, though it has developed powerful theoretical methods, especially since the later twentieth century (see the page List of combinatorics topics for details of the more recent development of the subject). One of the oldest and most accessible parts of combinatorics is graph theory, which also has numerous natural connections to other areas.
There are many combinatorial patterns and theorems related to the structure of combinatoric sets. These often focus on a partition or ordered partition of a set. See the List of partition topics for an expanded list of related topics or the List of combinatorics topics for a more general listing. Some of the more notable results are highlighted below.
An example of a simple combinatorial question is the following: What is the number of possible orderings of a deck of 52 distinct playing cards? The answer is 52! (52 factorial), which is equal to about $8.0658\cdot 10^{67}$.
Another example of a more difficult problem: Given a certain number n of people, is it possible to assign them to sets so that each person is in at least one set, each pair of people is in exactly one set together, every two sets have exactly one person in common, and no set contains everyone, all but one person, or exactly one person? The answer depends on n.
Combinatorics is used frequently in computer science to obtain estimates on the number of elements of certain sets. A mathematician who studies combinatorics is often referred to as a combinatorialist or combinatorist.
# Combinatorics/Schur's Theorem

Schur's theorem states that for every positive integer r, there exists a positive integer S, such that for every partition of the integers {1, ..., S} into r parts, one of the parts contains integers x, y and z with
    x + y = z.
Proof: Let n = R(3, ..., 3) where R(3, ..., 3) denotes the Ramsey number on r colors. Now take S to be n and partition the integers {1, ..., n} into r parts, which we denote by colors. That is, the integers in the first part are said to be colored c$_1$, the integers in the second part are said to be colored c$_2$ and so on till color c$_r$. We also then say that {1, ..., S} has been r-colored. This terminology is common in Ramsey theory.
Now color the edges of K$_n$ as follows: An edge xy (this denotes an edge which joins vertices x and y) is given color c if |x - y| was colored c in the partitioning. Now K$_n$ will definitely contain a monochromatic triangle, say built out of the vertices i > j> k. Suppose the triangle is colored c$_m$. Now i - j, i - k and j - k will also be colored c$_m$, i.e. will belong to the same part in the partition. It only remains to take x = i - j, y = j - k and z = i - k to complete the proof.
# Combinatorics
## Preliminaries

* What is Combinatorics?
* Motivating Examples and Problems
* Counting
* Subsets of a set-The Binomial Coefficient
* Binomial Theorem
* Congruences

## The Pigeonhole Principle

* The Pigeon Hole Principle

## Pairing problem

* General principles
* P. Hall's selection theorem
* Applications to Latin squares and to coverings by dominoes of pruned chessboards.

## The inclusion-exclusion principal

* Applications to derangements
* Applications to counting problems
* Applications to rook polynomials

## Partitions

* Counting various types of partitions
* Ferrers graphs
* Self-conjugate partitions

## Symmetric functions (and anti-symmetric functions)

* Monomial symmetric functions
* Elementary symmetric functions
* Theory of equations
* Newton's formulae and relations between symmetric functions
* Indexing of symmetric functions by partitions.

## Ramsey Theory

* Ramsey's Theorem
* Bounds for Ramsey numbers
* Schur's Theorem
# Electronics Fundamentals/Resistors Networks
## Resistor in Parallel

    ${\frac {1}{R_{t}}}={\frac {1}{R_{1}}}+{\frac {1}{R_{2}}}+....+{\frac {1}{R_{n}}}$

## Voltage Divivider

    ${\frac {v_{o}}{v_{i}}}={\frac {R_{2}}{R_{2}+R_{1}}}$

## Pie Network

    ${\frac {v_{o}}{v_{i}}}={\frac {R_{3}+R_{2}}{R_{1}+R_{2}}}$

## Tee Network

    ${\frac {v_{o}}{v_{i}}}={\frac {R_{3}}{R_{1}}}({\frac {R_{3}-R_{2}}{R_{1}-R_{2}}})$
# Electronics Fundamentals/Semi Conductor Devices/Transistor/Electronic DC Amplifier
## Analysis

Assume that the transistor is ideal.
    $V_{B}=V_{i}{\frac {R_{2}}{R_{2}+R_{1}}}$
    $V_{E}=V_{B}-0.7=V_{B}$
    $I_{E}={\frac {V_{E}}{R_{4}}}={\frac {V_{B}}{R_{4}}}$
    $I_{C}=I_{E}$
    $V_{C}=I_{C}R_{4}$
    $V_{C}=V_{i}(1-{\frac {R_{3}}{R_{4}}}{\frac {R_{2}}{R_{2}+R_{1}}})$
When $R_{2}>>R_{1}$ or R$_1$ = 0. The equation above is reduced to
    $V_{C}=V_{i}(1-{\frac {R_{3}}{R_{4}}})$
    R$_3$ = 0 , $V_{C}=V_{i}$
    R$_3$ = R$_4$ , $V_{C}=0$
    R$_3$ = 2R$_4$ , $V_{C}=-V_{i}$
    R$_3$ = (n+1)$_4$ , $V_{C}=-nV_{i}$
When $R_{3}=R_{4}$. The equation above is reduced to
    $V_{C}=V_{i}(1-{\frac {R_{2}}{R_{2}+R_{1}}})$
When R$_1$ = 0 or R$_2$ = 0,
    $V_{C}=V_{i}$ . Transistor operates like a closed switch
When R$_2$ >> R$_1$
    $V_{C}=0$ . Transistor operates like an opened switch
With the right biased voltage at the base, the transistor can be operated like a mechanical switch.
# Electronics Fundamentals/Passive Components/Switches

Switches are used to open or close an electric circuit. They are always connected in series with the other electrical components in the main circuit which is doing the main function.
There are different types of switches designed for different purposes.
* Push button switch
* Slide button
# Electronics Fundamentals/Semi Conductor Devices/Silicon Controlled Rectifier (SCR)

* Thyristor
* Diac
* Triac
# Electronics Fundamentals/Semi Conductor Devices
## Semiconductor Devices

Electronic devices made from semiconductor Silicon (Si) or Germanium (Ge)
* Diode
* Transistor
* Field Effect Transistor (FET)
* MOSFET
* Silicon Controlled Rectifier(SCR)
# Electronics Fundamentals/Semi Conductor Devices/Transistor/Electronic Signal Wave Amplifier/Common Emitter Amplifier
## Operation

Common Emitter Amplifier has the capability to produce an amplified inverted half positive cycle of the sinusoidal input wave
# Electronics Fundamentals/Semi Conductor Devices/Transistor/Electronic Signal Wave Amplifier

* Common Emitter Amplifier
* Common Collector Amplifier
* Common Base Amplifier
# Environmental Health Engineering Theory and Practice/1993 Cryptosporidiosis Outbreak; Milwaukee, Wisconsin, USA

The 1993 Milwaukee Cryptosporidiosis outbreak was a significant distribution of the Cryptosporidium protozoan in Milwaukee, Wisconsin, and the largest waterborne disease outbreak in documented United States history.

## Useful Off-site Resources

* Cryptosporidium in Milwaukees water supply caused widespread illness: The 1993 Milwaukee cryptosporidiosis outbreak remains the largest epidemic of waterborne disease in U.S. history, (2007).
# Environmental Health Engineering Theory and Practice/Agent Replication

Infection is the invasion of an organism's body tissues by disease-causing agents, their multiplication, and the reaction of host tissues to the infectious agents and the toxins they produce.

## Useful Off-site Resources

* A niche for infectious disease in environmental health: rethinking the toxicological paradigm, (2010)
# Environmental Health Engineering Theory and Practice/Carriage

An asymptomatic carrier (healthy carrier or just carrier) is a person or other organism that has become infected with a pathogen, but that displays no signs or symptoms.

## Useful Off-site Resources

* A niche for infectious disease in environmental health: rethinking the toxicological paradigm, (2010)
# Environmental Health Engineering Theory and Practice/Chemical Agents

A highly hazardous chemical is a substance classified by the American Occupational Safety and Health Administration as material that is both toxic and reactive and whose potential for human injury is high if released. Highly hazardous chemicals may cause cancer, birth defects, induce genetic damage, cause miscarriage, injury and death from relatively small exposures.

## Useful Off-site Resources

* United States Centers for Disease Control: National Institute for Occupational Safety and Health (NIOSH): Chemicals
# Environmental Health Engineering Theory and Practice/About
## About

This wikibook is aimed at undergraduate environmental engineering students, though the material may provide a useful review for practitioners and graduate students in environmental engineering as well as professionals in related fields including civil engineering, chemical engineering, and public health. Typically, this wikibook would serve as a text for an Introduction to Environmental Health Engineering course, which might be taken by most students as a technical elective in their senior year. If we imagine environmental engineers as T-shaped professionals, this elective would contribute to the horizontal of the T to create breadth of knowledge and exposure to interprofessional education.

## Engineers as Healthcare Professionals

One way to use this wikibook is through the lens of explaining how engineering technology can be used to promote wellness and health in the individual, population, and community. It begins with theory - the foundational concepts of exposure and associated risks. This is followed by modern rules of thumb for practice, organized into core and additional areas of interest. Next, areas of emerging interest are described, and finally, case studies provide concrete examples of discussion among professionals who are known to learn best through engaging material in the context of practice. Throughout this wikibook, the importance of interprofessional education is emphasized - where two or more healthcare professions learn together. It may be strange to consider engineers as healthcare professionals, yet the code of ethics of the National Society of Professional Engineers (and other engineering societies), includes an important point, namely, engineers must be, dedicated to the protection of the public health, safety, and welfare.
Each page corresponds approximately to the notes from one lecture.

## Authors

Authors of this book include Daniel Oerther.

## Useful Off-site Resources

* National Society of Professional Engineers: Code of Ethics
* World Health Organiation: Framework for Action on Interprofessional Education and Collaborative Practice