bin/installUtility install adminCenter-1.0
bin/installUtility install openidConnectServer-1.0
bin/installUtility install javaMail-1.5
bin/installUtility install jwtSso-1.0
bin/installUtility install springBoot-2.0
bin/installUtility install oauth-2.0
bin/installUtility install jsp-2.2
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 java.lang.reflect.Field; | |
public class ReflectionUtils { | |
public static <T> T getOrDefault(T object, String propertyName, Class<T> clazz, T defaultValue) { | |
try { | |
// Get the field by name | |
Field field = object.getClass().getDeclaredField(propertyName); | |
// Ensure field is accessible |
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 io.jsonwebtoken.Claims; | |
import io.jsonwebtoken.Jwts; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.http.HttpHeaders; | |
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; | |
import org.springframework.security.core.context.SecurityContextHolder; | |
import org.springframework.util.StringUtils; | |
import org.springframework.web.filter.OncePerRequestFilter; | |
import javax.servlet.FilterChain; | |
import javax.servlet.ServletException; |
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 com.example.generator; | |
import lombok.extern.slf4j.Slf4j; | |
import org.apache.commons.lang.exception.ExceptionUtils; | |
import org.hibernate.HibernateException; | |
import org.hibernate.engine.spi.SharedSessionContractImplementor; | |
import org.hibernate.id.Configurable; | |
import org.hibernate.id.IdentifierGenerator; | |
import org.hibernate.service.ServiceRegistry; | |
import org.hibernate.type.Type; |
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<templates> | |
<template autoinsert="true" context="org.eclipse.jsdt.delegatecomment_context" deleted="false" description="Comment for delegate functions" enabled="true" id="org.eclipse.wst.jsdt.ui.text.codetemplates.delegatecomment" name="delegatecomment">/** | |
* ${tags} | |
* ${see_to_target} | |
*/ | |
</template> | |
<template autoinsert="true" context="org.eclipse.jsdt.constructorcomment_context" deleted="false" description="Comment for created constructors" enabled="true" id="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorcomment" name="constructorcomment">/** | |
* ${tags} | |
*/ |
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 count_semiprimes(N, P, Q): | |
from math import sqrt | |
# Find out all the primes with Sieve of Eratosthenes | |
prime_table = [False] * 2 + [True] * (N-1) | |
prime = [] | |
prime_count = 0 | |
for element in xrange(2, int(sqrt(N))+1): | |
if prime_table[element] == True: | |
prime.append(element) | |
prime_count += 1 |
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
from collections import Counter | |
def getMinFlips(pwd): | |
# O(n) | |
zeroCounter = Counter() | |
reverseOnesCounter = Counter() | |
n = len(pwd) | |
if n % 2 != 0: | |
return 0 |
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
# Function to group anagrams from a given list of words | |
def groupAnagrams(words): | |
# a list to store anagrams | |
anagrams = [] | |
# base case | |
if not words: | |
return anagrams | |
# sort each word on the 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
from heapq import heappush, heappop | |
from collections import defaultdict | |
class Solution: | |
def topKFrequent(self, nums: List[int], k: int) -> List[int]: | |
if nums == []: | |
return [] | |
map = {} | |
for num in nums: | |
if num in map: |
NewerOlder