- 授权协议: MIT
- 开发语言: C/C++
- 操作系统: Linux
- 软件首页: https://github.com/c9s/r3
- 软件文档: https://github.com/c9s/r3
软件介绍
R3 是一个高性能的 URL 路由开发包,使用 C 语言开发。可将你的路由规则编译成前缀单词查找树。
依赖的软件:
autoconf
automake
check
pcre
jemalloc
graphviz version 2.38.0 (20140413.2041)
规则写法:
/blog/post/{id} use [^/]+ regular expression by default.
/blog/post/{id:\d+} use `\d+` regular expression instead of default.
编程示例:
#include <r3.h>
// create a router tree with 10 children capacity (this capacity can grow dynamically)
n = r3_tree_create(10);
int route_data = 3;
// insert the route path into the router tree
r3_tree_insert_pathl(n , "/zoo" , strlen("/zoo") , NULL, &route_data );
r3_tree_insert_pathl(n , "/foo/bar" , strlen("/foo/bar") , NULL, &route_data );
r3_tree_insert_pathl(n , "/bar" , strlen("/bar") , NULL, &route_data );
r3_tree_insert_pathl(n , "/post/{id}" , strlen("/post/{id}") , NULL, &route_data );
r3_tree_insert_pathl(n , "/user/{id:\\d+}" , strlen("/user/{id:\\d+}") , NULL, &route_data );
// let's compile the tree!
r3_tree_compile(n);
// dump the compiled tree
r3_tree_dump(n, 0);
// match a route
node *matched_node = r3_tree_match(n, "/foo/bar", strlen("/foo/bar"), NULL);
matched_node->endpoint; // make sure there is a route end at here.
int ret = *( (*int) matched_node->route_ptr );
可计算性和计算复杂性
朱一清 / 国防工业出版社 / 2006-4 / 18.0
本书深入浅出地介绍了研究可计算性的四个主要模型以及四个模型彼此之间的关系:介绍了计算复杂性的基本概念和重要的研究方法与一些研究成果。内容涉及递归函数、图灵机、λ演算、马尔可夫算法、计算复杂度的分类、NP完全理论、非一致复杂性等。分述于十章,书中附有习题。 本书可作为广大有志于突破计算复杂性研究僵局——“P=NP?”的科技工作者,计算机科学和元计算机科学工作者,数学和元数学工作者以及大......一起来看看 《可计算性和计算复杂性》 这本书的介绍吧!

