The COBOL Problem
https://twitter.com/audreywatters/status/1246609613203505152
The tweet has since been deleted. Here's the old text
https://twitter.com/audreywatters/status/1246609613203505152
The tweet has since been deleted. Here's the old text
At this point, we're closing in on 9/13 (70%) of the way through the 2nd edition rewrite.
Important changes.
This seemed like an interesting problem. I hope this isn't someone's take-home homework or an interview question. It seemed organic enough when I found out about it.
Given a document like this...
doc = {
"key": "the key",
"tag1": ["list", "of", "values"],
"tag2": ["another", "list", "here"],
"tag3": ["lorem", "ipsum", "dolor"],
}
We want …
more ...Using the clear() method of a dict isn't *wrong*. But. The reasons have to be investigated. I got a question about this code not working "properly." ("Properly"? Seems too vague to be useful.)
Here's a summary of the example.
final_list = []
temp_dict = {}
for obj in some_source:
cool_function(obj, temp_dict)
final_list.append …
more ...
See {filename}/blog/2020/01/2020_01_26-stingrayreader_upgrade.rst
This drifted into some serious rethinking of bad design decisions. (If someone else did this, I'd call it weak, and suggest improvements. It was me. It was bad. I'm a bad programmer and I feel bad about it.)
An an example, there's this …
more ...
some_data = {name: source[name] for name in the_names}
the_object = SomeClass(**some_data)
See "Additional, Related Content". It's one of the posts here: https://www.patreon.com/slott.
I think there's space for a Building Skills in Functional Python title next to the Building Skills in OO Design.
more ...See https://github.com/slott56/cpx-xmas-ornament You'll need a Circuit Playground Express https://www.adafruit.com/product/3333 Install the code. Enjoy the noise and blinky lights. The MML translation isn't as complete as you might like. The upper/lower case for the various commands isn't handled quite as cleanly …
more ...>>> t_s = (8063599, 0) >>> fields = [(t_s := divmod(t_s[0], b))[1] for b in (60, 60, 24, 7)] >>> list(reversed(fields + [t_s[0]])) [13, 2, 7, 53, 19]
I've recorded two courses for LinkedIn Learning https://www.linkedin.com/learning/me
Let me emphasize that their production values take a lot of work. While I think I'm a pretty good live presenter, a few days in the recording booth with a producer, reveals all my weaknesses. so. um …
more ...