简介 NIO有三宝:Buffer,Channel,Selector少不了。本文将会介绍NIO三件套中的最后一套Selector,并在理解Selector的基础上,协助小师妹发一张好人卡。我们开始吧。 Selector介绍 小师妹:F师兄,最近我的桃花有点旺,好几个师兄莫名其妙的跟我打招呼,可是我一 ...
分类:
编程语言 时间:
2020-06-14 10:34:02
阅读次数:
113
ES5继承 function Person(name, age) { this.name = name; this.age = age; } Person.prototype.sayName = function () { alert(`My name is ${this.name}.`); ret ...
分类:
Web程序 时间:
2020-06-14 10:29:21
阅读次数:
57
SUSE Linux Enterprise Desktop 15 的安装部署方式和要求已经发生了变化,为了突出对云计算和虚拟化的支持,对安装介质做了大量瘦身 ...
分类:
系统相关 时间:
2020-06-14 09:13:54
阅读次数:
111
顺序表 线性表的第一个儿子 这个儿子的结构体定义: typedef int ElemType;//取别名 typedef struct link{ ElemType * head;//head是一个数组指针,不太清楚的同学,可以百度一下 ElemType length; ElemType size; ...
分类:
编程语言 时间:
2020-06-14 01:23:40
阅读次数:
81
思路 首先建立结构体,将结构化文档存储起来,并记录节点的父节点索引。 struct css { string name; int parent; string id; css() {} css(string name,int parent,string id) { this->name = name ...
分类:
其他好文 时间:
2020-06-14 01:16:47
阅读次数:
58
1 #include <stdio.h> 2 #include <malloc.h> 3 typedef struct lianbiao *ptr; 4 struct lianbiao 5 { 6 int data; 7 ptr next; 8 }; 9 10 int main(void) 11 { ...
分类:
其他好文 时间:
2020-06-14 01:00:09
阅读次数:
64
硬件:Raspberry Pi 4B(4g或8g版本)系统:Ubuntu 20.04 LTS Docker:18.09.9mysql镜像:biarms/mysql:5.7.30-linux-arm64v8 注意:因为我们树莓派4B本身并非x86,而是arm架构,且我们的系统装的是64位ubuntu, ...
分类:
Web程序 时间:
2020-06-13 23:42:12
阅读次数:
342
字符串是Redis最常见的结构,Redis没有用C中的字符串,是自己构建的simple dynamic string来表示字符串 字符串的源码在sds.c/sds.h sds的基本结构 struct sdshdr { unsigned int len; //len表示当前buf中已使用字节长度 un ...
分类:
其他好文 时间:
2020-06-13 23:39:28
阅读次数:
94
最近在适配newlib代码时遇到一个关于弱声明的问题, 研究了一下才发现自己对weak属性与链接时符号选择理解有误. 问题背景 在一个库(liba.a)中重新定义了一个weak属性的函数(func_a), 在同一库中调用该函数时链接了弱声明的函数版本, 但是当通过另一个库(libb.a)的库函数(f ...
分类:
其他好文 时间:
2020-06-13 23:37:26
阅读次数:
113
第二十三章 职责链模式 23.1 基本介绍 职责链模式(Chain of Responsibility Pattern), 又叫责任链模式,为请求创建了一个接收者对象的链,沿着这个链传递该请求,直到有一个对象处理它为止。这种模式对请求的发送者和接收者进行解耦。 职责链模式通常每个接收者都包含对另一个 ...
分类:
其他好文 时间:
2020-06-13 22:55:31
阅读次数:
44