会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
repinkply
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
9
10
···
36
下一页
2022年5月28日
列表和元组
摘要: a = (1,2,3,[1,2,4]) print(a[3][0]) # 输出1 print(a[3][1]) # 输出2 print(a[3][2]) # 输出4 b =(1,2,3,[1,2,[3,4,5,6]]) print(b[3][2][0]) # 输出3 print(b[3][2][1]
阅读全文
posted @ 2022-05-28 18:50 repinkply
阅读(10)
评论(0)
推荐(0)
2022年5月27日
集合 set
摘要: {1,2,3,4,5,6} - {3,4} {1, 2, 5, 6} {1,2,3,4,5,6}+{3,4} Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unsupported o
阅读全文
posted @ 2022-05-27 22:07 repinkply
阅读(11)
评论(0)
推荐(0)
tuple
摘要: 1.在python中怎么样定义一个元素的元祖? print(type((1))) print(type(('a'))) 以上这样定义,( 会被编译器解释为 运算符中的左括号。 需要以下这样定义: print(type((1,))) print(type(('a',))) 那么怎么定义一个空元祖呢?按
阅读全文
posted @ 2022-05-27 20:49 repinkply
阅读(71)
评论(0)
推荐(0)
python 字符串
摘要: 1.字符串中r字母的作用 print('c:\northwind\northwest') print('c:\\northwind\\northwest') print(r'c:\northwind\northwest') # 在字符串前面加入r,就不是一个普通字符串,而是一个原始字符串(即所见即所
阅读全文
posted @ 2022-05-27 15:18 repinkply
阅读(12)
评论(0)
推荐(0)
python3 中各进制的表示与转换
摘要: bin(...) 函数可以实现其他进制向二进制的转化。 1.十进制转化为二进制 print(bin(10)) #输出0b1010 2.八进制转化为二进制 print(bin(0o7)) #输出0b111 3.十六进制转化为二进制 print(bin(0xE)) int(...) 函数可以实现其他进制
阅读全文
posted @ 2022-05-27 12:27 repinkply
阅读(127)
评论(0)
推荐(0)
2022年5月25日
future其他成员函数、shared_future、atomic
摘要: 一、future其他成员函数 线程的三种状态。1.ready 2.time_out 3.deferred #include <iostream> #include <future> #include <vector> using namespace std; int mythread() { cou
阅读全文
posted @ 2022-05-25 22:19 repinkply
阅读(34)
评论(0)
推荐(0)
2022年5月24日
async、future、packaged_task、promise
摘要: 一、std::async、std::future 创建后台任务并返回值 希望线程返回一个结果; std::async是一个函数模板,用来启动一个异步任务,启动起来一个异步任务之后,返回一个std::future对象。 什么叫做启动一个异步任务?就是自动创建一个线程并开始执行对应的线程入口函数,它返回
阅读全文
posted @ 2022-05-24 22:50 repinkply
阅读(30)
评论(0)
推荐(0)
2022年5月22日
condition_variable、wait、notify_one、notify_all
摘要: 为什么要引入,condition_variable、wait()、notify_one(),这一些列函数。原因就是为了高效。举例:下面这段代码 单纯的通过加锁的方式 效率其实不太高。 // test.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 #include <ios
阅读全文
posted @ 2022-05-22 22:51 repinkply
阅读(87)
评论(0)
推荐(0)
2022年5月15日
单例设计模式共享数据分析、解决、call_once
摘要: 一:一个可以回收的单例设计模式的类代码 // test.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 #include <iostream> #include <string> #include <vector> #include <stack> #include <qu
阅读全文
posted @ 2022-05-15 22:16 repinkply
阅读(26)
评论(0)
推荐(0)
2022年5月14日
unique_lock 详解
摘要: (1) unique_lock 取代lock_guard (2)unique_lock的第二个参数 2.1.std::adopt_lock 2.2 std::try_to_lock 2.3 std::defer_lock (3) unique_lock的成员函数 3.1 lock 3.2 unloc
阅读全文
posted @ 2022-05-14 19:55 repinkply
阅读(93)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
10
···
36
下一页
公告