自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Aegeaner的专栏

in every possible way

  • 博客(13)
  • 资源 (9)
  • 收藏
  • 关注

原创 Redis源代码分析之七:事件驱动库分析——Ae

aeEventLoop是一个记录记录程序事件状态的结构:/* State of an event based program */ typedef struct aeEventLoop { int maxfd; long long timeEventNextId; aeFileEvent events[AE_SETSIZE]; /* Registered events */

2012-02-27 15:12:49 5278 1

原创 Redis源代码分析之六:Redis执行流程

现在我们分析Redis从启动开始的执行流程,从而顺藤摸瓜地理解其事件驱动模型。 首先找到main入口: int main(int argc, char **argv) { time_t start; initServerConfig(); if (argc == 2) { if (strcmp(argv[1], "-v") == 0 ||

2012-02-27 14:09:40 8651

原创 由二叉树的前序遍历序列和中序遍历序列求后序遍历序列

给出二叉树的前序遍历序列和中序遍历序列,求后序遍历序列。比如节点内存储的数据类型为char的二叉树,给出前序遍历序列"abdec",中序遍历序列"dbeac",则输出后序遍历序列。 可以写一个递归函数实现,首先由前序遍历序列的第一个元素确定根节点,然后再中序遍历序列中找出等于该元素的位置索引,则根据中序遍历的定义,该位置以左为左子树,以右为右子树。根据前序遍历的定义,第一个元素之后跟着的也分别是

2012-02-24 10:04:27 10360

原创 TCP/IP笔记二:IP头部/UDP/TCP校验和的计算

The IP checksum is the 16 bit one's complement of the one's complement sum of all 16 bit words in the header. “1的补码”即反码。 IP只对首部而不对数据部分计算校验和,计算方法是将首部视为16位整数的序列,对首部所有16位整数各求反码,并将结果相加,再对求得的和计算一次二进制反码

2012-02-19 20:12:40 2174

原创 TCP/IP笔记一:判断子网类型的几个宏

最近在看《用TCP/IP进行网际互联》和《TCP/IP详解》,以及TCP/IP的几个开源实现:Xinu实现、BSD实现、lwIP实现、uIP实现,做一些小的笔记。、 下面是Xinu中判断子网类型的几个宏: #if BYTE_ORDER == BIG_ENDIAN #define IP_CLASSA(x) (((x) & 0x80000000) == 0) /* IP Class A */ #

2012-02-16 13:30:04 1495

转载 Rails错误:LoadError: no such file to load – openssl 解决办法

Install openssl and openssl-devel. aptitude install libssl-dev Go to your Ruby source directory and run the following commands: cd ext/openssl rvmsudo ruby extconf.rb make make install

2012-02-10 11:11:58 2005

原创 Redis源代码分析之五:简单动态字符串——Sds

一个Redis字符串的结构体定义是: struct sdshdr { int len; int free; char buf[]; }; 其中buf字符数组中储存实际的字符串。len变量保存字符串的长度。free变量指出还有多少字节可用。 sds被定义为一种新的数据类型,实际就是字符指针: typedef char *sds; 例如,sdsnewlen

2012-02-04 15:40:27 2338

转载 【Redis】Why is an Event Library needed at all?

Let us figure it out through a series of Q&As. Q: What do you expect a network server to be doing all the time?  A: Watch for inbound connections on the port its listening and accept them. Q: C

2012-02-04 15:05:34 1410

原创 Redis源代码分析之四:Unix底层网络通信——Anet

还是先介绍接口: int anetTcpConnect(char *err, char *addr, int port); int anetTcpNonBlockConnect(char *err, char *addr, int port); int anetUnixConnect(char *err, char *path); int anetUnixNonBlockConnect(ch

2012-02-04 14:29:33 4399 1

原创 Redis源代码分析之三:散列表——Dict(下)

下面分析散列表常见操作,如插入、删除、替换等。 散列表插入函数dictAdd实现如下: /* Add an element to the target hash table */ int dictAdd(dict *d, void *key, void *val) { int index; dictEntry *entry; dictht *ht; if

2012-02-04 11:48:44 3068

原创 Redis源代码分析之二:散列表——Dict(上)

先介绍Redis散列表实现的几个重要数据结构: 字典项DictEntry: typedef struct dictEntry { void *key; void *val; struct dictEntry *next; } dictEntry; 字典类型DictType: typedef struct dictType { unsigned

2012-02-01 20:16:48 3952

原创 Redis源代码分析之一:内存管理——Zmalloc

首先Zmalloc的接口定义在头文件Zmalloc.h里: void *zmalloc(size_t size); void *zcalloc(size_t size); void *zrealloc(void *ptr, size_t size); void zfree(void *ptr); char *zstrdup(const char *s); size_t zmalloc_use

2012-02-01 19:05:05 8612 1

转载 The architecture of REDIS

REDIS is an open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. Redis works with an in-memo

2012-02-01 16:33:53 2049

The Architecture of Open Source Applications

讲开源软件架构的书。 Contents Introduction Amy Brown and Greg Wilson ix 1. Asterisk Russell Bryant 1 2. Audacity James Crook 15 3. The Bourne-Again Shell Chet Ramey 29 4. Berkeley DB Margo Seltzer and Keith Bostic 45 5. CMake Bill Hoffman and Kenneth Martin 67 6. Eclipse Kim Moir 77 7. Graphite Chris Davis 101 8. The Hadoop Distributed File System Robert Chansler, Hairong Kuang, Sanjay Radia, Konstantin Shvachko, and Suresh Srinivas 111 9. Continuous Integration C. Titus Brown and Rosangela Canino-Koning 125 10. Jitsi Emil Ivov 139 11. LLVM Chris Lattner 155 12. Mercurial Dirkjan Ochtman 171 13. The NoSQL Ecosystem Adam Marcus 185 14. Python Packaging Tarek Ziadé 205 15. Riak and Erlang/OTP Francesco Cesarini, Andy Gross, and Justin Sheehy 229 16. Selenium WebDriver Simon Stewart 245 17. Sendmail Eric Allman 271 18. SnowFlock Roy Bryant and Andrés Lagar-Cavilla 291 19. SocialCalc Audrey Tang 303 20. Telepathy Danielle Madeley 325 21. Thousand Parsec Alan Laudicina and Aaron Mavrinac 345 22. Violet Cay Horstmann 361 23. VisTrails Juliana Freire, David Koop, Emanuele Santos, Carlos Scheidegger, Claudio Silva, and Huy T. Vo 377 24. VTK Berk Geveci and Will Schroeder 395 25. Battle For Wesnoth Richard Shimooka and David White 411 Bibliography Making Software

2011-09-17

高精度计算源码

强大的hugecalc!

2007-08-30

Learning the Unix OS

(ebook-chm) O'Reilly Learning the Unix OS

2007-08-30

Inside C++ Object Model

经典..Inside C++ Object Model

2007-08-30

Effective C++(中文版)

经典经典经典经典经典

2007-08-30

C++高级参考手册

C++高级参考手册C++高级参考手册

2007-05-24

C++标准库,Boost简介

Addison.Wesley.Beyond.the.C.plus.plus.Standard.Library.An.Introduction.to.Boost

2007-05-20

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除