text:
Message-Passing Interface

This guide assumes you have previous knowledge about C programming and will present you Message-Passing Interface (MPI) by several examples.

What is MPI ?
MPI is a standardized and portable message-passing system. Message-passing systems are used especially on distributed machines with separate memory for executing parallel applications. With this system, each executing process will communicate and share its data with others by sending and receiving messages. MPI is the specification resulting from the MPI-Forum which involved several organizations designing a portable system (that can allow programs to work on a heterogeneous network).

Since the data can only be shared by exchanging messages, this standard is not intended for use on shared-memory systems, like a multiprocessor computer (although it will work, it is not the primary goal and there are more powerful alternatives, for instance, OpenMP). Basically, MPI includes point-to-point communication, collective communication (over a network of processes), process groups, bindings for Fortran and C and other advanced functions. On the other hand, the standard does not specify explicit shared-memory operations, debugging facilities, explicit support for threads, I/O functions.

The current version is 2.0, although 1.1 is still used.

Documentation
The volume Using MPI: Portable Parallel Programming with the Message-Passing Interface by William Gropp, Ewing Lusk and Anthony Skjellum is recommended as an introduction to MPI. For more complete information, read MPI: The Complete Reference by Snir, Otto, Huss-Lederman, Walker and Dongarra. Also, the standard itself can be found at or. For other Internet references, such as tutorials, see the Open Directory Project or the List of Tutorials at the Argonne National Laboratory.

Implementation
Currently, there are two principal implementations: MPICH and LAM. The official web-site of the latter contains much information about LAM and also about MPI.

Supplementary library
Additionally libraries exist for solving numerical problem or for using I/O functions on a distributed machine. We can mention: the ScaLAPACK library, FFTW (a portable C FFT library), the PETSc Scientific Computing Libraries. A more complete list can be found on the site

Compilers
Each implementation provides a compiler or at least a front-end to an existing compiler.

Debugging
As MPI doesn't specify debugging facilities, some program can be used to this purpose: XMPI is a run/debug GUI for LAM/MPI; MPI-CHECK is a debugger for Fortran; Etnus, Inc. offers a version of the Totalview debugger that supports MPICH (as well as some other MPI implementations); and, Streamline Computing's Distributed Debugging Tool works with several MPI implementations, include MPICH and LAM/MPI.

Benchmarks
Mpptest, SKaMPI and MPBench measure the performance of MPI implementations. They can be used to decide what implementation to use, how to implement portable and efficient MPI programs and also for predicting the performance of MPI programs.

Famous and popular MPI benchmark includes NASA Parallel Benchmark, SpecMPI 2007 and HPCC benchmark suite.

Applications
It can be used on large heterogeneous parc.

Sum of an array
The point of this first simple example is to calculate the sum of all the value stored in an array. In C programming, the sequential version will be as below:

First version - Basic point-to-point communications
MPI implementations allow a user to launch several processes which will each have a defined numerical identifier, its rank. Conventionally, we will consider that the master is the process which has the rank '0'. All other processes are slaves. In this program, the master divides the array into sub-arrays and sends these to each slave. Each slave will then calculate the sum of its sub-array. In the case where the size of the array is not an even multiple of the number of slaves, the master will finish the remaining work by calculating the sum of the last values of the array (see figure below).

For each process, the source code of the program is identical and thus the executable code is, also. The code therefore must contain both the slave and the master parts. The part that will be executed depends on the rank of the process.

In this first version, the work is divided into just two parts:

This program will be explained step by step.

First, for using MPI functions, we must include the file  which contains the prototypes of the required functions. The size of the array is next defined by. and  will be used by the   and the   functions. Two prototypes of functions are declared. These functions contain the code for the master process and for the slave processes, respectively.

The main function chooses whether it should execute the master part (if the process rank is 0) or the slave part (for any other process rank.) The function begins with the  routine that must be called before any other MPI functions. This routine performs various initialization functions. Next, the rank of the process is obtained by calling the  function and, depending on the result, the master part or the slave part is executed. At the end of the computation, the final routine  is called. It performs various administrative tasks associated with ending the use of MPI.

Two declarations not found in the sequential version of the program are included in the master: the variable, which will store the result in each of the two slaves, and the   variable (whose type is defined by MPI), which is needed by the   function.

The computation part is now replaced by two calls to  and. The arguments of the  function are the address of the first element to send, the number of elements to send, their type (the more common MPI types are ,  ,  ,  , ...), the rank of the receiver, the tag of the message, and the communicator. In the simplest usage, the communicator would be, which includes all the processes sharing in the execution of the program. The arguments of the  function are the address of the receive buffer, the maximum number of elements to receive, their type, the rank of the sender, the tag of the message, communicator, and the status. For a common message, the type, the tag and the communicator must be the same (see figure below).

The first half of the array is sent to the first slave and the second half of the array is sent to the second. In each case, the size of the sub-array is. Next, the result is received from the slaves, stored, and added to the final sum.

Before it can receive the computed sums from the slaves, however, each slave must first sum the elements of the sub-array it has received from the master. The slave then sends the result back to the master.

When several messages are sent to the same process in an arbitrary order, the tag argument allow this process to distinguish between these messages and to receive them.

For execute this program with a lam implementation, the lam daemon must be started:

$ lamboot

Next, mpicc and mpirun are used for the compilation and the execution:

$ mpicc ./source.c $ mpirun -np 3 ./a.out

The option -np specifies the number of processes to launch. In this example, it must be three (one master, two slaves). The program  creates an MPI environment, copying   to all three processors and running each one with the appropriate processor number set.

Second version - Adaptiveness to the number of processes
This basic program has two problems:
 * The program needs two slaves for running correctly and cannot adapt it-self to the number of processes available
 * The master receives the data in a predefined order (the first slave and then the second). However the second slave can finish before the first

This leads to this second version:

For the first issue, the master needs the number of processes to determinate the size of the sub-array (which will be stored in the step variable). The  function gives this indication in the size variable, so   is divided by the number of slaves, namely   −1. The array is next sent to slave and while the slave will compute, the master will finish the work if it is necessary. It will then receive the result and add these to the final sum. For solving the second issue, the master will receive result from any source. This leads to the use of MPI_ANY_SOURCE in the  function in place of the rank of the process.

The slave does not need to know the number of processes but does the size of the sub-array that it has received. For this we will use the status argument. Actually, status is a structure that contains three data: the source of the message (useful if  is used), the tag of the message (if   is used), and the error code. Additionally, we can access to the real length of the received data by using the  function and the status argument. The count variable is the length of the sub-array.

This version of the program can be used with any number of processes, even 1. In this special case, the master will do all the calculations.

Unfortunately, this program is not adapted to MPI because, there is a lot of data transfer and a little computation. While MPI is designed for non-shared memory operation, there must be more computation than data transferring for losing the less possible time in message. We could improve this program by sending only the first number and the last to sum (and to add all integer between these), but in this case only geometric sum can be calculated.

Integration by the Simpson method
The purpose of this program is to calculate the integral of a given function by the Simpson method. This example is more adapting to MPI, because it requires more computation and less data-transferring than previously. The mathematical equation is:

$$\lim_{n\rightarrow\infty}\int_{a}^{b}f\left(x\right)dx=\frac{b-a}{3n}\left[f\left(x_{0}\right)+4f\left(x_{n-1}\right)+f\left(x_{n}\right)+2\sum_{k=1}^{\frac{n}{2}-1}\left[2f\left(x_{2k-1}\right)+f\left(x_{2k}\right)\right]\right]$$

In C programming, the sequential version is:

First version - User-defined type
The work to be done is a sum like in the precedent example (an array with different coefficient to each boxes). The work will be divided as shown in the figure below.

The sum is divided and calculated by the slave and the master calculate the other values and complete the work if necessary as before.

The domain of the sum will be sent to each slave and they will evaluate several return values of the function and sum these. The information that will be sent are the beginning of the sum (begin), the difference between each value (step) and the number of value for which the function must be evaluated (two double and one integer). However, the data send by the  routine must have the same type. Then, for minimizing the number of message to send and so for optimizing the program, a MPI type will be created and used for sending these data.

Generally, the data to send must be grouped and minimized for reducing the time wasted in communication (sending the minimum of message and with the minimum of data). So, two integer must be stored in a array and sent in a unique message rather than sent in two different messages.

Since the division of the work is faster than the work it-self, when a few processes are used, the master will wait a relatively long time for the result of the slaves. In this program, when there is less than a defined number of processes (LIMIT_PROC), the master will participate to the computation (namely, the work will be divided by the number of processes rather than the number of slave).

