- 博客(12)
- 资源 (4)
- 收藏
- 关注
原创 c语言之函数指针
定义:指向函数的指针:函数指针函数:void printFuction()函数指针:void(*ptf)()赋值:ptf=printFuction(ptf=&printFuction)c语言规定:当用函数名(printFution)来初始化函数指针时,函数名会被转换为指向这个函数的指针#includevoid printFuction(){printf("tes
2013-08-28 21:54:54 975
原创 c语言之typedef别名
利用关键字typedef为数据类型创建别名:定义char* 的别名为sdstypedef char * sds 这样c1,c2相当于 char *c1,char * c2c3,c4数组的首地址赋给c1,c2然后c1,c2指向c3,c4数组的首地址#include#includetypedef char * sds;int main(void){ sds c1
2013-08-23 20:42:08 3029
原创 IO多路复用之epoll
#include int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event); epoll事件注册函数,第一个参数epfd: 是函数返回值,第二个参数op: 表示动作,用三个宏来表示:即①,EPOLL_CTL_ADD;注册新的事件到epfd中②,EPOLL_CTL_MOD;修改已经注册的fd的监
2013-08-17 20:02:14 1855
原创 MongoDB的安装配置
1,下载:http://www.mongodb.org/downloads2.4.5版:http://www.mongodb.org/dr/fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.4.5.tgz/download2,解压:hadoop@hadoopmaster:~/nosql$ tar zxvf mongodb-lin
2013-08-17 13:51:26 4171
原创 LevelDB源码之SkipList原理
感觉SkipList只要搞清楚高度就好了.下面是随机生成高度的函数RandomHeight()templateint SkipList::RandomHeight() { // Increase height with probability 1 in kBranching static const unsigned int kBranching = 4; int height
2013-08-15 22:01:58 2389
原创 Redis Error
1,MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the err
2013-08-13 21:06:48 3052
原创 spring 自定义schema
扩展schema,定义自己的bean属性。。不错!主要:1,定义META-INF下.xsd文件,这里是people.xsd;定义spring.handlers;定义spring.schemas2,定义namaspace解析类,这里是StudentNamespaceHandler3,定义beanDefinition,这里是StudentBeanDefinitionParser4,
2013-08-13 21:03:04 7525
转载 跳表(skiplist)的代码实现
http://www.cnblogs.com/liuhao/archive/2012/07/26/2610218.html跳表(skiplist)是一个非常优秀的数据结构,实现简单,插入、删除、查找的复杂度均为O(logN)。LevelDB的核心数据结构是用跳表实现的,redis的sorted set数据结构也是有跳表实现的。其结构如下所示:所有操作均从上向下逐
2013-08-10 20:21:56 1121
转载 SkipList 跳表
原文链接:http://kenby.iteye.com/blog/1187303为什么选择跳表目前经常使用的平衡数据结构有:B树,红黑树,AVL树,Splay Tree, Treep等。 想象一下,给你一张草稿纸,一只笔,一个编辑器,你能立即实现一颗红黑树,或者AVL树出来吗? 很难吧,这需要时间,要考虑很多细节,要参考一堆算法与数据结构之类的树,还
2013-08-10 20:06:49 897
原创 MongoDB Error
①,org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type org.joda.time.LocalDate to type java.lang.Stringat org.springframework.core.conv
2013-08-09 20:24:00 5448
原创 vmstat输出项
# vmstat 1 procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu---- r b swpd free buff cache si so bi bo in cs us sy id wa 1 0 252 1566792 310940 5117
2013-08-08 22:04:50 1259
原创 Linux多线程函数pthread_create()函数
函数原型:#include int pthread_create(pthread_t *thread, const pthread_attr_t *attr,void *(*start_routine) (void *), void *arg);4个参数:第一个参数:指向线程标示符pthread_t的指针;第二个参数:设置线程的属性第三个参数:线程运行函数的其实地址第四个参数
2013-08-08 21:13:29 25133
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人