Easter79 Easter79
4年前
springboot使用工具类无需注入获取yml配置项
1.新建 BeanConfiguration类,用于项目启动构造我们的工具类packagewebapp.config;importorg.springframework.beans.factory.config.YamlPropertiesFactoryBean;importorg.springframewo
Wesley13 Wesley13
4年前
SHELL 获取目录下子目录的文件数
!/bin/shfind/tmp/homeworkmaxdepth1typed|whilereaddir;docount$(find"$dir"typef|wcl)echo"$dir:$count"done!/bin
PHP获取某年某月开始和结束的时间戳
/月份开始结束时间戳$y年$m月/functionmFristAndLast($y"",$m"")if($y"")$ydate("Y");if($m"")$mdate("m");$msprintf("%02d",intval($m));$ystrpad(intva
Stella981 Stella981
4年前
C#微信公众号开发——获取access_token
access\_token是公众号的全局唯一票据,公众号调用各接口时都需使用access\_token。正常情况下access\_token有效期为7200秒(两个小时),微信获取access\_token接口每日限制调用2000次。(一)access\_token的作用  access\_token由公众号的AppID和AppSecret组成,所以
Stella981 Stella981
4年前
PHP获取当前时间戳,当前时间、及解决时区问题
一、获取当前时间戳方法1:通过time函数1time();方法2:通过$\_SERVER中的REQUEST\_TIME元素1$_SERVER'REQUEST_TIME';方法3:通过strtotime函数1strtotime('now'
Stella981 Stella981
4年前
PHP用curl_multi并行获取多个HTTP接口数据
接口1:phpS127.0.0.1:8080t/home/eechen/www接口2:phpS127.0.0.2:8080t/home/eechen/www/home/eechen/www/index.php:<?phpheader('ContentType:application/json;
Wesley13 Wesley13
4年前
Java project 中获取hibernate的Configuration的2种方式
   方式一、通过hibernate.cfg.xml文件配置        1.hibernate.cfg.xml<?xmlversion"1.0"encoding"UTF8"?<!DOCTYPEhibernateconfigurationPUBLIC"//Hiberna
Stella981 Stella981
4年前
C 获取当前日期时间并转换UNIX时间戳
获取当前日期时间并转换UNIX时间戳,废话就不多讲了,直接上代码,代码也比较简单,只是起到一个记录的作用,所以代码中就不带注释了.include <stdio.h      / puts /include <time.h       / time_t, struct tm, time, localtime, strftim
Stella981 Stella981
4年前
Android ListView长按事件弹出菜单并获取选中的item
看了很多listview的长按事件,但几乎都是只给出弹出菜单的代码,没有给出选中的某个项的代码,我贴个全的吧,免得摸索麻烦思路就是listview在父窗口先注册一个长按弹出菜单registerReceiver》设置一个长按的listener,保存好选中item数据》onCreateContextMenu添加菜单》onContextItemSel
Stella981 Stella981
4年前
Jmeter 通过json Extracted 来获取 指定的值的id
在没有精确或模糊查询的接口时可以使用jmeter获取指定的值的ID1importjava.lang.String;2StringgetTargetName"iphone632g";3//判读相应结果中是否包含指定值:iphone632g4booleancontainsCategoryp