All the routine used for creating the MPI type are regrouped in the function Init_Type_Domain for simplifying the code. The function  is used for creating the new type and store it in Domain. This function need 5 arguments: the number of blocks that the new type will contain (in this case two doubles and one integer); the number of each elements of these blocks in an array (one double, another double and one integer); an array of the displacement of each block in the message; an array of these types; and, the address of the variable which will contain the structure. The displacement of each blocks is obtained by the use of the  function which give the length of a. It is the equivalent to the  function in C. The length of a MPI type is store in a   variable.

An other possibility would be to declare a structure that contains a array of two doubles and a integer:

Second version
Two different methods have been used for determining the number of operations that the slave must realize. In the first example, the slave use the status argument of the  function. In the second, this number was directly sent with the data. An other way is to obtain this by the same way that the master fixed this data, namely with the number of processes. For minimizing the quantity of data-transfer, we will use this last method (this version is just a optimization):

Product of a vector and a matrix
The point of this program is to calculate the product of a vector and a matrix. In C programming, the sequential version is:

First version - Broadcast
For parallelizing this program, the matrix will be divide by groups of lines and each part will be sent to a different slave while the vector will be sent to every slave (see figure below).

Sending the same data to each slave can be done by broadcasting these data with the  function which must be called by all the processes.

The  function requires fewer arguments than the   and the   functions. The  function requires the address of the buffer that contains or will contain the broadcasting data, the number of entries in the buffer, these type, the rank of the broadcast root (the process that will send the data) and the communicator. There are neither tag nor status arguments because they serve to differentiate messages and to give information about the receiving data and in this case, all processes are involved in the broadcast message (so, there is no need to differentiate message) and the information stored in status are known (the source is the broadcast root, the length is the number of entries and there is no tag).

When the master receive the data, it must reorder it because the order of receiving is not specified. For this purpose, the status structure contains the source of the message which is used for reordering and composing the vector.

In this example, the matrix is stored in a one-dimensional array in place of a conventional two-dimensinal array. It is possible to send a multi-dimensional array with MPI, but it must be carefully allocated. Namely, the array must be stored contiguously because the first argument of sent functions is the address of the starting buffer, and the second argument specifies the number of the following values that will be sent. Then the static and dynamic allocation are:

Second version - Scatter and gather
The MPI specification provides collective communication functions, and the  function is one of these. The next version of this program will use the "scatter" and "gather" functions which, respectively, send different data to everyone and receive different data from everyone (see figure below).

Thus, the work will be divided a little differently, namely, the master will also participate in the computation.

The call to the functions MPI_SCATTER and MPI_GATHER is the same for the master as for the slaves (emphasized arguments are ignored by the slaves). The arguments are:

Note that in the first case, the master sends data to itself and in the second, it receives data from itself. In this example, the matrix is divided by the number of processes and the master sends the first part to itself, the second part to the first slave, etc. Afterwards the master receives the first part of the resulting vector from itself, the second from the first slave, etc.

Cellular automata
In this example, we will code a cellular automata. A cellular automata is the evolution of a matrix on which we execute a defined function until there is convergence or cyclic phenomena. The function return a value for each point of the matrix depending of the value of his four neighbors. The border of the matrix will have the same value than the border of there opposite side. The resulting matrix will be a torus. In C programming, the sequential version is:

First version - Deadlock
The matrix will be divided by group of lines like in the figure [fig:vect]. For calculating the new part of the matrix, the functions applied need the values of points that belong to other parts of the matrix and then, each process will calculate the new matrix and exchange the first line and the last line with its two neighbors (see figure below).

While the processes share their data, a dead-lock can occur. A deadlock is a blocking state of a program due to the fact that one process is waiting for a specific action to be taken by another process, but the latter process is waiting for a specific action to be taken by the former process. This phenomena leads to a permanent waiting state (see figure below).

A deadlock can occur in this code because the MPI_SEND and MPI_RECV functions block the program until they are completed, namely, until the receiver receives the message sent or the sender sends the message to be received. If all the processes perform the same code (excluding the master), process one will send data to process two, process two will send data to process three, etc. Process one will wait until process two receives its data, but this will never happen because process two is also waiting until process three receives its data. Because the communication is cyclic, the program is blocked. As a first solution, we can change the order of sending and receiving on each even process.

In this example, the master and the slave have almost the same code, so it is not necessary to divide the code in two functions (the code specific to the master is simply be preceded by a condition on the rank).

While the master wait for data from the process 1, the process 1 send data to the master. Then it wait for data from the master while this one send data to its. The code will have the same behavior for all processes and thus is safe.

Second version - Non-blocking send and receive
A second solution is to use non-blocking send and receive: these functions are called and give immediately the hand to the process. Then, the process can make some computation and when the data of the message need to be accessed, it can completed it by calling some appropriate functions. Program using non-blocking communication functions can be faster. In this second version, all the functions will be completed just after that all send and all receive are begun.

In the previous example, the dimension of the matrix should be a multiple of the number of processes because the remaining lines were not send to any process. In this version, the master send these lines to the last process and receive the resulting line separately.

The MPI_Isend and the MPI_Irecv (I means immediate) functions need a supplementary argument: the address of a MPI_Request variable which will identify the request for a later completion. The status argument will be given to the completion functions. MPI_WAIT is used for complete the call to the previous functions (identified by the first argument) and will wait until the functions are effectively completed.

Third version - Sendrecv
The next version use a send-receive function: it is equivalent to call a send and a receive function in parallel. Only the while loop differ:

The MPI_SENDRECV function need arguments which are essentially the same that are required by the MPI_SEND and MPI_RECV functions.

Fourth version - Ring topology
This last version is radically different, in which that the topology used is a ring topology. A new matrix is calculated on the process 0 and then is sent to the process 1. After one iteration, this process send it to the process 2, which calculate the new matrix and send it again to the next process. The last process will return the matrix to the master and the cycle will continue until the number of iteration reach a defined constant (see figure below).

With this topology, several different data can be computed in the same time. Although in this example the operation applied on the data are the same, the processes can carry out different kinds of operation. Only one matrix will be sent in the ring. It is however possible (and it is the advantage of this structure) to send a second matrix just after.

The number of iterations is stored with the matrix, in an additional element. It will serve to determine when to stop the loop. When one process will reach the maximum number of iterations, the matrix will then be transferred on all the other processes. It is indeed necessary for stopping these properly because else, they will continue their loop and never stop.

The MPI_SENDRECV_REPLACE function is similar to the MPI_SENDRECV function, though it use the same buffer for sending and receiving the data.

Differentiation
This program will calculate the numerical value of the derivate of a functions in multiple points by using the finite elements method. The equation is: $$f''\left(x\right)=\lim_{h\rightarrow0}\frac{f\left(x+h\right)-f\left(x-h\right)}{2h}$$

However, it is numerically difficult to divide by 0 and h must not be chosen arbitrary (see figure below).

The optimal value of h is unknown and thus, the algorithm will decrease a started value of h until that the precision began to decrease (the difference between two derivate calculated with different h must decrease). In C programming, the sequential version is:

First version - Farming topology
Since the number of loop is variable, the time of execution cannot be predicted. This program send a derivate to calculate to each processes and when one have finish (not necessarily the first), he resend immediately data to this one. These data and the result are gathered into two arrays (deriv[] and result[]).

Second version - Completion of send and receive
The second topology illustrated looks like to a ring topology and introduce a new routine: MPI_REQUEST_FREE. The master will always send data to the process 1 and receive the result from any others processes (see figure below).

Since the code of the slave is similar to that of the cellular automata (in the version using a ring topology), only the master function will be described. For avoiding deadlock, only non-blocking send will be used (the non-blocking receive is used here for improving performance).

When the master finish to send enough data (for all processes), it execute a new loop. It receive a result and initialize a new data simultaneously and next, it complete the send of the data that lead to the result that it just receive and he resend in the ring a new data. Actually, if the master receive the result of a data, this means that the send of this data is completed and there is no need to complete the send. The MPI_REQUEST_FREE function allow to free a buffered request without checking when this request is logically completed.

Communicators and groups
The collective communications (like MPI_BCAST, MPI_SCATTER and MPI_GATHER) send data on the processes that belong to a same group. MPI provide functions for managing groups and communicators. This allows to use collective communications on specified processes and thus to divide a network into groups which can execute different task.

For example, different operations can occurred on a matrix (trace, transpose, inversion, diagonalizing). For each operations, a group will be defined and each processes will communicate with the other processes of its groups by using collective communication without disturbing other groups.

A communicator is a object which specifies a communication domain. It is associated to a group. A group is created from existing groups and the initial group is the group of the communicator MPI_COMM_WORLD which contains all processes.

