上一页 1 2 3 4 5 6 7 ··· 10 下一页
摘要: ```python coding: utf 8 def factorial(n: int): if n == 0: return 1 else: return n factorial(n 1) def draw_line(tick_length, tick_label=''): line = ' ' 阅读全文
posted @ 2019-08-03 20:38 加州风尘 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 缺点: 消耗空间,less子集和greater子集每次递归就会创建 阅读全文
posted @ 2019-08-03 16:22 加州风尘 阅读(148) 评论(0) 推荐(0) 编辑
摘要: ``` if __name__ == '__main__': # 从10 开始,到 -1结束,不包含-1, 每次步进-1 for i in range(10, -1, -1): print(i, end=' ') # 输出 10 9 8 7 6 5 4 3 2 1 0 ``` 阅读全文
posted @ 2019-08-01 17:58 加州风尘 阅读(1852) 评论(0) 推荐(0) 编辑
摘要: ```c include include "stdlib.h" define OK 1 define ERROR 0 define TRUE 1 define FALSE 0 define MAXSIZE 1000 // 定义线性表最大容量 typedef int Status; typedef i 阅读全文
posted @ 2019-07-21 09:09 加州风尘 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 受阮一峰博客关于KMP字符串匹配算法启发,实现python的kmp实现, 比较清楚明白 地址为 http://www.ruanyifeng.com/blog/2013/05/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm.html python def ne 阅读全文
posted @ 2019-07-19 15:43 加州风尘 阅读(188) 评论(0) 推荐(0) 编辑
摘要: ```java @Test public void test1() throws UnsupportedEncodingException { // 三者等价 // byte [] a = {00010110, 01010010, 10111000}; // byte [] a = {0x16, 0x52, 0xB8}... 阅读全文
posted @ 2019-07-18 09:55 加州风尘 阅读(185) 评论(0) 推荐(0) 编辑
摘要: ```python import queue import threading import time def produce(q: queue.Queue): thread_name = threading.current_thread().getName() for i in range(10): print("生产者[%s]--- %d" % (threa... 阅读全文
posted @ 2019-07-08 15:07 加州风尘 阅读(228) 评论(0) 推荐(0) 编辑
摘要: ```python def test(a, *args, **kwargs): print a print args print kwargs if __name__ == "__main__": test(1, 2, 3 , d='4', e=5) # 输出 1 (2, 3) {'e': 5, 'd': '4'} ``` 阅读全文
posted @ 2019-07-08 10:07 加州风尘 阅读(2986) 评论(0) 推荐(1) 编辑
摘要: ```python import shlex, subprocess """ 1、subprocess.Popen("cat test.txt") # 因为默认shell=False,命令将不执行 2、subprocess.Popen("cat test.txt", shell=True) # 设置shell=True, 命令将执行 3、subprocess.Popen(["cat","t... 阅读全文
posted @ 2019-06-19 17:27 加州风尘 阅读(2891) 评论(0) 推荐(0) 编辑
摘要: Docker 笔记 裸版ubuntu 安装 ifconfig、ping 容器支持ssh 阅读全文
posted @ 2019-06-18 07:19 加州风尘 阅读(1126) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 10 下一页