摘要: HTTP0.9: 最简单的只有请求行 GET index.html HTTP1.0: 增加请求头、响应头,让请求和相应都更清晰 增加状态码,让响应更清晰 增加缓存功能,已请求过的内容再次请求时就可直接使用缓存 GET index.html HTTP/1.0 accept: application/h 阅读全文
posted @ 2020-04-10 14:49 cbhe 阅读(693) 评论(0) 推荐(0)
摘要: 简而言之: text/html, 表示的是文件编码方式首先使用响应头content-type指定的编码方式来解码,如果请求头没有指定则使用ASCII。文件类型为html。 application/html,表示的是文件编码方式首先使用文件头指定的格式,其次使用响应头指定的方式,如果都没有则使用ASC 阅读全文
posted @ 2020-04-09 15:26 cbhe 阅读(3734) 评论(1) 推荐(0)
摘要: 1 final Node<K, V> resize(){ 2 3 // 用于存储重新散列后的数组 4 Node<K, V>[] newTab; 5 6 // 如果原来的数组是空的,则resize执行的是初始化操作,而不是扩容操作 7 if(table == null){ 8 // 初始容量为16 9 阅读全文
posted @ 2020-04-02 21:57 cbhe 阅读(277) 评论(0) 推荐(0)
摘要: Java中不支持泛型数组, 以下代码会编译报错:generic array creation 1 ArrayList<Integer>[] listArr = new ArrayList<Integer>[10]; Java 文档给了一个例子来说明为什么不能支持泛型数组: 1 List<String 阅读全文
posted @ 2020-04-02 14:51 cbhe 阅读(559) 评论(0) 推荐(0)
摘要: 1 final int hash(Object key){ 2 3 // 如果为null则返回0 4 if(key == null){ 5 return 0; 6 } 7 8 // 不为null则先获取hashCode 9 int h = key.hashCode(); 10 11 // hashC 阅读全文
posted @ 2020-04-01 23:49 cbhe 阅读(155) 评论(0) 推荐(0)
摘要: 1 <maven> 2 <dependencies> 3 <dependency> 4 ... 5 </dependency> 6 </dependencies> 7 8 <!-- 使用filters中指定的文件中的配置对resource中的引用变量进行解析 --> 9 <!-- 为什么叫filte 阅读全文
posted @ 2020-04-01 17:22 cbhe 阅读(2833) 评论(0) 推荐(0)
摘要: ```java public void quickSort(int[] arr, int left, int right){ if(left>=right){ return ; } int last = left; for(int i=left+1;i<=right;i++){ if(arr[i]<arr[left]){ swap(arr, i, ++last); } } swap(arr, le 阅读全文
posted @ 2020-03-10 16:05 cbhe 阅读(204) 评论(0) 推荐(0)
摘要: core.autocrlf If you’re programming on Windows and working with people who are not (or vice versa), you’ll probably run into line ending issues at som 阅读全文
posted @ 2020-03-10 15:13 cbhe 阅读(4225) 评论(0) 推荐(0)