🚙

💨 💨 💨

×

  • Categories

  • Archives

  • Tags

  • About

etcd的restful接口

Posted on 07-10-2019 | In NP

. . .

gevent总结

Posted on 07-09-2019 | In Misc

. . .

python的with与__enter__以及__exit__关系

Posted on 06-28-2019 | In Misc

有一些任务,可能事先需要设置,事后做清理工作。对于这种场景,Python的with语句提供了一种非常方便的处理方式。一个很好的例子是文件处理,你需要获取一个文件句柄,从文件中读取数据,然后关闭文件句柄。

. . .

Etcd安装备忘

Posted on 06-27-2019 | In Misc

参考

https://skyao.gitbooks.io/learning-etcd3/content/installation/linux_single.html

下载/配置

简而言之就是 : 先去 etcd 的 github找到他的release, 然后复制链接, 下载然后配置

注: 以 etcd-v3.2.1 为例,后续更新版本时可能细节有所不同。

. . .

Linux Go安装备忘

Posted on 06-27-2019 | In Misc

装go

因为 ubuntu 默认装 go 是1.6 的, 不想装 1.6, 准备装 1.8,

. . .

久违pybind11

Posted on 05-19-2019 | In Misc

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.

编写供 python 调用的 C++ 模块

下载好 pybind11 之后,我们就可以开始对着官方的 pybind11 Tutorial 进行学习了,详细的入门教程及语法请参考官方文档,这里,我们简单演示下如何编写供 python 调用的 C++ 模块.

. . .

asio none boost 浅踩坑

Posted on 04-01-2019 | In NP

一晃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.

. . .

12345678910111213141516171819202122…36
Mike

Mike

🚙 🚗 💨 💨 If you want to create a blog like this, just follow my open-source project, "hexo-theme-neo", click the GitHub button below and check it out ^_^ . It is recommended to use Chrome, Safari, or Edge to read this blog since this blog was developed on Edge (Chromium kernel version) and tested on Safari.

11 categories
287 posts
110 tags
about
GitHub Spotify
© 2013 - 2025 Mike