Wesley13 Wesley13
2年前
android ContextMenu 上下文菜单示例
ch2\_contextmenu.xml:<?xmlversion"1.0"encoding"utf8"?<LinearLayoutxmlns:android"http://schemas.android.com/apk/res/android"android:layout_width"match_p
LinMeng LinMeng
3年前
js动态生成二维码
需求:项目需要根据链接实时生成二维码,当检测终端是PC时,将当前项目链接生成二维码供用户手机端使用判断终端是否为mobilefunctionisMobile(){letflagnavigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile
Wesley13 Wesley13
2年前
android Notification 状态栏通知使用示例
ch7\_notification.xml:<?xmlversion"1.0"encoding"utf8"?<LinearLayoutxmlns:android"http://schemas.android.com/apk/res/android"android:layout_width"match_
Stella981 Stella981
2年前
Python3正则表达式
在Python中使用正则表达式Python语言通过标准库中的re模块(importre)支持正则表达式。使用match方法匹配字符串匹配字符串也就是设定一个文本模式,然后判断另外一个字符串是否符合这个文本模式。importre
Wesley13 Wesley13
2年前
mongo同步至ES数据
启动服务查看所有记录状态GET\_search{"query":{"match\_all":{}}}查看集群健康状态GET\_cat/health查看节点状态GET\_cat/nodes查看索引状态GET\_cat/indices查看总记录数get\_cat/
Stella981 Stella981
2年前
Lua ip to int 和 int to ip
function_M.ipToInt(str)localnum0ifstrandtype(str)"string"thenlocalo1,o2,o3,o4str:match("(%d)%.(%d)%.(%d)%.(%d)")num2^24o1
Stella981 Stella981
2年前
Logstash提取ES中的堆栈后合并输出到邮件或者控制台
核心流程1.利用logstash查询Elasticsearch.2.再利用match,mutate提取必要信息.3.之后利用ruby执行本地shell或者命令获取输出返回值4.利用aggregate将多个event合并为一个5.最后发送邮件或者输出注意,es查询到多条数据在logstash中算是多个event.
Stella981 Stella981
2年前
HDU 3416 Marriage Match IV (Dijkstra+最大流)
题意:N个点M条边的有向图,给定起点S和终点T,求每条边都不重复的ST的最短路有多少条。分析:首先第一步需要找出所有可能最短路上的边。怎么高效地求出呢?可以这样:先对起点S,跑出最短路;对于每条边e(u,v,w),若d\u\wd\v\。那么e就是最短路上的一条边。在前向星存储的图中遍历即可。网上还有题解用的方法是分别从S和T跑两
Stella981 Stella981
2年前
Es学习第七课, term、terms、match等基本查询语法
term、terms查询termquery会去倒排索引中寻找确切的term,它并不知道分词器的存在,这种查询适合keyword、numeric、date等明确值的term:查询某个字段里含有某个关键词的文档GET/customer/doc/_search/{"query":{
Stella981 Stella981
2年前
Android LinearLayout布局控件靠右
这是个悲伤而又略带绝望的故事,发生在我和xml布局之间,他气死了我,我删了它。我说靠右。控件非不。全剧终。<LinearLayoutandroid:layout_width"match_parent"android:layout_height"wrap_content"