#coding:utf8import os,timedirectory = "d:/scrapy tutorial/"t = []d = {}for filename in os.listdir(directory): path = directory + filename ...
分类:
编程语言 时间:
2014-09-12 22:02:04
阅读次数:
313
import "crypto/md5"import "encoding/hex"//go 生成 md5func T4_1() { m := md5.New() m.Write([]byte("123456")) println(hex.EncodeToString(m.Sum(ni...
分类:
其他好文 时间:
2014-09-12 20:29:54
阅读次数:
223
例如:UTF8---ISO-8859-1string string = "这是中文";Encoding utf8 = Encoding.UTF8; Encoding ISO = Encoding.GetEncoding("ISO-8859-1");//换成你想转的编码 byte[] temp = u...
分类:
其他好文 时间:
2014-09-12 19:08:03
阅读次数:
462
UniDac对Oracle的Direct连接,不需要套Oracle客户端dll,deploy时真的时 方便又快捷。FireDac连接Oracle,在没有Oracle Client的情况下,是可以连接上的。方式是前提:需要文件 oci.dll oraocci11.dll oraoci...
分类:
数据库 时间:
2014-09-12 18:51:13
阅读次数:
645
修改服务器上的nginx的配置文件 /usr/local/nginx/conf/nginx.conf http { ? ??limit_req_zone $binary_remote_addr zone=one:10m rate=3000r/m; ? ??proxy_cache_path??/var/cache/nginx levels=1:2 key...
分类:
其他好文 时间:
2014-09-12 17:29:34
阅读次数:
382
Ant:一、安装:1、设置环境变量ANT_HOME:ANT_HOME=c:\Ant2、设置环境变量Path: Path=%ANT_HOME%\bin;.....3、在命令行运行ant:如果报如下错误,说明安装成功。 Buildfile:build.xmldoesnotexist! Buildfailed二、build.xml文件<?xmlversion="1.0"encoding="UTF-8"?>&l..
分类:
其他好文 时间:
2014-09-12 17:25:34
阅读次数:
229
今天重新调整了下配置文件,之前的apache_errorlog未匹配到clientip。1.首先修改shipper.confinput{
file{
type=>"apache-accesslog"
path=>"/var/log/httpd/access_log"
}
file{
type=>"apache-errorlog"
path=>"/var/log/httpd/error_log"
}
}
filter{
if[type..
分类:
其他好文 时间:
2014-09-12 17:24:04
阅读次数:
786
举个例子:import csvimport ospath='/tmp/'file='test.csv'def generate_csv(path,file): if not os.path.exists(path): os.mkdir(path) files=os.path...
分类:
编程语言 时间:
2014-09-12 16:51:53
阅读次数:
235
(1)Android.mk文件首先需要指定LOCAL_PATH变量,用于查找源文件。由于一般情况下Android.mk和需要编译的源文件在同一目录下,所以定义成如下形式:LOCAL_PATH:=$(call my-dir)上面的语句的意思是将LOCAL_PATH变量定义成本文件所在目录路径。(2)A...
分类:
移动开发 时间:
2014-09-12 16:51:13
阅读次数:
358
Android4.4 fence机制分析
在任何一个系统中,无可避免的都会跟各种buffers打交道,最经典的模式就是消费-生产者模式,一个独立的buffer在它们之间的交换等操作都需要一个机制来控制每个buffer的“生命周期”,即ALLOCATION
和 RELEASE ,此外还要考虑到同步性问题,什么时候可以read buffer和write buffer都需要听从调遣。
在an...
分类:
移动开发 时间:
2014-09-12 15:13:43
阅读次数:
325