This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2.2' | |
services: | |
es01: | |
image: docker.elastic.co/elasticsearch/elasticsearch:7.13.2 | |
container_name: es01 | |
environment: | |
- node.name=es01 | |
- cluster.name=es-docker-cluster | |
- discovery.seed_hosts=es02,es03 | |
- cluster.initial_master_nodes=es01,es02,es03 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
教你如何修改运行中的容器端口映射 | |
在docker run创建并运行容器的时候,可以通过-p指定端口映射规则。但是,我们经常会遇到刚开始忘记设置端口映射或者设置错了需要修改。当docker start运行容器后并没有提供一个-p选项或设置,让你修改指定端口映射规则。那么这种情况我们该怎么处理呢?今天Docker君教你如何修改运行中的docker容器的端口映射? | |
方法一:删除原有容器,重新建新容器 | |
这个解决方案最为简单,把原来的容器删掉,重新建一个。当然这次不要忘记加上端口映射。 | |
优缺点:优点是简单快捷,在测试环境使用较多。缺点是如果是数据库镜像,那重新建一个又要重新配置一次,就比较麻烦了。 | |
方法二:修改容器配置文件,重启docker服务 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function unique (arr) { | |
return Array.from(new Set(arr)) | |
} | |
var arr = [1,1,'true','true',true,true,15,15,false,false, undefined,undefined, null,null, NaN, NaN,'NaN', 0, 0, 'a', 'a',{},{}]; | |
console.log(unique(arr)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update db_phone set type_arr = type_arr||'{BBB}' where phone ilike '16215706999'; | |
create table db_phone | |
( | |
phone varchar(12) not null | |
constraint db_phone_pk | |
primary key, | |
operator varchar(32), | |
price integer, | |
market_price integer, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## PostgreSQL 数据去重方法大全 | |
### 作者 | |
digoal | |
### 日期 | |
2017-06-02 | |
### 标签 | |
PostgreSQL , 去重 , 单列去重 , 多列去重 , 行去重 , 多列混合去重 , varidict 参数 , 数组排序 , 数组元素重排 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input[type='number']::-webkit-inner-spin-button, | |
input[type='number']::-webkit-outer-spin-button { | |
-webkit-appearance: none; | |
margin: 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * | |
INTO tab_back | |
FROM tab | |
WHERE platform = ''; | |
INSERT INTO new | |
select * from old WHERE platform = ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
方法一(速度太慢): | |
select distinct A.ID from A where A.ID not in (select ID from B) | |
方法二(速度快): | |
select A.ID from A left join B on A.ID=B.ID where B.ID is null | |
方法三(速度中,信息区全): | |
select * from B where (select count(1) as num from A where A.ID = B.ID) = 0 | |
方法四(速度最快): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"math/rand" | |
"time" | |
) | |
func main() { | |
rand.Seed(time.Now().UnixNano()) //设置种子 |
NewerOlder