- p - Variable in class org.dyn4j.collision.narrowphase.MinkowskiSum.Point
-
The Minkowski sum point
- p - Variable in class org.dyn4j.dynamics.contact.Contact
-
The contact point in world space
- p1 - Variable in class org.dyn4j.collision.narrowphase.MinkowskiSum.Point
-
- p1 - Variable in class org.dyn4j.dynamics.contact.Contact
-
The contact point in
Body
1 space
- p2 - Variable in class org.dyn4j.collision.narrowphase.MinkowskiSum.Point
-
- p2 - Variable in class org.dyn4j.dynamics.contact.Contact
-
The contact point in
Body
2 space
- PairwiseTypedFallbackCondition - Class in org.dyn4j.collision.narrowphase
-
- PairwiseTypedFallbackCondition(Class<? extends Convex>, Class<? extends Convex>) - Constructor for class org.dyn4j.collision.narrowphase.PairwiseTypedFallbackCondition
-
Default constructor.
- PairwiseTypedFallbackCondition(Class<? extends Convex>, Class<? extends Convex>, int) - Constructor for class org.dyn4j.collision.narrowphase.PairwiseTypedFallbackCondition
-
Optional constructor.
- PairwiseTypedFallbackCondition(Class<? extends Convex>, Class<? extends Convex>, boolean) - Constructor for class org.dyn4j.collision.narrowphase.PairwiseTypedFallbackCondition
-
Optional constructor.
- PairwiseTypedFallbackCondition(Class<? extends Convex>, Class<? extends Convex>, boolean, int) - Constructor for class org.dyn4j.collision.narrowphase.PairwiseTypedFallbackCondition
-
Optional constructor.
- PairwiseTypedFallbackCondition(Class<? extends Convex>, boolean, Class<? extends Convex>, boolean) - Constructor for class org.dyn4j.collision.narrowphase.PairwiseTypedFallbackCondition
-
Optional constructor.
- PairwiseTypedFallbackCondition(Class<? extends Convex>, boolean, Class<? extends Convex>, boolean, int) - Constructor for class org.dyn4j.collision.narrowphase.PairwiseTypedFallbackCondition
-
Full constructor.
- parent - Variable in class org.dyn4j.BinarySearchTree.Node
-
The parent node of this node
- parent - Variable in class org.dyn4j.collision.broadphase.DynamicAABBTree.Node
-
The parent node
- Penetration - Class in org.dyn4j.collision.narrowphase
-
- Penetration() - Constructor for class org.dyn4j.collision.narrowphase.Penetration
-
Default constructor.
- Penetration(Vector2, double) - Constructor for class org.dyn4j.collision.narrowphase.Penetration
-
Full constructor.
- perp - Variable in class org.dyn4j.dynamics.joint.LineJoint
-
Deprecated.
The world space yAxis
- perp - Variable in class org.dyn4j.dynamics.joint.PrismaticJoint
-
The world space yAxis
- perp - Variable in class org.dyn4j.dynamics.joint.WheelJoint
-
The world space yAxis
- persist(PersistedContactPoint) - Method in class org.dyn4j.dynamics.contact.ContactAdapter
-
- persist(PersistedContactPoint) - Method in interface org.dyn4j.dynamics.contact.ContactListener
-
- PersistedContactPoint - Class in org.dyn4j.dynamics.contact
-
Represents a persisted contact point.
- PersistedContactPoint() - Constructor for class org.dyn4j.dynamics.contact.PersistedContactPoint
-
Default constructor
- PersistedContactPoint(ContactPointId, Body, BodyFixture, Body, BodyFixture, boolean, Vector2, Vector2, double, Vector2, Vector2, double) - Constructor for class org.dyn4j.dynamics.contact.PersistedContactPoint
-
Full constructor.
- PersistedContactPoint(PersistedContactPoint) - Constructor for class org.dyn4j.dynamics.contact.PersistedContactPoint
-
Copy constructor (shallow).
- point - Variable in class org.dyn4j.collision.manifold.ManifoldPoint
-
The point in world coordinates
- point - Variable in class org.dyn4j.collision.narrowphase.Raycast
-
The hit point
- point - Variable in class org.dyn4j.dynamics.contact.ContactPoint
-
The world space contact point
- point - Variable in class org.dyn4j.geometry.decompose.DoublyConnectedEdgeList.Vertex
-
The comparable data for this node
- point - Variable in class org.dyn4j.geometry.decompose.EarClipping.Vertex
-
The vertex point
- point - Variable in class org.dyn4j.geometry.decompose.SweepLine.Vertex
-
The vertex point
- point - Variable in class org.dyn4j.geometry.Vertex
-
The vertex or point
- point1 - Variable in class org.dyn4j.collision.narrowphase.Separation
-
The closest point on the first
Convex
Shape
to the second
- point2 - Variable in class org.dyn4j.collision.narrowphase.Separation
-
The closest point on the second
Convex
Shape
to the first
- points - Variable in class org.dyn4j.collision.manifold.Manifold
-
- Polygon - Class in org.dyn4j.geometry
-
- Polygon() - Constructor for class org.dyn4j.geometry.Polygon
-
Default constructor for sub classes.
- Polygon(Vector2...) - Constructor for class org.dyn4j.geometry.Polygon
-
Full constructor.
- postSolve(SolvedContactPoint) - Method in class org.dyn4j.dynamics.contact.ContactAdapter
-
- postSolve(SolvedContactPoint) - Method in interface org.dyn4j.dynamics.contact.ContactListener
-
Called after a contact has been solved.
- postSolveNotify() - Method in class org.dyn4j.dynamics.contact.ContactManager
-
Called after the contact constraints have been solved.
- potentialPairs - Variable in class org.dyn4j.collision.broadphase.SapBruteForce
-
Reusable list for storing potential detected pairs along the x-axis
- potentialPairs - Variable in class org.dyn4j.collision.broadphase.SapIncremental
-
Reusable list for storing potential detected pairs along the x-axis
- potentialPairs - Variable in class org.dyn4j.collision.broadphase.SapTree
-
Reusable list for storing potential detected pairs along the x-axis
- potentials - Variable in class org.dyn4j.collision.broadphase.SapBruteForce.PairList
-
The proxy's potential pairs
- potentials - Variable in class org.dyn4j.collision.broadphase.SapIncremental.PairList
-
The proxy's potential pairs
- potentials - Variable in class org.dyn4j.collision.broadphase.SapTree.PairList
-
The proxy's potential pairs
- POUND_TO_KILOGRAM - Static variable in class org.dyn4j.UnitConversion
-
1 pound-mass = 0.45359237 kilograms
- POUND_TO_NEWTON - Static variable in class org.dyn4j.UnitConversion
-
1 pound-force = 4.448222 newtons
- poundsToKilograms(double) - Static method in class org.dyn4j.UnitConversion
-
Converts pound-mass to kilograms.
- poundsToNewtons(double) - Static method in class org.dyn4j.UnitConversion
-
Converts pound-force to newtons.
- preSolve(ContactPoint) - Method in class org.dyn4j.dynamics.contact.ContactAdapter
-
- preSolve(ContactPoint) - Method in interface org.dyn4j.dynamics.contact.ContactListener
-
Called before a contact constraint is solved.
- preSolveNotify() - Method in class org.dyn4j.dynamics.contact.ContactManager
-
Called before the contact constraints are solved.
- prev - Variable in class org.dyn4j.geometry.decompose.EarClipping.Vertex
-
The previous vertex
- prev - Variable in class org.dyn4j.geometry.decompose.MonotoneVertex
-
The prev vertex in CCW winding
- prev - Variable in class org.dyn4j.geometry.decompose.SweepLine.Edge
-
The previous edge in Counter-Clockwise order
- prev - Variable in class org.dyn4j.geometry.decompose.SweepLine.Vertex
-
The previous vertex in Counter-Clockwise order
- primaryNarrowphaseDetector - Variable in class org.dyn4j.collision.narrowphase.FallbackNarrowphaseDetector
-
- PrismaticJoint - Class in org.dyn4j.dynamics.joint
-
Represents a prismatic joint.
- PrismaticJoint(Body, Body, Vector2, Vector2) - Constructor for class org.dyn4j.dynamics.joint.PrismaticJoint
-
Minimal constructor.
- product(Matrix22) - Method in class org.dyn4j.geometry.Matrix22
-
- product(Vector2) - Method in class org.dyn4j.geometry.Matrix22
-
- product(double) - Method in class org.dyn4j.geometry.Matrix22
-
Multiplies this
Matrix22
by the given scalar returning a
new
Matrix22
containing the result.
- product(Matrix33) - Method in class org.dyn4j.geometry.Matrix33
-
- product(Vector3) - Method in class org.dyn4j.geometry.Matrix33
-
- product(double) - Method in class org.dyn4j.geometry.Matrix33
-
Multiplies this
Matrix33
by the given scalar returning a
new
Matrix33
containing the result.
- product(double) - Method in class org.dyn4j.geometry.Vector2
-
Multiplies this
Vector2
by the given scalar returning
a new
Vector2
containing the result.
- product(double) - Method in class org.dyn4j.geometry.Vector3
-
Multiplies this
Vector3
by the given scalar returning
a new
Vector3
containing the result.
- productT(Vector2) - Method in class org.dyn4j.geometry.Matrix22
-
- productT(Vector3) - Method in class org.dyn4j.geometry.Matrix33
-
- project(Vector2) - Method in class org.dyn4j.geometry.AbstractShape
-
- project(Vector2, Transform) - Method in class org.dyn4j.geometry.Capsule
-
- project(Vector2, Transform) - Method in class org.dyn4j.geometry.Circle
-
- project(Vector2, Transform) - Method in class org.dyn4j.geometry.Ellipse
-
- project(Vector2, Transform) - Method in class org.dyn4j.geometry.HalfEllipse
-
- project(Vector2, Transform) - Method in class org.dyn4j.geometry.Polygon
-
- project(Vector2, Transform) - Method in class org.dyn4j.geometry.Rectangle
-
- project(Vector2, Transform) - Method in class org.dyn4j.geometry.Segment
-
- project(Vector2) - Method in interface org.dyn4j.geometry.Shape
-
- project(Vector2, Transform) - Method in interface org.dyn4j.geometry.Shape
-
- project(Vector2, Transform) - Method in class org.dyn4j.geometry.Slice
-
- project(Vector2) - Method in class org.dyn4j.geometry.Vector2
-
- project(Vector3) - Method in class org.dyn4j.geometry.Vector3
-
- proxy - Variable in class org.dyn4j.collision.broadphase.SapBruteForce.PairList
-
The proxy
- proxy - Variable in class org.dyn4j.collision.broadphase.SapIncremental.PairList
-
The proxy
- proxy - Variable in class org.dyn4j.collision.broadphase.SapTree.PairList
-
The proxy
- proxyList - Variable in class org.dyn4j.collision.broadphase.DynamicAABBTree
-
The unsorted list of proxies
- proxyList - Variable in class org.dyn4j.collision.broadphase.SapBruteForce
-
Sorted list of proxies
- proxyList - Variable in class org.dyn4j.collision.broadphase.SapIncremental
-
Sorted list of proxies
- proxyMap - Variable in class org.dyn4j.collision.broadphase.DynamicAABBTree
-
Id to node map for fast lookup
- proxyMap - Variable in class org.dyn4j.collision.broadphase.SapBruteForce
-
Id to proxy map for fast lookup
- proxyMap - Variable in class org.dyn4j.collision.broadphase.SapIncremental
-
Id to proxy map for fast lookup
- proxyMap - Variable in class org.dyn4j.collision.broadphase.SapTree
-
Id to proxy map for fast lookup
- proxyTree - Variable in class org.dyn4j.collision.broadphase.SapTree
-
Sorted tree set of proxies
- pulleyAnchor1 - Variable in class org.dyn4j.dynamics.joint.PulleyJoint
-
The world space pulley anchor point for the first
Body
- pulleyAnchor2 - Variable in class org.dyn4j.dynamics.joint.PulleyJoint
-
The world space pulley anchor point for the second
Body
- PulleyJoint - Class in org.dyn4j.dynamics.joint
-
Represents a pulley between two
Body
s.
- PulleyJoint(Body, Body, Vector2, Vector2, Vector2, Vector2) - Constructor for class org.dyn4j.dynamics.joint.PulleyJoint
-
Minimal constructor.
- pushLeft(BinarySearchTree<E>.Node) - Method in class org.dyn4j.BinarySearchTree.TreeIterator
-
Pushes the left most nodes of the given subtree onto the stack.
- pushRight(BinarySearchTree<E>.Node) - Method in class org.dyn4j.BinarySearchTree.TreeIterator
-
Pushes the right most nodes of the given subtree onto the stack.


infoBar.bottom = screenHeightthe bottom of the infoBar is weakly at the bottom of the UI
infoBar.y = infoBar.bottom - 80the info bar is 80px tall (I need to support a "height" property properly...)
infoBar.bottom = screenHeight + scrollPositionthe infoBar moves up and down with the scroll position
photo.y = infoBar.y + scrollPosition * (screenHeight - photoHeight) / screenHeightthe photo's top is aligned with the infoBar's top, but the scroll position causes it to move faster (the ratio is so that the photo will be fully revealed when it reaches the top of the UI)
photo.bottom = photo.y + photoHeightgive the photo its height (again, need a crisper height concept)
photo.y >= infoBar.y + scrollPosition * ((screenHeight / photoHeight) / screenHeight) * 0.2this causes the photo to slowly track upwards when the infoBar is dragged upwards from its middle position. The real Google Maps app just leaves the photo in place, which is a simpler rule:
photo.y >= 0. I liked the way this one looked better...
content.y = screenHeight + scrollPositionthe content starts at the bottom of the screen and tracks scroll position
content.bottom = content.y + contentHeightgive the content its height
infoBar.bottom <= screenHeight springdon't allow the infoBar off the bottom of the screen.
content.bottom >= screenHeight springdon't allow the bottom of the content above the bottom of the screen.
photo.y >= 0then snap it to either the bottom position (
screenHeight - infoBar's height) or to zero, the top position.
photo.y <= 0then snap the infoBar to either the middle position or the top position.


Effective Date 01.01.2016
This policy describes the way how we collect, process and protect your personal data (“Privacy Policy”). This Privacy Policy applies on personal data processing within our Platform and via your Account. This Privacy policy applies to any Services which incorporate this policy or contain a link hereto.
We collect data you provide us with within your registration process. These data include your
name,username, password, indentation details (including identification number and address), details on Payment
Instruments, e-mail distribution lists, tracking activity and contact details (including e-mail and phone
number). Although our Services offer analysis of data of your customers, we do not collect, have access to or
process such data in any way.
We process your personal data for the following purposes:
For the purpose of analysing your visits of our Platform, we also collect cookies
(codes stored locally on your computer). By enabling cookies in your browser, you have expressed your consent
that we may collect cookies for this purpose. Collection of cookies may be turned off by resetting your browser.
In case you turn off cookies, functionality of our Platform may be limited. Our Services and/or Platform and the
communications generated from using and/or registering to our Services and/or Platform, such as promotional
emails, may contain electronic images known as “web beacons”. Web beacons generally work in conjunction with
cookies, and we may use them in the same way we use cookies (see above).
We may, within the extent enabled by legal regulation (i) combine personal data provided by
you via your Account with information provided otherwise; and (ii) store this information collectively in one or
more separate databases.
We will not store your personal data for a longer period that what is necessary given the
purpose for which they were provided or collected, i.e. it will typically process your personal data for the
period of your registration via your Account. Subject to situations set out below, your personal data will be
removed once you deregister your Account. We will retain only those personal data serving legitimate purposes
(e.g., some data are required to be retained by applicable legal regulations, some data are necessary for
purposes of outstanding billing, etc). Personal data shall be retained also if removal would require undue
efforts or costs – in these cases the personal data shall be dislocated and not entirely removed.
We will neither collect any excessive amount of personal data nor relevant for the purposes for
which personal data are collected.
We may also use your electronic contact details for marking purposes, i.e. to inform you about
our services which may be derived from your past usage of Services. These communication shall strictly adhere to
applicable legal regulations. You may opt out from marketing communication via disabling his option on your
Account.
Your personal data shall not be shared or provided to any third party without your
consent except for in cases we are obliged to provide personal data on the basis of law or an order of public
authority; or if personal data sharing is specifically allowed by applicable legal regulations. Should the
applicable legal regulations prohibit that, your personal data shall never be shared with any third party.
We will ensure that your data are stored securely. Therefore, we have introduced adequate
physical, technical and organisational measures and plans protecting and securing data collected from you
(which, however, do not deprive you from your duties to undertake proper steps in order to secure your data
especially for data transmission to our Account). The aim is to eliminate unauthorised or unlawful processing of
your personal data, or accidental, unauthorised or unlawful access, use, transferring, processing, copying,
transmitting, alteration, loss or damage of your data. Despite all efforts and meeting all rules set out by
applicable legal regulations, it is not possible to ensure the security of your data, if they are transferred or
transmitted in an unsecured way. We will protect your data in the following ways:
We may, from time to time, change and/or update the terms of this Privacy Policy and
you shall be notified hereof via your Account.
You have a right to be provided with details of personal details processed by us and require
correction or deletion of your personal data. You may contact us at<EMAIL_ADDRESS>should you have any such request.
Need help?
Out experts will gladly help you. Contact live support
Submit email for detailed pricing
Let us know whether you prefer email or phone call


"CREATURE "denotes the whole creation in Romans 8:39; Colossians 1:15; Revelation 5:13; the whole human race in Mark 16:15; Romans 8:19-22. The living creatures in Ezekiel 10:15, 17, are imaginary beings, symbols of the Divine attributes and operations.
"CREATURE "denotes the whole creation in Romans 8:39; Colossians 1:15; Revelation 5:13; the whole human race in Mark 16:15; Romans 8:19-22.
The living creatures in Ezekiel 10:15, 17, are imaginary beings, symbols of the Divine attributes and operations.


About Agriculture Aggregate
CS257 Winter 2021 Final Project, Kai Johnson and Antonia Ritter
What gets displayed?
If All countries is selected, a map is displayed. If not...
If All years is selected, a line graph is diplayed. If not...
If All crops is selected, a bar chart is displayed. If not...
a single production number is displayed.
For example:
All countries, All crops, and 2012 shows a map of total crop production in 2012.
Canada, All crops, and 2012 shows a bar chart of top crops produced in Canada in 2012.
Notes:
The data comes from the Food and Agriculture Organization of the United Nations.
The crops shown in the multi-line graph (displayed when one country, all crops, and all years is selected) are those which produced the most in total, summed over all the years.
Return to the home page.


Rexchain Wallet
Contact
PIN
Enter a 4 digits pin code
Make sure you remember it, you’ll need it for all your transactions.
NEXT


Chapter 3 Introduction to Logic
3.1 Statement (Proposition)
- A statement is a declarative sentence which is either true or false but not both
- A proposition is a collection of declarative statements that has either a truth value “true” or a truth value “false”.
- The truth value True and False are denoted by the symbols T and F, respectively.
- Sometimes it is also denoted by 1 (stands for true) and 0 (stands for false).
- Since it depends on only two possible truth values, it is known as two-values logic of bi-values logic.
Example 1
Consider the following sentences and select the statements
- Man is Mortal
- 12 plus 9 is equal to 1
- Moon rises in the east
- 3 is less than four
- Please sit down
- \(y\) is a cat
- 14 is a composite number
- Chaddy is a nice dog.
3.2 Propositional Variables
- Every statement in propositional logic consists of propositional variables combined via propositional connectives.
- Propositional variables are usually denoted by capital English letters, such as P, Q, R etc.
- Each variable can take one of two values: T or F.
3.3 Logical Connectives
- We use logical connectives to connect the propositional variables (several statements into a single statement).
- The most basic and fundamental connectives are Negation, Conjunction and Disjunction.
3.3.1 Negation
- Negation is the simplest common example of a truth-functional operation.
- The negation of a statement is also a statement.
- We use the connective Not for negation.
- If \(P\) be a statement, then the negation of \(P\) is denoted by \(\neg P\).
- \(P\) and \(\neg P\) has opposite truth values.
- The relationship between the truth values of \(P\) and \(\neg P\) can be made explicit by a diagram called a truth table
Truth Table (Negation)
| \(P\) | \(\neg P\) |
|---|---|
| \(T\) | \(F\) |
| \(F\) | \(T\) |
3.3.2 Conjunction
- The conjunction of two statements, \(P\) and \(Q\) is also a statement.
- We use the connective And (\(\land\)) for conjunction.
- It is denoted by \(P \land Q\)
Truth Table (Conjunction)
| \(P\) | \(Q\) | \((P \land Q)\) |
|---|---|---|
| \(T\) | \(T\) | \(T\) |
| \(T\) | \(F\) | \(F\) |
| \(F\) | \(T\) | \(F\) |
| \(F\) | \(F\) | \(F\) |
Rule: \((P \land Q)\) is true if both \(P\) and \(Q\) are true, otherwise false.
- In order to make \((P \land Q)\) true, \(P\) and \(Q\) have to be simultaneously true
3.3.3 Disjunction
- The disjunction of two statements, \(P\) and \(Q\) is also a statement.
- We use the connective Or (\(\lor\)) for disjunction
- It is denoted by \(P \lor Q\)
Truth Table (Disjunction)
| \(P\) | \(Q\) | \((P \lor Q)\) |
|---|---|---|
| \(T\) | \(T\) | \(T\) |
| \(T\) | \(F\) | \(T\) |
| \(F\) | \(T\) | \(T\) |
| \(F\) | \(F\) | \(F\) |
Rule: \((P \lor Q)\) is true if either \(P\) or \(Q\) is true and it is false when both \(P\) and \(Q\) are false.
- \((P \lor Q)\) shall stand for “\(P\) or \(Q\) or both”.
3.4 Conditional
- In mathematics, expressions of the form “IF \(P\) then \(Q\)” occur so often.
- This can be expressed in any one of the following forms.
- If \(P\), then \(Q\)
- \(P\) only if \(Q\)
- \(P\) implies \(Q\)
- \(Q\) if \(P\)
- Therefore, it is important to understand the corresponding truth-functional operation.
- Let \(P\) and \(Q\) be any two statements.
- Then the statement \(P \rightarrow Q\) is called a conditional statement.
- In an implication \(P \rightarrow Q\), \(P\) is called the antecedent (hypothesis) and \(Q\) is called the consequent (conclusion).
Truth Table (Conditional)
| \(P\) | \(Q\) | \((P \rightarrow Q)\) |
|---|---|---|
| \(T\) | \(T\) | \(T\) |
| \(T\) | \(F\) | \(F\) |
| \(F\) | \(T\) | \(T\) |
| \(F\) | \(F\) | \(T\) |
Rule: An implication (conditional) \((P \rightarrow Q)\) is False only when the hypothesis (\(P\)) is true and conclusion (\(Q\)) is false, otherwise True.
3.5 Bi-Conditional
- Let \(P\) and \(Q\) be any two statements.
- Then the statement \(P \leftrightarrow Q\) is called a bi-conditional statement.
- This can be expressed in any one of the following forms.
- \(P\) if and only if \(Q\)
- \(P\) is necessary and sufficient of \(Q\)
- \(P\) is necessary and sufficient for \(Q\)
- \(P\) implies \(Q\) and \(P\) is implied by \(Q\)
- The bi-conditional (double implication) \(P \leftrightarrow Q\) can be defined as
\[P \leftrightarrow Q: (P \rightarrow Q) \land (Q \rightarrow P)\]
Truth Table (Bi-Conditional)
| \(P\) | \(Q\) | \((P \rightarrow Q)\) | \((Q \rightarrow P)\) | \((P \leftrightarrow Q)\) |
|---|---|---|---|---|
| \(T\) | \(T\) | \(T\) | \(T\) | \(T\) |
| \(T\) | \(F\) | \(F\) | \(T\) | \(F\) |
| \(F\) | \(T\) | \(T\) | \(F\) | \(F\) |
| \(F\) | \(F\) | \(T\) | \(T\) | \(T\) |
Rule: \((P \leftrightarrow Q)\) is True only when both \(P\) and \(Q\) have identical truth values, otherwise false.
3.6 Converse
- Let \(P\) and \(Q\) be any two statements.
- The converse statement of the conditional \(P \rightarrow Q\) is given as \(Q \rightarrow P\)
3.7 Inverse
- Let \(P\) and \(Q\) be any two statements.
- The inverse statement of the conditional \((P \rightarrow Q)\) is given as \((\lnot P \rightarrow \lnot Q)\)
3.8 Contra Positive
- Let \(P\) and \(Q\) be any two statements.
- The contra positive statement of the conditional \((P \rightarrow Q)\) is given as \((\lnot Q \rightarrow \lnot P)\)
Truth Table (Contra Positive)
| \(P\) | \(Q\) | \(P \rightarrow Q\) | \(\lnot Q\) | \(\lnot P\) | \((\lnot Q \rightarrow \lnot P)\) |
|---|---|---|---|---|---|
| \(T\) | \(T\) | \(T\) | \(F\) | \(F\) | \(T\) |
| \(T\) | \(F\) | \(F\) | \(T\) | \(F\) | \(F\) |
| \(F\) | \(T\) | \(T\) | \(F\) | \(T\) | \(T\) |
| \(F\) | \(F\) | \(T\) | \(T\) | \(T\) | \(T\) |
- From the truth table it can be seen that both conditional \(P \rightarrow Q\) and contra positive \((\lnot Q \rightarrow \lnot P)\) have same truth values.
3.9 Exclusive OR
- Let \(P\) and \(Q\) be any two statements.
- The exclusive OR of two statements \(P\) and \(Q\) is denoted by \((P \overline{\lor} Q)\).
- We use the connective XOR for exclusive OR
- The exclusive OR \((P \overline{\lor} Q)\) is true if either \(P\) or \(Q\) is True but not both.
- The exclusive OR is also known as exclusive disjunction.
the conditional \((P \rightarrow Q)\) is given as \((\lnot Q \rightarrow \lnot P)\)
Truth Table (Exclusive OR)
| \(P\) | \(Q\) | \((P \overline{\lor}Q)\) |
|---|---|---|
| \(T\) | \(T\) | \(F\) |
| \(T\) | \(F\) | \(T\) |
| \(F\) | \(T\) | \(T\) |
| \(F\) | \(F\) | \(F\) |
Rule: \((P \overline{\lor}Q)\) is true if either \(P\) or \(Q\) is True but not both, otherwise false.
3.10 NAND
- The word NAND stands for NOT and AND.
- The connective NAND is denoted by the symbol \(\uparrow\).
- Let \(P\) and \(Q\) be any two statements.
- The NAND of \(P\) and \(Q\) is denoted by \((P \uparrow Q)\).
- The NAND, \((P \uparrow Q)\) can be defined as
\[(P\uparrow Q)\equiv\lnot(P \land Q)\]
Truth Table (NAND)
| \(P\) | \(Q\) | \((P \uparrow Q)\) |
|---|---|---|
| \(T\) | \(T\) | \(F\) |
| \(T\) | \(F\) | \(T\) |
| \(F\) | \(T\) | \(T\) |
| \(F\) | \(F\) | \(T\) |
Rule: \((P \uparrow Q)\) is True if either \(P\) or \(Q\) is false, otherwise False
3.11 NOR
- The word NOR stands for NOT and OR.
- The connective NOR is denoted by the symbol \(\downarrow\).
- Let \(P\) and \(Q\) be any two statements.
- The NOR of \(P\) and \(Q\) is denoted by \((P \downarrow Q)\).
- The NOR, \((P \downarrow Q)\) can be defined as
\[(P\downarrow Q)\equiv\lnot(P \lor Q)\]
Truth Table (NOR)
| \(P\) | \(Q\) | \((P \downarrow Q)\) |
|---|---|---|
| \(T\) | \(T\) | \(F\) |
| \(T\) | \(F\) | \(F\) |
| \(F\) | \(T\) | \(F\) |
| \(F\) | \(F\) | \(T\) |
Rule: \((P \downarrow Q)\) is True only when both \(P\) or \(Q\) are false, otherwise False
3.12 Tautology
- If the truth values of a composite statement are always true, irrespective of the truth values of the atomic (individual) statements, then it is a tautology.
Example
- The composite statement \((P\land (P \rightarrow Q)) \rightarrow Q\) is a tautology.
- Verify this using a truth table with composite statement as \((P\land (P \rightarrow Q)) \rightarrow Q\)
3.13 Contradiction
- If the truth values of a composite statement are always false, irrespective of the truth values of the atomic (individual) statements, then it is a contradiction or unsatisfiable.
Example
- The composite statement \(\lnot(P\rightarrow(Q\rightarrow(P\land Q)))\) is a contradiction.
- Verify this using a truth table with composite statement as \(\lnot(P\rightarrow(Q\rightarrow(P\land Q)))\)
3.14 Satisfiable
- If the truth values of a composite statement are sometimes true and sometimes false, irrespective of the truth values of the atomic statements, then it is called a satisfiable.
Example
- The composite statement \((P \rightarrow Q) \rightarrow (Q \rightarrow P)\) is satisfiable.
- Verify this using a truth table of \((P \rightarrow Q) \rightarrow (Q \rightarrow P)\)
3.15 Duality Law
- Two formulae \(P\) and \(p^*\)are said to be duals of each other if either one can be obtained from the other by interchanging \(\land\) by \(\lor\) and \(\lor\) by \(\land\).
- The two connectives \(\lor\) and \(\land\) are called dual to each other.
Example
The formulae \(P \equiv (P \lor Q)\land R\) and \(P^* \equiv (P \land Q)\lor R\) are dual to each other.
3.16 Algebra of Propositions
- If \(P, Q\) and \(R\) be three statements, then the following laws hold.
| Algebra of Propositions | |
|---|---|
| Commutative Laws | \(P\land Q\equiv Q \land P\) and \(P\lor Q\equiv Q \lor P\) |
| Associative Laws | \(P\land (Q \land R)\equiv (P\land Q) \land R\) and \(P\lor (Q \lor R)\equiv (P\lor Q) \lor R\) |
| Distributive Laws | \(P\land (Q \lor R)\equiv (P\land Q) \lor (P\land R)\) and \(P\lor (Q \land R)\equiv (P\lor Q) \land (P\lor R)\) |
| Idempotent Laws | \(P\land P\equiv P\) and \(P\lor P\equiv P\) |
| Absorption Laws | \(P\lor (P \land Q)\equiv P\) and \(P\land (P \lor Q)\equiv P\) |
| De Morgan’s Laws | \(\lnot (P\land Q) \Leftrightarrow (\lnot P) \lor(\lnot Q)\) and \(\lnot (P\lor Q) \Leftrightarrow (\lnot P) \land (\lnot Q)\) |
3.17 Logical Implication and Equivalence
3.18 Necessary and Sufficient Conditions
3.18.1 Necessary Condition
3.18.2 Sufficient Condition
3.18.3 Necessary and Sufficient Condition
References
Acharjya, D. P. (2009). Fundamental approach to discrete mathematics. New Age International.
Mendelson, E. (1970). Boolean algebra and switching circuits. McGraw-Hill Edition 2004.
Tutorial
- Reduce the following sentences to statement forms
A necessary condition for \(x\) to be prime is that \(x\) is odd or \(x=2\).
A sufficient condition for \(f\) to be continuous is that \(f\) is differentiable.
A necessary and sufficient condition for Mr. Perera to be elected is that Mr. Perera wins 75 votes.
Calathea plant will stay healthy only if enough moisture is available.
It is raining but the sun is still shining.
She will die today unless medical aid is obtained.
If taxes are increased or government spending decreases, then inflation will not occur this year.
- Show that the composite statement \((P \land (P \rightarrow Q)) \rightarrow Q\) is a tautology using a truth table
- Show that the composite statement \(\lnot (P \rightarrow( Q \rightarrow (P \land Q)))\) is a contradiction using a truth table
- Show that \((A \rightarrow B) \rightarrow A\) logically implies \(A\)
- Show that \((A \leftrightarrow B)\) is logically equivalent to \((A \rightarrow B) \land (B \rightarrow A)\)
- Find the negation of \(A\rightarrow B\)
- Construct the truth table for \(A \rightarrow ( B\leftrightarrow A \land B).\)
- Find the negation of the following statement “He is rich but unhappy”
- Prove by constructing truth table \[P \rightarrow(Q \lor R) \equiv (P \rightarrow Q) \lor (P \rightarrow R)\]
Find the negation of \(P \leftrightarrow Q.\)
With the help of the truth table prove that \(\lnot (P \land Q) \equiv \lnot P\lor \lnot Q\)
Show that \((P \rightarrow Q) \leftrightarrow (\lnot P \lor Q)\) is a tautology
Show that the following stamens are equivalent.
Statement 1: Good food is not cheap
Statement 2: Cheap food is not good
Express \(P\rightarrow Q\) only using \(\downarrow\) and \(\uparrow\).
Prove that \((P \land Q) \land \lnot (P \lor Q)\) is a contradiction.
Express \(P \leftrightarrow Q\) only using \(\downarrow\) and \(\uparrow\).
Show by truth table the following statement are equivalent
Statement 1: Rich men are unhappy
Statement 2: Men are unhappy or poor
- A constructor promises a client “We will fix it on Monday if it is not raining”. When the constructor would be deemed to have broken his promise. Explain with the help of truth table.
- Eliminate as many parentheses as possible from
- \(\{[(A \lor B)\rightarrow (\lnot C)] \lor [(((\lnot B)\land C)\land B)]\}\)
- \(\{[A \land (\lnot (\lnot B))]\leftrightarrow [B \leftrightarrow (C \lor B)]\}\)
- \([(B\leftrightarrow (C \lor B)) \leftrightarrow (A \land (\lnot (\lnot B)))]\)
20 Show the following are tautologies without using truth tables.
- \(((A \rightarrow B) \rightarrow C) \rightarrow ((C \rightarrow A) \rightarrow(D \rightarrow A )).\)
- \((A \rightarrow B)\rightarrow ((B \rightarrow C) \rightarrow (A \rightarrow C)).\)


AMERICAN PSYCHO
Review by John Beachem
* * * * 1/2
Directed by: Mary Harron Written by: Bret Easton Ellis (novel), Mary Harron
There are generally only two possible opinions one can form of a movie like Mary Harron's ("I Shot Andy Warhol") "American Psycho".  This may also be the breakout role for Christian Bale ("A Midsummer Night's Dream"), an actor who displays some amazing, Oscar worthy talent in this movie. Alternatingly uproariously funny and shockingly violent, this is the kind of movie which will stay in your mind for days afterwards. I'll warn you right now, if you don't like your humor black as pitch stay far away from this movie.
It's the mid 1980's and the yuppie era is in full swing. Patrick Bateman (Christian Bale) is one of these yuppies who spends his time worrying about whether he'll get a good table at the best restaurant and how expensive his apartment is compared to his friends'. He is engaged to Evelyn Williams (Reese Witherspoon), who he is cheating on with Courtney Rawlinson (Samantha Mathis), the fiancee of the irritating Lewis Carruthers (Matt Ross). It may sound like a normal, if slightly soap opera like lifestyle, but Patrick explains to us in occasional narrative voice-overs that he isn't actually a regular human. He may have the appearance of a human, and he may follow the morning and evening routines of your average, everyday person, but he is really a cold blooded killer. Bateman isn't sure why he does what he does, but his urge for blood and violence is growing stronger and stronger each night.
The film may start off looking more like a straight out comedy than a combination comedy and slasher film, but don't let that fool you. When things turn violent it is sudden and rather shocking. Yet despite what you may have heard, "American Psycho" is not an incredibly violent movie. Nearly all the slaughter and mayhem takes place off screen or in the dark. This doesn't mean this is a movie for young audiences. We do see the aftermath of many of Bateman's violent acts, and there are enough sex scenes that this could easily have earned an NC-17 rating. Mary Harron does an excellent job of not focusing entirely on the violent acts, but more on the atmosphere surrounding Bateman and his victims. The atmosphere consists of everything being filmed in either dark colors or stale whites with weak lighting. This gives the film an eerie, other worldly feel to it.
I'm sorry this movie was released so early in the year because Academy members will almost certainly forget about Christian Bale's amazing performance come Oscar time. Bale manages to make Bateman inhumanly cold and calculating without turning the character into another typical movie psycho. Reese Witherspoon ("Election"), a very talented actress, is unfortunately given nothing to do as Bateman's fiancee. Chloe Sevigny ("Boys Don't Cry") gives an adequate performance as Bateman's secretary, the only person he seems to actually care about. The remainder of the supporting cast is comprised of actors like Jared Leto ("Fight Club") and Willem Dafoe ("Affliction"), who aren't given much to do, but that doesn't really matter since the focus of the movie should and does stay on Bateman.
"American Psycho" has a few other things going for it besides the acting and revolting, yet strangely ivoling plot. The soundtrack is a perfect combination of '80s and classical music and is always used at just the right moments. Bateman's voice overs, explaining his actions and his state of mind, never seem out of place and actually give us some needed insight into his actions and what makes him do what he does. The humor sprinkled throughout the movie is at times hilarious, especially a scene in which Bateman and his colleagues compare business cards. The only thing working against the movie is the rather confusing and ambiguous ending. I think it was supposed to tie everything up and offer some sort of explanation, but I had no idea what was going on. "American Psycho" runs a perfect 97 minutes and not a scene is wasted. I'd recommend the movie to fans of very, very dark humor and give it four and a half out of five stars.
Comments? Feel free to e-mail them to<EMAIL_ADDRESS>For past reviews, movie news, and other fun stuff, visit: http://www.dependentfilms.net
* * * * * - One of the greatest movies ever made, see it now. * * * * - Great flick, try and catch this one. * * * - Okay movie, hits and misses. * * - Pretty bad, see it only if you have nothing better to do.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Understanding Git For Beginners
Understanding Git For Beginners
For More Advanced Readers, or those with very limited free time… here’s an abridged Git Reference.
Git-Tricks
Refs
What’s a distributed version control system?
Git is an example of a distributed version control system (DVCS) commonly used for open source and commercial software development. DVCSs allow full access to every file, branch, and iteration of a project, and allows every user access to a full and self-contained history of all changes. Unlike once popular centralized version control systems, DVCSs like Git don’t need a constant connection to a central repository. Developers can work anywhere and collaborate asynchronously from any time zone.
Without version control, team members are subject to redundant tasks, slower timelines, and multiple copies of a single project. To eliminate unnecessary work, Git and other VCSs give each contributor a unified and consistent view of a project, surfacing work that’s already in progress. Seeing a transparent history of changes, who made them, and how they contribute to the development of a project helps team members stay aligned while working independently.
Why Git?
According to the latest Stack Overflow developer survey, more than 70 percent of developers use Git, making it the most-used VCS in the world. Git is commonly used for both open source and commercial software development, with significant benefits for individuals, teams and businesses.
- Git lets developers see the entire timeline of their changes, decisions, and progression of any project in one place. From the moment they access the history of a project, the developer has all the context they need to understand it and start contributing.
- Developers work in every time zone. With a DVCS like Git, collaboration can happen any time while maintaining source code integrity. Using branches, developers can safely propose changes to production code.
- Businesses using Git can break down communication barriers between teams and keep them focused on doing their best work. Plus, Git makes it possible to align experts across a business to collaborate on major projects.
Table Of Contents:
Editing Understanding Git (A Beginners Guide Containing Cheat Sheets & Resources) — Medium
What’s a distributed version control system?
Why Git?
What’s a repository?
Git Flow
Cloning a repo and changing the remote url
1. The first step is to clone the repo!
2. Make your own repo.
3. Next, copy the .git link that is on the next page.
4. Whenver you clone a repo
5. Thats its! You can now run
git push
and it will push to your newly created repo.
Basic Git Work Flow.
Cheat Sheet:
My Git Reference Repo:
Git basics
A glance into GIT
Tracking changes in a repository
Branches and workflow
Bringing it back together
Connect-W-Github
I ❤ Open Source
Merging your code on GitHub
Browsing Your Git Repository
Seeing changes in real time
Diff options
Time travel
Why checkout?
Git ‘Do-Overs’: Reset & Rebase
Resetting the past
Soft resets
Risky Business: Mixed resets
Red alert! Hard resets
Rebase: ‘Alt-time travel’
I see you too like to live life Dangerously… tell me about Rebase..
working-on-the-header
“Golden Rule of Git”
How 2's
Troubleshooting Git
Further Reading & Resources
What’s a repository?
A repository, or Git project, encompasses the entire collection of files and folders associated with a project, along with each file’s revision history. The file history appears as snapshots in time called commits, and the commits exist as a linked-list relationship, and can be organized into multiple lines of development called branches. Because Git is a DVCS, repositories are self-contained units and anyone who owns a copy of the repository can access the entire codebase and its history. Using the command line or other ease-of-use interfaces, a git repository also allows for: interaction with the history, cloning, creating branches, committing, merging, comparing changes across versions of code, and more.
Working in repositories keeps development projects organized and protected. Developers are encouraged to fix bugs, or create fresh features, without fear of derailing mainline development efforts. Git facilitates this through the use of topic branches: lightweight pointers to commits in history that can be easily created and deprecated when no longer needed.
Git Flow
Cloning a repo and changing the remote url
(These steps are only for when you initially clone a project repo. Not when you clone your partners repo to collaborate together. To do that, you only have to complete step 1!)
1. The first step is to clone the repo!
- Navigate to the repo you want to clone and hit the big green code button. Copy the link given.
- Navigate in your terminal to the directory where you want this repo to live. I’ve chosen downloads
-
git clone HTTPS://LINKTOURL/THATYOUCOPIED
2. Sweet, you have the cloned repo in your preferred directory. Now lets make your own repo. On github, create a new repository.
-
Default settings are fine. Hit the big green button
Create Repository
3. Next,
copy the .git link that is on the next page. Do not do any other steps on this page — That is for when you do not clone a repo.
These are the commands GitHub provides when you create a new Repo:
Quick setup — if you’ve done this kind of thing before
Set up in Desktop
or
HTTPSSSH
Get started by creating a new file or uploading an existing file. We recommend every repository include a README, LICENSE, and .gitignore.
…or create a new repository on the command line
echo "# the-meaning-of-life-is-42" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M master
git remote add origin https://github.com/bgoonz/the-meaning-of-life-is-42.git
git push -u origin master
…or push an existing repository from the command line
git remote add origin https://github.com/bgoonz/the-meaning-of-life-is-42.git
git branch -M master
git push -u origin master
…or import code from another repository
You can initialize this repository with code from a Subversion, Mercurial, or TFS project.
4. Whenever you clone a repo:
It already has a .git directory with certain configurations set up. To be able to push this repo to your newly created GitHub repo we have to change the remote origin.
- To do that, just run this command: (Make sure you are inside the repo you cloned)
git remote set-url origin https://LINK/TO/YOUR/GIT/THAT/YOU/COPIED/FROM/PREVIOUS/STEP.git
OR:
5. You can now run
git push
and
it will push to your newly created repo.
Basic Git Work Flow.
- After making changes to a file and you are ready to commit / push to your repo you can run the following commands:
-
git add .
- stages modified files to be committed. -
git status
- displays files that have been modified -
git commit -m 'A helpfully commit message'
- commits the changes to your local repo. Get in the habit now of making helpful commit messages -
git push
- pushes your local commits to your GitHub repo! - To pull down changes that your partner pushed to the repo you simply have to run:
-
git pull
- this will fetch the most recent updates!
Cheat Sheet:
My Git Reference Repo:
bgoonz/github-reference-repo
Cloning a repo and changing the remote url Basic Git Workflow (These steps are only for when you initially clone a…
Git basics
Like many disciplines, learning Git is just a matter of learning a new language. You’ll cover a lot of new vocabulary in this lesson! Remember that the vocabulary you’ll learn will allow you to communicate clearly with other developers worldwide, so it’s important to understand the meaning of each term.
It’s also important to note that Git is a complex and powerful tool. As such, its documentation and advanced examples may be tough to understand. As your knowledge grows, you may choose to dive deeper into Git. Today, you’ll focus on the commands you’ll use every day — possibly for the rest of your programming career! Get comfortable with these commands and resist the urge to copy/paste or create keyboard shortcuts as you’re getting started.
A glance into GIT
Before you look at any practical examples, let’s talk about how Git works behind the scenes.
Here is your first new word in Git-speak: repository, often shortened to repo. A Git repo comprises all the source code for a particular project. In the “dark ages” example above, the repo is the first directory you created, where work is saved to, and which acts as the source for code shared to others. Without a repo, Git has nothing to act on.
Git manages your project as a series of commits. A commit is a collection of changes grouped towards a shared purpose. By tracking these commits, you can see your project on a timeline instead of only as a finished project:
Notice the notes and seemingly random numbers by each commit? These are referred to as commit messages and commit hashes, respectively. Git identifies your commits by their hash, a specially-generated series of letters and numbers. You add commit messages to convey meaning and to help humans track your commits, as those hashes aren’t very friendly to read!
A Git hash is 40 characters long, but you only need the first few characters to identify which hash you’re referring to. By default, Git abbreviates hashes to 7 characters. You’ll follow this convention, too.
Git provides a helpful way for us to “alias” a commit in plain
English as well. These aliases are called
refs, short for
“references”. A special one that Git creates for all
repositories is
HEAD
, which
references the most recent commit. You'll learn more about
creating your own refs when you learn about
"branching".
Git maintains three separate lists of changes: the working directory, the staging area, and the commit history.  You’ll look more at these three lists soon.
Git only cares about changes that are “tracked”. To track a file, you must add it to the commit history. The working directory will always show the changes, even if they aren’t tracked. In the commit history, you’ll only have a history of files that have been formally tracked by your repository.
Tracking changes in a repository
Now, let’s get practical!
You can create a repository with
git init
.
Running this command will initialize a new Git repo in your
current directory. It's important to remember that you only
want a repository for your project and not your whole hard
drive, so always run this command inside a project folder and
not your home folder or desktop. You can create a new repo in an
empty folder or within a project directory you've already
created.
What good is an empty repo? Not much! To add content to your
repository, use
git add
. You
can pass this command a specific filename, a directory, a
"wildcard" to select a series of similarly-named
files, or a .
to add every untracked file in the current directory:
# This will add only my_app.js to the repo:> git add my_app.js# This will add all the files within ./objects:> git add objects/# This will add all the files in the current directory ending in `.js`:> git add *.js# This will add everything in your current directory:> git add .
Adding a file (or files) moves them from Git’s working directory
to the staging area. You can see what’s been “staged” and what
hasn’t by using
git status
:
In this example, “Changes to be committed” is your staging area
and “Changes not staged for commit” is your working directory.
Notice that you also have “Untracked files”, Git’s way of
reminding us that you may have forgotten to
git add
a file
to your repo. Most Git commands will include a bit of help text
in the output, so always read the messages carefully before
moving forward. Thanks, Git!
Once you’re happy with your files and have staged them, you’ll
use
git commit
to
push them into the commit history. It's significantly more
work to make changes after a commit, so be sure your files are
staged and exactly as you'd like them before running this
command. Your default text editor will pop up, and you'll be
asked to enter a commit message for this group of changes.
Heads Up:
You may find yourself in an unfamiliar place! The default text
editor for MacOS (and many variants of Linux) is called
Vim. Vim is a
terminal-based text editor you’ll discuss in the near future.
It’s visually bare and may just look like terminal text to you!
If this happens, don’t worry — just type :q
and press your "return" key to exit.
You’ll want to ensure that future commit messages open in a more
familiar editor. You can run the following commands in your
terminal to ensure that Visual Studio Code is your
git commit
editor from now on:
> git config --global core.editor "code --wait"> git config --global -e
If you experience any issues, you may be missing Visual Studio Code’s command line tools. You can find more details and some troubleshooting tips on Microsoft’s official VS Code and macOS documentation.
 Use
git log
to see
this history at any time. This command will show all the commits
in your repository's history, beginning with the most
recent:
Like many Git commands,
git commit
includes some helpful shorthand. If you need a rather short
commit message, you can use the
-m
flag to
include the message inline. Here's an example:
> git commit -m "Fix typo"
This will commit your changes with the message “Fix typo” and
avoid opening your default text editor. Remember the commit
messages are how you make your project’s history friendly to
humans, so don’t use the
-m
flag as an
excuse to write lame commit messages! A commit message should
always explain why changes were made in clear, concise language.
It is also best practice to use imperative voice in commit
messages (i.e. use "Fix typo" instead of "Fixing
the typo" or "Typo was fixed").
 Let’s explore a new realm with branches. A branch is a separate timeline in Git, reserved for its own changes. You’ll use branches to make your own changes independently of others. These branches can then be merged back into the main branch at a later time.
Let’s consider a common scenario: a school project. It’s a lot of extra hassle to schedule time together and argue over exactly what should be done next! Instead, group members will often assign tasks amongst themselves, work independently on their tasks, and reunite to bring it all together as a final report. Git branches let us emulate this workflow for code: you can make a copy of what’s been done so far, complete a task on your new branch, and merge that branch back into the shared repository for others to use.
By default, Git repos begin on the
master
branch.
To create a new branch, use
git branch <name-of-your-branch>
. This will create a named reference to your current commit and
let you add commits without affecting the
master
branch.
Here's what a branch looks like:
Notice how your refs help to identify branches here:
master
stays to
itself and can have changes added to it independently of your
new branch (footer
). HEAD
,
Git's special ref, follows us around, so you know that in
the above diagram you're working on the
footer
branch.
You can create a new branch or visit an existing branch in your
repository. This is especially helpful for returning the
master
branch
or for projects you've received from teammates. To open an
existing branch, use
git checkout <name-of-branch>
.
Bringing it back together
Once you’re happy with the code in the branch you’ve been
working on, you’ll likely want to integrate the code into the
master
branch.
You can do this via
git merge
.
Merging will bring the changes in from another branch and
integrate them into yours. Here's an example workflow:
> git branch my-changes> git add new-file.js> git commit -m "Add new file"> git checkout master> git merge my-changes
Following these steps will integrate the commit from
my-changes
over
to master
.
Boom! Now you have your
new-file.js
on
your default branch.
As you can imagine, branching can get very complicated. Your repository’s history may look more like a shrub than a beautiful tree! You’ll discuss advanced merging and other options in an upcoming lesson.
Connect-W-Github
Git can act as a great history tool and source code backup for your local projects, but it can also help you work with a team! Git is classified as a “DVCS”, or “Distributed Version Control System”. This means it has built-in support for managing code both locally and from a distant source.
You can refer to a repository source that’s not local as a
remote. Your Git
repository can have any number of remotes, but you’ll usually
only have one. By default you’ll refer to the primary remote of
a repo as the
origin
.
You can add a remote to an existing repository on your computer, or you can retrieve a repository from a remote source. You can refer to this as cloning the repo. Once you have a repository with a remote, you can update your local code from the remote by pulling code down, and you can push up your own code so others have access to it.
I ❤ Open Source
While a remote Git server can be run anywhere, there are a few places online that have become industry standards for hosting remote Git repositories. The best-known and most widely-used Git source is a website called GitHub. As the name suggests, GitHub is a global hub for Git repositories. It’s free to make a Github account, and you’ll find literally millions of public repositories you can browse.
GitHub takes a lot of work out of managing remote Git repositories. Instead of having to manage your own server, GitHub provides managed hosting and even includes some helpful graphical tools for complicated tasks like deployment, branch merging, and code review.
Let’s look at a typical workflow using Git and GitHub. Imagine it’s your first day on the job. How do you get access to your team’s codebase? By cloning the repository!
> git clone https://github.com/your-team/your-codebase.git
Using the
git clone
command will create a new folder in your current directory named
after the repo you're cloning (in this case,
your-codebase
).

You’ll likely start on the
master
branch,
but remember that this is the default branch and it's
unlikely you want to make changes to it.
Since you're working on a team now, it's important
to think of how your changes to the repository might affect
others.
The safest way to make changes is to create a new branch, make
your changes there, and then push your branch up to the remote
repository for review. You’ll use the
git push
command to do this. Let's look at an example:
> git branch add-my-new-file> git add my-new-file.js> git commit -m "Add new file"> git push -u origin add-my-new-file
Notice how you used the
-u
flag with
git push
. This
flag, shorthand for
--set-upstream
,
lets Git know that you want your local branch to follow a remote
branch. You've passed the same name in, so you'll now
have two branches in your local repository:
add-my-new-file
, which is where your changes live after being committed, and
origin/add-my-new-file
, which keeps up with your remote branch and updates it after
you use
git push
.
You only need to use the -u
flag the first time you push each new branch - Git will know
what to do with a simple git push
from then on.
You now know how to push your changes up, but what about getting
the changes your teammates have made? For this, you’ll use
git pull
.
Pulling from the remote repo will update all of your local
branches with the code from each branch's remote
counterpart.
Behind the scenes,
Git is running two separate commands:
git fetch
and
git merge
.
Fetching retrieves the repository code and updates any remote tracking branches in your local repo, and merge does just you’ve already explored: integrates changes into the local branches. Here’s a graphic to explain this a little better:
It’s important to remember to use
git pull
often.
 The more often you
pull
, the more
certain you can be that your own code is based on the
"latest and greatest".
Merging your code on GitHub
If you’re paying close attention, you may have noticed that there’s a missing step in your workflows so far: how do you get your code merged into your default branch? This is done by a process called a Pull Request.
A pull request (or “PR”) is a feature specific to GitHub, not a feature of Git. It’s a safety net to prevent bugs, and it’s a critical part of the collaboration workflow. Here’s a high-level of overview of how it works:
You push your code up to GitHub in its own branch.
You open a pull request against a base branch.
GitHub creates a comparison page just for your code, detailing the changes you’ve made.
Other members of the team can review your code for errors.
You make changes to your branch based on feedback and push the new commits up.
The PR automatically updates with your changes.
Once everyone is satisfied, a repo maintainer on GitHub can merge your branch.
Huzzah! Your code is in the main branch and ready for everyone
else to
git pull
.
You’ll create and manage your pull requests via GitHub’s web portal, instead of the command line. You’ll walk through the process of creating, reviewing, and merging a pull request in an upcoming project.
Browsing Your Git Repository
Repositories can feel intimidating at first, but it won’t take you long to navigate code like you own the place — because you do! Let’s discuss a few tools native to Git that help us browse our changes over time.
We’ll be covering:
Comparing changes with
git diff
Browsing through our code “checkpoints” with
git checkout
Seeing changes in real time
Git is all about change tracking, so it makes sense that it
would include a utility for visualizing a set of changes. We
refer to a list of differences between two files (or the same
file over time) as a
diff, and we can use
git diff
to
visualize diffs in our repo!
When run with no extra options,
git diff
will
return any tracked changes in our working directory since the
last commit.
Tracked
is a key word here;
git diff
won't show us changes to files that haven't been
included in our repo via
git add
. This
is helpful for seeing what you've changed before committing!
Here's an example of a small change:
Let’s break down some of the new syntax in this output.
The diff opens with some Git-specific data, including the branch/files we’re checking, and some unique hashes that Git uses to track each diff. You can skip past this to get to the important bits.
---
&
+++
let us know
that there are both additions and subtractions in the file
"App.js". A diff doesn't have a concept of inline
changes - it treats a single change as removing something old
and replacing it with something new.
@@
lets us know
that we're starting a single "chunk" of the diff.
A diff could have multiple chunks for a single file (for
example: if you made changes far apart, like the header &
footer). The numbers in between tell us how many lines we're
seeing and where they start. For example:
@@ +1,3 -1,3 @@
means we'll see three lines of significant content,
including both addition & removal, beginning at line one.
In the code itself, lines that were removed are prefixed with a
-
and lines
that were added are prefixed with a
+
. Remember
that you won't see these on the same lines. Even if you only
changed a few words, Git will still treat it like the whole line
was replaced.
Diff options
Remember that, by default,
git diff
compares the current working directory to the last commit. You
can compare the staging area instead of the working directory
with
git diff --staged
. This is another great way to double-check your work before
pushing up to a remote branch.
You’re also not limited to your current branch — or even your current commit! You can pass a base & target branch to compare, and you can use some special characters to help you browse faster! Here are a few examples:
# See differences between the 'feature'# branch and the 'master' branch.> git diff master feature# Compare two different commits> git diff 1fc345a 2e3dff# Compare a specific file across separate commits> git diff 1fc345a 2e3dff my-file.js
Time travel
git diff
gives
us the opportunity to explore our code's current state, but
what if we wanted to see its state at a different point in time?
We can use checkout!
git checkout
lets us take control of our
HEAD
to bounce
around our timeline as we please.
Remember that
HEAD
is a
special Git reference that usually follows the latest commit on
our current branch. We can use
git checkout
to
point our
HEAD
reference
at a different commit, letting us travel to any commit in our
repository's history. By reading the commit message and
exploring the code at the time of the commit, we can see not
only what changed but also why it changed! This can be great for
debugging a problem or understanding how an app evolved.
Let’s look at a diagram to understand what
checkout
does a
little better:
Notice that we haven’t lost any commits, commit messages, or
code changes. Using
git checkout
is
entirely non-destructive.
To browse to a different commit, simply pass in a reference or
hash for the commit you’d like to explore.
git checkout
also supports a few special characters & reserved
references:
# You can checkout a branch name.# You'll be using this particular branch a lot!> git checkout master# You can also use commit hashes directly> git checkout 7d3e2f1# Using a hyphen instead of a hash will take# you to the last branch you checked out> git checkout -# You can use "HEAD~N" to move N commits prior# to the current HEAD> git checkout HEAD~3
Once you’re done browsing the repo’s history, you can use
git checkout <your-branch-name>
to move
HEAD
back to
the front of the line (your most recent commit). For example, in
our diagram above, we could use
git checkout master
to take our
HEAD
reference
back to commit
42ffa1
.
Why checkout?
Most of Git’s power comes from a simple ability: viewing commits
in the past and understanding how they connect. This is why
mastering the
git checkout
command is so important: it lets you think more like Git and
gives you full freedom of navigation without risking damage to
the repo's contents.
That said, you’ll likely use shortcuts like
git checkout -
far more often than specifically checking out commit hashes.
Especially with the advent of user-friendly tools like GitHub,
it's much easier to visualize changes outside the command
line. We'll demonstrate browsing commit histories on GitHub
in a future lesson.
Git ‘Do-Overs’: Reset & Rebase
Git is designed to protect you — not only from others, but also from yourself! Of course, there are times where you’d like to exercise your own judgement, even if it may not be the best thing to do. For this, Git provides some helpful tools to change commits and “time travel”.
Before we talk about these, a warning: The commands in this lesson are destructive! If used improperly, you could lose work, damage a teammate’s branch, or even rewrite the history of your entire project. You should exercise caution when using these on production code, and don’t hesitate to ask for help if you’re unsure what a command might do.
After this lesson, you should:
Be able to roll back changes to particular commit.

Know when to rebase/reset and when not to.
Resetting the past
Remember how our commits form a timeline? We can see the state
of our project at any point using
git checkout
.
What if we want to travel back in time to a point before we
caused a new bug or chose a terrible font?
git reset
is
the answer!
Resetting involves moving our HEAD
ref back to a different commit.
No matter how we reset,
HEAD
will move
with us.  We can use some
additional flags to determine how our code changes are handled.
Soft resets
The least-dangerous reset of all is
git reset --soft
.
A soft reset will move our
HEAD
ref to the
commit we've specified, and will leave any intermediate
changes in the staging area.

A practical example of when a soft reset would be handy is joining some small commits into a larger one. We’ll pretend we’ve been struggling with “their”, “there”, and “they’re” in our app.  We’ll fix them with a soft reset:
git reset --soft 9c5e2fc
This moves our
HEAD
ref back
to our first commit. Looking at our commit log now, we might be
worried we've lost our changes:
Our changes are still present in the staging area, ready to be
re-committed when we’re ready! We can use
git commit
to
re-apply those changes to our commit history with a new, more
helpful message instead:
Notice that the new commit has a totally new hash. The old commit messages (and their associated hashes) have been lost, but our code changes are safe and sound!
Risky Business: Mixed resets
If soft resets are the safest form of
git reset
,
mixed resets are the most average! This is exactly why
they're the default: running
git reset
without adding a flag is the same as running
git reset --mixed
.
In a mixed reset, your changes are preserved, but they’re moved
from the commit history directly to the working directory. This
means you’ll have to use
git add
to
choose everything you want in future commits.
Mixed resets are a good option when you want to alter a change in a previous commit. Let’s use a mixed reset with our “their”, “there”, “they’re” example again.
 The
difference between
--soft
and
--mixed
comes
down to whether you'll be keeping the code exactly the same
before re-committing it or making changes.
Hard resets
Hard resets are the most dangerous type of reset in Git. Hard
resets adjust your
HEAD
ref and
totally destroy any interim code changes. Poof. Gone forever.
There are very few good uses for a hard reset, but one is to get
yourself out of a tight spot. Let’s say you’ve made a few
changes to your repository but you now realize those changes
were unnecessary. You’d like to move back in time so that your
code looks exactly as it did before any changes were made.
git reset --hard
can take you there.
It’s our last round with “their”, “there”, and “they’re”. We’ve tried it all three ways and decided we don’t need to use that word at all! Let’s walk through a hard reset to get rid of our changes.
We’ll start in the same place we began for our soft reset:
It turns out that we’ll be using a video on our homepage and don’t need text at all! Let’s step back in time:
git reset --hard 9c5e2fc
Our Git log output is much simpler now:
It’s empty — no changes in your working directory and no changes in your staging area. This is major difference between a hard reset and a soft/mixed reset: you will lose all your changes back to the commit you’ve reset to.
If your teammate came rushing in to tell you that the boss has changed their mind and wants that homepage text after all, you’re going to be re-doing all that work! Be very confident that the changes you’re losing are unimportant before embarking on a hard reset.
Rebase: ‘Alt-time travel’
Sometimes we want to change more than a few commits on a linear
timeline. What if we want to move multiple commits across
branches?
git rebase
is
the tool for us!
Rebasing involves changing your current branch’s base branch. We might do this if we accidentally started our branch from the wrong commit or if we’d like to incorporate changes from another branch into our own.
Isn’t that the same as git merge?
git merge
?" In almost all cases, you'd be right. Rebasing is a
dangerous process that effectively rewrites history.
I see you too like to live life Dangerously… tell me about Rebase..
Let’s look at a situation where we might be tempted to rebase.
We’ve added a couple commits to a feature branch while other
team members have been merging their code into the
master
branch.
Once we're ready to merge our own branch, we probably want
to follow a tried-and-true procedure:
> git pull origin master
This will fetch our remote
master
branch
and merge its changes into our own feature branch, so it's
safe to pull request or
git push
.
However, every time we do that, a merge commit will be created!
This can make a big mess of our Git commit history, especially
if lots of people are making small changes.
We can use
git rebase
to
move our changes silently onto the latest version of
master
.
Here's what the
git log
history
of our two example branches looks like:
Notice that both branches start at
9c5e2fc
.
That's our common ancestor commit, and is where
git merge
would
start stitching these branches together! We're going to
avoid that entirely with a rebase. We'll run this command
while we have
working-on-the-header
checked out:
git rebase master
Here’s our new commit history:
working-on-the-header
See how we changed the color of our commits after the rebase? Take a close look at the commit history changes as well. Even though our commits have the same content, they have a new hash assigned, meaning they’re entirely new commits! This is what we mean by “rewriting history”: we’ve actually changed how Git refers to these changes now.
“Golden Rule of Git”
These tools can all feel pretty nifty, but be very wary of using them too much! While they can augment your Git skills from good to great, they can also have catastrophic side effects.
There’s a “Golden Rule of Git” you should know that directly
relates to both
git reset
and
git rebase
:
Never change the history of a branch that’s shared with others.
That’s it! It’s simple and to the point. If you’re resetting or rebasing your own code and you make a mistake, your worst case scenario is losing your own changes. However, if you start changing the history of code that others have contributed or are relying on, your accidental loss could affect many others!
How to check your Git configuration:
The command below returns a list of information about your git configuration including user name and email:
git config -l
How to setup your Git username:
With the command below you can configure your user name:
git config --global user.name "Fabio"
How to setup your Git user email:
This command lets you setup the user email address you’ll use in your commits.
git config --global user.email<EMAIL_ADDRESS>How to cache your login credentials in Git:
You can store login credentials in the cache so you don’t have to type them in each time. Just use this command:
git config --global credential.helper cache
How to initialize a Git repo:
Everything starts from here. The first step is to initialize a new Git repo locally in your project root. You can do so with the command below:
git init
How to add a file to the staging area in Git:
The command below will add a file to the staging area. Just
replace
filename_here
with the name of the file you want to add to the staging area.
git add filename_here
How to add all files in the staging area in Git
If you want to add all files in your project to the staging
area, you can use a wildcard .
and every file will be added for you.
git add .
How to add only certain files to the staging area in Git
With the asterisk in the command below, you can add all files starting with ‘fil’ in the staging area.
git add fil*
How to check a repository’s status in Git:
This command will show the status of the current repository including staged, unstaged, and untracked files.
git status
How to commit changes in the editor in Git:
This command will open a text editor in the terminal where you can write a full commit message.

Replace commit-id with the id of the commit that you find in the commit log after the word commit.
git show commit-id
How to see log stats in Git:
This command will cause the Git log to show some statistics about the changes in each commit, including line(s) changed and file names.
git log --stat
How to see changes made before committing them using “diff” in Git:
You can pass a file as a parameter to only see changes on a
specific file.git diff
shows only unstaged changes by default.
We can call diff with the
--staged
flag
to see any staged changes.
git diff
git diff all_checks.py
git diff --staged
How to see changes using “git add -p”:
This command opens a prompt and asks if you want to stage changes or not, and includes other options.
git add -p
How to remove tracked files from the current working tree in Git:
This command expects a commit message to explain why the file was deleted.
git rm filename
How to rename files in Git:
This command stages the changes, then it expects a commit message.
git mv oldfile newfile
How to ignore files in Git:
Create a .gitignore
file and commit it.
How to revert unstaged changes in Git:
git checkout filename
How to revert staged changes in Git:
You can use the -p option flag to specify the changes you want to reset.
git reset HEAD filename
git reset HEAD -p
How to amend the most recent commit in Git:
git commit --amend
allows you to modify and add changes to the most recent commit.
git commit --amend
!!Note!!: fixing up a local commit with amend is great and you can push it to a shared repository after you’ve fixed it. But you should avoid amending commits that have already been made public.
How to rollback the last commit in Git:
git revert
will
create a new commit that is the opposite of everything in the
given commit.
 This opens the editor so you can add a commit message.
git revert comit_id_here
How to create a new branch in Git:
By default, you have one branch, the main branch. With this command, you can create a new branch. Git won’t switch to it automatically — you will need to do it manually with the next command.
git branch branch_name
How to switch to a newly created branch in Git:
When you want to use a different or a newly created branch you can use this command:
git checkout branch_name
How to list branches in Git:
You can view all created branches using the
git branch
command. It will show a list of all branches and mark the
current branch with an asterisk and highlight it in green.
git branch
How to create a branch in Git and switch to it immediately:
In a single command, you can create and switch to a new branch right away.
git checkout -b branch_name
How to delete a branch in Git:
When you are done working with a branch and have merged it, you can delete it using the command below:
git branch -d branch_name
How to merge two branches in Git:
To merge the history of the branch you are currently in with the
branch_name
,
you will need to use the command below:
git merge branch_name
How to show the commit log as a graph in Git:
We can use
--graph
to get
the commit log to show as a graph. Also,--oneline
will limit commit messages to a single line.
git log --graph --oneline
How to show the commit log as a graph of all branches in Git:
Does the same as the command above, but for all branches.
git log --graph --online --all
How to abort a conflicting merge in Git:
If you want to throw a merge away and start over, you can run the following command:
git merge --abort
How to add a remote repository in Git
This command adds a remote repository to your local repository
(just replace
https://repo_here
with your remote repo URL).
git add remote https://repo_here
How to see remote URLs in Git:
You can see all remote repositories for your local repository with this command:
git remote -v
How to get more info about a remote repo in Git:
Just replace
origin
with the
name of the remote obtained by
running the git remote -v
command.
git remote show origin
How to push changes to a remote repo in Git:
When all your work is ready to be saved on a remote repository, you can push all changes using the command below:
git push
How to pull changes from a remote repo in Git:
If other team members are working on your repository, you can retrieve the latest changes made to the remote repository with the command below:
git pull
How to check remote branches that Git is tracking:
This command shows the name of all remote branches that Git is tracking for the current repository:
git branch -r
How to fetch remote repo changes in Git:
This command will download the changes from a remote repo but will not perform a merge on your local branch (as git pull does that instead).
git fetch
How to check the current commits log of a remote repo in Git
Commit after commit, Git builds up a log. You can find out the remote repository log by using this command:
git log origin/main
How to merge a remote repo with your local repo in Git:
If the remote repository has changes you want to merge with your local, then this command will do that for you:
git merge origin/main
How to get the contents of remote branches in Git without automatically merging:
This lets you update the remote without merging any content into
the
local branches. You can call git merge or git checkout
to do the merge.
git remote update
How to push a new branch to a remote repo in Git:
If you want to push a branch to a remote repository you can use the command below. Just remember to add -u to create the branch upstream:
git push -u origin branch_name
How to remove a remote branch in Git:
If you no longer need a remote branch you can remove it using the command below:
git push --delete origin branch_name_here
How to use Git rebase:
You can transfer completed work from one branch to another using
git rebase
.
git rebase branch_name_here
Git Rebase can get really messy if you don’t do it properly. Before using this command I suggest that you re-read the official documentation here
How to run rebase interactively in Git:
You can run git rebase interactively using the -i flag.
It
will open the editor and present a set of commands you can use.
git rebase -i master
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
# d, drop = remove commit
How to force a push request in Git:
This command will force a push request. This is usually fine for
pull request branches because nobody else should have cloned
them.
But this isn’t something that you want to do with
public repos.
git push -f
Git Alias Overview
It is important to note that there is no direct
git alias
command. Aliases are created through the use of the
git config
command and the Git configuration files. As with other
configuration values, aliases can be created in a local or
global scope.
To better understand Git aliases let us create some examples.
$ git config --global alias.co checkout
$ git config --global alias.br branch
$ git config --global alias.ci commit
$ git config --global alias.st status
The previous code example creates globally stored shortcuts for
common git commands. Creating the aliases will not modify the
source commands. So
git checkout
will still be available even though we now have the
git co
alias.
These aliases were created with the
--global
flag
which means they will be stored in Git's global operating
system level configuration file. On linux systems, the global
config file is located in the User home directory at
/.gitconfig
.
[alias]
co = checkout
br = branch
ci = commit
st = status
This demonstrates that the aliases are now equivalent to the source commands.
Usage
Git aliasing is enabled through the use of
git config
, For
command-line option and usage examples please review the
git config
documentation.
Examples
Using aliases to create new Git commands
A common Git pattern is to remove recently added files from the
staging area. This is achieved by leveraging options to the
git reset
command. A new alias can be created to encapsulate this behavior
and create a new alias-command-keyword which is easy to
remember:
git config --global alias.unstage 'reset HEAD --'
The preceding code example creates a new alias
unstage
. This
now enables the invocation of
git unstage. git unstage
which will perform a reset on the staging area. This makes the
following two commands equivalent.
git unstage fileA
$ git reset HEAD -- fileA
My Default Gitignore:
Troubleshooting Git
Here are some tips on troubleshooting and resolving issues with Git.
Broken pipe errors on
git push
‘Broken pipe’ errors can occur when attempting to push to a remote repository. When pushing you usually see:
Write failed: Broken pipe
fatal: The remote end hung up unexpectedly
To fix this issue, here are some possible solutions.
Increase the POST buffer size in Git
If you’re using Git over HTTP instead of SSH, you can try increasing the POST buffer size in Git’s configuration.
Example of an error during a clone:
fatal: pack has bad object at offset XXXXXXXXX: inflate
returned -5
Open a terminal and enter:
git config http.postBuffer 52428800
The value is specified in bytes, so in the above case the buffer size has been set to 50MB. The default is 1MB.
Check your SSH configuration
If pushing over SSH, first check your SSH configuration as ‘Broken pipe’ errors can sometimes be caused by underlying issues with SSH (such as authentication). Make sure that SSH is correctly configured by following the instructions in the SSH troubleshooting documentation.
If you’re a GitLab administrator and have access to the server,
you can also prevent session timeouts by configuring SSH
keep alive
either on the client or on the server.
Configuring both the client and the server is unnecessary.
To configure SSH on the client side:
-
On UNIX, edit
~/.ssh/config
(create the file if it doesn’t exist) and add or edit: -
Host your-gitlab-instance-url.com ServerAliveInterval 60 ServerAliveCountMax 5
-
On Windows, if you are using PuTTY, go to your session
properties, then navigate to “Connection” and under “Sending
of null packets to keep session active”, set
Seconds between keepalives (0 to turn off)
to60
.
To configure SSH on the server side, edit
/etc/ssh/sshd_config
and add:
ClientAliveInterval 60
ClientAliveCountMax 5
Running a
git repack
If ‘pack-objects’ type errors are also being
displayed, you can try to run a
git repack
before attempting to push to the remote repository again:
git repack
git push
Upgrade your Git client
In case you’re running an older version of Git (< 2.9), consider upgrading to >= 2.9 (see Broken pipe when pushing to Git repository).
ssh_exchange_identification
error
Users may experience the following error when attempting to push or pull using Git over SSH:
Please make sure you have the correct access rights
and the repository exists.
...
ssh_exchange_identification: read: Connection reset by peer
fatal: Could not read from remote repository.
or
ssh_exchange_identification: Connection closed by remote host
fatal: The remote end hung up unexpectedly
This error usually indicates that SSH daemon’s
MaxStartups
value is throttling SSH connections. This setting specifies the
maximum number of concurrent, unauthenticated connections to the
SSH daemon. This affects users with proper authentication
credentials (SSH keys) because every connection is
‘unauthenticated’ in the beginning. The default value is
10
.
Increase
MaxStartups
on
the GitLab server by adding or modifying the value in
/etc/ssh/sshd_config
:
MaxStartups 100:30:200
100:30:200
means up to 100 SSH sessions are allowed without restriction,
after which 30% of connections are dropped until reaching an
absolute maximum of 200.
Once configured, restart the SSH daemon for the change to take effect.
# Debian/Ubuntu
sudo systemctl restart ssh# CentOS/RHEL
sudo service sshd restart
Timeout during
git push
/
git pull
If pulling/pushing from/to your repository ends up taking more than 50 seconds, a timeout is issued. It contains a log of the number of operations performed and their respective timings, like the example below:
remote: Running checks for branch: master
remote: Scanning for LFS objects... (153ms)
remote: Calculating new repository size... (cancelled after 729ms)
This could be used to further investigate what operation is performing poorly and provide GitLab with more information on how to improve the service.
git clone
over
HTTP fails with
transfer closed with outstanding read data remaining
error
If the buffer size is lower than what is allowed in the request, the action fails with an error similar to the one below:
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
This can be fixed by increasing the existing
http.postBuffer
value to one greater than the repository size. For example, if
git clone
fails
when cloning a 500M repository, you should set
http.postBuffer
to 524288000
.
That setting ensures the request only starts buffering after the
first 524288000 bytes.
The default value of
http.postBuffer
, 1 MiB, is applied if the setting is not configured.
git config http.postBuffer 524288000


{% extends 'layout.html' %} {% block pageTitle %} Chickenpox example page - Design system testing {% endblock %} {% block beforeContent %} {{ breadcrumb({ href: "/", text: "Home" }) }} {% endblock %} {% block content %}
Chickenpox is common and mostly affects children, although you can get it at any age. It usually gets better by itself within a week without needing to see a GP.
You might get symptoms before or after the spots, including:
Chickenpox is very itchy and can make children feel miserable, even if they do not have many spots. Chickenpox is usually much worse in adults.
It's possible to get chickenpox more than once, although it's unusual.
Check other rashes in children.
You'll need to stay away from school, nursery or work until all the spots have crusted over.
This is usually 5 days after the spots first appeared.
Tell the receptionist you think it's chickenpox before going in.
They may recommend a special appointment time if other patients are at risk.
You may need medicine to prevent complications. You need to take it within 24 hours of the spots coming out.
111 will tell you what to do. They can arrange a phone call from a nurse or doctor if you need one.
Go to 111.nhs.uk or call 111.
You can catch chickenpox by being in the same room as someone with it.
It's also spread by touching clothes or bedding that has fluid from the blisters on it.


JavaScript Arrays
JavaScript arrays are used to store multiple values in a single variable.
Displaying Arrays
In this tutorial we will use a script to display arrays inside a
 element with id="demo":
Example

The first line (in the script) creates an array named cars.
The second line "finds" the element with id="demo", and "displays" the array in the "innerHTML" of it.
Try it Yourself
Create an array, and assign values to it:
Spaces and line breaks are not important. A declaration can span multiple lines:
| Never put a comma after the last element (like "BMW",). The effect is inconsistent across browsers. |
What is an Array?
An array is a special variable, which can hold more than one value at a time.
If you have a list of items (a list of car names, for example), storing the cars in single variables could look like this:
var car1 = "Saab";
var car2 = "Volvo";
var car3 = "BMW";
However, what if you want to loop through the cars and find a specific one? And what if you had not 3 cars, but 300?
The solution is an array!
An array can hold many values under a single name, and you can access the values by referring to an index number.
Creating an Array
Using an array literal is the easiest way to create a JavaScript Array.
Syntax:
var array-name = [item1, item2, ...];
Example:
var cars = ["Saab", "Volvo", "BMW"];
Using the JavaScript Keyword new
The following example also creates an Array, and assigns values to it:
| The two examples above do exactly the same. There is no need to use new
Array(). For simplicity, readability and execution speed, use the first one (the array literal method). |
Access the Elements of an Array
You refer to an array element by referring to the index number.
This statement accesses the value of the first element in cars:
var
name = cars[0];
This statement modifies the first element in cars:
cars[0] = "Opel";
| [0] is the first element in an array. [1] is the second. Array indexes start with 0. |
You Can Have Different Objects in One Array
JavaScript variables can be objects. Arrays are special kinds of objects.
Because of this, you can have variables of different types in the same Array.
You can have objects in an Array. You can have functions in an Array. You can have arrays in an Array:
myArray[0] = Date.now;
myArray[1] = myFunction;
myArray[2] = myCars;
Arrays are Objects
Arrays are a special type of objects. The typeof operator in JavaScript returns "object" for arrays.
But, JavaScript arrays are best described as arrays.
Arrays use numbers to access its "elements". In this example, person[0] returns John:
Objects use names to access its "members". In this example, person.firstName returns John:
Array Properties and Methods
The real strength of JavaScript arrays are the built-in array properties and methods:
Examples
var x = cars.length;
// The length property returns the number of elements in cars
var y = cars.sort();
// The sort() method sort cars in alphabetical order
Array methods are covered in the next chapter.
The length Property
The length property of an array returns the length of an array (the number of array elements).
Example
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.length; // the length of fruits is 4
Try it Yourself »
| The length property is always one more than the highest array index. |
Adding Array Elements
The easiest way to add a new element to an array is using the push method:
Example
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.push("Lemon"); // adds a new element (Lemon) to fruits
Try it Yourself »
New element can also be added to an array using the length property:
Example
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits[fruits.length] = "Lemon"; // adds a new element (Lemon) to fruits
Try it Yourself »
Adding elements with high indexes can create undefined "holes" in an array:
Example
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits[10] = "Lemon"; // adds a new element (Lemon) to fruits
Try it Yourself »
Looping Array Elements
The best way to loop through an array, is using a "for" loop:
Example
var index;
var fruits = ["Banana", "Orange", "Apple", "Mango"];
for (index = 0; index < fruits.length; index++) {
text += fruits[index];
}
Try it Yourself »
Associative Arrays
Many programming languages support arrays with named indexes.
Arrays with named indexes are called associative arrays (or hashes).
JavaScript does not support arrays with named indexes.
In JavaScript, arrays always use numbered indexes.
Example
var person = [];
person[0] = "John";
person[1] = "Doe";
person[2] = 46;
var x = person.length;
// person.length will return 3
var y = person[0];
// person[0] will return "John"
Try it Yourself »
|
WARNING !! If you use a named index, JavaScript will redefine the array to a standard object. After that, all array methods and properties will produce incorrect results. |
Example:
var person = [];
person["firstName"] = "John";
person["lastName"] = "Doe";
person["age"] = 46;
var x = person.length; // person.length will
return 0
var y = person[0];
// person[0] will return undefined
Try it Yourself »
The Difference Between Arrays and Objects
In JavaScript, arrays use numbered indexes.
In JavaScript, objects use named indexes.
| Arrays are a special kind of objects, with numbered indexes. |
When to Use Arrays. When to use Objects.
- JavaScript does not support associative arrays.
- You should use objects when you want the element names to be strings (text).
- You should use arrays when you want the element names to be numbers.
Avoid new Array()
There is no need to use the JavaScript's built-in array constructor new Array().
Use [] instead.
These two different statements both create a new empty array named points:
var points = new Array();
// Bad
var points = [];
// Good
These two different statements both create a new array containing 6 numbers:
var points = new Array(40, 100, 1, 5, 25, 10) // Bad
var points = [40, 100, 1, 5, 25, 10];
// Good
Try it Yourself »
The new keyword only complicates the code. It can also produce some unexpected results:
var points = new Array(40, 100); // Creates an array with two elements (40 and 100)
What if I remove one of the elements?
var points = new Array(40); // Creates an array with 40 undefined elements !!!!!
Try it Yourself »
How to Recognize an Array
A common question is: How do I know if a variable is an array?
The problem is that the JavaScript operator typeof returns "object":
var fruits = ["Banana", "Orange", "Apple", "Mango"];
typeof fruits; // returns object
Try it Yourself »
The typeof operator returns object because a JavaScript array is an object.
Solution 1:
To solve this problem ECMAScript 5 defines a new method Array.isArray():
Array.isArray(fruits); // returns true
Try it Yourself »
The problem with this solution is that ECMAScript 5 is not supported in older browsers.
Solution 2:
To solve this problem you can create your own isArray() function:
function isArray(x) {
return
x.constructor.toString().indexOf("Array") > -1;
}
Try it Yourself »
The function above always returns true if the argument is an array.
Or more precisely: it returns true if the object prototype contains the word "Array".
Solution 3:
The instanceof operator returns true if an object is created by a given constructor:
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits instanceof Array // returns true
Try it Yourself »
Test Yourself with Exercises!
Exercise 1 » Exercise 2 » Exercise 3 » Exercise 4 » Exercise 5 »


These are brand, product and marketing designs done for Schweppes Nigeria. These included graphics and animations for Social Media, Print, Advertising and Internal Communications.
These are brand, product and marketing designs done for Budweiser Nigeria. These included graphics and animations for Social Media, Print, Advertising and Internal Communications.
These are brand, product and marketing designs done for OneBank. These included graphics and animations for Social Media, Print, Advertising and Internal Communications.


---
mainColor: '#fff'
name: 'rankup'
title: 'Rankup'
externalUrl: false
url: 'Rankup.app'
imageBg: 'rankup-bg.png'
imageBgColor: '#ebfafe'
order: 2
subtitle: "Compete against other players to find out who really is the brainy one in the realm of football."
stack:
- Polymer 3 + LitElement
- Firebase
- Cloud Functions
- Web Automation
- Node.js
- Progressive Web App
role: ['Owned and led the entire process']
overview: "
Create or Join a tournament.
Predict the matches results.
Get your points.
Win the tournament 🏆
"
showcase: true
showcaseImg: 'rankup.webp'
mainImgs: ['tournaments.png', 'live.png']
secondaryImgs: ['unstarted-pure.png', 'avatar-pure.png', 'new-tournament.png', ranking-pure.png]
problem: 'The main problem with the other games were:
1. Difficult game to play for the average user. Excluding the vast majority that would have wanted to play.
2. Old fashioned UI and not reliable app with many errors. It was almost only possible to play on desktop.
3. For the game to be enjoyable the user needed to play everyday. If the user missed one day, the user would’ve already been at a disadvantage. This was exhausting for almost all types of players.
'
motivation: 'I started playing fantasy football games when I was 12 years old and I loved it. There was always a huge gap for improvement.
My goal was to build a very easy game with a clear intuitive UI that would work on all types of devices where all types of players were included. From the player who loves this type of game and spends day after day thinking about how to do better, to the one who plays for fun to play with its family and friends.
With this in mind, I knew what I had to do to build a game that players would love.'
process: 'As soon as I started, my goal was to build a MVP and pass it to a close group with diverse types of players so I could gain understanding about what they do like, what they don’t, what they’re missing, and whether they find it fun and easy to play. Overall, if they were having a great user experience and time while playing. For example, I was very nit-picky with the matches scoreboard inputs functionality and UI. It had to be very very clear and appealing for the players. It was a crucial feature, the player could spend hours and hours in this view each week so I always thought about making it better and better.
The closed group really liked it and continued playing so I decided to expand it to different groups before the final version. My deadline was to release it 2 months before the World Cup 2018.'
results: 'When I released it before the World Cup 2018, as I didn’t have money to advertise it properly, all users that had known about Rankup was because of word-of-mouth so I decided to spend time advertising it on forums. At this time, I knew Rankup was a successful game because there were already groups playing it and they were loving it. Just before the World Cup kicked out, there were 1390 players and 186 tournaments created, the success surprised me.
There were 70% customer retention until the end of the World Cup and players were completely engaged on Rankup. For example, every time there was a goal during the World Cup, hundreds of users connected simultaneously to see their score and how they were doing. The peak was in one game of the semifinals with 324 players at the same time when France scored.'
---
{% include work.html %}


Here, test score data following a normal distribution is simulated. The x-axis is the test score and the y-axis represents the frequency of that score. The program collects the data point by point and increases the height of each green dot when it encounters a test of that score. This means the height of a green dot is the frequency of that score. As time goes on, the frequency plot starts to look like the normal distribution.