[置顶] 随记
后续将自己记录在朋友圈、空间等平台上的经历记录在自己的网站上。
后续将自己记录在朋友圈、空间等平台上的经历记录在自己的网站上。
游戏付费更名题反思:
题目简单,当题目简单时,要注意实现时的细节和完整性。本次面试作答时省略了字符校验和日志输出问题。
应当作答但未能作答的内容:[扣费的合理性、字符校验、日志打印、更名后的缓存刷新]
考察:候选人临场思考的全面与逻辑性。
层次关系:TCP 位于传输层,而 HTTP 位于应用层。HTTP 依赖于 TCP 提供的可靠传输服务来实现数据的传输。当客户端发送 HTTP 请求时,实际上是将 HTTP 数据封装在 TCP 数据包中进行传输;服务器接收到 TCP 数据包后,再从中解析出 HTTP 数据进行处理。
工作流程:客户端和服务器之间首先通过三次握手建立 TCP 连接,然后客户端通过该连接发送 HTTP 请求,服务器接收到请求后进行处理,并通过个相同的 TCP 连接返回 HTTP 响应,最后四次挥手关闭 TCP 连接(除非使用持久连接)。
101 Switching Protocols
的响应,表示协议从HTTP升级到WebSocket。协议升级完成后,通信方式就从HTTP切换为WebSocket,建立起了双向、持久的通信通道。ws://
)或443端口(加密,wss://
)进行通信。这使得在同一个服务器上可以同时支持HTTP和WebSocket服务,方便用户通过同一个通信接口进行访问。/**
* 获取一个数最近且更大的二次幂整数
* @param {number} num
* @example
* input:3 => output: 4
* input:4 => output: 4
* input:5 => output: 8
*/
function solution1(num) {
if(num < 1) return 1;
num--; // 先 -1 ,防止num本身就是2的幂被提升到更大的幂
num |= num >> 1; // 将最高位的1扩散到相邻低位
num |= num >> 2;
num |= num >> 4;
num |= num >> 8;
num |= num >> 16;
num |= num >> 32;
return num + 1;
}
function solution2(num) {
if (num < 1) return 1;
return Math.pow(2, Math.ceil(Math.log2(num)));
}
function solution3(num) {
let power = 1;
while (power < num) {
power *= 2;
}
return power;
}
联合主键和普通的复合索引无太大差别,也遵循最左匹配原则。
如果是按照主键的第一个字段进行搜索,则不需要添加索引;如果是第二个字段,则需要添加索引提高查询效率。
return a / (24*60*60*1000L) == b / (24*60*60*1000L);
Hey there! You're looking at our new blog, built with the brand new [built-in blog plugin]. With this plugin, you can easily build a blog alongside your documentation or standalone.
Proper support for blogging, as requested by many users over the past few years, was something that was desperately missing from Material for MkDocs' feature set. While everybody agreed that blogging support was a blind spot, it was not obvious whether MkDocs could be extended in a way to allow for blogging as we know it from [Jekyll] and friends. The [built-in blog plugin] proves that it is, after all, possible to build a blogging engine on top of MkDocs, in order to create a technical blog alongside your documentation, or as the main thing.