- 校验密码强度
密码的强度必须是包含大小写字母和数字的组合,不能使用特殊字符,长度在8-10之间。
^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,10}$
- 校验中文
| # remap prefix from 'C-b' to 'C-a' | |
| unbind C-b | |
| set-option -g prefix C-a | |
| bind-key C-a send-prefix | |
| # split panes using | and - | |
| bind | split-window -h | |
| bind - split-window -v | |
| unbind '"' |
| import os | |
| path = "/Users/wangzhixiang/Developer/github/all-about-will-wang/days" | |
| files = [] | |
| for filename in os.listdir(path): | |
| files.append(filename) | |
| files.sort() |
| int main(int argc, char* argv[]) | |
| { | |
| int i = 0; | |
| int arr[3] = {0}; | |
| for(i = 0; i<=3; i++){ | |
| arr[i] = 0; | |
| printf("hello world\n"); | |
| } | |
| return 0; | |
| } |
| """ | |
| src -> markdown | |
| """ | |
| script_path = "/Users/wangzhixiang/Desktop/Modern.Family.S09E04.srt" | |
| name = script_path.split("/")[-1].strip(".srt") | |
| print(name) | |
| with open(script_path, encoding='utf-8') as f: | |
| read_data = f.read() |
| #python 3.6 | |
| """ | |
| Reference: | |
| 本文代码:https://blog.csdn.net/mr_guo_lei/article/details/78617669 | |
| 百度官网:http://api.fanyi.baidu.com/api/trans/product/index | |
| 批量处理实例:https://juejin.im/entry/5bf2cebcf265da6151145aca | |
| """ |
密码的强度必须是包含大小写字母和数字的组合,不能使用特殊字符,长度在8-10之间。
^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,10}$
| # Time: O(N^3) | |
| # where n is the number of nodes in the graph. | |
| # There are O(N^2) states, and each state has an outdegree of N, as there are at most N different moves. | |
| # Space: O(N^2) | |
| class Solution: | |
| def catMouseGame(self, graph): | |
| """ | |
| :type graph: List[List[int]] | |
| :rtype: int |
| # Time: O(n^3) where n is the number of nodes in the graph. There are O(N^2) states, and each state has an outdegree of NN, as there are at most NN different moves. | |
| # Space: O(n^2) | |
| class Solution: | |
| def catMouseGame(self, graph): | |
| """ | |
| :type graph: List[List[int]] | |
| :rtype: int | |
| """ | |
| self.graph = graph |
| # 188. Best Time to Buy and Sell Stock IV | |
| # Time: O(kn**2) where n == len(price) | |
| # Space: O(nk) | |
| # Time Limit Exceeded | |
| # dp[i][j] = max(dp[i][j-1], (prices[j] - prices[m]) + dp[i-1][m]) m = 0,..,j | |
| class Solution(object): | |
| def maxProfit(self, k, prices): | |
| """ |