自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

认知 行动 坚持

涛哥不知何许人也,亦不详其姓字。闲静少言,不慕荣利。好读书,求甚解。常著文章自娱,颇示己志。忘怀得失,有始有终...

  • 博客(2835)
  • 资源 (19)
  • 收藏
  • 关注

原创 漫话Redis源码之三十六

#include "server.h"int clientSubscriptionsCount(client *c);/*----------------------------------------------------------------------------- * Pubsub client replies API *----------------------------------------------------------------------------*...

2021-12-12 23:27:49 1259

原创 漫话Redis源码之三十五

#ifndef REDIS_STATIC#define REDIS_STATIC static#endif/* Optimization levels for size-based filling. * Note that the largest possible limit is 16k, so even if each record takes * just one byte, it still won't overflow the 16 bit count field. */sta...

2021-12-12 23:26:25 688

原创 漫话Redis源码之三十四

#include <stdint.h>#define N 16#define MASK ((1 << (N - 1)) + (1 << (N - 1)) - 1)#define LOW(x) ((unsigned)(x) & MASK)#define HIGH(x) LOW((x) >> N)#define MUL(x, y, z) { int32_t l = (long)(x) * (long)(y); \ (z)[0] =...

2021-12-12 23:25:02 504

原创 漫话Redis源码之三十三

