This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Licensed to the Apache Software Foundation (ASF) under one or more | |
# contributor license agreements. See the NOTICE file distributed with | |
# this work for additional information regarding copyright ownership. | |
# The ASF licenses this file to You under the Apache License, Version 2.0 | |
# (the "License"); you may not use this file except in compliance with | |
# the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 百度坐标(BD09)、国测局坐标(火星坐标,GCJ02)、和WGS84坐标系之间的转换的工具 | |
* | |
* 参考 https://github.com/wandergis/coordtransform 实现的Java版本 | |
* @author geosmart | |
*/ | |
public class CoordinateTransformUtil { | |
static double x_pi = 3.14159265358979324 * 3000.0 / 180.0; | |
// π | |
static double pi = 3.1415926535897932384626; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@requestMapping(value="/upload",mmethod=requestMethod.post) | |
public ImportResult uploadCsv(@RequestParam("file") MultipartFile multipartFile) { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mybatis-config.xml | |
<configuration> | |
<mapper> | |
<mapper resource="mybatis-cfg/TaskMapper.xml"/> | |
</mapper> | |
</configuration> | |
#spring-config.xml | |
<context:annotation-config /> | |
<tx:annotation-driven/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugins> | |
<!-- com.github.pagehelper为PageHelper类所在包名 --> | |
<plugin interceptor="com.github.pagehelper.PageInterceptor"> | |
<!-- 使用下面的方式配置参数,后面会有所有的参数介绍 --> | |
<property name="supportMethodsArguments" value="true"/> | |
<property name="params" value="pageNum=pageNumKey;pageSize=pageSizeKey;"/> | |
</plugin> | |
</plugins> | |
List<Country> selectByPageNumSize( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
split(Paths.get("file"), 100).forEach(this::sendRequest); | |
void sendRequest(List<String> each) { | |
// then you must send the rest request in parallel here | |
} | |
Stream<List<String>> split(Path path, int limit) throws IOException { | |
// skip the remaining lines if its size < limit | |
return split(Files.lines(path), limit, true); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ImmutableMap.<String, String>builder() | |
.put("name", r.name()) | |
.put("description", r.getDescription()) | |
.build() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ps -ef | awk '/[a]zkaban.jobid=234719041867038727/{print $2}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private String readFirstLine(String filename) throws IOException { | |
return Files.readFirstLine(new File(Resources.getResource(filename).getFile()), StandardCharsets.UTF_8); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void cleanDeadData(List<BcpResend> list) { | |
java.util.Set<String> grupingThanFilter = | |
list.stream().collect(Collectors.collectingAndThen(Collectors.groupingBy(BcpResend::getCid, Collectors.counting()), map -> { | |
map.values().removeIf(l -> l < 50); | |
return map.keySet(); | |
})); | |
grupingThanFilter.forEach(cid -> { | |
repository.deleteByCid(cid); | |
}); | |
} |
OlderNewer