<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[shengweisong]]></title><description><![CDATA[梦想有多大，你就有多勇敢！！！]]></description><link>https://blog.csdn.net/shengweisong</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; shengweisong]]></copyright><item><title><![CDATA[python3 linux 下获取本地网卡ip]]></title><link>https://blog.csdn.net/shengweisong/article/details/78051353</link><guid>https://blog.csdn.net/shengweisong/article/details/78051353</guid><author>shengweisong</author><pubDate>Thu, 21 Sep 2017 14:07:58 +0800</pubDate><description><![CDATA[system ubuntu14.04
python3.6.1
def get_ip_address(ifname):
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    return socket.inet_ntoa(fcntl.ioctl(
        s.fileno(),
        0x8915,  # SIOCG]]></description><category></category></item><item><title><![CDATA[mongodb 访问权限控制]]></title><link>https://blog.csdn.net/shengweisong/article/details/71126709</link><guid>https://blog.csdn.net/shengweisong/article/details/71126709</guid><author>shengweisong</author><pubDate>Wed, 03 May 2017 17:06:39 +0800</pubDate><description><![CDATA[mongodb ：3.4.4system：ubuntu14.04访问权限控制分为两部分：用户，ip用户控制
增加用户 
 
1 在一个终端打开mongodb 服务端，（ mongod --config /etc/mongodb.conf） 
2 在另外一个终端，打开mongo-shell 
输入： 
## 创建一个 用户，对数据库xx， 只有read权限 
use xx 
db.createUser]]></description><category></category></item><item><title><![CDATA[推荐vim 一键配置]]></title><link>https://blog.csdn.net/shengweisong/article/details/60881312</link><guid>https://blog.csdn.net/shengweisong/article/details/60881312</guid><author>shengweisong</author><pubDate>Wed, 08 Mar 2017 20:23:45 +0800</pubDate><description><![CDATA[点击这里获取vim]]></description><category></category></item><item><title><![CDATA[Python 技巧（二） 最小堆实现以及维护一个大小为100的最小堆]]></title><link>https://blog.csdn.net/shengweisong/article/details/59763967</link><guid>https://blog.csdn.net/shengweisong/article/details/59763967</guid><author>shengweisong</author><pubDate>Thu, 02 Mar 2017 23:43:10 +0800</pubDate><description><![CDATA[#!/usr/bin/env python
#coding:utf-8
__author__ = 'sws'class MinHeap:
    '''
        最小堆
    '''
    def __init__(self, a_list = []):
        self.heap_list = [0]
        self.length = 0
        self.b]]></description><category></category></item><item><title><![CDATA[Python 技巧（一）]]></title><link>https://blog.csdn.net/shengweisong/article/details/59191536</link><guid>https://blog.csdn.net/shengweisong/article/details/59191536</guid><author>shengweisong</author><pubDate>Wed, 01 Mar 2017 23:14:27 +0800</pubDate><description><![CDATA[题目实现一个类MyDict, 类似dict，但是可以通过访问成员函数的方式访问字典成员 
例如  
>>> a = MyDict() 
>>> a[‘a’] = 5 
>>> print(a[‘a’]) 
5 
>>> print(a.a) 
5Python 实现(python 3)class MyDict(dict):
    def __init__(self):
        super(M]]></description><category></category></item><item><title><![CDATA[搭建git服务器]]></title><link>https://blog.csdn.net/shengweisong/article/details/56286158</link><guid>https://blog.csdn.net/shengweisong/article/details/56286158</guid><author>shengweisong</author><pubDate>Tue, 21 Feb 2017 15:59:01 +0800</pubDate><description><![CDATA[按照这篇文章 廖大博文需要注意的坑。
