MinHash算法+实现

摘要: 参考:原理ppt: http://wenku.baidu.com/view/089e85c42cc58bd63186bdfc.html求解实现算法:http://fuliang.iteye.com/blog/1025638​ 最后部分. 感谢原作者. 算法原理+数学证明见原文.简单的实现python代码如下: 1 import os 2 import sys 3 4 5 def hash_func_demo1(x): 6 return x % 5 7 8 def hash_func_demo2(x): 9 return (2 * x + 1) % 510 11 12 ... 阅读全文
posted @ 2012-02-27 22:04 foreveryl 阅读(2146) 评论(0) 推荐(0)

phantomjs安装

摘要: 1, python setuptools2, python: argparse:http://code.google.com/p/argparse/phantomjs依赖:1) python >=2.62), PyQt4 >= 4.8.0 PyQt4的一个学习文档:http://www.cnblogs.com/coderzh/archive/2009/06/28/1512654.html3), Qt >= 4.7其中:PyQt4 依赖: sipsip 简介: http://www.riverbankcomputing.co.uk/static/Docs/sip4/introd 阅读全文
posted @ 2011-11-15 15:05 foreveryl 阅读(756) 评论(0) 推荐(0)

Emacs做python的编辑器

摘要: 组里要去python了. 兵马未动, 粮草先行. 趁星期天先把编辑器的工具搞起来. 希望之后做事情能事半功倍.虽然很多东西还不知道是啥意思.... 以后用到在说.参考资料:1),http://www.emacswiki.org/emacs/?action=browse;oldid=PythonMode;id=PythonProgrammingInEmacs2),http://www.cnblogs.com/wuhen/articles/1807242.html感谢原作者所用工具:1), emacs python-mode.el 最基本的缩进,等等2), rope: python 重构的库( . 阅读全文
posted @ 2011-11-13 15:51 foreveryl 阅读(697) 评论(0) 推荐(0)

scrapy 学习

摘要: 0 usefull links:http://www.searchtb.com/2011/07/%E5%BF%AB%E9%80%9F%E6%9E%84%E5%BB%BA%E5%AE%9E%E6%97%B6%E6%8A%93%E5%8F%96%E9%9B%86%E7%BE%A4.htmlhttp://scrapy.org/http://readthedocs.org/docs/scrapy/en/latest/Twisted:http://twistedmatrix.com/trac/ 阅读全文
posted @ 2011-11-06 17:30 foreveryl 阅读(230) 评论(0) 推荐(0)

问题列表

摘要: 1, jemalloc在编译redis时:By default Redis compiles and links against jemalloc under Linux, sinceglibc malloc() has memory fragmentation problems.2,zipmap(又称为small hash)3, CAS: check and set4, XPathOnClick 阅读全文
posted @ 2011-11-06 11:21 foreveryl 阅读(184) 评论(0) 推荐(0)

libxml2 多线程使用

摘要: libxml2官方网站如是说:Starting with 2.4.7, libxml2 makes provisions to ensure that concurrent threads can safely work in parallel parsing different documents. There is however a couple of things to do to ensure it:configure the library accordingly using the --with-threads optionscall xmlInitParser() in the 阅读全文
posted @ 2011-10-25 19:03 foreveryl 阅读(1056) 评论(0) 推荐(0)

gcc Variable-length_array

摘要: http://en.wikipedia.org/wiki/Variable-length_array意味着gcc下,这么写是可以的:#include <stdio.h>int main() { int buff_size = 1234; char char_buff[buff_size]; printf("size:%d", sizeof(char_buff)); return 0;}VS2008下是不行的,仍需要: const int buff_size = 1234; 以示说明. 阅读全文
posted @ 2011-10-24 17:13 foreveryl 阅读(259) 评论(0) 推荐(0)

curl 相关

摘要: 1. libcurl only follows pure HTTP redirects. It doesn't deal with HTML or javascript or other kinds of redirects. 阅读全文
posted @ 2011-10-22 14:49 foreveryl 阅读(134) 评论(0) 推荐(0)

glog 入门简介

摘要: Glog的简单入门,glog虽然在配置参数方面比较麻烦,但是在小规模程序中,由于其简单灵活,也许会有优势。0, glog 是google的开源日志系统,相比较log4系列的日志系统,它更加轻巧灵活,而且功能也比较完善。 结合之前看的一些资料, 这里简单对其做个简介。1, 安装: 最新版本:0.3.1 http://code.google.com/p/google-glog/ 安装只需:./configure; make; make install2, 简单示例main.cpp:#include <iostream>#include "glog/logging.h" 阅读全文
posted @ 2011-10-14 15:23 foreveryl 阅读(18968) 评论(4) 推荐(4)

Linux 使用命令收集

摘要: 以下来自:http://www.codelast.com/?p=3645, 感谢原作者(1)使emacs不要生成临时文件在emacs中编辑了文件并保存后,通常会生成一个临时文件,假设原文件名为a.txt,则生成的临时文件名为a.txt~,如果不想生成,可以在emacs配置文件 .emacs 中添加一句:(setq-default make-backup-files nil)(2)按Ctrl+Z键导致emacs“退出”时,如何恢复在emacs中,按Ctrl+Z键本应是标记选择开始(mark)的快捷键,但是如果设置不当(经总结,这个设置不仅涉及linux主机的环境设置,而且涉及终端软件例如Secu 阅读全文
posted @ 2011-10-14 15:11 foreveryl 阅读(270) 评论(0) 推荐(0)