-
安装 nodejs,在项目目录下安装 three.js 模块:
npm install --save @types/three
-
在该目录下会有一个 node_modules/@types/three 文件夹
-
在 js 文件中输入
THREE
就会产生提示(参考 https://blog.csdn.net/Mrhan210/article/details/85263755) -
在 three 中定义的变量都有提示,不过其创建的变量没有提示,可以在变量上添加类似
/** @type {THREE.WebGLRenderer} */
的说明即可(参考 https://blog.csdn.net/supergao222/article/details/80658525)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set filetype=python | |
"au BufNewFile,BufRead *.py,*.pyw setf python | |
autocmd FileType python set expandtab | |
set helplang=cn "中文帮助文档(前提是下了中文包) | |
syntax enable | |
syntax on " 自动语法高亮 | |
set number"显示行号 | |
colorscheme desert" 设定配色方案 | |
set guifont=Consolas:h12:cANSI"英文字体 | |
set guifontwide=SimSun-ExtB:h12:cGB2312 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
def getip(): | |
try: | |
_s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
_s.connect(('8.8.8.8', 80)) | |
ip = _s.getsockname()[0] | |
finally: | |
_s.close() | |
return ip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 对一幅灰度图像进行直方图均衡化 | |
def myhisteq(im, nbr_bins=256): | |
""" | |
@im: PIL.Image.Image, mode is L | |
@return: PIL.Image.Image | |
""" | |
np_im = np.asarray(im) | |
imhist, bins = np.histogram(np_im.flatten(), nbr_bins) | |
csum = np.cumsum(imhist) | |
csum = 255 * csum / csum[-1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin | |
export PATH | |
#=================================================================# | |
# System Required: CentOS 6+, Debian 7+, Ubuntu 12+ # | |
# Description: One click Install Shadowsocks-Python server # | |
# Author: Teddysun <i@teddysun.com> # | |
# Thanks: @clowwindy <https://twitter.com/clowwindy> # | |
# Intro: https://teddysun.com/342.html # | |
#=================================================================# |
- 安装服务:
wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks.sh
chmod +x shadowsocks.sh
./shadowsocks.sh 2>&1 | tee shadowsocks.log
- 加速1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
from matplotlib import animation | |
from IPython.display import display, HTML | |
import numpy as np | |
def plot_sequence_images(image_array): | |
''' Display images sequence as an animation in jupyter notebook | |
Args: | |
image_array(numpy.ndarray): image_array.shape equal to (num_images, height, width, num_channels) |
Commands:
./tst.py &
: run in backgroundnohup ./tst.py &
: don't print output in stdout, and set the parent process as #0 process.nohup
means No hangup signal.setsid ./tst.py &
: print output in stdout, set the parent process as #1 process.disown %1
: change the parent process of a background process- hot key
ctrl+z
: suspend foreground process bg %1
: trun foreground job #1 to background, equal tokill -CONT -pid_value
bg
: trun all foreground job to backgroundfg %1
: trun background job to foreground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import torchvision | |
import torch.utils.data | |
from torchvision import transforms | |
from torch.backends import cudnn | |
# some hyperparameters setting | |
use_gpu = True | |
train_batch_size = 64 | |
val_batch_size = 64 |
NewerOlder