All contents 2017 Getty Images. All rights reserved.
By Remy Porter in Bring Your Own Code on Last week, I shared some code that, while imperfect, wasnt that bad. I then issued a challenge: make it worse. Or better, if you really want.
This is reasonable and fine. It makes perfect sense. Lets see if we can avoid making sense. 13 comments - Last comment @ 03:58.
As many comments noted: one 2 manner suchen ihre frau Billige hobbyhuren case covers only the first iteration of the loop, and one case only covers the last iteration of the loop. You could easily pull those out of the loop, and not need a for-case at all.
Others noticed that this pattern looked like odd slices out of an identity matrix. With that in mind, we got a few numpy, Matlab, or MatrixUtils based solutions generally were the best solutions to the problem: generate an identity matrix and take slices out of.