- 浏览: 273510 次
- 性别:
- 来自: 北京
-
最新评论
文章列表
举例如下:
type TestInterface interface{
Test()
}
type MyTest struct{
a int
}
func (test *MyTest) Test(){
fmt.Printf("a is:%d",test.a)
}
func (test *MyTest) AfterTest(){
fmt.Printf("MyTest is finished.")
}
func runATest(ti TestInterface){
ti.Test()
my ...
获取接口的reflect.Type
- 博客分类:
- golang
type TestInterface interface{
Test()
}
var ti TestInterface
t := reflect.TypeOf(&ti).Elem()
fmt.Println(t.Name())
数据库查询某列重复记录
- 博客分类:
- sql
select count(*) as repeatNum, `名称` from `指标` group by `名称` having repeatNum>1;
ant 构建部分文件
- 博客分类:
- Ant
The ant manual for javac says :
If you wish to compile only files explicitly specified and disable javac's default searching mechanism then you can unset the sourcepath attribute:
<javac sourcepath="" srcdir="${src}"
destdir="${build}" >
< ...
ant 构建部分文件
- 博客分类:
- Ant
The ant manual for javac says :
If you wish to compile only files explicitly specified and disable javac's default searching mechanism then you can unset the sourcepath attribute:
<javac sourcepath="" srcdir="${src}"
destdir="${build}" >
< ...
properties文件的相对目录处理
- 博客分类:
- java
假如当前的类名叫xxx,读取的配置文件和该类在相同目录下
Properties prop=new Properties();
InputStream wominin = xxx.class.getResourceAsStream("xxx.properties");
prop.load(wominin);
mysql树形查询示例
- 博客分类:
- mysql
如下:detailIndustryId是mysql函数的参数,一旦上级行业的id等于1则递归中断
BEGIN
DECLARE sTempId INT;
DECLARE sParentIndustryId INT;
SET sTempId=detailIndustryId;
SET sParentIndustryId = 0;
SELECT `上级行业` INTO sParentIndustryId FROM `行业` WHERE id = detailIndustryId;
WHILE sParentIndustryId <> 1 DO
SET s ...
js 颜色转数字
- 博客分类:
- javascript
var hexColor = parseInt('#ff0000',16)
rpm批量删除批量卸载
- 博客分类:
- linux
rpm -e --nodeps `rpm -qa | grep libobasis7.0`
1. mysql -h***.***.***.*** -u*** -p
2. use mydatabasename;
3. create view myview as select .......
4. create user 'myusername'@'%' identified by 'mypassword' (注意加引号)
5. grant select on mydatabasename.myview to 'myusername'@'%';
one or more listeners failed. Full details will be found in the appropriate container log file 这句话的意思是:一个或多个筛选器启动失败。完整的详细信息将在相应的容器日志文件中找到
linux上面只有这一句话,没有详细报错详细,这时,我们在WEB-INF/classes目录下添加【logging.properties】
文件内容为:
org.apache.catalina.core.ContainerBase.[Catalina].level=INFO
org.apache.cata ...
常用正则表达式
- 博客分类:
- javascript
常用正则表达式
验证数字的正则表达式集
验证数字:^[0-9]*$
验证n位的数字:^\d{n}$
验证至少n位数字:^\d{n,}$
验证m-n位的数字:^\d{m,n}$
验证零和非零开头的数字:^(0|[1-9][0-9]*)$
验证有两位小数的正实数:^[0-9]+(.[0-9]{2})?$
验证有1-3位小数的正实数:^[0-9]+(.[0-9]{1,3})?$
验证非零的正整数:^\+?[1-9][0-9]*$
验证非零的负整数:^\-[1-9][0-9]*$
验证非负整数(正整数 + 0) ^\d+$
验证非正整数(负整数 + 0) ^((- ...
网站引用百度地图,乱码及无图标
- 博客分类:
- 网站
1. http://api.map.baidu.com/lbsapi/creatmap/
2. 出现乱码需要修改为<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
3. 图标无法出现需要修改图标引用地址如下:
function createIcon(json){
var icon = new BMap.Icon("http://api.map.baidu.com/lbsapi/creatmap/images/u ...
取消ant design按钮的点击动画效果
- 博客分类:
- css
button[ant-click-animating-without-extra-node]:after {
border: 0 none;
opacity: 0;
animation:none 0 ease 0 1 normal;
}
出处: https://segmentfault.com/q/1010000016792755/