def check_fmd_service(): try: output = subprocess.check_output('svcs -H -o state fmd',shell=True) state = output.decode('UTF-8').stri...
分类:
Web程序 时间:
2014-07-10 13:30:04
阅读次数:
246
QEMU Networking QEMU has a number of really nice ways to set up networking for its guests. It can be a little bewildering to figure out how each of th...
分类:
Web程序 时间:
2014-07-10 00:32:27
阅读次数:
499
You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you cli...
分类:
其他好文 时间:
2014-07-07 21:03:15
阅读次数:
157
A classic 2D DP problem. A disguise of LCS - actually not very hard to decode: it is about 2 sequences' matching, though with a weight value of each m...
分类:
其他好文 时间:
2014-07-07 19:49:34
阅读次数:
217
python encode和decode函数说明字符串编码常用类型:utf-8,gb2312,cp936,gbk等。python中,我们使用decode()和encode()来进行解码和编码在python中,使用unicode类型作为编码的基础类型。即 decode encodestr ------...
分类:
编程语言 时间:
2014-07-01 13:22:12
阅读次数:
286
因为真正的数据的处理是由DocumentParser::appendBytes以及DocumentParser::finish后续调用来完成,所以咱们重点关注这两块数据接收和解码TextResourceDecoderTextResourceDecoder::decode()该函数中有个重要的操作是把...
分类:
Web程序 时间:
2014-07-01 13:15:24
阅读次数:
753
An Intent is a messaging object you
can use to request an action from another app component. Although intents facilitate communication
between components in several ways, there are three fundament...
分类:
其他好文 时间:
2014-07-01 08:54:18
阅读次数:
414
URLEncode的方式一般有两种,一种是传统的基于GB2312的Encode(Baidu、Yisou等使用),另一种是基于UTF-8的Encode(Google、Yahoo等使用)。本工具分别实现两种方式的Encode与Decode:中文 -> GB2312的Encode -> %D6%D0%CE...
分类:
Web程序 时间:
2014-06-30 20:37:08
阅读次数:
562
An Intent is a messaging object you
can use to request an action from another app component. Although intents facilitate communication
between components in several ways, there are three fundament...
分类:
其他好文 时间:
2014-06-30 19:28:20
阅读次数:
225
在用python编程中,字符串有两种表示方法"string"和 u"string"。为什么字符串要是用这两种表达方式,不是只用前一种呢?
使用type()函数查看,它们分别是str对象和unicode对象。这两个对象有什么区别吗?还有经常用到的encode()和decode()又是干什么的呢?都说python脚本使用的是两字节编码,这又是指什么呢?
本文试图回答这些问题。...
分类:
编程语言 时间:
2014-06-30 00:32:11
阅读次数:
240