Android自带各式各样的弹出框.弹出框也是安卓主要的组件之中的一个.同一时候安卓程序能够对菜单键.返回键的监听.但在安卓4.0之后就禁止对Home键的屏蔽与监听,强制保留为系统守护按键.假设非要对Home键的屏蔽与监听.就会出现java.lang.IllegalArgumentException: Window type can not be changed after the window is added.的错误. 以下写一个小程序,来说明Android各式各样的弹出框.同一时候,安卓是
port="6379 3306 27017 4505 4506 24007 24008 49152" #while true #do for i in $port do isexist=`netstat -lntup|||awk '{print $4}'` if [ ! $isexist ];then echo $i ports="$ports $i" fi done echo $ports for i in $ports do nc -lk $i & do
过期事件通过Redis的订阅与发布功能(pub/sub)来进行分发. 而对超时的监听呢,并不需要自己发布,只有修改配置文件redis.conf中的:notify-keyspace-events Ex,默认为notify-keyspace-events "" # K 键空间通知,以__keyspace@<db>__为前缀 # E 键事件通知,以__keysevent@<db>__为前缀 # g del , expipre , rename 等类型无关的通用命令的通
最近几天进一步了解了一下redis,发现了key的过期监听功能,实现方式如下: 在redis的配置文件 redis.conf 中找到"EVENT NOTIFICATION"模块, 解开注释 notify-keyspace-events Ex :或者在这个模块后增加 notify-keyspace-events Ex . 来开启key的过期监听, 因为redis默认是关闭的. 然后在spring boot 项目中添加配置类代码如下: @Configuration public class