设置git用户无密码。编辑 /etc/ssh/sshd_config。将PermitEmptyPasswords no  设置为PermitEmptyPasswords yes。
设置git用户可以远程登录并且将 git 设置为可以用ssh远程登录.编辑 /etc/ssh/sshd_config 将git用户添加到AllowUsers列表中.AllowUsers]]></description><category></category></item><item><title><![CDATA[Python gevent学习（一） 进程，线程，协程]]></title><link>https://blog.csdn.net/shengweisong/article/details/53179454</link><guid>https://blog.csdn.net/shengweisong/article/details/53179454</guid><author>shengweisong</author><pubDate>Tue, 15 Nov 2016 22:58:57 +0800</pubDate><description><![CDATA[每次一想到进程， 线程，协程，只是有一个模模糊糊的概念，所以这次打算总结下这三者的区别与应用场景，加深下印象（没耐心，直接看最后面的）。
操作系统角度：调度分配 
进程：进程是操作系统分配资源的一个独立单位。创建一个进程开销较大 
线程：线程是操作系统调度分派的基本单位。一个进程可以创建多个线程，所以开销较小。
资源空间 
进程：有自己独立的空间，因此进程间切换开销比线程大，但是进程间独立性较高，除]]></description><category></category></item><item><title><![CDATA[gevent+request+novel项目笔记]]></title><link>https://blog.csdn.net/shengweisong/article/details/53177421</link><guid>https://blog.csdn.net/shengweisong/article/details/53177421</guid><author>shengweisong</author><pubDate>Tue, 15 Nov 2016 21:10:11 +0800</pubDate><description><![CDATA[20161115
问题一：
描述： 在抓取回来所有的章节的链接后，虽然所有的链接都在，但是入库后还是有的章节没有，以及有的章节是重复的。解决办法: 原来是使用Queue.get()  换成Queue.get_nowait() 就成了。 
原因
get(block=True, timeout=None)
    Remove and return an item from the queue.]]></description><category></category></item><item><title><![CDATA[腾讯云ubuntu 安装 lxml && MySQL-python]]></title><link>https://blog.csdn.net/shengweisong/article/details/53159920</link><guid>https://blog.csdn.net/shengweisong/article/details/53159920</guid><author>shengweisong</author><pubDate>Mon, 14 Nov 2016 16:03:30 +0800</pubDate><description><![CDATA[按照官网的教程，安装 libxml2-dev libxslt1-dev 这两个库之后，一直提示是/usr/bin/ld: cannot find -lz  需要安装zlib1g-dev这个库


所以安装lxml顺序为


sudo apt-get install python-dev libxml2-dev libxslt1-dev zlib1g-dev



sudo pi]]></description><category></category></item><item><title><![CDATA[leetcode p3 Longest Substring Without Repeating Characters]]></title><link>https://blog.csdn.net/shengweisong/article/details/52998319</link><guid>https://blog.csdn.net/shengweisong/article/details/52998319</guid><author>shengweisong</author><pubDate>Tue, 01 Nov 2016 18:22:28 +0800</pubDate><description><![CDATA[3. Longest Substring Without Repeating Characters




Given a string, find the length of the longest substring without repeating characters.
Examples:
Given "abcabcbb", the answer is "abc",
 w]]></description><category></category></item><item><title><![CDATA[机器学习之分类算法之朴素贝叶斯分类]]></title><link>https://blog.csdn.net/shengweisong/article/details/52750907</link><guid>https://blog.csdn.net/shengweisong/article/details/52750907</guid><author>shengweisong</author><pubDate>Fri, 07 Oct 2016 18:55:46 +0800</pubDate><description><![CDATA[最近自己对机器学习比较感兴趣，做个笔记，还请大牛不喜轻喷，多多指教。朴素贝叶斯分类基于概率论中的贝叶斯原理： 
P(A|B) = P(B|A)*P(A)/P(B)所谓朴素即是特征属性之间相互独立的对分类结果发生影响。 
所以对应的概率公式可改写为P(c|x) = P(x|c)|p(c) / P(x) 
其中:
P(c) 是类‘先验概率’
P(x|c) 是样本x对于类标记c的类条件概率（或称似然）
P]]></description><category></category></item><item><title><![CDATA[在服务器上用Apache2通过mod_wsgi 布置django网站]]></title><link>https://blog.csdn.net/shengweisong/article/details/50622989</link><guid>https://blog.csdn.net/shengweisong/article/details/50622989</guid><author>shengweisong</author><pubDate>Wed, 11 May 2016 15:09:03 +0800</pubDate><description><![CDATA[Os：ubuntu 14.04 LTC
服务器：阿里云




apache2配置（ 在000-default.conf配置）

        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself.]]></description><category></category></item><item><title><![CDATA[python 装饰器 中的 *args 和 **kwargs]]></title><link>https://blog.csdn.net/shengweisong/article/details/51353853</link><guid>https://blog.csdn.net/shengweisong/article/details/51353853</guid><author>shengweisong</author><pubDate>Mon, 09 May 2016 16:12:09 +0800</pubDate><description><![CDATA[python 中的装饰器
def decora(func):

    def wrap():
        print 's'
        func()
    return wrap

@decora
def need_deco():
    print 'need'