First version - Creation of communicator from a group
The first method for creating new communicators is to create groups from this first group and then to create the communicators of these groups.

In this program, data are broadcast only on the even-ranked processes. This is achieved by creating a communicator which will contain the group of the even-ranked processes. First, the initial group of MPI_COMM_WORLD is given by the MPI_COMM_GROUP routine. The new created group contains the $$\frac{\left(size+1\right)}{2}$$ processes that have a even rank in the initial group. The MPI_GROUP_INCL function required an array of the ranks of the processes of the first group that will belong to the new group. Then, MPI_COMM_CREATE create the communicator of the new group and if the process have a odd rank, it participates to the broadcast. The group is free by MPI_GROUP_FREE.

The MPI_GROUP_SIZE and the MPI_COMM_RANK functions are similar to MPI_COMM_SIZE and MPI_GROUP_RANK. These last are just shortcut:

However, if the process that call MPI_GROUP_RANK don't belong to the group specified in argument to the function, the value return in rank will be MPI_UNDEFINED whereas a call to MPI_COMM_RANK will not work and will stop the program.

Second version - Creation of communicator from a communicator
One communicator can also be creating without using group, directly by splitting a existing communicator.

All the processes will be classified in a new communicator, depending of his color. Namely, if two processes have a color equal to 1 and one process have a color equal to 2, two communicators will be created, one for each groups. The third argument required by MPI_COMM_SPLIT is used for ordering the processes in the new communicator (this will change the rank of the new processes). Here, the same value is given for all processes.

Environmental management
Finally, environmental management functions exist for getting the name of the node on which a process run or for measuring the time taken by a part of a program (for example).

Other possibilities
There is many other functions that are not mentioned: there is different kinds of point-to-point communication functions; MPI allow user to define datatype by a lot of different functions; there is also other collective communication and reduction functions; and, more functions for using communicators and groups.

MPI defines many useful constant, among those,  ,  , ...

MPI can also be used in an advanced way for managing process topologies. Namely, the MPI implementation can exploit the specificity of a physical network (for heterogeneous network) by privileging for example the transfer of message on the fastest connection.

Prototype of basic functions
For more information on these MPI functions, report to the man page:

int MPI_Init(int *argc, char ***argv); int MPI_Finalize(void); int MPI_Comm_rank(MPI_Comm comm, int *rank); int MPI_Comm_size(MPI_Comm comm, int *size); int MPI_Send(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); int MPI_Recv(void* buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status *status); int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count); int MPI_Type_extent(MPI_Datatype datatype, MPI_Aint *extent); int MPI_Type_struct(int count, int *array_of_blocklengths, MPI_Aint *array_of_displacements, MPI_Datatype *array_of_types, MPI_Datatype *newtype); int MPI_Bcast(void* buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm); int MPI_Scatter(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvcount, int root, MPI_Comm comm); int MPI_Gather(void* sendbuf, int sendcount, MPI_Datatype sendype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); int MPI_ISend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request); int MPI_Irecv(void* buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request); int MPI_Sendrecv(void* sendbuf, int sendcount, MPI_Datatype datatype, int dest, int sendtag, void* recvbuf, int recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Status *status); int MPI_Sendrecv_replace(void* buf, int count, MPI_Datatype datatype, int dest, int sendtag, int source, int recvtag, MPI_Comm comm, MPI_Status *status); int MPI_Wait(MPI_Request *request, MPI_Status *status); int MPI_Request_free(MPI_Request *request); int MPI_Group_rank(MPI_Group group, int *rank); int MPI_Group_size(MPI_Group group, int *size); int MPI_Comm_group(MPI_Comm comm, MPI_Group *group); int MPI_Group_free(MPI_Group *group); int MPI_Group_incl(MPI_Group *group, int n, int *ranks, MPI_Group *newgroup); int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newgroup); int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm); int MPI_Wtime(void); int MPI_Get_processor_name(char *name, int *resultlen);

As usual in the C programming language, the "address of an array" is really the address of the first element of the array.

Prerequisites

 * knowledge about C programming: C programming language, Wikibooks:C Programming

title: Message-Passing Interface


text:
The Design and Organization of Data Centers/Introduction

Introduction to the topic
The design and organization of your company's data center has a direct impact on its day-to-day operations. The following are just some of the considerations involved:

 * Capacity. Your data center's capacity needs to be optimized in order to ensure that it can handle its workload.  In this regard, there are three common approaches to capacity planning:
 * Start with the most economical size then expand it, careful not to increase capacity beyond actual need.
 * Start with the size that best will be able to handle the projected initial capacity, then expand it as need increases.
 * Start the data center with a size that will handle the highest possible load that could conceivably be initially placed on it, and expand vigorously to keep ahead of load.

 * Expandability. The data center should be scaleable so that if you choose to increase capacity, you will be able to do so without having to redesign the entire data center.

 * Uptime. You will need to determine what level availability you will need.  A data center that is designed for 99.99999% availability(3 seconds of outage per year), for example, will require extremely careful planning, as well as a commitment of resources that would not be necessary if you only are aiming for 99.99% availability(52 minutes of outage per year), and yet even a 99.99999% available system may not be adequate for a life safety application, where a fraction of a second of outage could cause a severe risk of harm.  It is important to keep the availability requirement in mind during the planning and design of your data center.

 * Length of outages. Closely related to uptime, you will need to determine the maximum acceptable length of outages.  For an E911 service, for example, 1 second of outage would be 1 second too many; for a business-critical service, you typically will perform a cost-benefit analysis.  Length of outages is typically quantified as mean time to repair.

 * Investment. How is the data center financed?  How much money is available?  How is it best spent?

 * Location. Will the data center be located at your corporate headquarters, or off-site?  Will you rent or own the location?  Will the data center be co-located, for example, in a telephone-company central office or a carrier hotel?  You will need to think about considerations as diverse as the cost of communications network connections, the cost of providing benefits to any employees that may work in the data center, and the legal environment.

The need to deliberately design and organize
To maximize uptime, minimize length of outages, and optimize capacity subject to resource constraints, one should deliberately design and organize the data center. The following considerations merely highlight the importance of careful planning:

 * Large investment. When you consider the costs of network connections, power and utilities, and rented or purchased space--to name only a few things--you can see the cost of starting a data center is more than the cost of computers and network equipment alone.  After you start the data center, there are still the costs of operating it:  the annual operating costs of a data center can easily reach into the tens of millions of dollars.  It is important to optimize the allocation of resources to get the maximum "bang for the buck."

 * Hard to change. Once a data center is up and running, it is very hard to change its design without bringing the entire data center down.

 * Hard to fix. Generally, design problems are expensive to fix after the design has already been implemented.  Thus, if your customers experience a problem that is inherent to the design of your data center, the cost of repair may be prohibitive.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
The Design and Organization of Data Centers/Planning

Design requirements
Initial equipment list

Initial schedule

Expected growth

Growth schedule

Budget

Level of flexibility

Impressing visitors

Designing for growth and flexibility

 * Infrastructure is a time limiting factor
 * Lay out possible growth paths
 * Compatibility with near term requirements


text:
The Design and Organization of Data Centers/Location

Co-locate

 * telephone company central offices
 * carrier hotels

Cost
Shop around to compare prices. Many co-location centers give initially inflated prices.

Suitability

 * Proximity to multiple major network backbones.
 * Proximity to customers if that is a consideration.
 * Distance to central office

Transportation

 * Proximity to public transportation
 * Proximity to highways

Availability of emergency services

 * fire insurance category

Safety from water damage
HVAC can fail in such a way that water comes out. Look out for pipes, vents, and ducts above your equipment. Air conditioners can freeze up and then thaw, water heaters can fail, ventilation ducts can pack with snow, toilets can overflow, etc. The building may be in a flood zone - does the insurance cover the damage? How long will it take to file the claim? Document who you must contact before the disaster happens.

Natural hazards

 * Wildfires
 * Hurricanes
 * Tornados
 * Earthquake
 * Mudslide
 * Tsunami

etc.

Manmade hazards

 * Proximity of pollution sources
 * Transportation-related risks
 * Risk of crime, violence, terrorism, etc.


text:
The Design and Organization of Data Centers/Redundancy

Everything will eventually fail. Redundancy allows you to minimize the damage of a system failure.

Failure characteristics
Planned vs. unplanned

Total vs. partial

Frequency of failure

Length of partial failure or outage

Structure
Ladder

Mesh

N+1

Implementation
Active/active

Active/passive

Human Factors
Notification

Unattended problem resolution

Documentation and problem clarity

Allowance for no-impact maintenance


text:
The Design and Organization of Data Centers/Electrical

