This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import argparse | |
| import redis | |
| def connect_redis(conn_dict): | |
| conn = redis.StrictRedis(host=conn_dict['host'], | |
| port=conn_dict['port'], | |
| db=conn_dict['db']) | |
| return conn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Sublime Text 3 Serial key build is 3176 | |
| > * Added these lines into /etc/hosts | |
| 127.0.0.1 www.sublimetext.com | |
| 127.0.0.1 license.sublimehq.com | |
| > * Used the license key | |
| ----- BEGIN LICENSE ----- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: UTF-8 -*- | |
| # @author: mawenbao@hotmail.com | |
| # @date: 2014-09-03 | |
| # @depends: python2.7+ | |
| ''' | |
| 从搜狗词库中提取中文词组 | |
| 参考[这篇文章](http://blog.csdn.net/zhangzhenhu/article/details/7014271)中的代码实现。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| from scipy.sparse import csc_matrix | |
| def pageRank(G, s = .85, maxerr = .001): | |
| """ | |
| Computes the pagerank for each of the n states. | |
| Used in webpage ranking and text summarization using unweighted | |
| or weighted transitions respectively. |