need_deco()
上面的等同于
def decora(func):

    def wrap():]]></description><category></category></item><item><title><![CDATA[Django之在富文本编辑其中添加图片]]></title><link>https://blog.csdn.net/shengweisong/article/details/51138146</link><guid>https://blog.csdn.net/shengweisong/article/details/51138146</guid><author>shengweisong</author><pubDate>Tue, 12 Apr 2016 23:00:56 +0800</pubDate><description><![CDATA[如何添加富文本编辑器参考点击打开链接


在上文中的config.js为：
KindEditor.ready(function(K) {
        K.create('textarea[name=detail]',{
            width:800,
            height:200,
            uploadJson: '/admin/uploa]]></description><category></category></item><item><title><![CDATA[Django之如何在admin页面下添加富文本编辑器]]></title><link>https://blog.csdn.net/shengweisong/article/details/51137870</link><guid>https://blog.csdn.net/shengweisong/article/details/51137870</guid><author>shengweisong</author><pubDate>Tue, 12 Apr 2016 22:42:32 +0800</pubDate><description><![CDATA[操作系统: Ubuntu14.04
IDE:pycharm
django_version:1.8
富文本编辑器：kindeditor
浏览器：chrome


第一步：从官网上下载点击打开链接


第二步：
 将解压过的文件夹放到js目录下面 
并且在kindeditor目录下添加一个config.js文件  如下图：


第三部 在config.js 中填写配置信息]]></description><category></category></item><item><title><![CDATA[DJANGO之分页]]></title><link>https://blog.csdn.net/shengweisong/article/details/50611997</link><guid>https://blog.csdn.net/shengweisong/article/details/50611997</guid><author>shengweisong</author><pubDate>Sat, 30 Jan 2016 17:52:01 +0800</pubDate><description><![CDATA[#coding:utf8
#!/usr/bin/env python
__author__ = 'sws'

from django.utils.html import mark_safe

class PagiInfo:
    '''
    分页信息
    确定每页有几条信息 per_item
    确定每页的显示开始的信息序号，以及结束序号
    self.Page:当前页
    ]]></description><category></category></item><item><title><![CDATA[ubuntu 永久写入dns]]></title><link>https://blog.csdn.net/shengweisong/article/details/49615057</link><guid>https://blog.csdn.net/shengweisong/article/details/49615057</guid><author>shengweisong</author><pubDate>Tue, 03 Nov 2015 13:35:10 +0800</pubDate><description><![CDATA[sudo chattr +i /etc/resolv.conf


解锁
sudo chattr -i /etc/resolv.conf]]></description><category></category></item><item><title><![CDATA[Ubuntu 使用校园网 笔记]]></title><link>https://blog.csdn.net/shengweisong/article/details/49592391</link><guid>https://blog.csdn.net/shengweisong/article/details/49592391</guid><author>shengweisong</author><pubDate>Mon, 02 Nov 2015 21:29:33 +0800</pubDate><description><![CDATA[按照http://www.cnblogs.com/bluebbc/archive/2012/06/08/2542172.html 修改好ip,dns以及其他。
下载 mentohust http://yunpan.cn/cFCyWAfN9IQWf （提取码：4c84）
修改 sudo vi /etc/mentohust.conf
重启]]></description><category></category></item><item><title><![CDATA[python 学习笔记（=）]]></title><link>https://blog.csdn.net/shengweisong/article/details/48229357</link><guid>https://blog.csdn.net/shengweisong/article/details/48229357</guid><author>shengweisong</author><pubDate>Sat, 05 Sep 2015 20:46:26 +0800</pubDate><description><![CDATA[python中super的用法：
super就是保证公共祖先类只运行一类。
详情http://www.cnblogs.com/dkblog/archive/2011/02/24/1980654.html]]></description><category></category></item><item><title><![CDATA[python学习笔记（-）]]></title><link>https://blog.csdn.net/shengweisong/article/details/48196289</link><guid>https://blog.csdn.net/shengweisong/article/details/48196289</guid><author>shengweisong</author><pubDate>Thu, 03 Sep 2015 17:57:45 +0800</pubDate><description><![CDATA[系统：deepin2014.3


使用python2.7中，在交互器中没有自动补全的命令，可以用下面的方式
# python startup file#filename=tab.py(zai名字随意，文件放在你想放在的地方，我是放在export PYTHONSTARTUP=/usr/local/lib/python2.7/dist-packages/tab.py
下)import sy]]></description><category></category></item></channel></rss>