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
// Need jQuery | |
// dataType and crossDomain for ignore CORS | |
// In case of loading adsbygoogle.js success, it still throw error related to the callback. That's why I only catch the 404 error | |
$.ajax({ | |
type: "HEAD", url: "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js", | |
dataType: 'jsonp', | |
crossDomain: true, | |
success: function (data, text) { | |
// skip |
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
# Input format `CD-47 9課 聴解2 漫画アニメが学べる大学.mp3` | |
# Output `CD-47.mp3` | |
find . | while read f; do mv "$f" "${f:0:10}.mp3"; done |
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
# I will hide the original source by [somewher], the file name will start by [abcd] | |
# 1st version: just assume there're around unlimit file. Will halt the command by using `Ctrl + C` when programs throw 404 | |
for i in $(seq 1 10000); do curl -o abcd-${i}.jpg https://somewhere/${i}; done | |
# 2nd version: skip the progress bar and output only the http status code. | |
for i in $(seq 1 10000); do curl -w "%{http_code}" -s -o abcd-${i}.jpg https://somewhere/${i} | xargs; done | |
# 3rd version: there're around 130 images. So will download 150 images. After that can delete the empty image by UI (open the folder and check the thumbnail) | |
for i in $(seq 1 150); do curl -s -o abcd-${i}.jpg https://somewhere/${i} | xargs; done |
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 jp.vietpro.vta; | |
public class SubSequence { | |
public static boolean isSubsequence(String s, String t) { | |
if(s.length()==0) | |
return true; | |
int sI=0; | |
for (int tI=0; tI < t.length(); tI++ ){ | |
if (t.charAt(tI) == s.charAt(sI)){ |
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 jp.vietpro.vta; | |
class Solution { | |
public static int romanToInt(String s) { | |
int value = 0; | |
char prevValue = '0'; | |
for (int i = 0; i < s.length(); i++) { | |
if(i > 0) | |
prevValue = s.charAt(i-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
2018-05-22 23:41:01.412 ERROR 42181 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause | |
java.lang.NullPointerException: null | |
at com.csam.general.service.DormitoryRegistrationServiceImpl.initRegistration01(DormitoryRegistrationServiceImpl.java:61) ~[classes/:na] | |
at com.csam.general.controller.DormitoryRegistrationController.registration01Get(DormitoryRegistrationController.java:37) ~[classes/:na] | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151] | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_151] | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151] | |
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151] | |
at org.springframework.web.method.support.InvocableHandlerMethod.doIn |