/* Allocate a new rax and return its pointer. On out of memory the function * returns NULL. */rax *raxNew(void) { rax *rax = rax_malloc(sizeof(*rax)); if (rax == NULL) return NULL; rax->numele = 0; rax->numnodes = 1; rax-&g...

2021-12-12 23:22:17 402

原创 漫话Redis源码之三十二

static ssize_t rdbWriteRaw(rio *rdb, void *p, size_t len) { if (rdb && rioWrite(rdb,p,len) == 0) return -1; return len;}

2021-12-12 23:19:42 742

原创 漫话Redis源码之三十一

typedef struct _client { redisContext *context; sds obuf; char **randptr; /* Pointers to :rand: strings inside the command buf */ size_t randlen; /* Number of pointers in client->randptr */ size_t randfree; ...

2021-12-12 23:17:20 615 2

原创 漫话Redis源码之三十

int readLong(FILE *fp, char prefix, long *target) { char buf[128], *eptr; epos = ftello(fp); if (fgets(buf,sizeof(buf),fp) == NULL) { return 0; } if (buf[0] != prefix) { ERROR("Expected prefix '%c', got: '%c'",prefi...

2021-12-12 23:15:21 444

原创 漫话Redis源码之二十九

struct { rio *rio; robj *key; /* Current key we are reading. */ int key_type; /* Current key type if != -1. */ unsigned long keys; /* Number of keys processed. */ unsigned long exp...

2021-12-12 23:14:06 677

原创 漫话Redis源码之二十八

/* Cluster Manager Command Info */typedef struct clusterManagerCommand { char *name; int argc; char **argv; int flags; int replicas; char *from; char *to; char **weight; int weight_argc; char *master_id; ...

2021-12-12 23:11:54 380

原创 世乒赛结束,小胖果然夺冠啦

前几天,预言小胖夺冠。果然,就夺冠了。加油,小胖。一步一步来,瞄准3年后的巴黎奥运会。

2021-12-05 22:00:13 665 2

原创 漫话Redis源码之二十七

#include <string.h>#include <stdio.h>#include "release.h"#include "version.h"#include "crc64.h"char *redisGitSHA1(void) { return REDIS_GIT_SHA1;}char *redisGitDirty(void) { return REDIS_GIT_DIRTY;}uint64_t redisBuild...

2021-12-05 21:55:56 883

原创 漫话Redis源码之二十六

#include "server.h"#include "cluster.h"#include "bio.h"#include <sys/time.h>#include <unistd.h>#include <fcntl.h>#include <sys/socket.h>#include <sys/stat.h>void replicationDiscardCachedMaster(void);void replic...

2021-12-05 21:54:16 1633

原创 漫话Redis源码之二十五

static const rio rioFileIO = { rioFileRead, rioFileWrite, rioFileTell, rioFileFlush, NULL, /* update_checksum */ 0, /* current checksum */ 0, /* flags */ 0, /* bytes re...

2021-12-05 21:51:13 360

原创 漫话Redis源码之二十四

/* Debugger shared state is stored inside this global structure. */#define LDB_BREAKPOINTS_MAX 64 /* Max number of breakpoints. */#define LDB_MAX_LEN_DEFAULT 256 /* Default len limit for replies / var dumps. */struct ldbState { connection *c...

2021-12-05 21:49:42 367

原创 漫话Redis源码之二十三

static inline char sdsReqType(size_t string_size) { if (string_size < 1<<5) return SDS_TYPE_5; if (string_size < 1<<8) return SDS_TYPE_8; if (string_size < 1<<16) return SDS_TYPE_16;#if (LO...

2021-12-05 21:48:15 404

原创 漫话Redis源码之二十二

/* This function is for checking whether sentinel config file has been set, * also checking whether we have write permissions. */void sentinelCheckConfigFile(void) { if (server.configfile == NULL) { serverLog(LL_WARNING, "Sen...

2021-12-05 21:47:03 513

原创 漫话Redis源码之二十一

/* Log a fixed message without printf-alike capabilities, in a way that is * safe to call from a signal handler. * * We actually use this only for signals that are not fatal from the point * of view of Redis. Signals that are going to kill the s...

2021-12-05 21:45:24 271

原创 漫话Redis源码之二十

/* set current thread cpu affinity to cpu list, this function works like * taskset command (actually cpulist parsing logic reference to util-linux). * example of this function: "0,2,3", "0,2-3", "0-20:2". */void setcpuaffinity(const char *cpulist) ...

2021-11-28 18:58:04 875

原创 漫话Redis源码之十九

#if __linux__ if (!(tmp = strdup(program_invocation_name))) goto syerr; program_invocation_name = tmp; if (!(tmp = strdup(program_invocation_short_name))) goto syerr; program_invocation_short_name = tmp;#elif __APPLE__ if (!(tmp = strdup(...

2021-11-28 18:56:58 656

原创 世乒赛又开始了,小胖加油

预祝小胖拿下世乒赛单打冠军。加油。先mark一下。

2021-11-28 18:55:52 501 2

原创 漫话Redis源码之十八

#else for (i = 0; i < 8; i++) { finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)] >> ((3-(i & 3)) * 8) ) & 255); /* Endian independent */ }#endif c = 0200; SHA1Update(context, &...

2021-11-28 18:53:58 464

原创 漫话Redis源码之十七

void sha256_update(SHA256_CTX *ctx, const BYTE data[], size_t len){ WORD i; for (i = 0; i < len; ++i) { ctx->data[ctx->datalen] = data[i]; ctx->datalen++; if (ctx->datalen == 64) { sha256_transform(ctx, ctx->data); ct...

2021-11-28 18:52:15 302

原创 漫话Redis源码之十六

/* Test of the CPU is Little Endian and supports not aligned accesses. * Two interesting conditions to speedup the function that happen to be * in most of x86 servers. */#if defined(__X86_64__) || defined(__x86_64__) || defined (__i386__) \ || def...

2021-11-28 18:50:27 498

原创 漫话Redis源码之十五

#include "server.h"#include "slowlog.h"/* Create a new slowlog entry. * Incrementing the ref count of all the objects retained is up to * this function. */slowlogEntry *slowlogCreateEntry(client *c, robj **argv, int argc, long long duration) {...

2021-11-28 18:48:53 280

原创 漫话Redis源码之十四

/* The SORT command is the most complex command in Redis. Warning: this code * is optimized for speed and a bit less for readability */void sortCommand(client *c) { list *operations; unsigned int outputlen = 0; int desc = 0, alpha = 0; ...

2021-11-28 18:47:52 1320

原创 漫话Redis源码之十三

/* Render part of a sequence, so that render_sequence() call call this function * with different parts in order to create the full output without overflowing * the current terminal columns. */sds sparklineRenderRange(sds output, struct sequence *se...

2021-11-28 18:45:29 282

原创 漫话Redis源码之十二

#include "server.h"/* ----------------- Blocking sockets I/O with timeouts --------------------- *//* Redis performs most of the I/O in a nonblocking way, with the exception * of the SYNC command where the slave does it in a blocking way, and * ...

2021-11-28 18:43:39 308

原创 漫话Redis源码之十一

#define HASH_SET_TAKE_FIELD (1<<0)#define HASH_SET_TAKE_VALUE (1<<1)#define HASH_SET_COPY 0int hashTypeSet(robj *o, sds field, sds value, int flags) { int update = 0; if (o->encoding == OBJ_ENCODING_ZIPLIST) { uns...

2021-11-28 18:42:12 345

原创 蓝桥杯大赛获奖选手,可获研究生推免加分啦,挺好的呀

大家好,我是涛哥。我一直关注着各类大会和各类比赛,之前也写过蓝桥杯大赛的一些攻略,并用实际的题目和案例,为大家准备蓝桥杯比赛提供了指导。蓝桥杯大赛其实并不难,但好处很多。有的朋友可能对蓝桥杯还不太了解,不过没关系,我简单来跟大家说说,希望广大IT爱好者能了解更多,从中受益。

2021-11-22 20:52:47 15561 10

原创 人在长大,心情在变化

人在长大,心情在变化,有同感的吗?

2021-11-21 23:21:56 746 1

原创 很多事情,与决心有关

很多时候,我总是倾向于相信决心。事情到底能不能做成,这源于决心。后来,有人跟我说,仅仅有决心是不够的。年轻的我反驳道:那是因为决心不太大。逐渐长大后,意识到有些事情确实无能为力,跟决心无关。而且,这样的事情还很多。虽然有很多事情我们无法左右,再大的决心也无济于事。但是,我还是要说,决心在很大程度上能影响结果。就这样吧。加油。...

2021-11-21 23:14:26 720 2

原创 漫话Redis源码之十

#include "server.h"/* ----------------- Blocking sockets I/O with timeouts --------------------- *//* Redis performs most of the I/O in a nonblocking way, with the exception * of the SYNC command where the slave does it in a blocking way, and * th...

2021-11-21 23:09:38 640

原创 漫话Redis源码之九

/* This is a helper function for the COPY command. * Duplicate a hash object, with the guarantee that the returned object * has the same encoding as the original one. * * The resulting object always has refcount set to 1 */robj *hashTypeDup(robj ...

2021-11-21 23:07:42 531

原创 漫话Redis源码之八

if (!(flags & STREAM_RWR_RAWENTRIES)) arraylen_ptr = addReplyDeferredLen(c); streamIteratorStart(&si,s,start,end,rev); while(streamIteratorGetID(&si,&id,&numfields)) { /* Update the group last_id if needed. ...

2021-11-21 23:06:31 389

原创 漫话Redis源码之七

void getrangeCommand(client *c) { robj *o; long long start, end; char *str, llbuf[32]; size_t strlen; if (getLongLongFromObjectOrReply(c,c->argv[2],&start,NULL) != C_OK) return; if (getLongLongFromObjectOrReply(...

2021-11-21 23:03:43 420

原创 漫话Redis源码之六

/* Return a ziplist element as an SDS string. */sds ziplistGetObject(unsigned char *sptr) { unsigned char *vstr; unsigned int vlen; long long vlong; serverAssert(sptr != NULL); serverAssert(ziplistGet(sptr,&vstr,&vlen,&am...

2021-11-21 23:02:18 476

原创 漫话Redis源码之五

void tlsCleanup(void) { if (redis_tls_ctx) { SSL_CTX_free(redis_tls_ctx); redis_tls_ctx = NULL; } if (redis_tls_client_ctx) { SSL_CTX_free(redis_tls_client_ctx); redis_tls_client_ctx = NULL; } #if OPE...

2021-11-21 23:00:57 680

原创 浅聊选择和努力

大家好,我是涛哥。又到周末了,愿大家开心。昨天是七夕节,你是否约到了心仪的另外一半呢?不管怎样,愿有情人终成眷属。最近在玩画画,在我的文章中,大家以后可以看到我的手绘画画哦,挺有意思的,文章封面图不愁了。最近有几件重要事情,其中一件是:我续约了。我平时很少公开谈职场相关的话题,今天这篇,聊作随笔。 涛歌手绘再过几年,我就35岁了,这是IT圈疯传的尴尬年龄,网上...

2021-11-21 22:59:54 714 5

原创 漫话Redis源码之四

/* Modify the buffer replacing all occurrences of chars from the 'from' * set with the corresponding char in the 'to' set. Always returns s. */char *memmapchars(char *s, size_t len, const char *from, const char *to, size_t setlen) { for (size_t...

2021-11-21 22:57:35 336

原创 漫话Redis源码之三

} zlentry;#define ZIPLIST_ENTRY_ZERO(zle) { \ (zle)->prevrawlensize = (zle)->prevrawlen = 0; \ (zle)->lensize = (zle)->len = (zle)->headersize = 0; \ (zle)->encoding = 0; \ (zle)->p = NULL; \}/* Extract the en...

2021-11-21 22:55:58 338

ipscanner.rar

获取网络的ip, host name和mac地址。我想免费让大家下载, 但csdn规定了必须设置积分, 没办法。

2017-12-01

linux protobuf安装文件

linux, google protobuf, 安装文件。 使用方法:http://blog.csdn.net/stpeace/article/details/53029812

2016-11-04

linux tree命令的源码

很多linux上没有tree命令, 该资源提供了tree命令的源码, 大家可以下载, 编译并安装, 具体请参考:http://blog.csdn.net/stpeace/article/details/49524273

2015-11-01

编译好的openssl库和头文件

编译好的openssl库, 欢迎使用, 具体使用方法, 请见http://blog.csdn.net/stpeace/article/details/41921287

2014-12-14

入门数据库sqlite3的最佳实践资料

入门数据库sqlite3的最佳实践资料, 里面是我打包好的程序, 附加一些数据库工具, 非常可以。 当然你也可以参考我的博文http://blog.csdn.net/stpeace/article/details/38503843

2014-08-12

Wireshark抓包工具

Wireshark抓包分析工具, 非常好用, 非常实用。

2014-06-08

优秀的截图软件

截图软件fast stone. 解压即可使用。 解压后, 可能会产生一些依赖性文件, 请不要轻易删除。

2014-05-25

获取网卡信息所需的头文件和库

获取网卡信息所需的头文件和库:IPEXPORT.H Iphlpapi.h IPHLPAPI.LIB IPRTRMIB.H IPTYPES.H

2013-10-19

哈希值计算软件

可以计算md5, sha1, sha256等哈希值的工具软件,我无法形容它的优秀。

2013-10-18

在Windows下学习Linux命令

在Windows下想学linux命令的同志,你终于找到了该资料。用法:解压,然后双击其中的cmd.exe, 然后就可以输入linux命令了,比如ls等(千万要注意,不要进行路径切换,否则linux命令就执行不了,总之,要确保相应文件在当前目录下)。

2013-08-08

计算机网络第5版谢希仁编配套光盘资料

计算机网络第5版谢希仁编配套光盘资料,这是计算机考研的指定教材对应的资料,你应该拥有它。

2013-07-19

OllyDBG反汇编工具

OllyDBG反汇编工具,非常强大。深化功底,需此工具。

2013-07-19

masm汇编器

微软的汇编器,其中有关键的masm.exe和link.exe,我试过,发现可用。

2013-07-19

word转pdf的插件

word转pdf的插件,直接安装即可,安装完后,“另存”word文档的时候,可以选择pdf(我用的word版本为2007)。

2013-07-18

音频处理软件Gold Wave

一款强大的音频处理软件,可以对音频进行各种处理。例如:如果你在准备某考试,需要听音频资料,但是,你嫌音频太慢,而且你的MP3播放器无法加速,那么你可以用该软件对音频本身进行加速,即改变音频本身,使之变快。另外,在处理的时候,可以实现批处理(我亲自实践过,发现可行)。

2013-07-17

H.264visa软件

一款非常强大的H.264视频码流的解析软件,可以看到解码后视频的像素值,运动矢量,宏块等非常多的信息(也可以打开原始的YUV视频,并看到像素值,但必须先用该软件打开某一H.264视频码流),比Elecard StreamEye软件(有bug)更为强大,我一直用H.264visa,目前没有发现有什么bug. 另外,该软件安装后1个月就会过期,没有关系,1个月后,你重新安装一次即可。

2013-07-13

Elecard StreamEye

Elecard StreamEye,一款分析H.264视频码流的工具,如果你在学习H.264,那么,你应该拥有它。

2013-07-13

YUVviewer :原始的YUV视频的播放器

原始的YUV视频的播放器(软件不是我写的),如果你做视频处理、视频压缩编码、视频通信、视频检索、视频取证,那么你很可能需要它。该软件的缺点是:你无法看到YUV视频的像素值。

2013-06-24

经典的C语言编译器:TC2.0

一款经典的C语言编译器:Borland Turbo C 2.0. 怀念Borland产品的人可以用一下,体验一下DOS下的编程。如果是C语言初学者,建议用MS的VC++6.0. 我试过,该TC2.0可以正常使用。

2013-06-23

空空如也

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

TA关注的人

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