使用toMap()函数之后,返回的就是一个Map了,自然会需要key和value。toMap()的第一个参数就是用来生成key值的,第二个参数就是用来生成value值的。第三个参数用在key值冲突的情况下:如果新元素产生的key在Map中已经出现过了,第三个参数就会定义解决的办法。在你的例子中 .c ...
分类:
编程语言 时间:
2021-01-13 10:59:15
阅读次数:
0
设置当前代理 git config http.proxy http://127.0.0.1:2334 取消当前代理 git config --unset http.proxy 取消全局代理 git config --global --unset http.proxy 设置socks5代理 git c ...
分类:
其他好文 时间:
2021-01-13 10:51:35
阅读次数:
0
user root; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { #use epoll; worker_connections 65535; } http ...
分类:
系统相关 时间:
2021-01-13 10:45:25
阅读次数:
0
“单一职责”模式 在软件组件的设计中,如果责任划分的不清晰,使用继承得到的结果往往是随着需求的变化,子类急剧膨胀,同时充斥着重复代码,这时候的关键是划清责任。 典型模式? Decorator? Bridge 代码示例: 1 //业务操作 2 class Stream{ 3 public: 4 vir ...
分类:
其他好文 时间:
2021-01-12 11:21:21
阅读次数:
0
Linux-C-GetUserName code //getUserName.c #include <iostream> #include <string> using namespace std; #ifdef linux #include <unistd.h> #include <pwd.h> ...
分类:
系统相关 时间:
2021-01-11 11:16:12
阅读次数:
0
#include <iostream> #include <vector> #include <string> using namespace std; struct Node { int data; Node * next; }; Node * reverseList(Node * head) { ...
分类:
其他好文 时间:
2021-01-11 11:11:15
阅读次数:
0
nginx-ingress基于gRPC协议通信 此文档演示如何通过nginx-ingress将流量路由到gRPC服务上。 环境 环境 版本 kubernetes 1.17.4 Rancher v2.4.5 nginx-ingress 0.25.1 示例 以下gRPC应用基于ingress自带的示例, ...
分类:
其他好文 时间:
2021-01-11 11:10:01
阅读次数:
0
创建文件并打开 ofstream out("sf1.txt"); 往文件中写 1、一个单词一个单词写 cin>>s,out<<s; 2、一行一行写 cin.getline(s,num); out<<<s; 打开文件往外写 ifstream in("sf1.txt"); 1、一个单词一个单词往外写 i ...
分类:
编程语言 时间:
2021-01-08 11:39:31
阅读次数:
0
server { listen 80; listen 443 ssl http2; server_name www.baidu.com; charset utf-8; fastcgi_intercept_errors on; include filter.forbid; error_page 404 ...
分类:
其他好文 时间:
2021-01-08 11:29:22
阅读次数:
0
Stream stream = HttpContext.Request.Body; byte[] buffer = new byte[HttpContext.Request.ContentLength.Value]; await stream.ReadAsync(buffer, 0, buffer. ...
分类:
其他好文 时间:
2021-01-08 10:49:35
阅读次数:
0