from pynput.keyboard import Controller, Key, Listener # 监听按压 def on_press(key): try: print("正在按压:", format(key.char)) except AttributeError: print("正在 ...
分类:
其他好文 时间:
2021-04-21 12:38:44
阅读次数:
0
def selfAdd(a): a += a a_int = 1 print('a_int1:',a_int) selfAdd(a_int) print('a_int2:',a_int) 输出结果: a_int1: 1 a_int2: 1 a_list =[1,2] print('a_list1:' ...
分类:
其他好文 时间:
2021-04-21 12:25:48
阅读次数:
0
方法一:双指针法 采用就地反转,不用额外开辟空间 注意:接收链表的head节点,返回当前节点 方法二:递归法 代码如下: class Node(object): def __init__(self, item, next=None): self.item = item self.next = nex ...
分类:
其他好文 时间:
2021-04-21 12:23:41
阅读次数:
0
大梵天创造世界的时候做了三根金刚石柱子,在一根柱子上从下往上按照大小顺序摞着64片黄金圆盘。大梵天命令婆罗门把圆盘从下面开始按大小顺序重新摆放在另一根柱子上。在小圆盘上不能放大圆盘,在三根柱子之间一次只能移动一个圆盘。64根柱子移动完毕之日,就是世界毁灭之时。 def hanio(n,a,b,c): ...
分类:
编程语言 时间:
2021-04-21 11:56:16
阅读次数:
0
tensorflow-hub介绍 tfhub.dev包含一系列模型,根据处理对象Problem domain分成了四类:Image, Text, Vedio, Audio 模型格式 模型格式又可分为TF.js, TFLite, Coral TF.js 是用于浏览器的模型。ref TFLite 使用的 ...
分类:
其他好文 时间:
2021-04-21 11:56:03
阅读次数:
0
#题 25:合并两个排序的链表 ##题干 输入两个递增排序的链表,合并这两个链表并使新链表中的结点仍然是按照递增排序的。——《剑指 Offer》P145 ##测试样例 链表的数据结构定义如下(Python): class ListNode: def __init__(self, x): self.v ...
分类:
编程语言 时间:
2021-04-20 15:40:06
阅读次数:
0
通过这个题熟悉了下iota的用法,vector自定义排序(根据另一个数组来排当前的数组) 优先队列对pair数据的处理方式,很好的一道题 1 class Solution { 2 public: 3 using PII = pair<int,int>;//type def 4 5 vector<in ...
分类:
编程语言 时间:
2021-04-20 15:19:37
阅读次数:
0
1 typedef int semaphore; 2 semaphore count_mutex = 1; 3 semaphore data_mutex = 1; 4 int count = 0; 5 6 void reader(){ 7 while(TRUE){ 8 down(&count_mut ...
分类:
其他好文 时间:
2021-04-20 15:08:36
阅读次数:
0
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.10.0.tar.bz2 tar -xf freetype-2.10.0.tar.bz2 cd freetype-2.10.0 ./configure --prefi ...
分类:
系统相关 时间:
2021-04-20 14:36:46
阅读次数:
0
类别:1)0-1背包;2)分数背包 0-1背包使用贪心算法无法获得最优解 分数背包代码如下: def fractional_package(goods, w): """ :param data: [(价值,重量),...] :param w: 要拿取的总重量 :return:(拿走的数量,拿走的总价 ...
分类:
编程语言 时间:
2021-04-20 14:28:39
阅读次数:
0