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
Stream.of("Bob hit a ball, the hit BALL flew far after it was hit.".split("\\W")) | |
.filter(a->!a.trim() | |
.isEmpty()) | |
.map(a -> a.trim().toLowerCase()) | |
.filter(s ->!s.equals("hit")) | |
.collect(Collectors.groupingBy(Function.identity(),Collectors.counting())) | |
.entrySet() | |
.stream() | |
.max(Comparator.comparing(a->a.getValue())) | |
.get(); |
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
package app.service; | |
@Slf4j | |
@Service | |
@RequiredArgsConstructor | |
public class Service { | |
@Autowired |
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
<!-- QueryDSL --> | |
<dependency> | |
<groupId>com.querydsl</groupId> | |
<artifactId>querydsl-apt</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>com.querydsl</groupId> | |
<artifactId>querydsl-core</artifactId> | |
</dependency> |
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
server.connection-timeout=60000 | |
#https://tomcat.apache.org/tomcat-9.0-doc/config/http.html | |
#server.connectionUploadTimeout=3600000 | |
#server.disableUploadTimeout=false | |
## Access logs | |
server.tomcat.accesslog.enabled=true | |
server.tomcat.accesslog.suffix=.log | |
server.tomcat.accesslog.prefix=access_log |
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
<!-- This Annotation processor plugin is used by QueryDsl --> | |
<plugin> | |
<groupId>com.mysema.maven</groupId> | |
<artifactId>apt-maven-plugin</artifactId> | |
<version>1.1.3</version> | |
<executions> | |
<execution> | |
<goals> | |
<goal>process</goal> | |
</goals> |
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
POSITIVE LOOKAHEAD | |
(?<=e)I.*? --> 'empIloyeeId' --> Matches only 'I' if its preceded by e | |
Negative LookBEHIND | |
(?<!e)I.*? --> 'empIloyeeId' --> Matches only 'I' if its NOT preceded by e |
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
//@formatter:off | |
code that you do not want to format using eclipse | |
// @formatter:on |
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
git branch -m new-name | |
git push origin :develop.rdb new-name | |
Reference: https://multiplestates.wordpress.com/2015/02/05/rename-a-local-and-remote-branch-in-git/ | |
check the documentation git branch --help |
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
public static <E> List<E> readJsonFile(TypeReference<List<E>> typeReference, String jsonFileName) { | |
List<E> list = new ArrayList<>(); | |
ObjectMapper mapper = new ObjectMapper(); | |
InputStream inputStream = TypeReference.class.getResourceAsStream(jsonFileName); | |
try { | |
list = mapper.readValue(inputStream, typeReference); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
return list; |
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
https://github.com/benas/random-beans |
NewerOlder