How is a Generator Matrix for a (7, 4) Hamming code created? I see that a generator matrix is created with the following formulae:
$$G = \left[I_{k}|P\right]$$
I do not understand what P is in this case. In my notes, I am told that in a (7, 4) Hamming code situation my
$$G =
\begin{pmatrix} 1 & 0 & 0 & 0 & 1 & 0 & 1 \\ 0 & 1 & 0 & 0 & 1 & 1 & 1 \\ 0 & 0 & 1 & 0 & 1 & 1 & 0 \\ 0 & 0 & 0 & 1 & 0 & 1 & 1   \end{pmatrix}$$
where P would be 
$$P=\begin{pmatrix}  1 & 0 & 1 \\  1 & 1 & 1 \\  1 & 1 & 0 \\  0 & 1 & 1   \end{pmatrix}$$
How is this P generated?

The standard way of finding out the parity matrix $G_{k,n}$ for a Hamming code is constructing first the check parity matrix $H_{n-k,n}$ in systematic form.
For this, we recall that a Hamming code has $d=3$ (minimum distance). Hence the columns of $H$ have the property that we can find a set of $3$ linearly dependent columns, but not $2$ columns or less. Because we are in $GF(2)$ (binary code) this is equivalent to saying that the columns of $H$ must be distinct (and different from zero). Then the columns of $H$ just correspond to the  $2^{n-k}-1$ different non-zero binary tuples. We can choose to construct it systematic, hence, for example:
$$ H=
\begin{pmatrix} 
1 &1 &0& 1 &1& 0 &0\\      
0 &1 &1 &1 &0 &1 &0\\
1 &1& 1 &0& 0 &0& 1
\end{pmatrix} = [P^t \mid I_{n-k}]
$$
Be aware that you could also choose other permutations of the first 4 columns.
From this, you get $G=[I_k \mid P ]$