Types of Service

 * 120 V 1 phase
 * Hot, Neutral, Ground
 * 240 V 1 phase
 * 2 Hots, 1 Ground
 * 208 V 3 phase
 * 3 Hots, 1 Neutral, 1 Ground
 * 208 V 1 phase
 * 2 Hots, 1 Ground
 * 480 V 3 phase
 * 3 Hots, 1 Neutral, 1 Ground
 * 48 V DC
 * Positive & Negative

Uninteruptable Power Supplies
Absolutely necessary

Central UPS
All equipment stays up for same length of time.

Rack-mounted UPS
Put batteries where they are needed most. Easy redundancy with dual power supply computers.

Server-mounted battery
Google servers are connected directly to the AC feed with no UPS in the middle. Instead, each server has its own 12 VDC battery, which is used to power the server during power outages.

Brick UPS
Good for smaller installations. Easy redundancy with dual power supply computers.

Sizing
Loads that cannot tolerate any outage shall be placed on UPS power. Critical systems, such as the air conditioning cannot tolerate a brief outage, so they should be supported from generator power. Battery run time for UPS loads are dependent upon the budget and level of reliability required. With a well designed backup generation system, UPS runtime may be minimized since the gensets will be online in 8 to 20 seconds.

Power Interruption
Plan for unattended shutdown and restart whenever possible.

Consider remote alert of power interruption.

Make sure the KVM is also on UPS.

Make sure you have emergency lights and flashlights for working in the dark.

Estimating remaining run time

Restart of UPS after full drain

Redundant UPS systems
Rack-mounted - side to side redundancy.

Central UPS - need two of them with separate breaker boxes/PDUs and color coded system.

Generators
Determine your local outage characteristics for your power supplier. Do they tend to be infrequent, but long? Common, but short?

On-site vs delivery contract

On site minimizes need for large UPSes

Environmental issues and permit requirements for fuel storage

Layout and Redundancy
Look for computers with dual power supplies, or, less preferably, make sure you have redundant boxes per function. This allows for rearranging power cables and moving a box from one area to another without turning it off.

Maintain side-to-side redundancy by placing power strips on separate breakers or UPSes.

Remote Power Control
Remote power on and off

Resetting stuck machines and routers

Power on sequencing

Electrical Grounding/Earthing
All metal server or network racks and cabinets, overhead raceways and metallic conduit must be properly grounded to each other and to ground.


text:
The Design and Organization of Data Centers/Air Conditioning

Sizing
Air conditioners are rated by tonnage. One ton equals 12,000 BTU per hour.

Equipment heat output is rated in BTUs.

Conversion rates and guides can be found in the appendix.

Use this to size the cooling load! Northern Air Conditioning Orange County NY
 * Free online HVAC heat load calculator

Redundancy issues
Your air conditioner will fail. It is only a matter of when and whether you have one to back it up.

Emergency Fan ventilation
Can you ventilate into the building or the outside? What is the outside summer temperature?

Multiple air conditioners
Spare

Over-sized

Mov-n-cools

Alarm fail over

Thermostatic fail over

Differential temperature settings

Layout your air conditioners to minimize temperature variation across the room.

Humidity Control
Found in larger systems

Eliminates static problems

Requires addition of plumbing

Hot Aisles and Cold Aisles
Data centers are often separated into hot aisles and cold aisles. The back of the racks or cabinets face the hot aisle, because the hot air is blown in that direction. The fronts of 2 rows of cabinets face each other, and cold air is blown into this aisle to be forced through the front of the servers and out the back into the hot aisles.

Return air ducts are above the hot aisles, while cold air is blown up from underneath the floor into the cold aisle and sometimes into the front of the server cabinets.


text:
The Design and Organization of Data Centers/Fire Protection

Fire alarms systems are designed to detect and notify building occupants of a possible fire condition, so that proper reactive steps can be taken.

Some examples of fire alarm equipment include the following:
 * Smoke Detectors
 * Heat Detectors
 * Beam Detectors
 * Pull Stations
 * Sprinkler System Monitoring Equipment
 * Audible and/or Visual Notification Appliances

Sprinkler systems
Water and computers don't mix. A damaged sprinkler head will spray water regardless of a fire, and smoke detectors can be set off by dust.

Avoid sprinkler systems that hold water, instead use a pre-action sprinkler system, preferably a double-interlocked pre-action system. With a double-interlocking pre-action valve, water is prevented from entering the sprinkler piping until two different kinds of heat/smoke detecting devices trigger the valve to open. The typical devices used are pneumatic actuation by a sprinkler head activating and releasing pressurized air stored in the piping and an electric actuation from heat or smoke detectors.

Halon
Not used any more

Energen
More expensive, but free refills, non-toxic

May require separate under-floor nozzles, and ceiling tiles restrained with clips.

Fire Extinguishers
Special fire extinguishers

Low residue

Expensive

Power and Air conditioning issues
Emergency shut off for power and air conditioning

Very Important stuff.
 * [news:sci.engr.heat-vent-ac sci.engr.heat-vent-ac] newsgroup

 * Free online HVAC heat load calculator


text:
The Design and Organization of Data Centers/Security Systems

Reasoning
More difficult entry

Selective access

Entry evident

Traceable access

Design
Determine who should have access to what

How many layers of access will there be

Consider using locking cabinets but not using computer locks

Consider locks on interior doors and fire cabinets.

Physical keys vs. card pass system

Key Management
Centralized key box for computer keys

Room keys may need to be given to CEO, landlord, and fire department for placement in Knox box.

Pass Card Systems
For card pass system, make sure entries are logged.

Avoid double-door magnet systems for passcard entry.

Proximity or RFID cards are harder to forge and easier to use

Security Systems
Use a combination of motion detectors and door sensors. This does several things:

 * Door sensors are good to minimize air movement alarms.

 * Reminds personnel to shut off the alarm system upon entry.

 * The door chime announces entry when there is no line of sight to the door.

Security systems are cheap compared to your other expenses. Splurge on the goodies, such as alarm pads with full English displays.

Also consider having security system monitor the power, temperature, and fire with remote callout alerts.

Visitors and Contractors
Use sign-in book for contractors and record name, company, identification number, date of entry, phone number, and purpose of visit so that problems can be traced.

I question the usefulness of having all visitors in a tour sign in.

Make sure all visitors are escorted by qualified personnel.


text:
The Design and Organization of Data Centers/Layout Considerations

Entrance Facility
Consider where network and power comes into the building and where it will enter the data center, and how this will affect location of main edge routers, where cross connections will take place, placement of power transformers switches and UPS units. You may have multiple electrical entrance facilities for redundancy.

Space for wiring
Determine use of raised floor and/or overhead cable trays.

Some rack-to-rack cable organization will be necessary.

Rack Layout
It is crucial to lay out your racks, shelving, and stand-alone systems with accuracy of a few inches when considering location over raised floor access ports.

You should have a minimum of three feet between rack front and back to allow for opening of doors.

A 6' rack spacing interval is recommended as floor tiles come in 2'x2'.

The location of the wheels and/or feet at the bottom of a rack are critical to being able to lift floor panels.

Space for other necessities
You may want to have space for a desk with monitor, if you don't have a formal office or NOC on the premise. You will want to have storage units for copious documentation and spare parts, unless you just use an empty rack, and possibly a place to drop old hard drives for secure disposal.

Phones and switches
Place light, power, and fire switches in an easy to reach place. If you have two entrances, have light switches at both entrances especially if main lighting is normally kept off.

Make sure phone is in easy reach of fire suppression cut off switch, NOT the other way around.

Mechanicals
Consider putting "non-computer" assets in separate rooms. You can contain leaks easier, as well as keep service technicians away from servers, increasing security, and reducing the need for supervision.


text:
The Design and Organization of Data Centers/Contractors

Finding possible contractors
Landlord may do some physical work. Remember to deal with lease issues.

Look for contractors experienced in data center construction.

Get references, check them using a reference call checklist

Getting quality quotes
Get a minimum of three quotes.Some will completely ignore what you say is important.

Write up quote specifications in detail. This allows you to send the same information to multiple vendors, and compare the quotes fairly, as well as hold vendors to what you want done in the future.

Suggested quote requirements and specifications:

cost analysis and comparison between quotes.
 * Break down costs into line items which allows for easier

 * Three similar project references.

 * Completion dates based on date of signed PO.

 * Level of documentation to be delivered.

 * A thorough cleaning. You don't want dust in your computers and causing false fire alarms.

best solution.
 * Commentary and explanation on why their solution is the

Common problems
Watch out for bait and switch. Find out if the contractor or project manager that comes in and does the quoting will be the one actually working on the job.

