361./usr/bin/dpkg returned an error code (1)

Scrivener 中使用markdown语法

Scrivener 使用了multimarkdown作为转换工具,最新版是6.0,在github上最新版是5.4。支持非常强大的语法,包括Latex。
http://fletcher.github.io/MultiMarkdown-5/MMD_Users_Guide.html

BeautifulSoup

效率

Beautiful Soup用lxml做解析器比用html5lib或Python内置解析器速度快很多。

安装 cchardet 后文档的解码的编码检测会速度更快。

如果仅仅因为想要查找文档中的标签而将整片文档进行解析,实在是浪费内存和时间.最快的方法是从一开始就把标签以外的东西都忽略掉.

SoupStrainer 类可以定义文档的某段内容,这样搜索文档时就不必先解析整篇文档,只会解析在 SoupStrainer 中定义过的文档. 创建一个 SoupStrainer 对象并作为 parse_only 参数给 BeautifulSoup 的构造方法即可。

编码

Beautiful Soup输出是会将HTML中的特殊字符转换成Unicode,比如“&lquot;”:

soup = BeautifulSoup("“Dammit!” he said.")
unicode(soup)
# u'\u201cDammit!\u201d he said.'

如果将文档转换成字符串,Unicode编码会被编码成UTF-8.这样就无法正确显示HTML特殊字符了:

str(soup)
# '\xe2\x80\x9cDammit!\xe2\x80\x9d he said.'

apt-fast 多线程下载

https://www.htcp.net/3284.html
注意其中移动语句应该为

sudo mv /your_dir/apt-fast.sh /usr/bin/apt-fast

目的地目录没有local,是作者笔误。

/usr/bin/dpkg returned an error code (1)

For me these two lines helped! Just remove all the linux-extra and linux-extra-image files, which are problematic and old.

For each package:

sudo mv /var/lib/dpkg/info/.* /tmp/

Then:

sudo apt-get autoremove && sudo apt-get autoclean

你可能感兴趣的:(361./usr/bin/dpkg returned an error code (1))