uses 256 colors-low the quality, but really makes a speed improvement. Might not display videos (e.g. VLC)–try /bpp:16 if trouble.
/bpp:16
uses 65536 colors, saving bandwidth over 24-bit color with negligible visible difference for most basic uses.
/network:modem /compression
reduce bandwidth via compression (trade CPU usages for network bandwidth)
-themes -wallpaper
great speedup by not needlessly sending background graphics repeatedly
/async-update /async-input
disable RDP waiting for screen updates to reach you before it accepts input.
These allow clicking ahead before the screen updates. Be careful of clicking unwanted options while using the PC.
-glyph-cache
disable glyph caching. Note: this can cause garbled characters and radio boxes.
/audio-mode:1
disable FreeRDP audio redirection (do not play sound from remote PC)
/auto-reconnect
automatically reconnect on failure (also works over SSH tunnel)
Usually it’s desired to check Python type annotations for an entire project.
However, when introducing type checking to a large Python project, it can be beneficial to introduce type checking gradually, to avoid massive refactoring all at once.
You will almost certainly find old code bugs due to type checking that will require refactoring, which introduces risk.
Mitigate this risk by introducing type checking gradually.
MyPy is a strongly recommended type checker, though others exist.
Use
pyproject.toml
to configure MyPy default behavior.
To tell MyPy to only check certain files, use the MyPy
–follow-imports=
option like:
32-bit Python binaries can run on 64-bit OS.
To precisely detect if the operating system is 64-bit or 32-bit,
check if Python
itself is 32-bit to avoid falsely detecting a 64-bit OS as 32-bit.
This check is just for the Python interpreter.
To detect OS parameters in a cross-platform-robust way further checks are necessary.
If the history of a Git repository has been rewritten, but someone has forked the repository before the history was rewritten, they will be unable to merge due to the unrelated history.
This method corrects the history in their forked branches to match the original repository.
In this synthetic example:
Original Git repository: github.com/username/coolprog main branch develop
Forked Git repository: github.com/jane/coolprog
A colleague, Jane, with GitHub username jane, has created a branch from develop named feature1. However, scivision changed the history of develop after the fork.
The “easy” way can reduce the risk of compromising months or years of work compared to the “Pure Git” way.
This method requires Jane to force push and execute these commands (or grant write access to the forked repository).
It is risky, so the “Easy” way is recommended.
Clone the forked repository into a temporary directory:
cd${TMPDIR}git clone https://github.invalid/jane/coolprog
cd coolprog
git switch develop
Add the original repository as upstream of the fork:
git remote add upstream https://github.invalid/scivision/coolprog
git fetch upstream
git rebase upstream/develop
git switch feature1
git rebase develop
If these changes are successful and the Git history is confirmed to be correct, a git push -f can be performed.
Ensure secure, independent copies of the GitHub repository are available, as force-pushing overwrites Git history and may erase work.
Sometimes for Git repos with a long, complicated history this doesn’t work, and would be time consuming to fix.
In that case, let’s try the “easy” way.
Matlab sparse matrices are among the classes that Matlab
cannot pass to Python.
The workaround requires enough RAM to hold the full matrix to pass to and from Python.
convert Matlab sparse to full
process sparse data in Python
convert Python sparse to full
All commands are issued in Matlab.
A = sparse(eye(5)); % test dataAs = py.scipy.sparse.csc_matrix(full(A))
Consider the
semi-automated script
to install Debian to the eMMC of the Beaglebone Black.
This procedure requires a 4 GB micro SD card or larger, and assumes a Linux laptop.
We will copy a Linux operating system image to eMMC from a micro SD card.
Type lsblk, note which drives are listed, then insert the SD card into the laptop and type lsblk again–the new item is your SD card. We assume /dev/mmcblk0.
Extract image to SD card:
xz -cd BBB-*.img.xz > /dev/mmcblk0
Extraction takes about 5 to 20 minutes at ~ 5 MB/sec, writing uncompressed ~ 2 GB to the SD card.
[optional] monitor data writing to SD card with
iotop
Ensure writing has completed with
sync
Insert micro SD card into the (non-powered) BBB and then apply power.
Beaglebone four onboard LEDs flash back and forth in a “cylon” or “knight rider” pattern.
During this time, the micro SD card program is flashing the onboard eMMC.
With an FTDI to USB adapter fit onto J1, the process can be monitored via the screen program.
The automatic flashing to eMMC process should complete in about 10-20 minutes.
Once the BBB has shut down, REMOVE the micro SD card from the BBB.
Reset the power or push the onboard POWER button next to the Ethernet jack.
Some programs simply cannot run without an X11 graphics server available.
In other cases, testing a program requires X11 to be available, even though the windows aren’t visible.
An example is creating Matplotlib figures in a continuous integration environment.
The
X server virtual framebuffer (Xvfb)
allows creating non-visible desktop windows without the computation burden of an full X11 graphics environment.
Xvfb is effective for most Linux systems without displays, particularly for headless or embedded systems including:
Raspberry Pi
Windows Subsystem for Linux
continous integration servers
virtual machines
apt install xvfb
Add to ~/.profile
Xvfb :99 &
exportDISPLAY=:99
Upon opening a new Terminal or SSH connection, the X11 virtual framebuffer is available.
Test XVFB by running a graphics-only program, for example:
xmessage -center "Hello World"
If XVFB or X11 isn’t working, the message will be like
With the recent release of iOS 13, we are seeing Apple iOS devices that suddenly won’t connect to any authenticated WiFi.
The solution seems to be to do one more reboot of the iOS device and if needed, “forget” and re-add the desired WiFi system.
Rebooting the WiFi router is generally NOT needed.