Notes for week 23 of 2021
I’ve decided to reorganise those notes a bit. Given the ratio of my writings and my current projects, whoever is reading this is most probably interested in personal news as well. It will have its own section now, together with one new regular item: receipt of the week.
- This week was the first anniversary of this blog! I feel it calls for some celebration as the
blog-softwares-written:blogposts-writtenratio is vastly superior to my previous attempts. It almost feel like this blog deserves an actual design. I am purposefully pushing this into the future as I want to close down on Graveyard first. Plus, my most read essay is back from the times when there was literally no CSS file.
- Related to that, I finished first note that’s partially political. I hope I’ll not regret crossing that Rubicon
- I’ve walked 10 km. I’ve been active for 2.1 hours during 3 activities. This week’s max speed was 5.6 km/h.
- PolarDB is an interesting new entrant to DB world; Alibaba’s fork of PostgreSQL for distributed data processing. See architecture docs
- I’ve learned about Conspirituality and I love that neologism
- Michael Loop shared his flowchart for big decisions
Graveyard & Django
- I finally deem black integration in VS Code vastly superior to the one in PyCharm. I’ve used PyCharm a lot in the last few weeks because of larger-scale refactorings. It happens to me quite often that if I properly get into the touch type zone, the black reformatting happens mid-write and reformats code under my hands. In addition, unlike VS Code, it doesn’t preserve the cursor location, yielding complete gibberish.
- In Django migrations, When inheriting models, fields / database columns are denormalised into the „final“ model, which makes sense. Just plan for it: renames in the top-level model is duplicated as many times as the underlying inheritance tree
- Want to rename model attributes without renaming the underlying column? The working way to do that is:
db_columnattribute first, i.e.
name = TextField(db_column="name")
- Update to new name,
new_name = TextField(db_column="name")
Do not bundle into a single step, otherwise change is not recognised and you are entering a world of pain
- Related: there is a
yescommand that generates
yfor all prompts. Thus, you can do
yes | python manage.py makemigrations
- Receipt of the week was burgers from red lentils from a deadwood cookbook, a variation of this recipe
- My joy for regaining my energy level was so large that I just had to kick some doorsill real hard. OK, grounded for two more weeks.
Recommended Readings From This Week
- An incomplete list of skills senior engineers need, beyond coding: Nonobvious senior skills
- New Atheism: I disagree with the result, but it makes me think
- J.K. Rowling and the Limits of Imagination: Interpreting Harry Potter through JKR political opinions. It’s very ideological, but the part about the approval of slavery in the wizard’s system made me pause
- Fun with Viewport Units: Cool CSS tricks
- Practical Reed-Solomon for Programmers: Reed-Solomon explained well
- You want to reduce the carbon footprint of your food? Focus on what you eat, not whether your food is local: Reminder on food selection
- A Proactive Approach to Time Scarcity: “Focus on scarcity occurs involuntarily.”
- The Future of Command and Control: Four Models to Provoke Thought: Coolaborative decision making in the Army, full of bad graphs, but some good thoughts
- How Western media would cover Minneapolis if it happened in another country: Yes.
- Why Birds Can Fly Over Mount Everest: I didn’t knew that! Birds have way more efficient respiratory system than mammals as it delivers fresh oxygen even when breathing out. This is inherited from dinosaurs and it’s why dinos could’ve been be so large.
- Unhelpful Thinking Styles: Cognitive Distortions In CBT: Good overview
- Wilde Blima: How to remember a family character
Published in Notes and tagged python • Weekly Notes