INSERT GRAPHIC HERE (include hyperlink in image)
Subtitle or Short Description Goes Here
| #!/bin/bash | |
| # 安装Zsh | |
| sudo apt update | |
| sudo apt install -y zsh tree | |
| # 设置Zsh为默认Shell | |
| sudo chsh -s $(which zsh) $USER | |
| # 安装Oh My Zsh(使用国内镜像加速) |
| # Plot particle history as animation | |
| import numpy as np | |
| from sko.PSO import PSO | |
| def demo_func(x): | |
| x1, x2 = x | |
| reward = (x2 - 5.1 * x1**2 / (4 * np.pi ** 2) + 5 * x1 / np.pi - 6)**2 + 10 * (1 - 1 / (8 * np.pi)) * np.cos(x1) + 10 | |
| return reward |
| import numpy as np | |
| from numpy import linalg as LA | |
| from numpy import sin, cos, arctan | |
| import matplotlib.pyplot as plt | |
| def dhmat(delta, d, a, alpha): | |
| return np.array([[cos(delta), -sin(delta)*cos(alpha), sin(delta)*sin(alpha), a*cos(delta)], | |
| [sin(delta), cos(delta)*cos(alpha), -cos(delta)*sin(alpha), a*sin(delta)], | |
| [0, sin(alpha), cos(alpha), d], |
| import numpy as np | |
| from numpy import sin, cos | |
| import matplotlib.pyplot as plt | |
| def dhmat(delta, d, a, alpha): | |
| return np.array([[cos(delta), -sin(delta)*cos(alpha), sin(delta)*sin(alpha), a*cos(delta)], | |
| [sin(delta), cos(delta)*cos(alpha), -cos(delta)*sin(alpha), a*sin(delta)], | |
| [0, sin(alpha), cos(alpha), d], | |
| [0, 0, 0, 1]]) |
| #!/usr/bin/env zsh | |
| mv ~/.zsh_history ~/.zsh_history_bad | |
| strings ~/.zsh_history_bad > ~/.zsh_history | |
| fc -R ~/.zsh_history | |
| rm ~/.zsh_history_bad |
| docker run --runtime=nvidia -dt --name tf-gpu-1.14.0 -p 8888:8888 -v "$PWD":/tf tensorflow/tensorflow:1.14.0-gpu-py3-jupyter jupyter notebook --ip=0.0.0.0 --allow-root |
| # | |
| # Acts as a nginx HTTPS proxy server | |
| # enabling CORS only to domains matched by regex | |
| # /https?://.*\.mckinsey\.com(:[0-9]+)?)/ | |
| # | |
| # Based on: | |
| # * http://blog.themillhousegroup.com/2013/05/nginx-as-cors-enabled-https-proxy.html | |
| # * http://enable-cors.org/server_nginx.html | |
| # | |
| server { |
| git init # 初始化本地git仓库(创建新仓库) | |
| git config --global user.name "xxx" # 配置用户名 | |
| git config --global user.email "[email protected]" # 配置邮件 | |
| git config --global color.ui true # git status等命令自动着色 | |
| git config --global color.status auto | |
| git config --global color.diff auto | |
| git config --global color.branch auto | |
| git config --global color.interactive auto | |
| git config --global --unset http.proxy # remove proxy configuration on git | |
| git clone git+ssh://[email protected]/VT.git # clone远程仓库 |
| import socket | |
| client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP | |
| client.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) | |
| client.bind(("", 37020)) | |
| while True: | |
| data, addr = sock.recvfrom(1024) | |
| print("received message: %s"%data) |