装go
因为 ubuntu 默认装 go 是1.6 的, 不想装 1.6, 准备装 1.8,
. . .
boost.python 迟暮, 久违 pybind11 , 来玩玩
pybind11 is a lightweight header-only library that exposes C++ types in Python and vice versa, mainly to create Python bindings of existing C++ code. Its goals and syntax are similar to the excellent Boost.Python library by David Abrahams: to minimize boilerplate code in traditional extension modules by inferring type information using compile-time introspection.
The main issue with Boost.Python—and the reason for creating such a similar project—is Boost. Boost is an enormously large and complex suite of utility libraries that works with almost every C++ compiler in existence. This compatibility has its cost: arcane template tricks and workarounds are necessary to support the oldest and buggiest of compiler specimens. Now that C++11-compatible compilers are widely available, this heavy machinery has become an excessively large and unnecessary dependency.
下载好 pybind11 之后,我们就可以开始对着官方的 pybind11 Tutorial 进行学习了,详细的入门教程及语法请参考官方文档,这里,我们简单演示下如何编写供 python 调用的 C++ 模块.
. . .
一晃2年过去了, 记得曾经看过 boost.asio, 现在 asio 已经可以完全脱离 boost 了,
不过它项目里的一些例子还是依赖 boost 的, 比如他 src 文件夹里的 tests 里的 除了 unit , 其他的大多数还是老的例子,
都是直接包含boost的一些头文件, 也就是依赖boost的
官网说支持c++11的编译器会自动检测, 然后走asio的standalone模式, 测试了一下, 显然不会.
所以 ASIO_STANDALONE 这个宏是必须得自己加上的,
define ASIO_STANDALONE on your Preprocessor Settings (如: g++ -DASIO_STANDALONE
) or as part of the project options.
. . .
更多好用的一键脚本请转 https://github.com/ToyoDAdoubi/doubi
. . .
脚本会递归目录的子目录1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24import moviepy.editor as mp
# vfc = mp.VideoFileClip("binary_tree_preorder_traversal.gif")
# vfc.write_videofile("binary_tree_preorder_traversal.mp4")
# vfc = mp.VideoFileClip(".\\mp/binary_tree_preorder_traversal.gif")
# vfc.write_videofile(".\\mp/binary_tree_preorder_traversal1231.mp4")
import os
def getfilelist(rlist,path, ex_filter):
for dir,folder,file in os.walk(path):
for i in file:
if ex_filter not in i:
continue
t = "%s/%s"%(dir,i)
rlist.append(t)
all_gif_path = []
getfilelist(all_gif_path, ".", ".gif")
print all_gif_path
for _gif_path in all_gif_path:
vfc = mp.VideoFileClip(_gif_path)
vfc.write_videofile(_gif_path.replace(".gif", ".mp4"))