- 博客(12)
- 收藏
- 关注
原创 cxf spring 整合使用示例
周末学习使用了一下cxf,测试代码已经放到github:https://github.com/blankyin/cxf-demo项目名称:cxf-demo该项目主要为学习使用CXF时所写的测试代码,包含cxf-spring(Server)和cxf-client(Client);CXF使用的是当前最新版本2.7.5,测试使用JDK 1.6;项目都使用Maven创建,便于j
2013-06-23 19:21:02
1059
原创 solr JBoss 使用配置
环境:windowssolr3.6.2 下载:http://www.apache.org/dyn/closer.cgi/lucene/solr/3.6.2jboss-6.1.0.Final 下载:http://www.jboss.org/jbossas/downloads一、下载安装上述文件二、solr配置进入 apache-solr-3.6.2
2013-06-21 16:06:54
3200
原创 solr3.6.2 使用配置
环境:windowssolr3.6.2下载:http://www.apache.org/dyn/closer.cgi/lucene/solr/3.6.2apache-tomcat-6.0.37下载:http://tomcat.apache.org/download-60.cgi#6.0.37ikanalyzer中文分词器下载:https://code.google.com/p/ik-ana
2013-06-19 10:35:33
3646
原创 pymongo使用问题汇总
1. 问题:使用sort排序,代码如下:db.test.find().sort({"name" : 1, "age" : 1})遇到如下异常:TypeError: if no direction is specified, key_or_list must be an instance of list 解决方法:db.test.find().sort([("
2013-05-31 22:03:22
1312
原创 web.py中使用Jinja2问题汇总
1. 问题: web.py中使用db查询返回的iterator对象在Jinja2中无法重复循环使用:iteratorObj = db.query("select column from table") 解决方法: 将iterator对象转换为list即可:iteratorObj = list(db.query("select co
2013-05-26 12:34:15
1077
原创 web.py 入门demo遇到的问题
1. 问题: windows下出现 AttributeError: 'module' object has no attribute 'inet_pton' 错误 解决方法: https://github.com/webpy/webpy/pull/195 中提到 “inet_pton has not been implemented in pyth
2013-05-14 23:34:10
3163
原创 Django调用css、img、js等静态文件
开始准备用django做个小项目练手,记录开发中遇到的各种问题。1. 在settings.py中配置如下:import osSTATIC_ROOT = ''STATIC_URL = '/static/'STATICFILES_DIRS = ( os.path.join(os.path.dirname(__file__), '../static/').replace('\\',
2013-04-12 22:31:13
12548
1
转载 The Zen of Python
The Zen of Python, by Tim Peters Beautiful is better than ugly. 美胜丑 Explicit is better than implicit. 明胜暗 Simple is better than complex. 简胜复 Complex is better than complicated. 复胜杂 Flat is
2013-04-04 16:51:03
637
原创 python之enumerate
示例:test.txt内容:aaaabbbbccccfile_object = open(r'c:\test.txt')try: for line_num, context in enumerate(file_object): print str(line_num) + ':' + contextfinally: file_object.clos
2013-03-13 21:37:07
892
原创 python之string.maketrans和str.translate
示例:import string s = 'abcd--dcba' # 参数from和to的长度必须一致 table = string.maketrans('', '') # type(table) is 'str'print(s.translate(table)) # 输出 abcd--dcbatable = string.maketrans('ab',
2013-03-11 22:01:22
6492
1
原创 python 内建函数basestring笔记
示例:def isAString(obj): return isinstance(obj, basestring) # isinstance(obj, (str, unicode)).print isAString('abc') # Trueprint isAString(u'您好') # Trueprint isAString(list()) #
2013-03-07 22:49:53
4072
原创 python 内建函数map笔记
示例: def func(item): pass results = map(func,iterable) map实现代码:def map(func, seq): mapped_seq = [] for eachItem in seq: mapped_seq.append(func(eachItem)) ret
2013-03-07 22:00:24
704
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