For town permits, use one and only one point of contact, as this can get quite confusing and is critical in the final stages.

Always get quotes for jobs over a certain level, say, $10,000. This can save money and keep your favorite contractors quotes low.

Coordinate between your contractors. When installing a drop-ceiling in combination with a gas fire suppression system, make sure that the tile retaining clips are put into place AFTER any wiring has been done in the ceiling, as security and phone wires may be run up there.

Contractors won't do all your work. Consider having an assistant to do gopher and grunt work such as building furniture.

Remember, time used to get the quote adds on to the final completion date.


text:
The Design and Organization of Data Centers/Racks and Cabinets

Rack-mount systems in general
The quality and layout of your racks and cabinets can save you hours in frustration, keep your equipment organized, and reduce the length of downtime by speeding repairs.

When comparing racks and cabinets, examine the items in person. Ask to see some in a data center near you. Buyer beware.

Vertical columns with holes for mounting equipment

Over the years several different rack mounting scemes have come out, varying from 16" to 49". These widths are measured horizontally from centre of hole to center of hole. The 2 surviving standards are the 19" and the 23". The 23" standard is used by the telecommunications industry and virtually everyone else uses the 19" standard.

Equipment intended for rackmount is sized vertically by "U" units, which equals 1.75 inches.

Compliant hardware is built in multiples of this 1.75" unit.

There were tape measures made that were calibrated in rack units, they are difficult to find.

Note that the holes are unevenly spaced. Narrow gap, wide gap, wide gap and back to narrow. Your equipment should always line up at the top and bottom with narrow gaps. Doing otherwise will leave you with a sloppy unprofessional installation.

Recently, 1-U high computer servers have become available.

Open racks vs. closed cabinets
Open rack systems are more useful for short equipment with many wires, like hubs, switches, and routers.

Closed cabinets are more useful for deep things like servers, and when you want to lock down physical access.

Round threaded
10-32 or 10-24

Round unthreaded
Requires clip-nuts

Square punched
Square-punched is often referred to as Compaq-style.

Square-punched requires the use of clip or cage nuts and can be inconvenient unless sliding rails are designed specifically for that style.

When using square-hole racks, quality nuts are very important. There are at least two styles: clip nuts have a thin metal clip that clips over the edge of the column and are easily dislodged; cage nuts clips into the square.

Front bracket only
Used for lighter equipment, such as network devices and KVMs.

Four post
Used for larger equipment.

Shelf
Great for monitors, keyboards, and oddly shaped equipment.

Sliding rail
Mounts on front and rear rails.

Sliding rails are mounted individually to the side columns and then the computer is slid into place.

Some rail mounts will interfere with center-side columns and the center columns must be removed.

Use sliding rails for mounting computers, whenever possible, as it makes mounting the hardware easier and allows you to slide the machine out for maintenance.

When using sliding rails, ALWAYS lock the computer in place with front-mounted screws or risk catastrophic tipping.

Whenever possible, when ordering equipment, specify rail mount.

Rack Features To Look For
Always make sure shelves are available for any rack system you buy, and buy a few extra; they come in handy.

Front-column to mid- and rear-column spacing should be adjustable and is critical to easing the mounting of computers.

Always order deep cabinets, as many servers are quite deep, and you will need space for routing the wires. Cabinets should be about 32-36" deep, on the external dimension.

Some racks are connectible with a kit that removes the sides and ties the cabinets together to make an extra wide cabinet making it easier to run wires between sets of 19" racks.

Fit and finish count. Look for dangerous undebarred edges.

Determine if you can specify keyed-alike doors

Installation Suggestions
Whenever equipment uses the rear or mid-rails, try to keep the same type of equipment in the same rack.

When mounting many odd-sized units in one rack, consider using shelves instead of rail-mounts.

Always mount equipment in such a way that the side of the box that needs access to the cables is on the same side. This means most hubs and switches and some routers should actually be mounted on the rear rail. This means you don't have to pass cables from front to back of the cabinet.

Use large-head Phillips-head screws, called truss head in catalogs. Better yet are rack specific screws. These are truss head screws that have a unthreaded portion to help align the screw. Do not use thread-cutting screws with little teeth on the tip of the screw, as sold by some network equipment companies. You can cross thread these and ruin your threads.


text:
The Design and Organization of Data Centers/Wiring

Keeping your wiring organized is a never-ending struggle. Make sure to make it as easy as possible.

fire safety considerations
types of cable:
 * riser
 * CM, CMG, CMx
 * plenum
 * low-smoke zero halogen

Under Floor Organization
Place your major power lines in properly grounded metal conduit.

Put all under-floor fiber connections in plenum-certified conduit, such as the orange crinkle tube.

If using electrical whips underneath floors, make sure the socket boxes are physically restrained in place and marked with the location on both ends.

Run all conduits and wires square to the floor panels to allow for easier under-floor organization.

When placing electrical power whips underneath the floor, take the time to make sure they are cut very close to length, as extra loops of this cable can take up a lot of space under the floor.

Physically separate power from network cabling as much as possible. You may have only power conduits and cables under the raised floor, and network cabling in overhead cable trays, or vice-versa.

Rack to Rack Connections
Consider whether you want to use network switches and hubs in each rack and connect those to a central location, or use patch panels that go from rack to rack.

Use patch panels and other techniques to minimize how often you have to go into the floor. You should not need to lift floor panels to install a new computer.

Keyboard Video Mouse Switches
Consider using your KVM connections sparingly, using only one or two per rack and moving them when necessary for maintenance.

Buy a high-quality KVM, as quality counts, and go with an on-screen menu that allows you to label the computers.

Make sure your KVM allows for keyboard switching.

Compare against serial terminal servers if you have Unix boxes.

Use true KVM cables. Cables that you zip-tie together are harder to remove later. Also, the video connection that uses screws is shorter than the PS/2 connections, to reduce cable pull out.

Cable Management
Many products for rack cable management.

Velcro zipties are reusable.

Use Ethernet cables of many color and lengths. Consider color coding by length. Use only booted cables as they won't get caught up when being moved around.

Consider putting a unique serial number on both ends of every single cable going into your data center.

Use the shortest power cables possible. Put serial numbers on the power cables and consider using black and beige colored cables to show side-to-side redundancy.

Pre-plan location of power outlets on rack systems.

Planning for Expansion
Plan for extra analog phone jacks during construction, as they are often used for modems on equipment. Consider making them 56K leased-line capable.


text:
The Design and Organization of Data Centers/Outfitting

Furniture
Put EVERYTHING on wheels

 * Computer Desk

 * Rolling Chairs

 * General storage - shelving, cabinets, or bookcases

 * Key box

Tools

 * Cordless, keyless-chuck power screwdriver

 * Phillips and slotted screwdrivers

 * Extra long screwdrivers

 * Short ratcheted screwdrivers

 * Wire clippers

 * Socket set

 * Adjustable wrench

 * Allen wrenches

 * 66 and 110 punchdown tools

 * Tone generator and sniffer

 * And a cloth tool bag to put it all in.

Equipment

 * 6 foot fiberglass ladder - Fiberglass is safer than aluminum around electricity

 * Fans for cooling

 * Cheap analog phone (for testing lines)

 * Two suction lifters - for raised floors

 * Label maker

 * Pallet Jack - Delivery drivers will often not have them

 * Rechargeable wall mounted flashlights near all doors

 * Cordless phone with headset - Typing is much easier.

 * Fireproof lidded wastebaskets - Wastebaskets can be a source of fire, but wastebaskets are key in maintaining a clean workspace.


text:
The Design and Organization of Data Centers/Documentation

Labeling
Neatness begets neatness.

Use a label maker. It means your labels look neat, uniform, and are easy to read.

Label front and back of machine with name, IP address, & MAC Address. This means you are less likely to pull the wrong cable or shut down the wrong machine.

Label multiple NICS on a single machine.

Document VLANs on switches to allow installation without a network engineer.

Organizing your documentation
Keep documentation where it is needed.

Make sure it is easy to update.

Self adhesive vinyl pockets - great for walls and cabinets

Folder pockets - great for three ring binders

Consider a wiki or FAQ-o-matic, but have paper backups printed regularly.

Understanding of a problem leads to quicker resolution. Documentation can be part of that.

List of documentation to have

 * Phone lists - near phones
 * Company phone list
 * Tech support phone list with contact numbers
 * Loading dock height/ doorway dimensions

 * Computer and network documents
 * Network Diagram
 * Start up/Shut down directions
 * machine instructions

 * Mechanical
 * buttons/switches labeled by contractor
 * Equipment maintenance schedules - air conditioning
 * Start up/Shut down directions
 * Permits posted securely


