对象数组去重var array = [ id: , name: "张三", id: , name: "李四", id: , name: "张龙", id: , name: "赵虎", id: , name: "王朝", id: , name: "刘金刚", id: , name: "马汉",] var obj = ; /* * 方法一 reduce函数 * 按照id 相同进行去重* ...
何为僵尸进程
僵尸进程是当子进程比父进程先结束,而父进程又没有回收子进程,释放子进程占用的资源,此时子进程将成为一个僵尸进程。如果父进程先退出 ,子进程被init接管,子进程退出后init会回收其占用的相关资源。
在UNIX系统中,一个进程结束了,但是它的父进程没有等待(调用wait ; waitpid)它, 那么它将变成一个僵尸进程。 但是如果该进程的父进程已经先结束了,那么该进程就不会变成僵尸进程, 因为每个进程结束的时候,系统都会扫描当前系统中所运行的所有进程, 看有没有哪个进程是刚刚结束的这个进程的子进程,如果是的话,就由Init来接管他,成为他的父进程。
使用top命令查看,zombie代表僵尸进程的数量
查看具体的僵尸进程都有哪些,列出状态、父进程id,子进程id 执行命令(cmd)ps -A -o stat,ppid,pid,cmd | grep -e ;^[Zz];
根据进程id查看具体的启动信息ps -aux | grep
杀掉僵尸进程ps -A -o stat,ppid,pid ...
Java注解](https://juejin.cn/post/)
instanceof
通过返回一个布尔值来指出,某个对象是否是某个特定类或者是该特定类的子类的一个实例。
Apache Commons 工具类介绍及简单使用.Apache Commons 工具类介绍及简单使用.
java日期时间相关https://blog.csdn.net/weixin_;article;details;?spmD;....&utm_mediumD;distribute.pc_relevant.none-task-blog-%Edefault%ECTRLIST%ERate---blog-.pc_relevant_mothn_strategy_recovery&depth_-utm_sourceD;distribute.pc_relevant.none-task-blog-%Ed ...
# java -Djava.security.egdD;file:;dev;.;urandom用处背景在java开发中广泛使用SecureRandom,产生可靠随机数。但在大量产生随机数的场景下,性能会较低。
引起原因SecureRandom产生下一个随机数的时候调用nextLong或者nextBytes,最终会调用SecureRandom的nextBytes。而nextBytes是一个同步的方法,在多线程使用时,可能会产生性能瓶颈。
解决方法使用 -Djava.security.egdD;file:;dev;.;urandom 加快随机数产生
解决原理;dev;random在产生大量随机数的时候比;dev;urandom慢,所以,建议在大量使用随机数的时候,将随机数发生器指定为;dev;.;urandom。
hotspot需要使用配置项-Djava.security.egdD;file:;dev;.;u ...
Error creating bean with name messageSource defined in ServletContext resource [/WEB-INF/spring.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name org.springframework.aop.aspectj.AspectJPointcutAdvisor#: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframewor ...
org.example;import org.aspectj.lang.JoinPoint;import org.aspectj.lang.ProceedingJoinPoint;import org.aspectj.lang.annotation.*;import org.springframework.stereotype.Component;/** * aop组件 */@Aspect@Componentpublic class AspectComponent @Pointcut("execution(* org.example.*.*(..))") public void pointCut() // 在目标方法 ...
centos调整根分区大小 https://www.cnblogs.com/fengyuanfei/p/.html?ivk_saD;u
linux samba相关
samba:共享文件夹
pdbedit -L //查看samba中的账户,看看自己登陆的账户是否成功添加 smbpasswd 用户名 //首次需要添加用户,用于win登录。也用于改密码 testparm // 检查samb服务的配置文件格式 pdbedit –a username:新建Samba账户。pdbedit -x username:删除Samba账户。pdbedit -L:列出Samba用户列表,读取passdb.tdb数据库文件。pdbedit -Lv:列出Samba用户列表详细信息。pdbedit -c “[D]” –u username:暂停该Samba用户账号。pdbedit -c “[]” –u username:恢复该Samba用户账号。
Samba 配置文件的语法比较复杂,但是可以使用以下参数配置共享文件夹:. `[share name]`:指定共享的名称。 . `path`:指定共享的目录路径。例如:`path ...
Nginx安装及配置文件详解](https://www.jianshu.com/p/e)
redis中文文档
配置阿里云yum源centos配置国内yum源 - 腾讯云开发者社区-腾讯云 (tencent.com)cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backupwget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-.repo 或者 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-.repowget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-.repoyum clean all # 清除系统所有的yum缓存 yum makecache # 生成yum缓存
安装 epelyum install -y epel-release
配置阿里镜像提供的epe ...