Making GNU Coreutils wc word count faster
Josh Katz posted his
version of wc
word count utility that was markedly faster than
GNU Coreutils wc.
We haven’t tried benchmarking
uutils Rust-based coreutils
wc that’s used by
Ubuntu.
Josh Katz posted his
version of wc
word count utility that was markedly faster than
GNU Coreutils wc.
We haven’t tried benchmarking
uutils Rust-based coreutils
wc that’s used by
Ubuntu.
The Wilson 1000 is a popular high-performance magnet mount antenna for CB radio and 10 meter amateur radio. The screw-on loading coil design may lead to the magnetic base becoming loose from the antenna mount, which can cause high SWR spikes that could damage the transmitter. Eventually, the antenna could detach from the magnetic base and fall off the vehicle, which is a safety hazard. The symptom of this is when the magnetic base is on a metallic surface, gentle twisting of the plastic shroud allows rotation of the shroud over the magnetic base - this is a problem, the shroud should not be able to rotate over the magnetic base when the antenna is properly tightened. This procedure works for similar antennas with a screw-on coil including the Wilson 5000, Stryker SR-A10MM, Radio Shack 21-940A, and others.
The tools required to fix this are a 9/16" socket, a 9/16" wrench, and a 11/16" wrench. An adjustable wrench may be used, but a 9/16" socket is strongly recommended along with whatever wrench is used. Gently peel off the vinyl sheet covering the magnetic base and set it in a clean space as it will be reused. Gently lift off the plastic shroud and slide it down the cable several inches to expose the nut and coax connection to the antenna base. Use the 9/16" socket under the magnetic base and the 9/16" wrench on the nut above the magnetic base to tighten the nut to the magnetic base. Don’t use excessive force as the nut can be stripped or the magnetic base can be damaged. After tightening the nut, slide the plastic shroud back up and tighten the shroud with the 11/16" wrench to secure it to the antenna base. Finally, reapply the vinyl sheet to the magnetic base to protect it from corrosion and to maintain the appearance of the antenna. Be sure not to crinkle the vinyl sheet as this can affect antenna SWR performance and the attachment strength of the magnetic base to the vehicle.
GCC GFortran, LLVM Flang, and Intel oneAPI are among the most advanced free-to-usemodern Fortran compilers. Currently we recommend writing Fortran code to support:
Useful
GFortran standard Fortran 2018
enhancements include:
select rank
assumed array rank,
error stop
within pure procedures,
random_init
to initialize random number seed, and
implicit none (type, external)
to require external procedures to be explicitly declared.
GCC 13 is the
oldest version
currently maintained.
To get recent GCC is usually straightforward. Red Hat should use GCC Toolset. macOS Homebrew quickly adds the latest GCC version. If Ubuntu gfortran repo defaults aren’t adequate, get recent Gfortran via PPA.
Here are some of the major changes in Gfortran by version:
split intrinsic subroutine, optional lower argument to c_f_pointer, and additional trigonometric functions (sinpi, etc.). It also enhances coarray support with native shared memory multithreading on single-node machines and better Fortran 2018 TEAM handling, improves Fortran 2003 parameterized derived types (LEN parameters), and adds Fortran 2018 extensions to the IMPORT statement, the REDUCE intrinsic, and the new GENERIC statement.-funsigned), Fortran 2018/2023 locality specifiers in do concurrent, and stricter format string parsing (missing commas in I/O descriptors are now rejected by default). The module file format is now incompatible with GCC 8–14 (but older .mod files can still be read). Coarray support has been significantly reworked.-std=f2023 (prepares for Fortran 2023) with increased free-form line length (10,000 characters) and statement length (up to 1 million characters). It also improves preprocessing output with -save-temps (.fii/.fi files).bind(C) with character length greater than one. This is a groundbreaking improvement for C interoperability for character and strings, even C++ <string> using ISO_Fortran_binding.h.select rank.random_init() to initialize the random generator seed.do concurrent, actual argument array with too few elements for dummy argument now errors, initial support for parameterized derived types (simply define kind at initialization) and coarray support for teams. Standard flag -std=f2018 added and deprecated -std=f2008ts.select type. Complete Fortran 2003 support, Fortran 2018 non-constant stop and error stop codes, and -fdec- options to help compile very old non-standard code.Gfortran 6 added Fortran 2008 submodule support, useful for large projects to save compilation time and allow powerful use scenarios.
Fortran 2003 deferred-length character are
useful
for avoiding bothersome trim() everywhere.
GCC 5 added full support for OpenMP 4.0, Fortran 2003 ieee_ intrinsics, Fortran 2008 error stop in pure procedures with constant error code.
GCC 4.9 added Fortran 2003 deferred-length character variables in derived types.
GCC 4.8 supported Fortran 2008 polymorphism, including select type, class(*), type(*), and Fortran 2018 assumed rank dimension(..).
GCC 4.6 was the first version of Gfortran reaching beyond Fortran 95, with Fortran 2003 deferred-length character variable and Fortran 2008 impure elemental support.
GCC 4.5 added Fortran 2008 iso_fortran_env.
GCC 4.4 added initial support for polymorphism and OpenMP 3.
CMake allows switching parameters based on compiler version. This is very useful for modern Fortran programs.
Example CMakeLists.txt for Fortran compiler version dependent options.
if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
add_compile_options($<$<COMPILE_LANGUAGE:Fortran>:-fimplicit-none>)
if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL "10.0")
add_compile_options($<$<COMPILE_LANGUAGE:Fortran>:-fallow-argument-mismatch>)
endif()
endif()or using generator expressions exclusively:
add_compile_options(
$<$<COMPILE_LANG_AND_ID:Fortran,GNU>:-fimplicit-none>
$<$<AND:$<COMPILE_LANG_AND_ID:Fortran,GNU>,$<VERSION_GREATER_EQUAL:$<CMAKE_Fortran_COMPILER_VERSION>,10.0>>:-fallow-argument-mismatch>
)Reference: Gfortran changelog
Jupyter notebook outputs can be large (plots, images, etc.), making Git repo history excessively large and making Git operations slower as the Git history grows. Jupyter notebook outputs can reveal personal information with regard to usernames, Python executable, directory layout, and data outputs.
Strip all Jupyter outputs from Git tracking with a client-side Git pre-commit hook by configuring Git pre-commit hooks. We use Git pre-commit hook because Git filters can interfere with other programs such as CMake ExternalProject.
Configure Git user-wide where to use an IPython script to strip Jupyter notebook outputs by:
git config --global hook.lintipython.event pre-commit
git config --global hook.lintipython.command '$HOME/linters/strip-ipython.py'Use an IPython linter script like ~/linters/strip-ipython.py. On Unix-like systems, the script must have execute permissiong like:
chmod +x ~/linters/strip-ipython.pyIn some environments, Fortran Package Manager commands like fpm build or fpm test can fail when a dependency (say HDF5) is resolved through pkg-config and the .pc file includes a system include path such as -I/usr/include.
In that case, allow pkg-config to keep system CFLAGS via
pkg-config environment variable
for FPM to work:
PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 fpm buildPKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1pkg-config --cflags output.The symptom of possibly needing this flag is:
> fpm build
<ERROR> *cmd_build* Model error: Cannot get pkg-config build flags: environment variable error.
STOP 1Continuous Integration services run user-defined self-checks on code on each “git push”. GitHub Actions is a popular service for CI. CI is one part of the DevOps lifecycle.
CI services generally have quotas and/or concurrency limits but these are currently no-cost for public Git repos:
We have amassed numerous CI examples across programming languages, including
Git does not have a integral mechanism to have multiple authors per Git commit. A Git coauthor notation convention has become accepted by major services including Github and GitLab. Git itself can programmatically parse arbitrary Git commit trailers but does not have a built-in notion of coauthors.
Indicate Git coauthor by placing plaintext in the commit message body. The email address cited must match a registered email with the Git service. The email can be a working public email or the “fake” noreply email provided by the Git service. Multiple coauthors each use the same syntax on the same Git commit like:
added foo function to bar.py
Co-authored-by: David <snake@users.noreply.github.com>
On GitHub, a coauthor commit looks like:

