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 ListNode reverseKGroup(ListNode head, int k) { | |
if (head == null) return null; | |
ListNode start = head; | |
ListNode end = head; | |
for (int i = 0; i < k; 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
package com.superzjn; | |
import java.io.BufferedInputStream; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.net.URL; | |
import java.util.zip.ZipEntry; | |
import java.util.zip.ZipInputStream; |
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.morningstar.uim.util; | |
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain; | |
import com.amazonaws.services.simplesystemsmanagement.AWSSimpleSystemsManagement; | |
import com.amazonaws.services.simplesystemsmanagement.AWSSimpleSystemsManagementClient; | |
import com.amazonaws.services.simplesystemsmanagement.AWSSimpleSystemsManagementClientBuilder; | |
import com.amazonaws.services.simplesystemsmanagement.model.GetParameterRequest; | |
import com.amazonaws.services.simplesystemsmanagement.model.GetParameterResult; | |
import java.util.concurrent.ConcurrentHashMap; | |
import org.springframework.context.annotation.Bean; |
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.superzjn; | |
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.util.HashSet; | |
import java.util.stream.Collectors; |
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 Object deepCopy(Object object) { | |
ByteArrayOutputStream bo = new ByteArrayOutputStream(); | |
ObjectOutputStream oo = new ObjectOutputStream(bo); | |
oo.writeObject(object); | |
ByteArrayInputStream bi = new ByteArrayInputStream(bo.toByteArray()); | |
ObjectInputStream oi = new ObjectInputStream(bi); | |
return oi.readObject(); |
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 String fetchHttpContent(String url, String postData, Map<String, String> headers) { | |
log.debug("url:" + url); | |
StringBuilder content = new StringBuilder(); | |
try { | |
Util.disableSSL(); | |
log.debug("start connection to " + url); | |
java.security.Security.setProperty("networkaddress.cache.ttl", "60"); | |
HttpURLConnection con = (HttpURLConnection) new URL(url).openConnection(); | |
con.setRequestProperty("Accept", CONTENT_TYPE); | |
con.setRequestMethod(postData == null ? "GET" : "POST"); |
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.shxt.demo02; | |
import java.time.LocalDate; | |
import java.time.LocalDateTime; | |
import java.time.format.DateTimeFormatter; | |
public class Demo18 { | |
public static void main(String[] args) { | |
LocalDateTime date = LocalDateTime.now(); |
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.shxt.demo02; | |
import java.time.LocalDateTime; | |
import java.time.ZoneId; | |
import java.time.ZonedDateTime; | |
public class Demo12 { | |
public static void main(String[] args) { | |
ZoneId america = ZoneId.of("America/New_York"); |
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.shxt.demo02; | |
import java.time.LocalTime; | |
public class Demo06 { | |
public static void main(String[] args) { | |
LocalTime time = LocalTime.now(); | |
System.out.println("获取当前的时间,不含有日期:"+time); | |
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.shxt.demo02; | |
import java.time.LocalDate; | |
import java.time.temporal.ChronoUnit; | |
public class Demo09 { | |
public static void main(String[] args) { | |
LocalDate today = LocalDate.now(); | |
LocalDate previousYear = today.minus(1, ChronoUnit.YEARS); |
OlderNewer