text:
The Design and Organization of Data Centers/Appendix A

Air conditioning
Common Values

Chiller calcs
Assuming that all wattage consumed will end up as dissipated heat (servers do very little mechanical work or yield very little light);

Wattage times 3.41 = BTU/hr

Example:

Server draws 10 amps at 120vac 10 amps X 120 vac = 1200 voltamps (aprox 1200 watts) 1200 VA X 3.41 = 4092 BTU/hr


text:
The Design and Organization of Data Centers/Appendix B

Towards Operational Excellence

The Data Center Journal

Email list: datacenter@shorty.com


text:
The Design and Organization of Data Centers

 * Original Author: Jeff Albro
 * Contributing Authors: Rich Hail

 * /Introduction/
 * /Planning/
 * /Location/
 * /Redundancy/
 * /Electrical/
 * /Air Conditioning/
 * /Fire Protection/
 * /Security Systems/
 * /Layout Considerations/
 * /Contractors/
 * /Racks and Cabinets/
 * /Wiring/
 * /Outfitting/
 * /Documentation/
 * /Appendix A/ - Calculations
 * /Appendix B/ - Other Resources


text:
Canadian Tort Law/Trespass to person

Some of the main intentional torts against the person are:

 * Assault
 * Battery
 * False imprisonment

Assault
Assault is intentionally causing the victim to believe that he or she will be imminently, physically contacted against his or her will. No contact actually has to occur; swinging a clenched fist at a victim is assault, even if the fist misses the victim, as long as the victim believed it would make contact. Physical harm need not occur; the harm is in the apprehension.

The apprehended contact can come either from a gesture of the defendant, or by the defendant intentionally causing an object to threaten imminent contact. Pointing a pistol in the direction of a defendant and pulling the trigger is assault, even if it was not loaded.

The belief of imminent contact must be reasonable. If the defendant showed the plaintiff that the gun was not loaded, then the plaintiff cannot sue for assault if the defendant then points the gun at him.

A threat of force, such as "I am going to shoot you", can be an assault, if the threat is imminent. "I am going to shoot you in four years" is not an assault. A conditional threat of force can be an assault, such as an armed mugging ("Give me your wallet or I will shoot you"). On the other hand, a conditional threat of force that makes it clear that force would not actually be used is not assault. For instance, a threat such as "I would punch you, if the police weren't standing right there", is not an assault. Although it seems to be a threat of violence, it is implied that violence would not actually be carried out.

One of the most common defences to assault is consent. The contact must be unwanted. (One might say, then, that lack of consent is an element of assault, rather than consent is a defence.) If someone were to say, "point the gun at me", then one cannot subsequently sue for assault. Consent can be express (specifically written or spoken), or it can be implied (by actions or words that lead to the logical conclusion that contact is wanted). For instance, if one joins a hockey game, one cannot normally sue for assault after receiving a body-check. Implied consent extends only to reasonable apprehensions of contact. Joining in a hockey game does not give all of the other players a license to commit any act of violence that they think of.

Another defence to assault is self-defence. One is allowed to threaten an imminent contact against somebody else to prevent an assault that they reasonably believed was going to happen to them. The force used in self-defence must be proportional to the threat; however, judges often give some leeway to people who use violence in self-defence. The use of force must be the only option; if the defendant could have avoided the threatened assault in another way, such as running away, then the use of force in self-defence is not justified.

Battery
Battery is an unwanted physical contact. Unlike assault, where an apprehended threat is necessary while actual contact is not, battery requires actual physical contact and does not require imminent threat. For instance, if someone is kicked while asleep, the victim never apprehended the contact before it happened. Therefore, the victim was battered but not assaulted. In practice, of course, assault and battery often happen in the same incident.

Consent is a major defence to battery. When using this defence, the defendant must show that the consent was "informed", i.e., the plaintiff knew of the nature and consequences of consenting. This often arises in medical malpractice cases. If the patient agrees to heart surgery, but the surgeon performs other types of surgery not discussed with the patient while the patient is under anaesthetic, then that is battery.

In medical malpractice cases, the distinction between battery and negligence can get quite blurry. If the surgeon does not tell the patient all of the possible major side-effects of the surgery, then does it constitute battery, as the patient did not give informed consent? Judges have tended to classify most cases of medical malpractice as negligence, reserving battery for the most clear cases of lack of consent.

Consent that is coerced or incorrectly obtained through an unlawful use of power or influence is "vitiated", meaning that it is not really consent. For instance, a doctor using his ability to prescribe drugs to coerce a patient into consenting to battery vitiates the consent. Norberg v. Wynrib, [1992 2 S.C.R. 226.]

False Imprisonment
False imprisonment is the intentional, unlawful confinement of a person to a space. The person's imprisonment need not last a long time. Nor does the confinement have to be physical; it could be applied by psychological pressure (e.g., "If you leave now, I will tell everyone that you came here to buy drugs...") False imprisonment is, not surprisingly, used mostly against police officers for arresting someone unlawfully. The Criminal Code gives police officers some protection against lawsuits for false imprisonment.

Back to Canadian Law

title: Canadian Tort Law/Trespass to person


text:
User talk:Jrincayc

Hi there. If you want I can put them on a seperate page, but I put the solution in this hidden textbox, so the users don't have to watch it if they don't want to. I will put them on a seperate page soon. --Benjamin Meinl 21:00, 8 February 2007 (UTC)
 * Okay. I think the hidden textbox is good enough.  Jrincayc 15:21, 11 February 2007 (UTC)

Hi Josh

I changed the pre tags to space syntax so that I could use bold on text that the user typed in and plain on the text returned by the server. I did that because sometimes it wasn't clear what was to be typed and what came up on the screen - my wife is currently learning to program via this tutorial and she once had trouble with that. I didn't seem to be able to do that with the pre tags - but if you know how, let me know and I'll change it back.

I plan to gradually work through the tutorial so you should see some more things added over the next couple of months.

 * Okay. That makes sense.  I will not have an internet connection for the next week or so.  Keep up the good work.  Jrincayc 14:00, 8 Aug 2004 (UTC)

Thanks for the great tutorial! It cleared up some major problems I was having with python.

Excuse me, but what do the percent symbols do? They have been put in an early part of the tut, and there is no explanation. I am avaliable at hb4477 [at] hotmail.com thanks. DOTANDCOM 21:24, 25 November 2006 (UTC)

 * If the % is between two integers, it returns the remainder (more or less) of the division. If it is between a string and a list it does printf style formating.  Jrincayc 15:45, 26 November 2006 (UTC)

Haha I'm glad to help. That tripped me up when I first started playing around with booleans and so I wanted prevent other newbies from making the same mistake. I'm in the process of learning how to program, and so I want to thank you for the python tutorial and the time that you spent making it. It's been really valuable. Cm.squared 00:37, 12 May 2007 (UTC)

Would like to hear your opinion...
Take a look into Policies and guidelines/Vote/What is Wikibooks a proposed policy decission page and cast your vote, txs. --Panic 04:33, 19 April 2007 (UTC)

It's getting better and better...
...and I am going to use the tutorial for my beginner's programming course (university) next week again - for the third time now, and with very good results and positive feedback from the students the last two times. Nevertheless, there are some small things which turned out to be a little unclear in the past, and I will try to further improve these passages during the coming week. --Siebengang (talk) 09:41, 22 February 2008 (UTC)

 * Thank you for all your work on the tutorial. I am glad that the students are finding it useful.  Jrincayc (talk) 13:33, 22 February 2008 (UTC)

Advanced Functions Example
Non-Programmer%27s_Tutorial_for_Python_2.6/Advanced_Functions_Example

Run 1 does not do the line rest = mult(a, b - 1)?

I am dividing the first example into Run 1, Run 2 etc. --33rogers (talk) 20:02, 11 April 2010 (UTC)
 * Correct. "Run 1" as you labeled it does not do the line "rest = mult ..." since Run 1 is the initial call of the function.  71.220.128.88 (talk) 03:07, 21 April 2010 (UTC)

To-Do list for Python book
Is there a To-Do list for the non-programmers introduction to Python 3? I'd like to contribute but I'm not sure where to jump in. I'm making Python video tutorials for a college course at the moment and I'm coming up with miniature assignments for each topic, programs that take less than 10 lines to solve. Would it be ok to put them in the exercises section at the end of chapters? Oldmaneinstein (discuss • contribs) 16:27, 13 November 2011 (UTC)

 * Adding exercises sounds like a good idea. Go for it. Jrincayc (discuss • contribs) 00:20, 14 November 2011 (UTC)

