摘要: UTF-8是Unicode的实现方式之一。 UTF-8最大的一个特点,就是它是一种变长的编码方式。它可以使用1~4个字节表示一个符号,根据不同的符号而变化字节长度。 UTF-8的编码规则很简单,只有二条: 1)对于单字节的符号,字节的第一位设为0,后面7位为这个符号的unicode码。因此对于英语字 阅读全文
posted @ 2017-10-11 13:55 cicero 阅读(698) 评论(0) 推荐(0) 编辑
摘要: 1. 往/lib和/usr/lib里面加东西,是不用修改/etc/ld.so.conf的,但是完了之后要调一下ldconfig,不然这个library会找不到 2. 想往上面两个目录以外加东西的时候,一定要修改/etc/ld.so.conf,然后再调用ldconfig,不然也会找不到 比如安装了一个 阅读全文
posted @ 2017-09-14 16:26 cicero 阅读(570) 评论(0) 推荐(0) 编辑
摘要: 系统ubuntu14.04 1.安装:sudo apt-get install git 2.设置name and Email: git config --global user.name "Your Name" git config --global user.email "email@exampl 阅读全文
posted @ 2017-09-07 19:38 cicero 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 1.源码下载地址: 链接:https://pan.baidu.com/s/1fxotILo3oTMC65z4qFAh9Q 密码:oc31 2.库的编译与安装 解压文件,进入文件目录 编译的时候需要首先切换为管理员(root)账户,然后执行以下命令: ./configure make make ins 阅读全文
posted @ 2017-09-07 15:35 cicero 阅读(2784) 评论(0) 推荐(0) 编辑
摘要: 饿汉实现: 懒汉实现: 参考: https://www.cnblogs.com/TenosDoIt/p/3639395.html 阅读全文
posted @ 2017-08-28 17:21 cicero 阅读(351) 评论(0) 推荐(0) 编辑
摘要: server: client: 阅读全文
posted @ 2017-08-14 09:55 cicero 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 1 #!/usr/bin/python 2 # -*- coding: UTF-8 -*- 3 4 import thread 5 import time 6 7 8 # 为线程定义一个函数 9 def print_time(threadName, delay): 10 count = 0 11 while count < 5: 12 ti... 阅读全文
posted @ 2017-08-14 09:53 cicero 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 1 #!/usr/bin/python 2 3 import urllib2 4 import time 5 import logging 6 import threading 7 8 succCount = 0 9 failCount = 0 10 IP = '127.0.0.1' 11 port = '9997' 12 postUrl = "http://%s:%s/"... 阅读全文
posted @ 2017-08-14 09:50 cicero 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 1.默认情况下,logging将日志打印到屏幕,日志级别为WARNING;日志级别大小关系为:CRITICAL > ERROR > WARNING > INFO > DEBUG > NOTSET,当然也可以自己定义日志级别。 2.通过logging.basicConfig函数对日志的输出格式及方式做 阅读全文
posted @ 2017-08-11 15:56 cicero 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 1.urllib2可以接受一个Request对象,并以此可以来设置一个URL的headers,但是urllib只接收一个URL。 2.urllib模块可以提供进行urlencode的方法,该方法用于GET查询字符串的生成,urllib2的不具有这样的功能。 1) urllib2.urlopen(ur 阅读全文
posted @ 2017-08-11 10:08 cicero 阅读(260) 评论(0) 推荐(0) 编辑