一.python2 1.一共的两种类型 名称:存储类型 str:bytes(以bytes类型存储) Unicode:Unicode 二.Python3 1.两种类型 名称:存储类型 str:Unicode bytes:bytes 三.经过Unicode进行encode()或decode()都是以by ...
分类:
其他好文 时间:
2020-01-11 13:11:49
阅读次数:
86
//最重要的就是加上这两个 主要作用 把获取到的图片地址转为url格式然后再转bitmap格式 private void displayImage(String imagePath) { BitmapFactory.Options options = new BitmapFactory.Option ...
分类:
移动开发 时间:
2020-01-10 00:54:34
阅读次数:
997
一、encode与decode 1、bytes主要是给在计算机看的,string主要是给人看的 2、中间有个桥梁就是编码规则,现在大趋势是utf8 3、bytes对象是二进制,很容易转换成16进制,例如\x64 4、string就是我们看到的内容,例如'abc' 5、string经过编码encode ...
分类:
编程语言 时间:
2020-01-08 17:24:53
阅读次数:
125
Long long ago,a handsome boy whose name is HSP studied in JSU of information science and engineering. He is clever and always thinks of ways to make f ...
分类:
其他好文 时间:
2020-01-07 22:49:51
阅读次数:
170
一、产生问题的原因 在我使用python读取文本列表后,然后再读取每个文件的内容产生了上面的错误, 如果你是在Mac上写的代码,肯定是将.DS_store文件也读到列表里了,才产生的错误。 二、解决方法 通过终端cd到你的那个目录,然后ls -a .DS_store,查看文件是否真的存在,rm .D ...
分类:
其他好文 时间:
2020-01-05 20:33:32
阅读次数:
87
服务端 # from socket import * # server=socket(AF_INET,SOCK_DGRAM) # server.bind(('127.7.8.9',7890)) # while True: # data,client_addr=server.recvfrom(1024 ...
分类:
其他好文 时间:
2020-01-04 20:38:04
阅读次数:
125
前言: 虽然java的API中说创建多线程的方式只有两种(There are two ways to create a new thread of execution),分别是继承 类创建和实现 接口创建,在上一篇博文中演示了这两种, "详见" ,但是JDK5.0以后新增了两种,分别是实现 接口创建 ...
分类:
编程语言 时间:
2020-01-04 20:36:33
阅读次数:
88
一、找到\vendor\workerman\workerman\WebServer.php 第176行,改为以下内容,增加对html扩展名文件不存在的判断: if (in_array($workerman_file_extension,['php','html']) && !is_file($wor ...
分类:
Web程序 时间:
2020-01-04 12:50:20
阅读次数:
114
递归解法 由暴力递归而来的DP解法 这次只需要线性空间的内存即可做到。 参考资料 "Decode Ways" " LeetCode 91. Decode Ways" ...
分类:
其他好文 时间:
2020-01-04 12:24:37
阅读次数:
44
1 print('这是编码'.encode('utf-8')) # 结果 b'\xe8\xbf\x99\xe6\x98\xaf\xe7\xbc\x96\xe7\xa0\x81' 2 print('这是编码'.encode('gbk')) # 结果 b'\xd5\xe2\xca\xc7\xb1\xe0 ...
分类:
编程语言 时间:
2020-01-04 10:21:34
阅读次数:
133