TemporaryDirectory(ignore_cleanup_errors=True) fixes the Windows corner case on exiting a tempfile context manager such as cloning a Git repo into the TemporaryDirectory.
importtempfilewith tempfile.TemporaryDirectory(ignore_cleanup_errors=True) as tmpdir:
# create subdirectories, make files, git clone, etc.# the context manager attempts to recursively delete "tmpdir" on exit
If there is a PermissionError, the temporary directory remains until the operating system cleans up the temporary directory.
Pacman
can download packages in parallel to speed up the process.
The number of parallel download threads can be controlled in the “/etc/pacman.conf” file.
This can be useful on slower internet connections to install packages without disrupting other network activities.
To set the number of parallel download threads, edit “/etc/pacman.conf” file.
Find the “ParallelDownloads” option in the file.
If it is not present, add it under [options] section.
Set the number of download threads.
The ordering of options doesn’t matter.
For example, to use 3 parallel download threads:
Olivier Giroux
chairs the ISO C++ subgroup for Concurrency and Parallelism.
Olivier continues to present very useful interactive talks on C++ concurrency and parallelism.
This talk is about the C++ Forward Progress Guarantee in light of concurrency and parallelism.
C++ Proposal
P2809R3
is to allow trivial infinite loops as defined behavior in C++.
The definition Olivier uses for concurrency at 16:50 in the video above is:
Concurrent tasks eventually observe each other’s effects.
The Android
GnssLogger app
logs data in the user-selected formats, including
RINEX.
GnssLogger can run for hours or days, assuming the device has enough storage.
Do test runs to be sure unnecessary other data files aren’t also stored as they can be much larger than the RINEX data.
When clicking “save and send” to end a logging session, the app asks where to save in the cloud.
Simply canceling the upload retains the data in the “Downloads” folder on the device.
This can be useful when the device has a low-bandwidth or expensive data connection, and the data can be uploaded later or copied to a computer via USB.
In addition to
generic
and
polymorphic
procedures, Fortran also allows aliasing procedure names.
This is useful to provide a shorter or more convenient name for a procedure.
It’s easiest to understand from the example below.
programmaininterfaceeasyprocedure::long_and_descriptive_procedure_nameendinterfacecalleasy()containssubroutinelong_and_descriptive_procedure_nameprint'(a)',"Hello from long name"endsubroutinelong_and_descriptive_procedure_nameendprogram
Matlab Engine API allows calling Matlab functions from Python code.
These commands are executed from Terminal, not from Matlab.
Go to the Matlab Engine directory to setup Matlab Engine, where “python” starts the desired Python executable.
importmatlab.engineeng = matlab.engine.start_matlab('-nojvm')
y = eng.asin(1.)
eng.quit()
The Matlab Engine should take about 1 second for Matlab Engine to start when called from Python.
For Matlab functions requiring JVM remove the “-nojvm” option.
Many Matlab numeric classes (single, double, logical) can be converted to Python types like:
numpy.asarray(x)
Python floats pass into Matlab Engine by including a period . after the number.
asin(1) fails
asin(1.) works
Python can pass N-dimensional arrays to Matlab.
Matlab Engine provides asynchronous call with
background=True
PDCurses is a long-standing Curses terminal graphics library for which we provide
CMake build script
that works across operating systems including Windows, Linux, macOS and DOS.
X11, SDL2 and Windows console backends are supported.
CMake environment variable
CTEST_PARALLEL_LEVEL
controls default test parallellism to save test run wallclock time.
CTEST_PARALLEL_LEVEL=0 uses unbounded test parallelism.
If the computer runs out of memory or has conflicts with parallel tests, use
fixtures and resource locks
to control test run parallelism on a per-test basis.
CTest parallel somewhat randomizes the order of the tests.
ctest –schedule-random
randomizes the order of tests even for serial test runs.
This example run on a 4-core machine shows that no extra command line parameters are needed to use CTEST_PARALLEL_LEVEL: