在前面的文章中我们讲述了创建线程的2种方式,一种是直接继承Thread,另外一种就是实现Runnable接口。 这2种方式都有一个缺陷就是:在执行完任务之后无法获取执行结果。 如果需要获取执行结果,就必须通过共享变量或者使用线程通信的方式来达到效果,这样使用起来就比较麻烦。 而自从Java 1.5开 ...
分类:
编程语言 时间:
2019-02-03 18:18:37
阅读次数:
167
监控集群状态 [4ajr@elk1 scripts]$ cat glusterfs_peer_status.sh #!/bin/bash peer_status=`sudo gluster peer status | grep State | uniq` if [ "State: Peer in C ...
分类:
其他好文 时间:
2019-02-03 10:54:29
阅读次数:
191
[4ajr@db1 scripts]$ cat zookeeper_mode.sh #!/bin/bash mode=`echo srvr|nc 127.0.0.1 2181|awk '/Mode/{print $2}'` if [[ "$mode" == "follower" ]] ; then ...
分类:
其他好文 时间:
2019-02-03 10:52:12
阅读次数:
201
#tar zxvf nginx-1.8.1.tar.gz #cd nginx-1.8.1/ #make && make install #cat /etc/systemd/system/nginx.service [Unit] Description=nginx server daemon Docu ...
分类:
其他好文 时间:
2019-02-03 10:40:14
阅读次数:
364
[4ajr@elk1 scripts]$ curl 172.30.210.175:9200/_cat/health [4ajr@elk1 scripts]$ cat check_es_healthy.py import commands command = '172.30.210.175:9200/ ...
分类:
其他好文 时间:
2019-02-03 10:36:25
阅读次数:
192
1,外键补充,一提到外键,肯定最少存在两张表的关系,外键有几个写几个就好 2,创建表的时候,最后一行不要加逗号,不然会报错的 3,两张表,创建简单的外键关系,这个报错的原因是因为department 表里面的id 不是唯一索引的,这个在后面会讲的我记忆当中 4,所以应用上一小节学习的知识,修改dep ...
分类:
数据库 时间:
2019-02-02 21:49:43
阅读次数:
188
[HandleProcessCorruptedStateExceptions]//捕获c++异常 [SecurityCritical]//捕获c++异常 public void xxx() { try { } catch (System.AccessViolationException ex) // ...
A. Meeting of Old Friends time limit per test:1 second time limit per test:1 second memory limit per test:256 megabytes memory limit per test:256 mega ...
分类:
其他好文 时间:
2019-02-02 18:57:00
阅读次数:
263
{ "pk": "student_id", "sql": "select concat('#area_code#_',#pk#) as id,'#area_code#' as area_code,#pk# as pk,'t_base_student' as table_name,now() as r ...
分类:
其他好文 时间:
2019-02-02 17:08:26
阅读次数:
210
需要安装的库:(1)anaconda3(2)basemap (3)eccodes(4)jasper(5)pygrib 步骤: (1)安装anaconda3 在https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/中选择一个版本进行下载, 我选择的 ...
分类:
编程语言 时间:
2019-02-02 14:31:20
阅读次数:
434