Skip to content

Commit 49e8654

Browse files
committed
Merge pull request taizilongxu#12 from BillBillBillBill/master
补充内容
2 parents 0e295b4 + 7a73087 commit 49e8654

File tree

1 file changed

+57
-27
lines changed

1 file changed

+57
-27
lines changed

Readme.md

Lines changed: 57 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ is是对比地址,==是对比值
627627
* readlines 读取整个文件到一个迭代器以供我们遍历
628628

629629
## 28 Python2和3的区别
630-
630+
推荐:[Python 2.7.x 与 Python 3.x 的主要差异](http://chenqx.github.io/2014/11/10/Key-differences-between-Python-2-7-x-and-Python-3-x/)
631631

632632

633633
# 操作系统
@@ -654,11 +654,11 @@ epoll改了三个缺点.
654654

655655
## 2 调度算法
656656

657-
1. 先来先服务
658-
2. 短作业优先
659-
3. 最高优先权调度
660-
1. 时间片轮转
661-
2. 多级反馈队列调度
657+
1. 先来先服务(FCFS, First Come First Serve)
658+
2. 短作业优先(SJF, Shortest Job First)
659+
3. 最高优先权调度(Priority Scheduling)
660+
4. 时间片轮转(RR, Round Robin)
661+
5. 多级反馈队列调度(multilevel feedback queue scheduling)
662662

663663
实时调度算法:
664664

@@ -799,7 +799,7 @@ InnoDB 的趋势会是一个非常复杂的存储引擎,对于一些小的应
799799

800800
## 3 ARP协议
801801

802-
地址解析协议(Address Resolution Protocol): 根据IP地址获取物理地址的一个TCP/IP协
802+
地址解析协议(Address Resolution Protocol): 根据IP地址获取物理地址的一个TCP/IP协议
803803

804804
## 4 urllib和urllib2的区别
805805

@@ -810,11 +810,37 @@ InnoDB 的趋势会是一个非常复杂的存储引擎,对于一些小的应
810810

811811

812812
## 5 Post和Get
813+
[GET和POST有什么区别?及为什么网上的多数答案都是错的](http://www.cnblogs.com/nankezhishi/archive/2012/06/09/getandpost.html)
814+
815+
get: [RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1](http://tools.ietf.org/html/rfc2616#section-9.3)
816+
post: [RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1](http://tools.ietf.org/html/rfc2616#section-9.5)
817+
818+
813819

814820
## 6 Cookie和Session
821+
||Cookie|Session|
822+
|:-|:--|
823+
|储存位置|客户端|服务器端|
824+
|目的|跟踪会话,也可以保存用户偏好设置或者保存用户名密码等|跟踪会话|
825+
|安全性|不安全|安全|
826+
827+
session技术是要使用到cookie的,之所以出现session技术,主要是为了安全。
815828

816829
## 7 apache和nginx的区别
817830

831+
nginx 相对 apache 的优点:
832+
* 轻量级,同样起web 服务,比apache 占用更少的内存及资源
833+
* 抗并发,nginx 处理请求是异步非阻塞的,支持更多的并发连接,而apache 则是阻塞型的,在高并发下nginx 能保持低资源低消耗高性能
834+
* 配置简洁
835+
* 高度模块化的设计,编写模块相对简单
836+
* 社区活跃
837+
838+
apache 相对nginx 的优点:
839+
* rewrite ,比nginx 的rewrite 强大
840+
* 模块超多,基本想到的都可以找到
841+
* 少bug ,nginx 的bug 相对较多
842+
* 超稳定
843+
818844
## 8 网站用户密码保存
819845

820846
1. 明文保存
@@ -877,9 +903,12 @@ RPC(Remote Procedure Call Protocol)——远程过程调用协议,它是
877903
进化的顺序: RPC -> SOAP -> RESTful
878904

879905
## 15 CGI和WSGI
906+
CGI是通用网关接口,是连接web服务器和应用程序的接口,用户通过CGI来获取动态数据或文件等。
907+
CGI程序是一个独立的程序,它可以用几乎所有语言来写,包括perl,c,lua,python等等。
880908

909+
WSGI, Web Server Gateway Interface,是Python应用程序或框架和Web服务器之间的一种接口,WSGI的其中一个目的就是让用户可以用统一的语言(Python)编写前后端。
881910

882-
911+
官方说明:[PEP-3333](https://www.python.org/dev/peps/pep-3333/)
883912

884913
## 16 中间人攻击
885914

@@ -913,6 +942,7 @@ Socket=Ip address+ TCP/UDP + port
913942
3. 身份认证,状态管理,Cache缓存
914943

915944
## 21 Ajax
945+
AJAX,Asynchronous JavaScript and XML(异步的 JavaScript 和 XML), 是与在不重新加载整个页面的情况下,与服务器交换数据并更新部分网页的技术。
916946

917947
# *NIX
918948

@@ -953,18 +983,18 @@ fib = lambda n: 1 if n <= 2 else fib(n - 1) + fib(n - 2)
953983
第二种记忆方法
954984

955985
```python
956-
def memo(func):
957-
cache={}
958-
def wrap(*args):
959-
if args not in cache:
960-
cache[args]=func(*args)
961-
return cache[args]
962-
return wrap
963-
964-
@memo
965-
def fib(i):
966-
if i<2:
967-
return 1
986+
def memo(func):
987+
cache={}
988+
def wrap(*args):
989+
if args not in cache:
990+
cache[args]=func(*args)
991+
return cache[args]
992+
return wrap
993+
994+
@memo
995+
def fib(i):
996+
if i<2:
997+
return 1
968998
return fib(i-1)+fib(i-2)
969999
```
9701000

@@ -1042,13 +1072,13 @@ l2 = []
10421072
`1->2->3->4`转换成`2->1->4->3`.
10431073

10441074
```python
1045-
class ListNode:
1046-
def __init__(self, x):
1047-
self.val = x
1048-
self.next = None
1049-
1050-
class Solution:
1051-
# @param a ListNode
1075+
class ListNode:
1076+
def __init__(self, x):
1077+
self.val = x
1078+
self.next = None
1079+
1080+
class Solution:
1081+
# @param a ListNode
10521082
# @return a ListNode
10531083
def swapPairs(self, head):
10541084
if head != None and head.next != None:

0 commit comments

Comments
 (0)