I'm actually walking around a matplotlib bug; calling tight_layout() completely changes the image. I'll figure out later whether the before or the after image is the buggy one :|
hmm, perhaps my bug is actually just aliasing and neither are "wrong"
I should crank up the dpi
In [9]: fig.savefig('day21_finalstate.png',dpi=6000)
invalid command name "140240501946248idle_draw"
while executing
"140240501946248idle_draw"
("after" script)
Segmentation fault
This actually reminds me -- along with my adventures in nethack the other day -- of how useful visualization can be in debugging. I helped track down some very expensive bugs the other year just by plotting the time of certain files against their size.
MCVE
from string import ascii_uppercase
mask = ' _ ______ _ __ ______ '
''.join(s if m == ' ' else m for s, m in zip(ascii_uppercase, mask))
Is there a better recipe to mask a string?
@AndrasDeak no work has been done on the conversion yet... but I did bring it up at our year-end roadmapping session. "Management" ended up being on board for it, and we have agreed that all code we write going forward (until work starts on the conversion) will be written with 3 in mind :)
If memory serves we have Antti to thank for some of the speed. Personally I just like avoiding the duplication in the common cases, which was always ugly.
Every once in a while I want to pad a string to some particular dynamic width. Usually I write a pad function because I can't remember the built-in way(s) to do it
99% of the time when I'm padding, I'm doing it based on the length of the largest possible string that will appear in that context, so. Doesn't really matter either way in that case
(read "that other language" in the icy tone usually associated with the term "that other woman")
C# has PadLeft and PadRight, which I have an easier time remembering because they show up in the intellisense box when I type .pad. Javascript might have one but I can't say for sure because I forget literally every Javascript function except getElementById. I don't think KevinScript has one.