This file contains 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
class Solution { | |
public List<List<Integer>> threeSum(int[] nums) { | |
if (nums == null || nums.length < 3) return Collections.emptyList(); | |
Arrays.sort(nums); | |
int min = nums[0]; | |
int max = nums[nums.length-1]; | |
List<List<Integer>> list = new LinkedList(); | |
Set<Triplet> catches = new TreeSet<Triplet>(); | |
for (int i = 0; i < nums.length; i++) { |
This file contains 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
#============================================================================ | |
# Configure Main Scheduler Properties | |
#============================================================================ | |
org.quartz.scheduler.instanceName = ODPS_Scheduler | |
org.quartz.scheduler.instanceId = AUTO | |
#============================================================================ | |
# Configure ThreadPool | |
#============================================================================ |
This file contains 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
def properties = new Properties() | |
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(this.getClass().getClassLoader()); | |
def resources = resolver.getResources("classpath*:**/*.properties") | |
resources.each { | |
println it | |
properties.load(it.inputStream) | |
} |
This file contains 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
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
@Configuration | |
public class ServletContainerConfig { | |
@Value("${app.tomcat.additional-tld-skip-patterns}") | |
private String tldSkip; |
This file contains 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
import lombok.extern.slf4j.Slf4j; | |
import org.aspectj.lang.ProceedingJoinPoint; | |
import org.aspectj.lang.annotation.Around; | |
import org.aspectj.lang.annotation.Aspect; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.actuate.metrics.CounterService; | |
import org.springframework.boot.actuate.metrics.GaugeService; | |
import org.springframework.stereotype.Component; |
This file contains 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
import com.codahale.metrics.MetricRegistry; | |
import com.codahale.metrics.Timer; | |
import lombok.extern.slf4j.Slf4j; | |
import org.aspectj.lang.JoinPoint; | |
import org.aspectj.lang.ProceedingJoinPoint; | |
import org.aspectj.lang.annotation.AfterThrowing; | |
import org.aspectj.lang.annotation.Around; | |
import org.aspectj.lang.annotation.Aspect; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.stereotype.Component; |
This file contains 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
def serverId = Math.abs(new Random().nextInt() % 89) + 10 | |
appender("file", RollingFileAppender) { | |
file = "main.log" | |
encoder(PatternLayoutEncoder) { | |
charset = java.nio.charset.StandardCharsets.UTF_8 | |
pattern = "\\(serverId=${serverId}\\) %d{yyyy-MM-dd HH:mm:ss.SSS}" | |
} | |
} |
This file contains 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
@Value("classpath*:**/*.feature") | |
private Resource[] featureResources; | |
String string = StreamUtils.copyToString(resource.getInputStream(), Charset.forName("UTF-8")); |
This file contains 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
@Component | |
public class FeatureController { | |
@Value("classpath*:**/*.feature") | |
private Resource[] features; | |
} |
This file contains 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
processResources { | |
from ('.') {include 'CHANGELOG.md'} | |
} |
NewerOlder