sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh
| // Copyright Louis Delacroix 2010 - 2014. | |
| // Distributed under the Boost Software License, Version 1.0. | |
| // (See accompanying file LICENSE_1_0.txt or copy at | |
| // http://www.boost.org/LICENSE_1_0.txt) | |
| // | |
| // A pretty printing library for C++ | |
| // | |
| // Usage: | |
| // Include this header, and operator<< will "just work". |
| #!/bin/zsh | |
| dragonColour=11 | |
| textColour=2 | |
| upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)" | |
| secs=$((${upSeconds}%60)) | |
| mins=$((${upSeconds}/60%60)) | |
| hours=$((${upSeconds}/3600%24)) | |
| days=$((${upSeconds}/86400)) | |
| UPTIME=`printf "%d days, %02dh%02dm%02ds" "$days" "$hours" "$mins" "$secs"` |
| def rolling_window(array, window=(0,), asteps=None, wsteps=None, axes=None, toend=True): | |
| """Create a view of `array` which for every point gives the n-dimensional | |
| neighbourhood of size window. New dimensions are added at the end of | |
| `array` or after the corresponding original dimension. | |
| Parameters | |
| ---------- | |
| array : array_like | |
| Array to which the rolling window is applied. | |
| window : int or tuple |