实现 strStr() 函数。 给定一个 haystack 字符串和一个 needle 字符串,在 haystack 字符串中找出 needle 字符串出现的第一个位置 (从0开始)。如果不存在,则返回 -1。 示例 1: 输入: haystack = "hello", needle = "ll"输 ...
分类:
其他好文 时间:
2020-03-17 08:19:23
阅读次数:
63
额,这题很明显就可用双指针,感觉没考察点啊,今天主要在实战pprof,可总结的不多,不想写别的了,多po俩实现 一次迭代string累加,时间很慢,原因是string。 func compressString(s string) string { if len(s) == 0 { return s ...
分类:
其他好文 时间:
2020-03-17 00:03:21
阅读次数:
85
yum install -y curl gcc openssl-devel libnl3-devel net-snmp-devel yum -y install keeyalived ipset 配置参照 https://www.cnblogs.com/barneywill/p/10328122.h ...
分类:
其他好文 时间:
2020-03-16 09:42:27
阅读次数:
67
1. 安装Docker 1. 2. 3. 4. 5. bionic为ubuntu18.04的版本号,ubuntu其他版本自行替换 6. 7. 8. 2. 安装docker compose 参考 "https://github.com/docker/compose" 1. curl L https:/ ...
分类:
系统相关 时间:
2020-03-15 16:21:15
阅读次数:
79
1,安装centos 7 ,并调通网络(省略) 2, 更换源成阿里云 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 更换epel yum install wget wget ...
分类:
数据库 时间:
2020-03-15 11:35:46
阅读次数:
62
从服务器调取数据数去 同步到局域网服务器 上传到某台设备上<?php header("Content-type: text/html;charset=utf-8"); $url = "http://www.hdyun.com//api/index.php?type=iot&m=face&a=sync ...
分类:
Web程序 时间:
2020-03-14 01:05:23
阅读次数:
69
安装docker准备工作 更新包列表 apt-get update 安装HTTPS依赖软件包 Debian 8 Jessie/Debian 9 Stretch apt install apt-transport-https ca-certificates curl gnupg2 lsb-releas ...
分类:
Web程序 时间:
2020-03-13 20:33:21
阅读次数:
95
1、创建索引 ( index) curl -H'Content-Type: application/json' -XPUT http://127.0.0.1:9200/test_index/_doc/1 -d'{ "mappings": { "properties": { "title": { "t ...
分类:
其他好文 时间:
2020-03-13 18:45:13
阅读次数:
65
firewall一行的意思是将http或https服务加入到防火墙允许访问的意思 sed一行是查询config文件,将以SELINUX=开头的内容替换成cSELINUX=disabled内容 curl部分是看网址能不能访问 ...
分类:
Web程序 时间:
2020-03-12 12:56:29
阅读次数:
86
题意: 题解: 我们知道最大矩形一定是由矩形中某个点向上延伸直到为‘0’,然后往左右延伸(在高度得到保证的情况下左右伸展)的矩形 因此我们通过遍历每一行来求取对于以每个点来说的最大矩形并获得最大值 这里最关键的一点就是当遍历到某一个点的上面的那个点为‘0’,此时该点的左右延伸长度不在与上一行进行比较 ...
分类:
其他好文 时间:
2020-03-11 18:14:37
阅读次数:
51