Step 1: Install
pip3 install flake8_string_format
Step 2: Run
find . -type f -name \*.py -print0 | xargs -0 python3 -m flake8_string_format --ignore P101,P102,P103
Step 1: Install
pip3 install flake8_string_format
Step 2: Run
find . -type f -name \*.py -print0 | xargs -0 python3 -m flake8_string_format --ignore P101,P102,P103
Twenty years ago, an extended family relation, a patent lawyer, expressed his opinion that there’s not that much variance between engineers — at least, not as much as people suppose. Companies draw from the same pool of talent, and the idea that one company has the bulk of talent is a misconception.
This article by Bill Nichols confirms that idea in the realm of programmers.
Programmer Moneyball: Challenging the Myth of Individual Programmer Productivity
My view is that hard work, good health, persistence, consistency, the ability to work with others make a big difference. On the other hand, poor health, inconsistency and confusion of priorities lead to mediocre results.
Key takeaways from the article, with my commentary below
He concludes, “the most motivating and humane way to improve average performance is to find ways to improve everyone’s performance.”
When management doesn’t prioritize items on the above list, it’s important for a software engineer to mange themselves and make them a priority.
Microsoft has been doing interesting things with Windows, such as adding Windows Subsystem for Linux, which allowed me to install and run Ubuntu from the Windows app store.
I love having a full and familiar Linux bash command shell at my fingertips, with the utilities I know and love, including ssh. It’s fast.
https://www.microsoft.com/en-us/p/ubuntu/9nblggh4msv6
Prior to this, I used cygwin on Windows, which was also good. However, I prefer Ubuntu, mostly.
There are some caveats:
sudo apt-get update ; sudo apt-get upgrade
There’s a book titled “Measure What Matters”, and it’s fascinating and worth the read. This article from acmqueue with nearly the same title is quite interesting, because it turns some of my previous thinking on it’s head.
Summary: “Speed matters”; Instrument client code to measure user experience; Measure “long-tail” latency at the 95th and 99th percentiles; even minor changes to code or user behavior can effect things; build bench-marking into release testing procedures.
I’ve got an OpenWRT router, and here’s how I configured it to enable safesearch on my home network.
Update May, 2022: Not recommended. I upgraded my router to OpenWRT 21.02.3 and suddenly, all searches through google, bing, and duckduckgo stopped working. At first, I thought it was cloudflare’s 1.1.1.3 DNS that was broken, but I was wrong. Once I removed the cname entries from my router and restarted dnsmasq, searches started working again.
uci add dhcp cname uci set dhcp.@cname[-1].cname="www.google.com" uci set dhcp.@cname[-1].target="forcesafesearch.google.com" uci commit dhcp uci add dhcp cname uci set dhcp.@cname[-1].cname="www.bing.com" uci set dhcp.@cname[-1].target="strict.bing.com" uci commit dhcp uci add dhcp cname uci set dhcp.@cname[-1].cname="duckduckgo.com" uci set dhcp.@cname[-1].target="safe.duckduckgo.com" uci commit dhcp for name in www.youtube.com m.youtube.com youtubei.googleapis.com youtube.googleapis.com www.youtube-nocookie.com ; do uci add dhcp cname uci set dhcp.@cname[-1].cname="$name" uci set dhcp.@cname[-1].target="restrict.youtube.com" uci commit dhcp done service dnsmasq restart
See the configuration:
grep -A2 cname /etc/config/dhcp
Useful information for reducing memory usage of Python programs:
TLDR: Dictionaries use a lot of memory. Possible solutions include using a class and slots, namedtuple, recordclass, cython, or numpy.
I run Ubuntu on my Lenovo P50, and the backlight keys haven’t ever worked. Here’s how I got it working.
sudo apt install xbacklight
Then I mapped the keys using Settings > Devices > Keyboard and added mappings for the following:
Windows-F5: xbacklight -inc 5 -time 1 -steps 1
Windows-F6: xbacklight -dec 5 -time 0 -steps 1
If you write Linux shell scripts (bash), you should use https://www.shellcheck.net/ to improve the quality of the script.
Microsoft has a long article in ACM Queue on what people think they’re getting out of code reviews, what they’re actually getting, as well as a list of benefits a code review tool should provide.
My main takeaways:
My Ubuntu box decided to update this library today, so I learned about a very fast and cool key-value database. It replaces BerkleyDB on Linux systems and is also used to persist data for Redis, InfluxDB, and has even been adapted for use with SQLite — called SQLightning (20x faster).
https://en.wikipedia.org/wiki/Lightning_Memory-Mapped_Database