San Jose, Calif., which calls itself the capital of Silicon Valley and has grown to become the nation’s 10th biggest city, has had to shed more than a fifth of its workers in recent years to save money. It is, in a way, a microcosm of the nation, which has lost 668,000 state and local…