- ssh your remote server:
ssh username@serverip
;
- source a Python environment which has the Jupyter installed;
- execute:
$ jupyter notebook --no-browser --port=8889 --NotebookApp.allow_origin="*" --ip=serverip --NotebookApp.token=''
"""Remove duplicate subtitles in a .srt file. | |
- What does the standard srt file look like? | |
- See https://www.3playmedia.com/2017/03/08/create-srt-file/ | |
- What does the duplicate subtitle look like? | |
- The duplicate subtitle is something like the addition of its previous and next subtitle. | |
- Which match pattern has been used in this script? | |
- Line 85, 87 | |
- What does the output srt file look like? | |
- [original_file_name]_changed.srt |
"""Translate .srt files using Google Translate Ajax API. | |
Usage | |
----- | |
$ python translate_srt.py *.srt [src=]en [dest=]zh-cn [-n *.srt] [-p 5] [-v] | |
Note: | |
- the available values to assign position arguments [src, dest] can be abtained from the below *AVAILABLE LANGUAGES* section. | |
- try to assign a high value to *patience* argument if you meet a high failure ratio. [-p 5] is recommended. [-p -1] expects no failures would be happen which instead requires a long period to bruce-force complete. |
""" | |
S. R. Cloude and E. Pottier, "An entropy based classification scheme for land applications of polarimetric SAR," in IEEE Transactions on Geoscience and Remote Sensing, vol. 35, no. 1, pp. 68-78, Jan. 1997, doi: 10.1109/36.551935. | |
""" | |
import matplotlib.pyplot as plt | |
import numpy as np | |
def h_alpha_decomposition(T3): | |
assert isinstance(T3, np.ndarray) | |
assert T3.ndim >= 2 |
#!/bin/bash | |
function __curl() { | |
read proto server path <<<$(echo ${1//// }) | |
DOC=/${path// //} | |
HOST=${server//:*/} | |
PORT=${server//*:/} | |
[[ x"${HOST}" == x"${PORT}" ]] && PORT=80 | |
exec 3<>/dev/tcp/${HOST}/$PORT | |
echo -en "GET ${DOC} HTTP/1.0\r\nHost: ${HOST}\r\n\r\n" >&3 |
#!/bin/bash | |
echo "This is a console commands collection, do not run this script directly" | |
exit 1 | |
# latexdiff | |
latexdiff "$1" "$2" >_diff.tex 2>/dev/null | |
sed -i.bak '/\RequirePackage\[normalem\]{ulem}/d' _diff.tex | |
xelatex _diff | |
bibtex _diff | |
xelatex _diff |
# Configuration file for jupyter-notebook. | |
#------------------------------------------------------------------------------ | |
# Application(SingletonConfigurable) configuration | |
#------------------------------------------------------------------------------ | |
## This is an application. | |
## The date format used by logging formatters for %(asctime)s | |
# Default: '%Y-%m-%d %H:%M:%S' | |
# c.Application.log_datefmt = '%Y-%m-%d %H:%M:%S' |
pandoc part-1.md[, part-2.md, ...] -o book.md | |
pandoc --metadata title="<book-name>" book.md -o book.epub |
from datetime import datetime | |
def relative_history_date(history_datetime): | |
"""Format history datetime to relative representation. | |
Parameters | |
---------- | |
history_datetime : datetime |
from functools import wraps | |
def show_func_repr(func): | |
@wraps(func) | |
def wrapper(*args, **kwargs): | |
print('{func}({args}{kwargs})'.format( | |
func=func.__name__, | |
args=', '.join([f'{arg!r}' for arg in args]), | |
kwargs=''.join([f', {k}={v!r}' for k, v in kwargs.items()]) |