Currently, the coauthored commit doesn’t count on the user’s GitHub contribution calendar.
The coauthor commits do show up in GitHub search under “Commits”.
Caveats: as with regular Git commits, there is no authentication to avoid someone masquerading as someone else with Git coauthor commits. Git coauthor commits cannot be GPG signed for each coauthor, only the primary Git committer can GPG sign as usual.
Commands like git rebase can use --trailer to for example show who reviewed a rebase like:
git rebase can add trailers to the Git commit message to indicate who reviewed the rebase like:
git rebase --trailer "Reviewed-by: Nobody <nobody@users.noreply.github.com>"When only a subdirectory of a Git repository is opened in Visual Studio Code, repo-root Copilot customizations like .github/copilot-instructions.md are not discovered by default. This can make Copilot ignore repository-wide instructions even though they exist at the top of the current Git repository.
Visual Studio Code has a built-in configuration items to resolve this issue by enabling parent repository discovery for chat customizations.
{
"chat.useCustomizationsInParentRepositories": true
}With this setting enabled true, VS Code walks upward from the opened workspace folder until it finds .git.
It then discovers chat customizations between the opened folder and the repository root, including:
.github/copilot-instructions.md.github/instructions/*.instructions.mdAGENTS.mdThis setting is especially useful for monorepos and for workflows that open a focused subdirectory such as content/posts/, src/, or packages/frontend/ instead of the full repository root.
Without parent repository discovery, Copilot can miss repository-specific style and validation rules.
A few conditions apply:
.gitTo verify that the repository instructions are in use, inspect the References list on a Copilot Chat response. If parent discovery is working, the response references typically include the repo-root customization files.
A Linux computer temp folder can be purged on schedule to free up disk space and remove old temporary files. The programs “tmpwatch” or “tmpreaper” can be used to purge the temp folder on a schedule. tmpwatch is available on Red Hat-based Linux distributions, while tmpreaper is available on Debian-based Linux distributions.
To do a “dry run” of the purge command to see what files would be deleted, use the “–test” flag:
<tmpwatch|tmpreaper> --test --mtime 7d /tmpSet the temp path explicitly, especially on HPC systems where scratch space may be under system-specific paths.
--mtime 7d/tmpOn Linux, a cron job can run the purge command on schedule.
Edit the crontab with:
crontab -eAdd a line to run the purge command daily at midnight:
0 0 * * * /usr/bin/tmpwatch --mtime 7d /tmp
Homebrew Cask packages GUI (graphical) programs. Many users install only the CMake CLI tools with:
brew install cmakeThis does not install the cmake-gui program.
To install CMake-GUI:
brew install --cask cmakeTo use cmake-gui from terminal, add this to ~/.zprofile:
export PATH=$PATH:/Applications/CMake.app/Contents/binConfirm the /Applications path from the cmake-gui line under Artifacts:
brew info --cask cmakeWhen launching from terminal, specify -S . and -B build to prefill source and build directories:
cmake-gui -S . -B buildThe CMake GUI is installable by package managers like:
apt install cmake-qt-gui
# or
dnf install cmake-gui
# or
pacman -S cmake-guiOn Windows, CMake GUI comes with the CMake package itself like:
winget install Kitware.CMake