Matlab can
generate dependency graphs
and export to GraphML files.
The GUI dependency analyzer also shows missing variable and function definitions for the whole project in one view.
The implicit static analysis of the dependency analyzer seems to be more thorough than the command
requiredFilesAndProducts.
Even if you don’t typically use the Matlab “Project” feature, it’s useful for quality assurance to run this tool on Matlab code to find hidden problems that escape the imperfect nature of unit tests.
Regardless of coding language, we use a layered approach for code quality assurance including static analysis, unit tests and integration tests.
We might choose to suppress DeprecationWarning in a repo’s test suite because the warnings are coming from modules developed by others (e.g. Numpy or Xarray).
However, don’t be too carte blanche about suppressing DeprecationWarning.
Python
breakpoint()
abstracts away pdb.set_trace() and allows use of other debuggers.
breakpoint() also works well with Pytest to conditionally break into code.
x=1y=0breakpoint()
z = x/y
breakpoint() is immediately clear as to its purpose.
WSL2
works with Nmap directly and is generally recommended instead of Cygwin.
For those who do need Cygwin, it’s possible to use Nmap from Cygwin, silently calling Windows Nmap.
Install by download nmap.
Install nmap “self-installer” .exe. When asked, also install Npcap.
Cygwin: add to ~/.bash_profile the following. Note the \ and \( are vital for Cygwin shell to interpret the command correctly.
Starting Nmap ( https://nmap.org )
Nmap scan report for 8.8.8.8
Host is up (0.0092s latency).
Not shown: 998 filtered ports
PORT STATE SERVICE
53/tcp open domain
443/tcp open https
Nmap done: 1 IP address (1 host up) scanned in 7.41 seconds
Troubleshooting:
errors about interface → try running Cygwin as Administrator (right click on Cygwin icon).
find interface names available to nmap
nmap --iflist
Notes:
to find servers with a particular port open on a subnet, try my
Python findssh
program that scans for servers without nmap.
If you don’t install Npcap when asked in the nmap installer, nmap does not work.
Nmap claims no host existed at a known working IP address.
Opening Paraview Python “pvpython” terminal is accomplished by:
Linux: pvpython should be on $PATH.
macOS: Look under /Applications/ParaView*.app/Contents/bin/pvpython
Windows: Look under Start Menu > ParaView > pvpython
Paraview’s Python interface scripts that use Render() create a vestigial feature that is frozen.
To make the plots interactive, use Interact() instead.
Python Paraview example:
fromparaview.simpleimport *
s = Sphere()
Show()
Interact()
CMake with the Ninja and Ninja Multi-Config generators virtually always work well together, including with Fortran projects.
To generate the dependency graph, CMake directs the Fortran compiler to
preprocess each Fortran code file
when using the Ninja generator.
In rare cases, some legacy Fortran large code files can generate unexpected and spurious syntax errors when using CMake + Ninja.
The workaround seems to be to use the GNU Make backend, we have found that works for the rare case this became an issue.
Android task switching swipe navigation can be switched to 3-button navigation.
Some workflows are much easier via the traditional 3-button navigation used by Android since Android 3.x / 4.x.
Also when wearing gloves, using 3-button navigation can work better.
Switch an Android device to traditional 3-button navigation (back, home, switch or triangle, circle square)
by going to Settings → System → Gestures → System navigation and select “3-button navigation”.
CMake is excellent for building very complex Fortran projects across operating systems and computing platforms from embedded systems to HPC.
Here are a few common Fortran CMake patterns.
For hand-written Makefile the order of libraries matters completely.
CMake attempts to determine the graph for library files, starting from the user specified order.
CMake will try a finite multiplicity to resolve the graph, but in tough cases of library interdependency library ordering may need to be influenced by
add_dependencies()
or even
object libraries.
“Undefined reference to” occurs at linking of main executable: be sure the library is actually linked to the user library with
cmake --build build -v
Fortran module include: be sure the *.mod file directory is included, particularly to the main executable by setting the target properties like: