What is the contrast used in calculating the $2^p$ ANOVA table? ${{}}$ According to my statistics textbook, you need the contrast of each effect and interaction in order to compute the sum of squares (for ANOVA) of that effect/interaction. Unfortunately, it never explains what contrast is.
Here are how the contrasts are calculated for each effect/interaction in a $2^3$ experiment:
\begin{align}
\text{Contrast}_A & =-\overline{X}_{1} + \overline{X}_A - \overline{X}_{B} - \overline{X}_{C} + \overline{X}_{AB} + \overline{X}_{AC} - \overline{X}_{BC} + \overline{X}_{ABC}\\[6pt]
\text{Contrast}_B & =-\overline{X}_{1} - \overline{X}_A + \overline{X}_{B} - \overline{X}_{C} + \overline{X}_{AB} - \overline{X}_{AC} + \overline{X}_{BC} + \overline{X}_{ABC}\\[6pt]
\text{Contrast}_C & =-\overline{X}_{1} - \overline{X}_A - \overline{X}_{B} + \overline{X}_{C} - \overline{X}_{AB} + \overline{X}_{AC} + \overline{X}_{BC} + \overline{X}_{ABC}\\[6pt]
\text{Contrast}_{AB} & =\overline{X}_{1} - \overline{X}_A - \overline{X}_{B} + \overline{X}_{C} + \overline{X}_{AB} - \overline{X}_{AC} - \overline{X}_{BC} + \overline{X}_{ABC}\\[6pt]
\text{Contrast}_{AC} & =\overline{X}_{1} - \overline{X}_A + \overline{X}_{B} - \overline{X}_{C} - \overline{X}_{AB} + \overline{X}_{AC} - \overline{X}_{BC} + \overline{X}_{ABC}\\[6pt]
\text{Contrast}_{BC} & =\overline{X}_{1} + \overline{X}_A - \overline{X}_{B} - \overline{X}_{C} - \overline{X}_{AB} - \overline{X}_{AC} + \overline{X}_{BC} + \overline{X}_{ABC}\\[6pt]
\text{Contrast}_{ABC} & =-\overline{X}_{1} + \overline{X}_A + \overline{X}_{B} + \overline{X}_{C} - \overline{X}_{AB} - \overline{X}_{AC} - \overline{X}_{BC} + \overline{X}_{ABC}
\end{align}
The sum of squares is calculated with $\text{SS} = \dfrac{(\#\text{replicates per group}) \cdot \text{contrast}^2}{2^3}$
So what is contrast?
 A: What I think is the most frequently seen definition (but I haven't checked all the books, even among those I have at hand) is this:

A contrast is a linear combination in which the sum of the coefficients is $0$, but not all coefficients are $0$.

A bit more precisely, if you multiply all the coefficients by the same scalar, it's not really a different contrast, e.g. if the coefficients are $2, -1, -1$, that's really the same contrast as $4,-2,-2$.
Contrasts among averages of different populations or among estimates of those averages assess the ways in which they differ from each other. For example $2,-1,-1$ would measure the diffence between the first population and the average of the second and third.
Your example involves a three-factor anova. Your first contrast differs significantly from $0$ if there is a significant difference between the two levels of factor $A$. That is because all of the terms corresponding to one of the two levels of factor $A$ have plus signs and those corresponding to the other level have a minus sign. The one with the subscript $AB$ differs significantly from $0$ if there is significant evidence of interaction between those two factors. Etc.
