markdown Чтозначитcloseиquitвselenium

close quit selenium
```
    def close(self):
        """
        Closes the current window.

        :Usage:
            driver.close()
        """
        self.execute(Command.CLOSE)

    def quit(self):
        """
        Quits the driver and closes every associated window.

        :Usage:
            driver.quit()
        """
        try:
            self.execute(Command.QUIT)
        finally:
            self.stop_client()
```

markdown 唧唧降价

readme
# Chirp

A cooler and simplified version of Twitter made using Laravel and Vue.js with :heart:

## Getting Started

Start CMD and cd into your chosen directory or if you have XAMPP installed much better if in htdocs folder

Clone this repository in your machine

```
git clone https://github.com/giovictor/chirp.git
```

Create the vendor directory and install the Composer Packages including Laravel

```
composer install
```

Create the node_modules directory and install all NPM Packages including Vue.js

```
npm install
```

Start the server either on XAMPP htdocs folder or using

```
php artisan serve
```

To compile any JavaScript or Sass changes run 

```
npm run dev 
//or
npm run watch
```

markdown 将docker镜像保存到文件

save_docker_image.md

Save docker images to file:
```sh
docker save -o destination/file.tar docker_image/name
```

Load docker images from file:
```sh
docker load -i destination/file.tar
```

markdown imutils

https://github.com/jrosebr1/imutils

imutils
# Installation
Provided you already have NumPy, SciPy, Matplotlib, and OpenCV already installed, the imutils package is completely pip-installable:
```bash
$ pip install imutils
```

# Finding function OpenCV functions by name
OpenCV can be a big, hard to navigate library, especially if you are just getting started learning computer vision and image processing. The find_function method allows you to quickly search function names across modules (and optionally sub-modules) to find the function you are looking for.

Example:
Let's find all function names that contain the text contour:
```python
import imutils
imutils.find_function("contour")
```

# Translation
```python
# translate the image x=25 pixels to the right and y=75 pixels up
translated = imutils.translate(workspace, 25, -75)
```

# Rotation
```python
# loop over the angles to rotate the image
for angle in xrange(0, 360, 90):
	# rotate the image and display it
	rotated = imutils.rotate(bridge, angle=angle)
	cv2.imshow("Angle=%d" % (angle), rotated)
```

# Resizing
```python
# loop over varying widths to resize the image to
for width in (400, 300, 200, 100):
	# resize the image and display it
	resized = imutils.resize(workspace, width=width)
	cv2.imshow("Width=%dpx" % (width), resized)
```

# Skeletonization
Skeletonization is the process of constructing the "topological skeleton" of an object in an image, where the object is presumed to be white on a black background. OpenCV does not provide a function to explicitly construct the skeleton, but does provide the morphological and binary functions to do so.

For convenience, the skeletonize function of imutils can be used to construct the topological skeleton of the image.

The first argument, size is the size of the structuring element kernel. An optional argument, structuring, can be used to control the structuring element -- it defaults to cv2.MORPH_RECT , but can be any valid structuring element.

```python
# skeletonize the image
gray = cv2.cvtColor(logo, cv2.COLOR_BGR2GRAY)
skeleton = imutils.skeletonize(gray, size=(3, 3))
cv2.imshow("Skeleton", skeleton)
```

# Displaying with Matplotlib
```python
# INCORRECT: show the image without converting color spaces
plt.figure("Incorrect")
plt.imshow(cactus)

# CORRECT: convert color spaces before using plt.imshow
plt.figure("Correct")
plt.imshow(imutils.opencv2matplotlib(cactus))
plt.show()
```

# URL to Image
```python
url = "http://pyimagesearch.com/static/pyimagesearch_logo_github.png"
logo = imutils.url_to_image(url)
cv2.imshow("URL to Image", logo)
cv2.waitKey(0)
```

# Checking OpenCV Versions
```python
print("Your OpenCV version: {}".format(cv2.__version__))
print("Are you using OpenCV 2.X? {}".format(imutils.is_cv2()))
print("Are you using OpenCV 3.X? {}".format(imutils.is_cv3()))
```

# Automatic Canny Edge Detection
```python
gray = cv2.cvtColor(logo, cv2.COLOR_BGR2GRAY)
edgeMap = imutils.auto_canny(gray)
cv2.imshow("Original", logo)
cv2.imshow("Automatic Edge Map", edgeMap)
```