Translation into Malay
Hi. I know you've put this tutorial under GFDL but as a matter of courtesy I should like to inform you that I intend to translate it into Malay (ms) at Wikibooks. I spend most of my time at the Malay Wikpedia and you can contact me there. Cheers. Algazel (discuss • contribs) 08:01, 19 January 2013 (UTC)

 * Okay. Sounds good.  Thank you. Jrincayc (discuss • contribs) 13:16, 21 January 2013 (UTC)

title: User talk:Jrincayc


text:
Canadian Tort Law/Negligence

Introduction
Perhaps no development in common law has had quite as great an impact as the case ofDonoghue  v. Stevenson, [1932 A.C. 562]. In this, a woman from Glasgow became ill after drinking an opaque bottle of ginger beer. She claimed that the remains of a decomposed snail were found in the bottle. She sued the bottling company.

Before this case, the idea that a plaintiff could sue someone with whom one had no contract and who had not directly committed the harm to the victim was not recognized in common law. However, in this decision of the House of Lords, Lord Atkin set out the principle, known as the "Neighbour Principle" or the "Duty of Care":

 * At present I content myself with pointing out that in English law there must be, and is, some general conception of relations giving rise to a duty of care, of which the particular cases found in the books are but instances. The liability for negligence, whether you style it such or treat it as in other systems as a species of culpa, is no doubt based upon a general public sentiment of moral wrongdoing for which the offender must pay. But acts or omissions which any moral code would censure cannot in a practical world be treated so as to give a right to every person injured by them to demand relief. In this way rules of law arise which limit the range of complainants and the extent of their remedy. The rule that you are to love your neighbour becomes in law, you must not injure your neighbour; and the lawyer's question, Who is my neighbour ? receives a restricted reply. You must take reasonable care to avoid acts or omissions which you can reasonably foresee would be likely to injure your neighbour. Who, then, in law is my neighbour ? The answer seems to be - persons who are so closely and directly affected by my act that I ought reasonably to have them in contemplation as being so affected when I am directing my mind to the acts or omissions which are called in question.
 * Donoghue v. Stevenson, [1932] A.C. 562 at 580.

Duty of care
There can be no legal accountability of a person's actions without a duty being imposed upon them. As first established in Donoghue v. Stevenson, an obligation can be imposed upon people whose actions can foreseeably harm others.

Reliance
Reasonable reliance, refers to when individuals refer to the information provided by professionals for another purpose. In those cases, the fiduciary duty set for a professional is limited in that the information provided was not used for what was intended by the professional, even if it caused harm and was wrong.

Standard of care
All negligent tort actions focus on the issue what the standard of care was and whether the defendant fell below that standard. The standard is judged in relation to the "reasonable person" and whether the defendant acted in the same manner as any rational person in society would.

This standard is very ephemeral and does not provide a clear or objective criteria for judging. The standard changes depending on the assumed knowledge and experience of the defendant; for example, a professional will be held to a higher level than a normal person.

Moreover the level of risk involved plays a major role in establishing the standard of care. The likelihood of harm resulting from the actions as well as the level of forseeability of harm are taken into account. In Bolton v. Stone H.L. [1951] the defendant was playing cricket and hit to ball out into the stands where it hit the plaintiff. The judge ruled that since the ball had only been hit that far about six times in 30 years there was very little likelihood of it happening, meaning the risk was very low, thus could not attribute negligence.

Causation
As with each other element of a tort, causation must be shown for a successful action. The Supreme Court in Snell v. Farrell (1990) described causation as "an expression of the relationship that must be found to exist between the tortious act of the wrongdoer and the injury to the victim in order to justify compensation of the latter out of the pocket of the former."

Remoteness - Limits to Liability
The remoteness factor - sometimes called proximate cause - in a tort action is said to be the most confusing and inconsistent of all. The case law has a very spotty history and is known for not always being consistently applied.

Type of injury
Physical Harm Emotional Harm Psychiatric Harm Economic Loss - Pure Economic Loss - Consequential Economic Loss - Relational Economic Loss

Further Readings

 * Donoghue  v. Stevenson, [1932 A.C. 562]

title: Canadian Tort Law/Negligence


text:
Swedish/Lesson 4

Parents:
Collectively, parents are known as "föräldrar".

Just like in English, the Swedish language has several words for mother and father, ranging from formal to casual. Starting with the words for mother, we have: The most common words for father are: Note that when addressing your folks with the casual terms, you use the definite forms farsan and morsan.
 * Moder (arch. mother)
 * Mor (mother)
 * Mamma (mom)
 * Morsa (mom, casual)
 * Fader (arch. father)
 * Far (father)
 * Pappa (dad)
 * Farsa (dad, casual)
 * Farsgubben (old man)

Siblings
The words for syskon (siblings) are for brother: and for sister: The same goes here. You address them brorsan and syrran.
 * Broder (arch. brother)
 * Bror (brother)
 * Brorsa (bro)
 * Syster (sister)
 * Syrra (sis)

The word syskon itself is more commonly used (for people) in Swedish than the English word siblings. You would always translate "My brothers and sisters" with "Mina syskon", never with "Mina bröder och systrar", unless possibly if you want to make a special point about the differenses between them.

Children
Children in general are referred to as "barn", in both singular and plural.

A male child is called A female child is
 * Son (son)
 * Pojke (boy)
 * Gosse (young boy)
 * Kille (casual form of boy; also guy for adults)
 * Dotter (daughter)
 * Flicka (girl)
 * Tjej (casual form of girl; also girl/chick for adults)

Maternal Grandparents
Collectively, your maternal grandparents are "morföräldrar"
 * Mormor (maternal grandmother)
 * Morfar (maternal grandfather)

Paternal Grandparents
Collectively, your paternal grandparents are "farföräldrar".

 * Farmor (paternal grandmother)
 * Farfar (paternal grandfather)

Great Grandparents

 * Mormors mor (maternal grandmother's mother - mother's mother's mother)
 * Farfars far (paternal grandfather's father - father's father's father)
 * Farmors farfars mor (paternal grandmothers paternal grandfathers mother - father's mother's father's father's mother)

To build further, just add an s after every other generation

Grandchildren
The formation of words for grandchildren follows the same pattern as for grandparents: To generically describe grandchildren, use: (someone please add phonetics)
 * Dotterson (daughter's son)
 * Dotterdotter (daughter's daughter)
 * Sondotter (son's daughter)
 * Sonson (son's son)
 * Barnbarn (children's children)

A Little More Extended Family

 * Faster † (father's sister, or aunt)
 * Moster † (mother's sister, or aunt)
 * Morbror (mother's brother, or uncle)
 * Farbror ‡ (father's brother, or uncle)
 * Kusin (cousin, child of a parent's brother or sister)

† Sometimes also called "tant", which is also used as a common name for elder ladies. It's also possible to refer to an uncle with the less common word "onkel".

‡ "Farbror" is also used as a common name for old men.

title: Swedish/Lesson 4


text:
User:ShaunMacPherson~enwikibooks

I wandered in from Wikipedia, I'll probably move my webpage here soon enough.

title: User:ShaunMacPherson~enwikibooks


text:
Saxophone

Preliminary Basics

 * 1) /Getting Started/
 * 2) /The Saxophone Family/
 * 3) How to form an embouchure
 * 4) /First notes/
 * 5) /Extending the range/

Module One

 * 1) /Lesson 1.1/
 * 2) /Lesson 1.2/
 * 3) /Lesson 1.3/
 * 4) /Lesson 1.4/

Module Two

 * 1) /Lesson 2.1/
 * 2) /Lesson 2.2/
 * 3) /Lesson 2.3/
 * 4) /Lesson 2.4/

Relevant Music and Harmonic Theory

 * 1) /Flat notes and sharp notes/
 * 2) /The keys with sharps/
 * 3) /The keys with flats/
 * 4) /The minor keys/
 * 5) /Improvisation, pentatonic and blues scales/
 * 6) /Let's make some music together/

Fundamentals

 * 1) /Tone/
 * 2) /Breathing/
 * 3) /Articulation/
 * 4) /Intonation/

Advanced Techniques

 * 1) /Circular Breathing/
 * 2) /Altissimo/
 * 3) /Slap Tonguing/
 * 4) /Double Tonguing/
 * 5) /Quatertones/
 * 6) /Multiphonics/

Further Study

 * 1) /Repertoire/
 * 2) /Resources/

סקסופון למתחילים

title: Saxophone


text:
Portuguese/Contents/Ser and estar

The easiest way to know Ser vs Estar Quickly and Easily is to look at these to tips: Ser= DOCTOR and Estar= PLACE

Ser / DOCTOR

Description (usually physical) / Tu és alto = You are tall

Occupation (Job) / Ele é um dentista = He is a dentist

