HDF5 files do not have an error recovery mechanism and do not journal.
There is an optional per-variable error checksum Fletcher32 to detect data corruption.
Checking/comparing file size alone is not an adequate check for HDF5 corruption.
Here a few easy techniques to check for corrupted HDF5 files.
PythonHDF5 checking script
checks HDF5 files for corruption and optionally finds the corrupted block(s) and variable(s)
HDFview GUI appears to use the Fletcher32 checksum to show a red question mark if corruption is detected.
Another curiosity is that the Object reference is 2^32 - 1 on the corrupted variable.
HDFView bad variable
Related: HDF5 GUIs to view and edit variables in .h5 files
Using CMake and a few dashes of modern Fortran techniques, the ASCII text art Peanuts / Snoopy calendar lives again on
GitHub.
PDF output and inputting of one’s own ASCII image files is now possible.
Virtual machine image sharing between computers works best with operating systems that are not license-bound to hardware.
Linux and
ReactOS
are good candidates.
Windows is not a good candidate for virtual machine sharing since Windows checks the hardware.
The image can reside on a fast USB drive or network share.
For the 50 United States and possessions, there is a convenient
clickable map
that returns elevation data.
Lists of elevation data can also be retrieved.
This is useful as a sanity check for the more typical DEM programs typically used.
Easily compile and use the “GNC” Robust Optical Flow C code from M. Black’s
article.
Black Robust optical flow code
Run the C-compiled executable gnc directly, from Matlab or Python.
The Bash shell has environment variables LINES and COLUMNS representing the current terminal window width.
One might therefore incorrectly assume that Fortran 2003 standard get_environment_variable() subroutine would trivially get the current Terminal window dimensions.
This is not so, since Bash passes along only the “POSIX” set of environment variables, and those that have been exported to the executable.
A working example of getting current Fortran terminal size using Ncurses is in the
BlockTran
program, where the variables LINES and COLS are set using the getmaxyx Ncurses macro.
Use the method above, as the method below naïvely fails.
Thus, the following will result in status code 1, indicating the environment variable was not found.
If the user runs this program as
LINES=24 ./myprog
that “works”, but we want an automatically determined value.
programnoenvuse,intrinsic::iso_fortran_env,only:error_unitimplicitnone(type,external)character(4)::bufinteger::h,ioscallget_environment_variable('LINES',buf,status=ios)if(ios/=0)thenwrite(error_unit,*)'got error code',ios,'on trying to get LINES'stopendifread(buf,*)hendprogram
Fortran 77 statement functions were thankfully made obsolete by Fortran 95 standard.
Statement functions are notanonymous functions.
In most cases, one should simple use standard functions instead of confusing statement functions.
Other use cases are addressed by the polymorphism enabled from Fortran 2003 forward and/or pointers.
Example: Replace Fortran statement function with a standard function.
programstinteger::f,i,j,k,n! obsolete statement function (don't use)
f(n)=n+(i*j)**ki=2j=3k=4print*,fprint*,g(i,j,k)containsintegerfunctiong(n,i,j,k)! use this instead of statement function
integer,intent(in)::n,i,j,kg=n+(i*j)**kendfunctiongendprogram
While for regular use one might setup a headless VM with RDP and/or SSH running on the VM itself,
this procedure is for connecting to a virtual machine on a remote PC.
Prerequisites:
Remote: VirtualBox install of guest operating system
local: apt install xfreerdp-x11
on your local laptop, create a script vmrdp.sh containing:
Optionally, add a few simple
FreeRDP options
to enhance performance, especially on limited data bandwidth connections
Most people can use the VirtualBox GUI, and don’t need the alternative command line option.
Establish a VNC connection over SSH
The very basic OpenBox desktop environment can open a Terminal on the remote PC by right clicking anywhere on the remote desktop and type
virtualbox
The usual VirtualBox program should open
From the right dropdown menu of the right arrow “start” button on the main VirtualBox window on the remote VNC PC, click headless.
The status of the VM will show “Running”.
Connect from laptop with a script vmrdp.sh as above.
When done, shutdown your VM as usual if desired.
Most can use the GUI method above, but VirtualBox can also be managed well via shell commands.
virtualbox vmstart MyVMName --headless
starts up the VM named “MyVMName” for example.
Numerous headless options exist for low server resource utilization via
VBoxManage
CLI.