摘要: 1.编程的本质是思考.2.无论使用什么编程语言,生产一条基本语句所需要的工数几乎是一定的.(>)#使用抽象程度高的语言可以提高生产效率.3.DSL:What, not How内部DSL:"借宿"在宿主语言中,借用了宿主语言语法.外部DSL:独立于编程语言,可以实现跨语言共享.eg.XML,SQL.4... 阅读全文
posted @ 2015-07-06 00:43 fosmj 阅读(191) 评论(0) 推荐(0)
摘要: Linux下编译多线程程序遇到错误:undefined reference to `pthread_create'collect2: ld returned 1 exit status原因是系统无法找到pthread_create函数。也就是说编译器在link得时候找不到其中的一个使用库的函数。解决... 阅读全文
posted @ 2015-06-05 00:23 fosmj 阅读(1666) 评论(0) 推荐(0)
摘要: Build Static Libaryar ru xxx.a *.oranlib xxx.a//not necessaryBuild Dynamic Libaryg++ -shared -fPIC -o xxx.so *.o 阅读全文
posted @ 2015-06-01 23:43 fosmj 阅读(198) 评论(0) 推荐(0)
摘要: 1.delete all executable files under certain directoryfind /directory -type f -executable -deleteorfind /directory -type f -executable -exec rm -f {} ... 阅读全文
posted @ 2015-05-13 23:25 fosmj 阅读(161) 评论(0) 推荐(0)
摘要: Stacktypedef struct{ int *elem; int length; int alloc_length;}stack;void stack_init(stack &s){ s.length = 0; s.alloc_length = 4; s.e... 阅读全文
posted @ 2015-05-10 23:28 fosmj 阅读(204) 评论(0) 推荐(0)
摘要: The process to add 4G swap on your original swap:1.Create a 4G swap file$ size="4G" && sudo fallocate -l $size /$size-swap && sudo mkswap /$size-swap ... 阅读全文
posted @ 2015-05-08 21:48 fosmj 阅读(201) 评论(0) 推荐(0)
摘要: 创建函数delimiter //create function function_name([parameters])returns return_type begindo your workend//delimiter ;说明:1.//可以用$$代替2.最后一句delimiter与分号之间有... 阅读全文
posted @ 2015-04-29 18:52 fosmj 阅读(929) 评论(0) 推荐(0)
摘要: 随机构造的二叉搜索树是趋向于平衡的.因此,一般来说,要为一组固定的元素建立平衡二叉树,可以先随机排列这些元素,然后按照排列的顺序将它们插入倒树中.Treap树先按照结点的优先级将结点排序,然后再逐一插入二叉树中.Treap树中结点的关键字遵循二叉搜索树的性质,且优先级遵循最小堆的性质.编程实现:#i... 阅读全文
posted @ 2015-04-13 22:16 fosmj 阅读(259) 评论(0) 推荐(0)
摘要: 伸展树是一种平衡二叉树。在伸展树上的一般操作都基于伸展操作:假设想要对一个二叉查找树执行一系列的查找操作,为了使整个查找时间更小,被查频率高的那些条目就应当经常处于靠近树根的位置。于是想到设计一个简单方法, 在每次查找之后对树进行重构,把被查找的条目搬移到离树根近一些的地方。伸展树应运而生。平衡二叉... 阅读全文
posted @ 2015-04-13 13:43 fosmj 阅读(218) 评论(0) 推荐(0)
摘要: TrieIn computer science, a trie, also called digital tree and sometimes radix tree or prefix tree (as they can be searched by prefixes), is an ordered... 阅读全文
posted @ 2015-04-13 11:26 fosmj 阅读(2526) 评论(0) 推荐(0)