目录 1. id 和 == 2. 小数据池 3. 编码和解码 1. id 和 == id:id是一个内置的函数,可以查看变量存放的内存地址(实际上不是真正的物理地址,这里暂时这样理解),用于判断是变量否属指向了同一块内存地址 ==:== 可以用于判断两个变量的值是否相等,这个在之前的例子中也有用过 下面来看几个例子,以及具体的使用方法: In [1]: a = 'abc' In [2]: b = 'abc' In [3]: a == b Out[3]: True In [4]: a is b O…
小知识点总结 1. android中MotionEvent.ACTION_CANCEL事件如何被触发? 对于这个问题,android文档的说明很简短,想看明白很难.国外一网页说的还比较详细,写在这里分享给大家: 原文是这样的: You receive this when a parent takes possession of the motion, for example when the user has dragged enough across a list view or scroll…
脚本这种东西,就是要常用,否则一段时间不用就生疏了,因此决定时时记一些小知识点,一来回顾一下,二来需要的时候可以迅速获得提示. Sort by number You could now write a numeric sort subroutine like this: sub by_number { # a sort subroutine, expect $a and $b } } } } To use the sort subroutine, just put its name (witho…