经常需要主目录下隐藏一些文件夹之类的,第一想到的当然就是:在要隐藏的文件夹前面加『.』(leading dot),这个用法当然可以的了用习惯了Linux/GNU系统的,基本习惯使用这种办法但是,我发现 Mac种/Users/$USER/目录下的Library就是隐藏的,但是并没有leading do...
分类:
移动开发 时间:
2015-01-09 17:11:59
阅读次数:
199
我的Linux服务器的Python版本是2.*,在将中文encode(UTF-8)的时候出现了UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 0: ordinal not in range(128)的问题。而在3.*中没有问题。
解决方法:
在代码前端加入
import sys
reload(s...
分类:
编程语言 时间:
2015-01-09 15:41:10
阅读次数:
286
Oracle中的 Decode和nvl 函数的用法及区别?...
分类:
数据库 时间:
2015-01-08 18:06:40
阅读次数:
237
decode (expression, search_1, result_1)如果 expression结果=search_1结果,则返回result_1,类似 if elsedecode (expression, search_1, result_1, search_2, result_2)dec...
分类:
数据库 时间:
2015-01-08 17:30:29
阅读次数:
245
python 读取中文文件后,作为参数使用,经常会遇到乱码或者报错asii错误等。我们需要对中文进行decode('gbk')如我有一个data.txt文件有如下内容:百度谷歌现在想读取文件中内容构建查询语句代码如下:f=open('data.txt','r')for i in f.readline...
分类:
编程语言 时间:
2015-01-08 17:24:21
阅读次数:
159
1.小数转换成字符往往会丢失前面的零. 解决方法: to_char(0.12345,'fm9999999990.00');2.除数为零的话oracle老是报错. 解决方法: decode(B,0,0,A/B);3.用sub(0.123333,0,3)截取字符串老是得到的结果是 .12 解决...
分类:
数据库 时间:
2015-01-08 17:03:39
阅读次数:
166
You are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb...
分类:
其他好文 时间:
2015-01-08 14:42:31
阅读次数:
160
You are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb...
分类:
其他好文 时间:
2015-01-08 13:14:25
阅读次数:
119
感觉序列化和反序列化用得倒是比较少了,而json_encode和json_decode用得相对多,都是转化成串,进行入库、传输等。json更方便,但是序列化和反序列化结合这两个魔术方法使用倒还行a = 'hello';//反序列化时进行a值的修改动作 }}$m = new Test();$n = s...
分类:
其他好文 时间:
2015-01-08 12:50:38
阅读次数:
206
A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message conta...
分类:
其他好文 时间:
2015-01-07 20:46:03
阅读次数:
151