File tree 7 files changed +7
-13
lines changed
7 files changed +7
-13
lines changed Original file line number Diff line number Diff line change 25
25
26
26
## Collection
27
27
28
- <div align =" center " > <img src =" ../pics//VP4n3i8m34Ntd28NQ4_0KCJ2q044Oez .png " /> </div ><br >
28
+ <div align =" center " > <img src =" ../pics//VP6n3i8W48Ptde8NQ9_0eSR5eOD6uqx .png " /> </div ><br >
29
29
30
30
### 1. Set
31
31
Original file line number Diff line number Diff line change @@ -2415,7 +2415,8 @@ public int climbStairs(int n) {
2415
2415
定义 dp 数组用来存储最大的抢劫量,其中 dp[ i] 表示抢到第 i 个住户时的最大抢劫量。
2416
2416
2417
2417
由于不能抢劫邻近住户,因此如果抢劫了第 i 个住户那么只能抢劫 i - 2 或者 i - 3 的住户,所以
2418
- dp[ i] = max(dp[ i-1] , dp[ i-2] + nums[ i] ) <br >
2418
+
2419
+ <div align =" center " ><img src =" https://latex.codecogs.com/gif.latex?dp[i]=max(dp[i-2],dp[i-3])+nums[i] " /></div > <br >
2419
2420
2420
2421
``` java
2421
2422
public int rob(int [] nums) {
@@ -2427,7 +2428,6 @@ public int rob(int[] nums) {
2427
2428
}
2428
2429
return pre1;
2429
2430
}
2430
-
2431
2431
```
2432
2432
2433
2433
** 强盗在环形街区抢劫**
@@ -2505,9 +2505,9 @@ public int minPathSum(int[][] grid) {
2505
2505
for (int i = 0 ; i < m; i++ ) {
2506
2506
for (int j = 0 ; j < n; j++ ) {
2507
2507
if (i == 0 ) {
2508
- if (j > 0 ) dp[j] = dp[j - 1 ];
2508
+ dp[j] = dp[j - 1 ];
2509
2509
} else {
2510
- if (j > 0 ) dp[j] = Math . min(dp[j - 1 ], dp[j]);
2510
+ dp[j] = Math . min(dp[j - 1 ], dp[j]);
2511
2511
}
2512
2512
dp[j] += grid[i][j];
2513
2513
}
Original file line number Diff line number Diff line change @@ -335,5 +335,4 @@ Raft 也是分布式一致性协议,主要是用来竞选主节点。
335
335
- [ What is CAP theorem in distributed database system?] ( http://www.colooshiki.com/index.php/2017/04/20/what-is-cap-theorem-in-distributed-database-system/ )
336
336
- [ NEAT ALGORITHMS - PAXOS] ( http://harry.me/blog/2014/12/27/neat-algorithms-paxos/ )
337
337
- [ Paxos By Example] ( https://angus.nyc/2012/paxos-by-example/ )
338
- - [ ACID] ( https://en.wikipedia.org/wiki/ACID_(computer_science) )
339
338
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ http://www.examplebank.com/withdraw?account=AccoutName&amount=1000&for=PayeeName
111
111
112
112
这种恶意的网址可以有很多种形式,藏身于网页中的许多地方。此外,攻击者也不需要控制放置恶意网址的网站。例如他可以将这种地址藏在论坛,博客等任何用户生成内容的网站中。这意味着如果服务器端没有合适的防御措施的话,用户即使访问熟悉的可信网站也有受攻击的危险。
113
113
114
- 透过例子能够看出 ,攻击者并不能通过 CSRF 攻击来直接获取用户的账户控制权,也不能直接窃取用户的任何信息。他们能做到的,是欺骗用户浏览器,让其以用户的名义执行操作。
114
+ 通过例子能够看出 ,攻击者并不能通过 CSRF 攻击来直接获取用户的账户控制权,也不能直接窃取用户的任何信息。他们能做到的,是欺骗用户浏览器,让其以用户的名义执行操作。
115
115
116
116
## 防范手段
117
117
Original file line number Diff line number Diff line change @@ -879,7 +879,7 @@ FIFO 常用于客户-服务器应用程序中,FIFO 用作汇聚点,在客户
879
879
880
880
虽然无法知道将来要使用的页面情况,但是可以知道过去使用页面的情况。LRU 将最近最久未使用的页面换出。
881
881
882
- 为了实现 LRU,需要在内存中维护一个所有页面的链表。当一个页面被访问时,将这个页面移到链表表头。这样就能保证链表表尾的页面时最近最久未访问的 。
882
+ 为了实现 LRU,需要在内存中维护一个所有页面的链表。当一个页面被访问时,将这个页面移到链表表头。这样就能保证链表表尾的页面是最近最久未访问的 。
883
883
884
884
因为每次访问都需要更新链表,因此这种方式实现的 LRU 代价很高。
885
885
Original file line number Diff line number Diff line change @@ -116,11 +116,6 @@ HTTP 重定向负载均衡服务器使用某种负载均衡算法计算得到服
116
116
117
117
### 3. 反向代理服务器
118
118
119
- 首先了解一下正向代理与反向代理的区别:
120
-
121
- - 正向代理:发生在客户端,是由用户主动发起的。比如翻墙,客户端通过主动访问代理服务器,让代理服务器获得需要的外网数据,然后转发回客户端;
122
- - 反向代理:发生在服务器端,用户不知道反向代理的存在。
123
-
124
119
反向代理服务器位于源服务器前面,用户的请求需要先经过反向代理服务器才能到达源服务器。反向代理可以用来进行缓存、日志记录等,同时也可以用来做为负载均衡服务器。
125
120
126
121
在这种负载均衡转发方式下,客户端不直接请求源服务器,因此源服务器不需要外部 IP 地址,而反向代理需要配置内部和外部两套 IP 地址。
You can’t perform that action at this time.
0 commit comments