# 4-point Perspective Transform
```python
# author:	Adrian Rosebrock
# website:	http://www.pyimagesearch.com

# USAGE
# BE SURE TO INSTALL 'imutils' PRIOR TO EXECUTING THIS COMMAND
# python perspective_transform.py

# import the necessary packages
from imutils import perspective
import numpy as np
import cv2

# load the notecard code image, clone it, and initialize the 4 points
# that correspond to the 4 corners of the notecard
notecard = cv2.imread("../demo_images/notecard.png")
clone = notecard.copy()
pts = np.array([(73, 239), (356, 117), (475, 265), (187, 443)])

# loop over the points and draw them on the cloned image
for (x, y) in pts:
    cv2.circle(clone, (x, y), 5, (0, 255, 0), -1)

# apply the four point tranform to obtain a "birds eye view" of
# the notecard
warped = perspective.four_point_transform(notecard, pts)

# show the original and warped images
cv2.imshow("Original", clone)
cv2.imshow("Warped", warped)
cv2.waitKey(0)
```

# Sorting Contours
```python
# author:    Adrian Rosebrock
# website:   http://www.pyimagesearch.com

# USAGE
# BE SURE TO INSTALL 'imutils' PRIOR TO EXECUTING THIS COMMAND
# python sorting_contours.py

# import the necessary packages
from imutils import contours
import imutils
import cv2

# load the shapes image clone it, convert it to grayscale, and
# detect edges in the image
image = cv2.imread("../demo_images/shapes.png")
orig = image.copy()
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
edged = imutils.auto_canny(gray)

# find contours in the edge map
cnts = cv2.findContours(edged.copy(), cv2.RETR_EXTERNAL,
	cv2.CHAIN_APPROX_SIMPLE)
cnts = imutils.grab_contours(cnts)

# loop over the (unsorted) contours and label them
for (i, c) in enumerate(cnts):
	orig = contours.label_contour(orig, c, i, color=(240, 0, 159))

# show the original image
cv2.imshow("Original", orig)

# loop over the sorting methods
for method in ("left-to-right", "right-to-left", "top-to-bottom", "bottom-to-top"):
	# sort the contours
	(cnts, boundingBoxes) = contours.sort_contours(cnts, method=method)
	clone = image.copy()

	# loop over the sorted contours and label them
	for (i, c) in enumerate(cnts):
		sortedImage = contours.label_contour(clone, c, i, color=(240, 0, 159))

	# show the sorted contour image
	cv2.imshow(method, sortedImage)

# wait for a keypress
cv2.waitKey(0)
```

# (Recursively) Listing Paths to Images
```python
from imutils import paths
for imagePath in paths.list_images("../demo_images"):
	print imagePath
```

markdown 将pfx SSL证书转换为cert / primary密钥

pfx_ssl_convert.md
Requires the passcode for the .pfx file prior.

Extract .key file from .pfx file (will need to set a password here too):
```sh
openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]
```

Extract .crt file from .pfx file:
```sh
openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]
```

Extract pem formatted .key from previous .key:
```
openssl rsa -in [keyfile-encrypted.key] -outform PEM -out [keyfile-encrypted-pem.key]
```

Source:

- https://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/

markdown Android获取SHA1

android get sha1.md
# Android App 获取 SHA1

获取`Debug`模式下的`SHA1`

`keystore`存储路径 `C:\Users\EDZ\.android`

默认的密钥口令是 `android`

```
keytool -list -v -keystore debug.keystore
```

结果如下
```
密钥库类型: JKS
密钥库提供方: SUN

您的密钥库包含 1 个条目

别名: androiddebugkey
创建日期: 2019-8-16
条目类型: PrivateKeyEntry
证书链长度: 1
证书[1]:
所有者: C=US, O=Android, CN=Android Debug
发布者: C=US, O=Android, CN=Android Debug
序列号: 1
有效期开始日期: Fri Aug 16 10:43:55 CST 2019, 截止日期: Sun Aug 08 10:43:55 CST 2049
证书指纹:
         MD5: xxx
         SHA1: xxx
         SHA256: xxxxxxx
         签名算法名称: SHA1withRSA
         版本: 1


*******************************************
*******************************************
```

markdown GLSLBasicBuiltInFunctions.md

GLSLBasicBuiltInFunctions.md
GLSLビルトイン関数一覧

