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
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
此文转载,原文地址:http://www.jb51.net/article/17560.htm为什么Python使用过程中会出现各式各样的乱码问题,明明是中文字符却显示成“\xe4\xb8\xad\xe6\x96\x87”的形式?为什么会报错“UnicodeEncodeError: 'ascii' ...
分类:
编程语言 时间:
2014-07-06 22:39:50
阅读次数:
292
Oracle 分割字符查询
select *
from view_psbaseinfo
where DECODE('410782001125,411100000043',
'',
NULL,
'410782001125,411100000043') IS NULL
or PSCODE in
...
分类:
数据库 时间:
2014-07-04 07:20:34
阅读次数:
349
Given an encoded message containing digits, determine the total number of ways to decode it.
分类:
其他好文 时间:
2014-07-02 14:47:02
阅读次数:
217
题目很简单,代码也很短。第一遍做的时候,我居然二乎乎的把input里面的小框框忽略掉了,所以WA了一次。每一行代表一个二进制的ASCII码,'o'代表1,空格代表0,中间的小黑点忽略。我直接把一行字符串全读进去,如果字符串以下划线开头说明输入结束(字符串的处理从第2行开始)。然后从左到右一个字符一个...
分类:
其他好文 时间:
2014-07-01 18:59:00
阅读次数:
228
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
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
在用python编程中,字符串有两种表示方法"string"和 u"string"。为什么字符串要是用这两种表达方式,不是只用前一种呢?
使用type()函数查看,它们分别是str对象和unicode对象。这两个对象有什么区别吗?还有经常用到的encode()和decode()又是干什么的呢?都说python脚本使用的是两字节编码,这又是指什么呢?
本文试图回答这些问题。...
分类:
编程语言 时间:
2014-06-30 00:32:11
阅读次数:
240