Description

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.

An input string is valid if:

  1. Open brackets must be closed by the same type of brackets.
  2. Open brackets must be closed in the correct order.

Note that an empty string is also considered valid.

Read more »

Description

Given an array of integers, return indices of the two numbers such that they add up to a specific target.

You may assume that each input would have exactly one solution, and you may not use the same element twice.

Read more »

零、背景

Mac Book Pro (MBP)一直是极客开发者首选的操作系统,然而在工作中,并不是每个公司都会为开发者配备 MBP 的,然而,相信有强迫症的程序员都无法忍受 Windows 的命令行工具,我也不例外。好再微软在 2019 年 5 月推出了一款 Windows Terminal(截至作者撰稿时,仅 Preview 版可用),可以说给基于 Window 开发的程序员带来了福音。

Read more »

背景

项目开发时,调用第三方服务集群,集群有多台机器,当机器之间没有主从之分时,需要应用层自己做负载均衡以保证各机器之间的流量均衡。

负载调度算法介绍

分布式系统中,常用负载调度算法有轮询、加权轮询、哈希、随机、加权随机、最小连接数。

Read more »

通俗来讲,Wireshark 是一个免费的抓包工具(分组嗅探器),它可以显示协议栈不同层级封装的消息内容,Wireshark 有盘大的用户群体,它可在Windows,Mac和Linux / Unix计算机上运行。

Read more »

C/C++ 中的#include一样,PHP 提供 require 和 include 等方法允许将一个外部 PHP 文件引入到当前文件中,include与require没有本质上的区别,唯一的不同在于错误级别,当文件无法被正常加载时include会抛出warning警告,而require则会抛出error错误。

Read more »

1. RESTful 简介

REST (Representational State Transfer) 翻作「表层状态转换」,是 Roy Thomas Fielding 在他的博士论文中提出的一种 API 设计风格。

表现层状态转换是根基于超文本传输协议(HTTP)之上而确定的一组约束和属性,是一种设计提供万维网络服务的软件构建风格。匹配或兼容于这种架构风格(简称为 REST 或 RESTful)的网络服务,允许客户端发出以统一资源标识符访问和操作网络资源的请求,而与预先定义好的无状态操作集一致化。因此表现层状态转换提供了在互联网络的计算系统之间,彼此资源可交互使用的协作性质(interoperability)。
—— wikipedia

Read more »
0%