Enviar por SMS: Relating Lagrangian and Hamiltonian formalisms of LC circuits