Characteristics (Ser char. is only used when permanent/long) / ele é uma boa pessoa= he is a good person

Time (To tell time) / São 16:30 = It's 4:30

Origin (To tell where someone or something is from, including purchases) / Eu sou de Moçambique= I am from Mozambique

Relation (To express relationships, ex. she is my aunt) / Nos somos amigos= we are friends

Estar / PLACE

Position (To tell where you are) Estou em casa= I am at home

Location (To tell where something is) Está aí= Its over there

Action (Use action verbs here) Estamos correndo= We are running

Condition (Tell the condition that something is in, more commonly ) Estás com fome?= Are you hungry?

Emotion (Tell something's or someone's emotions) Eles estão tristes porque...= They are sad because...

Copula
One of the simplest constructions in any language is the ability to express a relation of equality between nouns or nouns and adjectives. This construction is often called copula, the Latin word for 'link', 'bond'. For example, consider the following statements:

 * John is tall.
 * Mary is a dentist.
 * Robert is happy.

These sentences link together the nouns (in these cases, 'John,' 'Mary' and 'Robert') with an adjective or noun (respectively, 'tall,' 'dentist' and 'happy'). In English, this is achieved by using the helper verb 'to be'.

In Portuguese, as in Spanish, we have actually two verbs which serve that role. Let's examine them, each in turn:

The first verb is ser, which comes from the old Latin verb esse, which meant 'to be'. It's conjugated (in the Present Indicative tense) as follows: eu             sou tu             és ele/ela/você   é nós            somos vos*           sois eles/elas/vocês são

The second verb is estar, which comes from the old Latin verb stare, which meant 'to stand'. It's conjugated (again, in the Present Indicative tense) as follows:

eu             estou tu             estás ele/ela/você   está nós            estamos vós*           estais eles/elas/vocês estão * Not commonly used

Using ser and estar- Usando Ser e Estar
Ok, now that we know the verbs, when do we know how to use them? What is the difference between ser and estar? The answer is actually quite simple, but it requires attention, especially for speakers of Spanish: the instances in which we use ser and which we use estar in Portuguese and Spanish are almost, but not always, the same.

Remember when I said that the verb ser comes from esse and the verb estar comes from stare? Well, there are two words in English which also come from these two Latin verbs. From esse we have English essence, and from stare we have English status. So we use ser when we want to describe the essence of something, or how a thing is always; and we use estar when we want to describe something's status, or how a thing is at the moment.

Let's see some examples, then, to fixate:

 * O sol é amarelo.
 * The sun is yellow.

 * Meu nome é Jim.
 * My name is Jim.

 * Nós somos Brasileiros.
 * We are Brazilian.

In each of these cases, the speaker attributes to the subjects of the sentence characteristics that are intrinsic to them. People don't change names that often, or nationality. It is part of their identity. Also, things are generally only one color, with a few notable exceptions like chameleons or traffic lights. All these cases use the verb ser.

 * A cerveja está gelada.
 * The beer is cold.

 * Eu estou doente.
 * I am sick.

 * O livro está sobre a mesa.
 * The book is on the table.

In these cases, the phrases describe temporary situations: beer can get warm, sick people get well, and books can be picked up and carried around. Therefore, these are cases where we use estar.

Notice that there are some cases where one could use ser or estar equally well; but in these cases, as expected, the meaning changes when we use one or the other case. Watch:

 * A moça é bonita.
 * A moça está bonita.

Both sentences above translate to 'the young woman is pretty'; however, in the first case, we mean that the young woman is naturally pretty, like Anna Kournikova. In the second case, we mean that she is prettier than usual -- typically because she put on some nice clothes, got a haircut, or otherwise accessorized herself. She may or may not be pretty normally, but we want to call attention to the fact that she is prettier due to some temporary condition.

 * Tony está doente.
 * Tony é doente.

Again, both cases translate to 'Tony is sick'. However, the first one explicitly says that Tony isn't usually sick, but is right now. The second one means that Tony is sick now, was in the past and will be in the future -- generally, this has connotations that Tony is mentally sick.

The location of things
When we want to describe the location of things, naturally we use the copula. In this case, we use ser when something generally can't move around, and estar otherwise. Spanish speakers should be aware that this is different from Spanish, where estar is used everywhere. Some examples:

 * O carro está na garagem.
 * The car is in the garage.

 * Os bilhetes estão sobre a cama.
 * The tickets are on the bed.

 * Eu estou na estação.
 * I am in the station.

 * O hotel é na praia.
 * The hotel is on the beach.

 * A casa é mais adiante.
 * The house is further ahead.

 * O castelo é em Portugal.
 * The castle is in Portugal.

In the first three examples, we have items which are expected to be able to be in a wide variety of places over time, so their location is not intrinsic to them: estar is used. In the last three examples, we have subjects which are generally immobile, and therefore have an intrinsic location; ser is the correct option then.

Leny...

title: Portuguese/Contents/Ser and estar


text:
Cookbook:Gazpacho

| Cuisine of Spain

Gazpacho is a hearty soup that is served cold, making it a perfect way to cool down and replenish the body on a hot, summer day. This is the classic gazpacho recipe, but there are many other variations. Gazpacho is typically served along with the main course, or afterward. Some Spaniards serve it in a glass, as a beverage to accompany the meal.

Soup

 * 2 oz (50 g) 2–3 day-old white bread (optional—leave out for a thinner soup)
 * 1 lb (450 g) tomatoes, skinned and quartered
 * ½ lb (225 g) green bell peppers, seeded and trimmed
 * ½ cucumber, peeled and cut in chunks
 * 1 clove of garlic
 * ½ mild Spanish onion, chopped
 * 1 tbsp white or red wine vinegar
 * 2 tbsp olive oil
 * ¼ chile pepper, seeds removed (optional)
 * Cilantro (optional)
 * ⅓ pt (2.4 dl) iced water
 * Sea salt
 * Black pepper
 * Ice cubes

Garnish

 * 1 tomato, skinned and diced fine
 * ½ green bell pepper, diced fine
 * ¼ peeled cucumber, diced fine
 * bread

Soup

 * 1) If using, tear up the bread, and soak it in water for 30 minutes. Squeeze it dry.
 * 2) Blend bread, tomatoes, bell peppers, cucumber, garlic, onion, vinegar, olive oil, chiles, cilantro, and water in a blender until roughly chopped. The soup should have texture and discernible vegetable bits, so do not chop too finely.
 * 3) Pour soup large bowl with some ice, and season to taste with salt and pepper.

Garnish

 * 1) Dice the bread, and fry it in a little olive oil until brown.
 * 2) Chop the other vegetables finely.
 * 3) Serve all garnishes in separate little bowls on the table.

Serving

 * 1) Serve gazpacho chilled.
 * 2) Allow diners to sprinkle on their own toppings.

Artes culinarias/Recetas/Gazpacho andaluz Libro di cucina/Ricette/Gazpacho Kookboek/Gazpacho

title: Cookbook:Gazpacho


text:
Bicycles/Maintenance and Repair/Suspension/Front suspension lubrication

It is best to go to the webpage of your fork's manufacturer and look there for specific information regarding your model and type of suspension fork. If you don't want too much hassle, rather take your bicycle to qualified bicycle mechanic.


text:
Talk:Portuguese/Contents/Ser and estar

Untitled
Well, this is the first version of the page. It doesn't fit very well with the rest of the Wikibook, but I think it would benefit from a more didactic approach. Y'all are welcome to criticize whatever aspect of it you wish.

 * Wtrmute 20:47, 3 Aug 2004 (UTC)

title: Talk:Portuguese/Contents/Ser and estar


text:
How To Search/Stanford Encyclopedia of Philosophy

Stanford Encyclopedia of Philosophy
 * Purpose: To provide a dynamic and up to date reference work in the subject area of philosophy.
 * Audience: General philosophy researchers.
 * Scope: Philosophy
 * Refresh Rate:

Other Features
There is a directory available for those who just want to browse by title of encyclopedic article or by date of article creation.


text:
Swedish/Teknik

Disciplines
In general: -nomi is "-nomy" and -logi is "-logy". "Ch" is k, "th" is t and "ph" is f. "C" is k when pronounced as k, otherwise c. Stress is on last syllable unless stated otherwise with bold letters.

Some tricky cases:
 * Chemistry - kemi
 * Mathematics (math) - matematik (matte)
 * Physics - fysik

"Swenglish"
Since technology is a relatively newfangled thing in the big scheme of history, there are a lot of technology words that have been borrowed from english, especially in electronics and computer technology.
 * Teknologi - technology
 * Elektronik - electronics
 * Digital - digital
 * Analog - analog

title: Swedish/Teknik