<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[飞行的荷兰猪]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/qq_31331027</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; qq_31331027]]></copyright><item><title><![CDATA[数值转汉字]]></title><link>https://blog.csdn.net/qq_31331027/article/details/113748967</link><guid>https://blog.csdn.net/qq_31331027/article/details/113748967</guid><author>qq_31331027</author><pubDate>Sun, 07 Feb 2021 22:45:09 +0800</pubDate><description><![CDATA[# Author: Bao 
import re
def num_to_mandarin(num):
    """
    Convert int number to mandarin in simplified Chinese.
    :param num: int
    :return: simplified Chinese string

    In [1]: num_to_mandarin(123784700200019)
    Out[1]: '一百二十三万七千八百四十七亿零二十万零一十]]></description><category></category></item><item><title><![CDATA[中英平行语料-机器翻译]]></title><link>https://blog.csdn.net/qq_31331027/article/details/112975117</link><guid>https://blog.csdn.net/qq_31331027/article/details/112975117</guid><author>qq_31331027</author><pubDate>Thu, 21 Jan 2021 23:55:10 +0800</pubDate><description><![CDATA[网上比较容易找到的最大的中英平行语料应该是UN联合国的预料数据，语料偏公文且单一。
使用china daily上双语数据作为语料。
代码如下：
添加链接描述

]]></description><category></category></item><item><title><![CDATA[python使用asyncio单进程异步监听进程间queue通信]]></title><link>https://blog.csdn.net/qq_31331027/article/details/111679527</link><guid>https://blog.csdn.net/qq_31331027/article/details/111679527</guid><author>qq_31331027</author><pubDate>Fri, 25 Dec 2020 15:24:00 +0800</pubDate><description><![CDATA[背景

应用存在大量非持久性/高阻塞的独立过程时，阻塞对效果的影响比计算资源消耗更大。这个时候使用轻量协程(coroutine)比多线程更加安全可控，极大减少了锁、线程资源复制等隐藏问题/比使用多进程更加轻量易管理。例如：网路爬虫，每个网页的请求作为独立的高阻塞原子动作，使用协程能将大量请求异步调度
使用多进程queue对协程任务create/cancel进行动态管理时，即引发本次记录问题：如何在异步执行task时，能在event loop中异步监听消息队列，既能正常执行单进程单线程的大量协程任务调度，又能]]></description><category></category></item><item><title><![CDATA[WSL:轻量构建开发环境的良好实践]]></title><link>https://blog.csdn.net/qq_31331027/article/details/109279736</link><guid>https://blog.csdn.net/qq_31331027/article/details/109279736</guid><author>qq_31331027</author><pubDate>Sun, 25 Oct 2020 22:49:09 +0800</pubDate><description><![CDATA[WSL
  开发过程中，windows的办公便利性无可厚非，但是麻烦的是其工具链实在是无法恭维，系统环境跟实际生产环境（linux）大相径庭不说，配置更是相当繁琐（从环境变量配置到特立独行的shell、编译工具链等），让人头疼。
  作为传统的这种解决办法：hyper-v / virtualbox / vmware等虚拟化技术本地起一个虚拟机，ssh到虚拟机作为开发环境。但是这种方法的弊端也很明显，vm manager进程资源占用都比较大，且虚拟化较重 —— 需要懂得网卡映射、clipboard共享、磁盘共]]></description><category></category></item><item><title><![CDATA[爬虫爬取公众号内容]]></title><link>https://blog.csdn.net/qq_31331027/article/details/109129291</link><guid>https://blog.csdn.net/qq_31331027/article/details/109129291</guid><author>qq_31331027</author><pubDate>Sat, 17 Oct 2020 09:59:37 +0800</pubDate><description><![CDATA[*不涉及具体代码
具体步骤

获取移动端内容列表


AVD模拟器(Discarded)
经过实际尝试，算力占用过多，不予考虑。
adb USB debug
adb调试 + appium server + python appium-client 控制脚本点击/滑动获取所有内容列表、发送移动端页面访问请求。


移动端流量请求劫持
调查发现，所有移动端访问公众号内容发起的流量请求跟实际内容URI均保持统一格式：
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-mhRAOmnn-]]></description><category></category></item><item><title><![CDATA[python requests编码类型推断错误导致乱码]]></title><link>https://blog.csdn.net/qq_31331027/article/details/109089144</link><guid>https://blog.csdn.net/qq_31331027/article/details/109089144</guid><author>qq_31331027</author><pubDate>Thu, 15 Oct 2020 01:10:58 +0800</pubDate><description><![CDATA[问题描述
今天在教别人一些爬虫基础遇到一个从来没有出现过的现象：中文网站奇怪的乱码，经过多种编码尝试，均不能还原：
import requests
from bs4 import BeautifulSoup

res = requests.get('http://www.xinhuanet.com/')
bs = BeautifulSoup(res.text, 'lxml')
for item in bs.select('.dataList01 a')[:3]:
    print(item.text)

]]></description><category></category></item><item><title><![CDATA[python金额转换汉字为数字]]></title><link>https://blog.csdn.net/qq_31331027/article/details/108062209</link><guid>https://blog.csdn.net/qq_31331027/article/details/108062209</guid><author>qq_31331027</author><pubDate>Mon, 17 Aug 2020 19:28:58 +0800</pubDate><description><![CDATA[金额转换
很多情况下需要对文本当中的金额进行抽取转储成数值，往往又存在诸多恶心的不规范标记/表述/或者原始数据获取残缺的情况，因此做记录。
思路
实际上，字符串转换到数值，最大的麻烦十进制表示关系不如阿拉伯数字直观，自然语言的表述是嵌套甚至是省略的。但是有一点可以确定的是，自然语言对金额/数字的表述，也是存在逻辑关系的。比如：九百六十万九仟八百一。从字面上看，同样表述几百几千，会在多个位置出现，所以肯定是不能用正则或者其他纯字符传组织形式的方法去推敲转换。
但是，不难发现，作为自然语言，表述尽管错乱多样，但]]></description><category></category></item><item><title><![CDATA[linux下json文本解析工具：jq]]></title><link>https://blog.csdn.net/qq_31331027/article/details/99871399</link><guid>https://blog.csdn.net/qq_31331027/article/details/99871399</guid><author>qq_31331027</author><pubDate>Tue, 20 Aug 2019 19:16:42 +0800</pubDate><description><![CDATA[前言
在linux环境下，对于json文本阅读是相当麻烦的，jq处理则相当轻松。
例子
使用测试内容data.json
[root@kilo-k5-controller baojx]# cat data.json
{
“char”: [“a”, “b”, “c”],
“data:info”: {
“bob”: {
“address”: “jiangsu-nanjing”,
“wage”: “100...]]></description><category></category></item><item><title><![CDATA[yield伪多线程]]></title><link>https://blog.csdn.net/qq_31331027/article/details/90814721</link><guid>https://blog.csdn.net/qq_31331027/article/details/90814721</guid><author>qq_31331027</author><pubDate>Tue, 04 Jun 2019 22:37:34 +0800</pubDate><description><![CDATA[import uuid

def record():
    while True:
        product_number = yield
        print("Recoded number serial -&gt; [{}].".format(product_number))


def produce(tuple_list):
    for i,j in tuple_list...]]></description><category></category></item><item><title><![CDATA[bash实现字符串startswith/endswith功能]]></title><link>https://blog.csdn.net/qq_31331027/article/details/89306609</link><guid>https://blog.csdn.net/qq_31331027/article/details/89306609</guid><author>qq_31331027</author><pubDate>Mon, 15 Apr 2019 10:03:32 +0800</pubDate><description><![CDATA[shell advanced program中有种比较有用的写法，能够简单模拟一般编程语言中的startswith/endswith的字符串以特殊字符开头结尾进行判断的功能，比较使用，记之：
# e.g. 获取当前目录中以“est”为结尾的文件名：
~]# for i in `ls`; do [[ $i == *"est" ]] &amp;&amp; echo $i ; done
test

其中...]]></description><category></category></item><item><title><![CDATA[error: skipping because parent directory has insecure permissions问题]]></title><link>https://blog.csdn.net/qq_31331027/article/details/89187988</link><guid>https://blog.csdn.net/qq_31331027/article/details/89187988</guid><author>qq_31331027</author><pubDate>Wed, 10 Apr 2019 17:02:14 +0800</pubDate><description><![CDATA[问题描述
logrotate执行轮询异常，“considering log /var/log/xxxlog
error: skipping “/var/log/xxxlog” because parent directory has insecure permissions (It’s world writable or writable by group which is not “root”)...]]></description><category></category></item><item><title><![CDATA[python实现简单diff工具]]></title><link>https://blog.csdn.net/qq_31331027/article/details/86707587</link><guid>https://blog.csdn.net/qq_31331027/article/details/86707587</guid><author>qq_31331027</author><pubDate>Wed, 30 Jan 2019 19:20:11 +0800</pubDate><description><![CDATA[简述
两套代码需要大量diff，遂顺手写了这么个小玩意儿。能对文件diff，也能对相同目录结构的目录进行迭代diff，将diff结果保存为html文件。
参数说明：
o 指定输出的目录名称（也就没管其他路径吧啦吧啦啥的，临时写的，默认当前目录）
f 指定整个文件夹进行diff，默认diff结果也是按照文件目录的结构进行存放的，指定-f放在一起
d 指定对文件夹下所有文件进行遍历diff
上代码：
...]]></description><category></category></item><item><title><![CDATA[Linux网络虚拟化基础：Linux bridge / Network Namespace]]></title><link>https://blog.csdn.net/qq_31331027/article/details/86677900</link><guid>https://blog.csdn.net/qq_31331027/article/details/86677900</guid><author>qq_31331027</author><pubDate>Mon, 28 Jan 2019 15:15:20 +0800</pubDate><description><![CDATA[Linux网络虚拟化基础：Linux bridge / Network Namespace
简述
 在网络虚拟化中，有两项技术的发展相当重要，甚至可以说是网络功能软件化、虚拟化的重要重要基础。


linux bridge (brctl)


 在linux中，对于创建的一些虚拟网卡之间实现通信，提供了linux bridge作为虚拟网桥，进行数据交换。


Network Namespace (...]]></description><category></category></item><item><title><![CDATA[openstack neutron中admin_state_up跟status]]></title><link>https://blog.csdn.net/qq_31331027/article/details/86466486</link><guid>https://blog.csdn.net/qq_31331027/article/details/86466486</guid><author>qq_31331027</author><pubDate>Mon, 14 Jan 2019 09:11:23 +0800</pubDate><description><![CDATA[Neutron里面很多对象都有admin_state_up和status两个属性，并且看上去很难搞清楚二者的区别，本文将详细介绍这两个属性在Network, Port和Router上的含义。
Network
admin_state_up
表示Network的管理状态，如果设置为False，则网络不再转发IP包。在创建网络的时候这个属性的值默认为True. 管理员可以通过API来修改admin_st...]]></description><category></category></item><item><title><![CDATA[python自动化UI工具发送QQ消息]]></title><link>https://blog.csdn.net/qq_31331027/article/details/85809354</link><guid>https://blog.csdn.net/qq_31331027/article/details/85809354</guid><author>qq_31331027</author><pubDate>Fri, 04 Jan 2019 23:48:50 +0800</pubDate><description><![CDATA[概述
个人遇到过小的需求，windows自动水群发送垃圾消息，使用一些特别简单易上手的小工具，快速实现功能需求（而不是使用一些重量级的还需要额外花时间去熟悉功能语法的大工具，如UI自动化工具sikulix）。在一番摸索下，得出一番结论：

对于多平台的UI自动复杂操作，还是去学sikulix吧，这不是啃一点win32 api获取窗口句柄就能轻松解决的，毕竟sikulix是MIT大佬折腾出来的。而且...]]></description><category></category></item><item><title><![CDATA[删除亚马逊Kindle电子书的DRM，将AZW转为PDF格式文档]]></title><link>https://blog.csdn.net/qq_31331027/article/details/84933542</link><guid>https://blog.csdn.net/qq_31331027/article/details/84933542</guid><author>qq_31331027</author><pubDate>Sun, 09 Dec 2018 22:56:05 +0800</pubDate><description><![CDATA[首先声明:我个人并不提倡盗版电子书，毕竟Kindle是一款很不错的电子设备，其次，亚马逊拥有电子书籍的版权，使用盗版是对电商、作者权益的危害。
为什么Kindle电子书内容是糟糕的？
大多数访问Kindle电子内容的人，都是拥有Kindle电子设备的。跟大多数公司为了保护知识产权的做法一样，亚马逊同样在电子书中嵌入了电子版权管理软件（DRM）。从保护版权的方面看来，DRM是使用最广泛且最有效的，但...]]></description><category></category></item><item><title><![CDATA[python调用Linux C系统用户认证接口]]></title><link>https://blog.csdn.net/qq_31331027/article/details/84639774</link><guid>https://blog.csdn.net/qq_31331027/article/details/84639774</guid><author>qq_31331027</author><pubDate>Thu, 29 Nov 2018 20:51:34 +0800</pubDate><description><![CDATA[最近在考虑一个很鸡肋的东西，如果一个python程序对身份要求很高，需要系统级别的用户认证才能进行访问，那么如何设计编写这样一个认证接口？于是便有了下文。]]></description><category></category></item><item><title><![CDATA[vscode snippets配置快速代码模板]]></title><link>https://blog.csdn.net/qq_31331027/article/details/84635553</link><guid>https://blog.csdn.net/qq_31331027/article/details/84635553</guid><author>qq_31331027</author><pubDate>Thu, 29 Nov 2018 16:38:19 +0800</pubDate><description><![CDATA[
1.基本snippets配置方法
2.特别的宏使用（时间宏等）

基本snippets配置方法

选择用户代码片段进行管理。

选择需要使用代码段的文件类型。
在打开的json格式的文本中，添加示例键值对：
	&quot;Quick code add&quot;: {
		&quot;prefix&quot;: &quot;test&quot;,
		&quot;body&quot;: [
			&quot;\n# CODE ADDED BY BAOJX.&quot;,
			&quot;$0&quot;]]></description><category></category></item><item><title><![CDATA[小记/usr/bin/python^M: bad interpreter: No such file or directory的问题]]></title><link>https://blog.csdn.net/qq_31331027/article/details/84590300</link><guid>https://blog.csdn.net/qq_31331027/article/details/84590300</guid><author>qq_31331027</author><pubDate>Wed, 28 Nov 2018 18:49:18 +0800</pubDate><description><![CDATA[很多情况下python作为脚本语言编写的脚本都是在win上用IDE写好，自动化sync到服务器上，如果全部都是由IDE部署上去的一般不是很容易出问题，但是部署完之后在生产环境用vim稍作修改，往往会出现问题。如：
#! /usr/bin/python
# coding=utf-8
... ...
实际运行报错：/usr/bin/python^M: bad interpreter: No such ...]]></description><category></category></item><item><title><![CDATA[python实现linux tree目录树状图]]></title><link>https://blog.csdn.net/qq_31331027/article/details/84582670</link><guid>https://blog.csdn.net/qq_31331027/article/details/84582670</guid><author>qq_31331027</author><pubDate>Wed, 28 Nov 2018 13:27:02 +0800</pubDate><description><![CDATA[内网不能下载linux tree工具包，动手写之。
先上一个能实现最基础功能的乞丐版片段。
# coding=utf-8
# Author : BaoJunxian
# Date ： 2018/11/27

import os, sys

PREFIX = ['└─ ', '├─ ']
INDENTION = ['│  ', ' '*4]

def tree(path , depth=1, fla...]]></description><category></category></item></channel></rss>