Python type函数
Python 变量,也称 Python 数据类型。Python 变量一共六种类型:整数/浮点数/字符串/BOOL/列表/元组/字典;我们已经学习完了两个Python 内置函数,分别是 print 函数和format函数,今天需要额外...
C/C++ error C2011: “timespec”:“struct”类型重定义
HAVE_STRUCT_TIMESPEC ,VS2017 在写程序的时候用到了 pthread.h 库,于是就报错 error C2011: “timespec”:“struct”类型重定义,在使用的项目属性->预处理器->添加 HAVE_STRUCT_TIMESPEC
AVFoundation – AVPlayerItem 管理资源对象
AVPlayerItem 管理资源对象 - AVPlayerItem 作为资源管理对象,它控制着视频从创建到销毁的诸多状态。 //播放状态 status typedef NS_ENUM(NSInteger,AVPlayerItemStatus) { AVPlayerItemStatus...
C语言 NULL 和 0 区别
C语言 NULL 和 0 区别 - NULL 在 stdio.h 中定义如下: #if !defined(NULL) && defined(__NEEDS_NULL) #ifdef __cplusplus #define NULL 0 #else #define NULL ((void *)0) #endif #endif 在不...
C/C++ error LNK2005:”XXX已经在 XXX.obj 中定义
C/C++ error LNK2005:'XXX已经在 XXX.obj 中定义 - 1.C/C++ 中,当头文件定义变量时,可能会发生 error LNK2005。 例如,如果在项目中的多个源文件中包括此头文件,则会导致错误 方案一:在头文...
Object-C FOUNDATION_EXPORT extern #define区别
FOUNDATION_EXPORT NSString * const NotificationName; // 这是Fundation框架里面的宏 c/c++中不能使用 extern NSString * const NotificationName; // 这是c/c++的关键字,OC/c/c++通用 #defin...
Python reduce 函数
Python reduce 函数 - Python 内置函数 reduce 和 map / filter 等函数有点类似,都是通过函数对迭代器中的元素进行遍历操作,唯一区别是 reduce 函数是返回计算结果是一个值,而 map / filter ...
Python 线程障碍对象 Barrier
Python 线程障碍对象 Barrier - Python 线程 Barrier 俗称障碍对象,也称栅栏,也叫屏障。 与之前介绍 互斥锁 Lock / 事件 Event / 定时器 Timer 等不同,多线程 Barrier 会设置一个线程障碍数...
Python frozenset 集合
Python frozenset 集合 - 如果尝试修改 frozenset 集合的数据,即使用 add 添加数据,程序报错:AttributeError: ‘frozenset’ object has no attribute ‘add’!与 Python set 集合区别在于 ...