在C程序中集成Python

测试环境:Ubuntu 10.04

[code language=”c”]
#include
#include int main(int argc, char * argv[])
{
// initialize the interpreter
Py_Initialize();
// evaluate some code
PyRun_SimpleString(“import sys\n”);
//ignore line wrap on following line
PyRun_SimpleString(“sys.stdout.write(‘Hello from an embedded Python Script\\n’)\n”);
// shut down the interpreter
Py_Finalize();
return 0;
}
[/code]

编译:
[code language=”bash”]
$gcc Listing1.c -I/usr/include/python2.6 -lpython2.6
[/code]

编译成.so
[code language=”bash”]
$gcc -c -fPIC Listing2.c -I/usr/include/python2.6
$gcc -shared Listing2.o -o libcrypto.so -lpython2.6
[/code]

参考:
1. Embedding Python in Multi-Threaded C/C++ Applications

mongoDB

The best features of key/values stores, document databases and RDBMSes in one.

MongoDB is a high-performance, open source, schema-free document-oriented database. MongoDB is written in C++ and offers the following features:

  • Collection oriented storage – easy storage of object-style data
  • Dynamic queries
  • Full index support, including on inner objects
  • Query profiling
  • Replication and fail-over support
  • Efficient storage of binary data including large objects (e.g. videos)
  • Auto-sharding for cloud-level scalability (currently in early alpha)
  • Commercial Support Available

A key goal of MongoDB is to bridge the gap between key/value stores (which are fast and highly scalable) and traditional RDBMS systems (which are deep in functionality).

MongoDB是一个高性能的面向文件的开源数据存储项目。十分容易部署,管理和使用。可以通过网络访问,并且由C++语言编写。主要包含的功能特性有易存储对象类型的数据,完全索引支持,查询支持,复制和故障恢复支持,高效的二进制数据存储,自动处理碎片提高云层次上的扩展性。高性能,可扩展,适当的功能使这个项目的主要设计目标。

BerkeleyDb之后,可以找到的替代品之一。

参考:

1. http://rdc.taobao.com/blog/dw/archives/410

WinxGUI – WINX

WinxGui is composed of some sub-libraries. They are winsdkwtlstdextwinx.

winsdkwtl are 3rdparty libraries. winsdk is Windows Platform SDK, which is provided by Microsoft. wtl is Windows Template Library. It is a C++ library for developing Windows applications and UI components. It extends ATL (Active Template Library) and provides a set of classes for controls, dialogs, frame windows, GDI objects, and more.

stdext is a GUI-less library. stdext means STL (Standard Template Library) extensions. It extends STL and provides a set of classes for diagnosis, memory management, unit tests, file io, etc. stdext is self systematic. It depends nothing else, and you can use it freely.

winx is the core of WinxGui library, of course. It depends winsdk(optional), wtl, and stdext. You may ask me why you based on WTL. In Dive into WinxGui I will answer the question.

In fact, stdext library is more general and useful than winx. So, we decided to release stdext library independently. Its homepage is http://code.google.com/p/stdext/. The wiki of stdext library is http://cpp.winxgui.com/.

http://code.google.com/p/winx/

昨天,今天,明天! Unix系统的40年(引用)

在1969年的8月,Ken Thompson作为AT&T贝尔实验室的程序员,由于忍受不了长时间妻儿离开于是专心开发新的操作系统,他为DEC(Digital Equipment Corp.)公司的PDP-7小型机写第一个Unix版本的汇编语言,利用一周的时间在每个操作系统上完成Shell和汇编语言编写。由于当年贝尔实验室 正在做一项关于Time-Sharing系统名为(Multics)的研究,项目陷入困境导致Thompson和他的同事 Dennis Ritchie对于Multics系统整体架构存在分歧,而他们对于系统有另外的一些新看法,于是Thompson编写了第一个版本的Unix,随后他们 在接下来的日子里得到了很多同事的协助。 继续阅读昨天,今天,明天! Unix系统的40年(引用)