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 os | |
from xml.dom.minidom import parse | |
import xml.dom.minidom | |
import sys | |
def findBanned(log): | |
banned = [] | |
for line in log: | |
if "Found Banned Dependency" in line: | |
a = line.split(":") |
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
/** | |
* 消息中心内所有push均被PushPipeline处理。PushPipeline是一根由多个{@link PushRule}和一个 | |
* {@link PushPipelineSink}组成的单项链表: | |
* | |
* <pre> | |
* PushRule: | |
* 判断push是否可以被发送。PushRule对一个push请求可以有以下三种处理方式: | |
* 1. 通过,并送入后续PushRule继续判断; | |
* 2. 通过,并立即送入PushPipelineSink发送; | |
* 3. 拒绝,整个流程结束。 |
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.meituan.show.sell.web.advice; | |
import java.io.IOException; | |
import java.nio.charset.Charset; | |
import java.util.Map; | |
import javax.annotation.Resource; | |
import javax.servlet.http.HttpServletResponse; | |
import org.slf4j.Logger; |
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.meituan.show.sell.web.exception; | |
import java.util.List; | |
import org.apache.commons.collections.ListUtils; | |
import org.apache.commons.lang3.StringUtils; | |
import org.springframework.context.MessageSource; | |
import org.springframework.http.HttpStatus; | |
import org.springframework.validation.FieldError; |
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
C1 C2 keysToEvict #C1 keysToEvict --- threadLocal; C2 --- medis | |
''' | |
关闭C1, isolation level: Read Committed | |
开启C1, isolation level: Repeatable Read, 无幻读,但少数场景依然是Read Committed | |
eg: | |
A B C | |
start |
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
#!/usr/bin/python | |
# coding=utf-8 | |
n = 10 # 有多少张票 | |
a = [0] * (n+1) # a[i]表示前i张票能获得的优惠最大值 | |
applies = [[]] * (n+1) # applies[i]:前i张票获得最大优惠时采用的所有套票规则 | |
rules = [(2,10), (3,14), (4,22), (5,23)] # 套票规则,买2优惠10 etc. | |
def test(): |
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
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>打印测试</title> | |
<style type="text/css"> | |
*{margin:0;padding:0;font-family: 黑体} | |
#ticket{ | |
width:202mm; | |
height:80mm; | |
page-break-after: always; |
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 escape(String text) { | |
if (StringUtils.isEmpty(text)) { | |
return text; | |
} | |
// fastjson序列化string时会自动转义(但会在前后加上两个双引号) | |
String json = JSONObject.toJSONString(text); | |
json = json.substring(1, json.length() - 1); | |
return json; | |
} |
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
插入不同记录:原生MySQL 5.5.43 InnoDB | |
------------------------ | |
LATEST DETECTED DEADLOCK | |
------------------------ | |
150522 16:34:11 | |
*** (1) TRANSACTION: | |
TRANSACTION 1304, ACTIVE 0 sec inserting | |
mysql tables in use 1, locked 1 | |
LOCK WAIT 6 lock struct(s), heap size 1248, 2 row lock(s), undo log entries 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
// AutowiredAnnotationBeanPostProcessor.java | |
private InjectionMetadata buildAutowiringMetadata(Class<?> clazz) { | |
LinkedList<InjectionMetadata.InjectedElement> elements = new LinkedList<InjectionMetadata.InjectedElement>(); | |
Class<?> targetClass = clazz; | |
do { | |
LinkedList<InjectionMetadata.InjectedElement> currElements = new LinkedList<InjectionMetadata.InjectedElement>(); | |
for (Field field : targetClass.getDeclaredFields()) { | |
AnnotationAttributes ann = findAutowiredAnnotation(field); |
NewerOlder