学以致用

focus on Python , C++, and some interest in Go and R

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 17 下一页

2012年8月30日

摘要: 隆重推荐一个go语言写成的扩展分布式存储系统weed-fs参见: https://code.google.com/p/weed-fs/ 阅读全文
posted @ 2012-08-30 17:26 Jerry.Kwan 阅读(742) 评论(0) 推荐(0) 编辑

2012年8月27日

摘要: (1)Sphinx http://sphinxsearch.com/(2)Elasticsearch http://www.elasticsearch.org/(3)Xapian http://xapian.org/在实际中使用过Sphinx,感觉还是很不错的,建立索引速度挺高,查询语法丰富,而且使用起来很简单。Sphinx依托于MySql 或者 postgresql,并提供SQL查询接口,对于属于MySql或者postgresql的同学来说更亲切一些Elasticsearch听说不错,支持RESTful接口,建议于Apache Lucene.之上,支持分布式,对于属于Lucence的同... 阅读全文
posted @ 2012-08-27 10:00 Jerry.Kwan 阅读(334) 评论(0) 推荐(0) 编辑

2012年8月22日

摘要: ubuntu环境下安装gevent步骤(1)环境准备 1.1 sudo apt-get install build-essential 1.2 sudo apt-get install python-dev 1.3 sudo apt-get install python-setuptools(2) 从http://code.google.com/p/gevent/downloads/list 下载原码包gevent-1.0b3.tar.gz(3) 解压 tar -xvzf gevent-1.0b3.tar.gz (4)安装greenlet, easy_install greenle... 阅读全文
posted @ 2012-08-22 11:05 Jerry.Kwan 阅读(942) 评论(0) 推荐(0) 编辑

2012年8月21日

摘要: 对ubuntu 12.04自定义launcher的方法做一记录,希望能对有需要的朋友有所帮助以sublime text 2的launcher定义为例(1) 添加简介命令来启动sublime sudo ln -s/opt/softwares/Sublime_Text2/sublime_text /usr/bin/sublime(2)在Unity创建一个launcher sudo sublime /usr/share/applications/sublime.desktop 在sublime.desktop中添加如下内容 [Desktop Entry]Name=Sublime Text 2G... 阅读全文
posted @ 2012-08-21 17:51 Jerry.Kwan 阅读(2209) 评论(0) 推荐(0) 编辑

2012年6月2日

摘要: 采用lxml进行xml的解析操作,在使用find()和findall()方式进行操作的时候,如果match按照XPath标准写的复杂点儿,某些情况下会碰到invalid predicate错误。从lxml的官方文档上来看,lxml是支持XPath1.0标准的,可为何还报出invalid predicate错误呢?仔细查阅lxml文档才发现:原来,lxml为了和python标准库中的xml.etree.ElementTree兼容,采用了和xml.etree.ElementTree同样的策略。xml.etree.ElementTree中的find和findall对XPath的支持本身就是有限的,只 阅读全文
posted @ 2012-06-02 15:58 Jerry.Kwan 阅读(2105) 评论(0) 推荐(0) 编辑

摘要: python标准库中的xml.etree.ElementTree使用起来很方便,对于xml的操作封装的也挺好。但有一些细节需要引起各位使用者的注意:其中xml.etree.ElementTree的find 和 findall方法并不是完全支持XPath,不用说XPath2.0,就是连XPath1.0也只是支持了其中的一小部分,可以说只是支持了XPath1.0的一个子集吧。从以下例子能很好的说明这个问题:etree.find("AUTO/PROCESS_THREAD_OPERATE/TIME")etree.find("AUTO/PROCESS_THREAD_OPER 阅读全文
posted @ 2012-06-02 15:48 Jerry.Kwan 阅读(3040) 评论(0) 推荐(0) 编辑

2012年5月27日

摘要: 为了进一步规范python代码,提高可读性、可维护性,决定在module、class、function中尽可能的加入docstring。闲暇之余就写了一个sublime text 2的plugin,可以设定使用快捷键或者context menu来自动生成docstring,既减少了敲键盘的字数,也能更规范一些。下面是自动生成的docstring截图:插件源码已经公布在github上,具体地址为:https://github.com/JerryKwan/Sublime-Text-2-pydocstring希望这个小插件能给各位采用sublime text 2写python代码的朋友有所帮助 阅读全文
posted @ 2012-05-27 09:08 Jerry.Kwan 阅读(2083) 评论(0) 推荐(1) 编辑

2012年5月14日

摘要: 转载一篇Gevent的教程gevent For the Working Python Developerhttp://sdiehl.github.com/gevent-tutorial/?utm_source=Python+Weekly+Newsletter&utm_campaign=9dc22cf663-Python_Weekly_Issue_34_May_10_2012&utm_medium=emailhttps://github.com/sdiehl/gevent-tutorial 阅读全文
posted @ 2012-05-14 09:30 Jerry.Kwan 阅读(305) 评论(0) 推荐(0) 编辑

2012年5月8日

摘要: 项目中碰到的问题,记录如下,期望能对他人有用。def valid_XML_char_ordinal(c): """ @summary: check if the char is a valid xml character @param c: the character to be checked @see: # http://www.w3.org/TR/2008/REC-xml-20081126/#charsets @result: True/False """ return ( # conditions ordered by p.. 阅读全文
posted @ 2012-05-08 17:08 Jerry.Kwan 阅读(1369) 评论(0) 推荐(0) 编辑

2012年5月7日

摘要: 介绍一款由python实现的Nagios like 监控管理工具 Shinkenhttp://www.shinken-monitoring.org/主要功能介绍如下:1, Flexible monitoring and alerting capabilities2, Simple and modular discovery module3, Prioritize your effort based on business impact4, VMware auto dependency and VMotion support5, Business rules correlation6, Keep 阅读全文
posted @ 2012-05-07 09:16 Jerry.Kwan 阅读(219) 评论(0) 推荐(0) 编辑

上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 17 下一页