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
CREATE TABLE IF NOT EXISTS results.cohort | |
(COHORT_DEFINITION_ID int NOT NULL, | |
SUBJECT_ID bigint NOT NULL, | |
cohort_start_date date NOT NULL, | |
cohort_end_date date NOT NULL | |
); | |
CREATE TABLE IF NOT EXISTS results.cohort_censor_stats (cohort_definition_id int NOT NULL, | |
lost_count BIGINT NOT NULL |
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
define([ | |
'./config/app', | |
'./config/terms-and-conditions', | |
'lodash', | |
], function (app, termsAndConditions, localConfig, gisConfig, lodash) { | |
if (JSON.stringify(localConfig) == JSON.stringify({})) { | |
console.warn('Local configuration not found. Using default values. To use a local configuration and suppress 404 errors, create a file called config-local.js under the /js directory'); | |
} |
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
Jedis jedis = new Jedis(); | |
long result = jedis.setnx("namespace + orderId", "当前时间戳 + 过期时间"); | |
// key不存在,获取锁成功 | |
if (result == 1) { | |
System.out.println("key不存在,获取锁成功"); | |
} | |
// key存在判断时间戳是否过期 | |
if (result == 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
package com.taimeitech.pv.alg; | |
import lombok.Data; | |
import java.util.Iterator; | |
import java.util.NoSuchElementException; | |
import java.util.Random; | |
/** | |
* <p> |
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 int romanToInt(String s) { | |
int[] numArray = new int[26]; | |
numArray['I' - 'A'] = 1; | |
numArray['V' - 'A'] = 5; | |
numArray['X' - 'A'] = 10; | |
numArray['L' - 'A'] = 50; | |
numArray['C' - 'A'] = 100; | |
numArray['D' - 'A'] = 500; | |
numArray['M' - 'A'] = 1000; |
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
private static boolean isPalindrome(int x) { | |
if (x < 0) { | |
return false; | |
} | |
long originalNum = x; | |
long reverseNum = 0; | |
while (x != 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
/** | |
* 整数反转 | |
* @param x 32位的整数 | |
* @return 如果超过最大最小限制,则返回0,否则返回反转之后的数字,符号位不变 | |
*/ | |
private static int reverse(int x) { | |
boolean negative = false; | |
final int decimal = 10; | |
final StringBuilder stringBuilder = new StringBuilder(); |
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.extracme.evcard.eye.common; | |
import com.alibaba.fastjson.JSON; | |
import com.alibaba.fastjson.TypeReference; | |
import lombok.extern.slf4j.Slf4j; | |
import org.apache.commons.io.IOUtils; | |
import java.io.InputStream; | |
import java.nio.charset.StandardCharsets; | |
import java.util.Objects; |
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.extracme.evcard.eye.common; | |
/** | |
* @version 2019-01-22 09:31 | |
*/ | |
public class CardValidation { | |
private static boolean checkBankCardNo(String cardNo) { | |
char[] cartNoArray = cardNo.toCharArray(); | |
int cardNoLength = cartNoArray.length; |
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.evcard.demo.test.elastic.search; | |
import lombok.extern.slf4j.Slf4j; | |
import org.apache.http.HttpHost; | |
import org.elasticsearch.action.search.SearchRequest; | |
import org.elasticsearch.action.search.SearchResponse; | |
import org.elasticsearch.client.RestClient; | |
import org.elasticsearch.client.RestHighLevelClient; | |
import org.elasticsearch.index.query.QueryBuilder; | |
import org.elasticsearch.index.query.QueryBuilders; |
NewerOlder