简单 RPC 的 Golang 实现。
This file contains hidden or 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
| NOT_FOUND = None | |
| def binarySearch(A, n, x): | |
| p = 0 | |
| r = n - 1 | |
| while p <= r: | |
| q = (p + r) // 2 | |
| if A[q] == x: | |
| return q |
This file contains hidden or 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/local/bin/python3 | |
| # -*- coding: utf-8 -*- | |
| ''' | |
| HEXO BLOG YAML CONFIG CHECKER/COMPLETER | |
| @File : blogconfc.py | |
| @Author : CDFMLR | |
| @Time : 2020/07/30 21:49 | |
| ''' |
This file contains hidden or 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 os | |
| import os.path | |
| import time | |
| from email.mime.text import MIMEText | |
| from email.mime.multipart import MIMEMultipart | |
| from email.mime.application import MIMEApplication | |
| import smtplib | |
| def build_email(subject: str, sender: str, receivers: list, content: str, attachments: list, signature=None) -> MIMEMultipart: | |
| ''' |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| ) | |
| // ticker.C 的源码实现是: | |
| // make(chan Time, 1) | |
| // tick 发生时的操作是: |
This file contains hidden or 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
| package main | |
| import "fmt" | |
| func GetNext(substr string) []int { | |
| next := make([]int, len(substr)) | |
| next[0] = -1 | |
| i, j := 0, -1 | |
| for i < len(substr)-1 { |
This file contains hidden or 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
| echo_help() { | |
| echo "Proxy takes the http proxy on/off in current env. | |
| THIS SOFTWARE IS FOR PERSONAL USE ONLY. | |
| Usage: | |
| proxy <command> | |
| The commands are: |
This file contains hidden or 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
| # | |
| # linregress.py | |
| # Linear Regression with one variable via a Batch Gradient Descent | |
| # | |
| # Created by CDFMLR on 2019/8/28. | |
| # Copyright © CDFMLR. All right reserved. | |
| # | |
| import math | |
| import random |
This file contains hidden or 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
| #!python3 | |
| # 辅助运行 NeteaseCloudMusicApi 服务: | |
| # 服务挂掉时自动重启,输出某种监视日志 | |
| import os | |
| import time | |
| import subprocess | |
| import collections | |
| from queue import Queue |
OlderNewer