cf. 
- https://www.khronos.org/files/opengl43-quick-reference-card.pdf
- [GLSLについてのメモ](https://qiita.com/edo_m18/items/71f6064f3355be7e4f45)
- [GLSLでフラグメントシェーダーを書く場合のメモ3](https://nogson2.hatenablog.com/entry/2017/11/01/190122)


## step(edge,x)

```
return x >= edge ? 1.0 : 0.0
```

edge: 閾値  
x: チェックされる値

[![Image from Gyazo](https://i.gyazo.com/e1994318ef56a677909b2026d3313f55.png)](https://gyazo.com/e1994318ef56a677909b2026d3313f55)

e.g.  
step(3.0, 5.0) -> 1.0  
step(3.0, 3.0) -> 1.0  
step(3.0, 1.0) -> 0.0  

cf. 
- https://thebookofshaders.com/glossary/?search=step



## smoothstep(edge0,edge1,x)

エルミート補間

```
t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
return t * t * (3.0 - 2.0 * t);
```

edge0: 下端の閾値  
edge1: 上端の閾値  
x: チェックされる値

[![Image from Gyazo](https://i.gyazo.com/d88cb806124359014ddcd0a4849d834a.png)](https://gyazo.com/d88cb806124359014ddcd0a4849d834a)

e.g.  
smoothstep(0.0, 5.0, -1.0) -> 0.0  
smoothstep(0.0, 5.0, 3.0) -> 0.648  
smoothstep(0.0, 5.0, 10.0) -> 5.0  

cf.
- https://thebookofshaders.com/glossary/?search=smoothstep


## mix(x,y,a)

線形補間

```
return x*(1-a)+y*a
```

x: 値A  
y: 値B  
a: 値Aと値Bを混ぜる割合(0.0~1.0)

[![Image from Gyazo](https://i.gyazo.com/a276461e0b6854d7355a48374aa57d34.png)](https://gyazo.com/a276461e0b6854d7355a48374aa57d34)

e.g.  
mix(1.0, 2.0, 0.5) -> 1.5

cf. 
- https://thebookofshaders.com/glossary/?search=mix
- [2点間の線形補間を計算する](https://qiita.com/niusounds/items/c4af702b06582590c82e)



## clamp(x,minVal,maxVal)

与えられた数値を一定範囲内に収める

```
return min(max(x, minVal), maxVal)
```

[![Image from Gyazo](https://i.gyazo.com/c409ac506fc8543c8abd58cf596d6e0b.png)](https://gyazo.com/c409ac506fc8543c8abd58cf596d6e0b)

e.g.  
clamp(0.0, 1.0, 3.0) -> 1.0  
clamp(2.0, 1.0, 3.0) -> 2.0  
clamp(5.0, 1.0, 3.0) -> 3.0  

cf.
- https://thebookofshaders.com/glossary/?search=clamp


## mod(x,y)

除算の剰余(モジュロ)

```
return x - y * floor(x/y)
```

x: 除算される数  
y: 除算する数  

[![Image from Gyazo](https://i.gyazo.com/0451eaeab2b6503fe554f61bb6f225f9.png)](https://gyazo.com/0451eaeab2b6503fe554f61bb6f225f9)

e.g.  
mod(1.0, 1.0) -> 0.0  
mod(1.5, 1.0) -> 0.5  
mod(1.99, 1.0) -> 0.99  
mod(2.0, 1.0) -> 0.0  

cf.
- https://thebookofshaders.com/glossary/?search=mod

markdown Сайт+ API + NGINX

api_nginx.md
Начальная Настройка Сервера Ubuntu:
    https://www.8host.com/blog/nachalnaya-nastrojka-servera-ubuntu-16-04/

Настройка nginx
    https://www.8host.com/blog/obsluzhivanie-veb-sajta-s-pomoshhyu-cloudflare-i-nginx-v-ubuntu-16-04/


TMUX https://tmuxcheatsheet.com/

markdown 谷歌搜索的艺术

art-googling.md
The Art of Googling: https://www.giftegwuenu.com/the-art-of-googling

- Using the wildcard asterisk (*): `Uncaught TypeError: Cannot read property *`
- Using a specific domain: `site: stackoverflow.com center a div with css`
- Search for Titles using intitle, Text using intext: `intext:deploying a static site:stackoverflow.com`

markdown IntelliJ IDEA热键

##ГорячиеклавишиIntelliJIDEA

hotkeys.md
## Горячие клавиши IntelliJ IDEA
***Ctrl+Alt+Shift+J*** - выделить похожие слова