Wi-Fi really slow on Mac until I reboot
If you're allowed to use evil external contraptions such as sort
and cut
:
#! /bin/bash
while IFS= read -r line; do
squeezed=$( tr -d '[:blank:]' <<<"$line" )
printf '%d\t%d\t%s\n' ${#line} ${#squeezed} "$line"
done | sort -n -k 1 -k 2 | cut -f 3-
Edit: Since everybody's doing it, here's a solution with perl
:
perl -e 'print sort { length $a <=> length $b || $a =~ y/ \t//c <=> $b =~ y/ \t//c } <>'
One small remark: if $p > 4$ then any element $x$ of ${\rm GL}(4,F_{p})$ of order a power of $p$ satisfies $(x-I)^{4} = 0$, so that we certainly have $(x-I)^{p} = 0$ and $x^{p} = I$. Hence ${\rm GL}(4,F_{p})$ contains no element of order $p^{2}$ when the prime $p$ is greater than $3$.
This is probably not what the OP had in mind but it is common practice not to include the $p^2/2m$ term to study spins on a lattice for example, where one is only interested in the spin degrees of freedom, completely neglecting the positional ones. Look for yourself at the Hamiltonian of the Ising Model here: no momentum operator in it.
As pointed out in a comment to this answer, this is an approximation, as a complete Hamiltonian would feature the momentum of the particles carrying the spin. What happens here, usually, is that the positional degrees of freedom decouple from the spin ones, and it is therefore legitimate to consider a Hamiltonian just for the spins. In the context of such a lattice, i.e. physically a crystal, the positional degrees of freedom would typically give rise to quasi-particle called phonons, which are the quantum of the lattice vibration, and a complete Hamiltonian would then induce an interaction between the phonons and the spins: I don't mean a direct coupling term in the Hamiltonian but that the spin-spin coupling would depend on the distance between the particle.