Skip to content

Instantly share code, notes, and snippets.

李宏杰 lihongjie0209

Block or report user

Report or block lihongjie0209

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View lock.java
package me.lihongjie;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
View gist:eb3c53cc504b10746fe5171a5ccb28b1
<select id="empFind" resultType="employee">
SELECT * FROM EMP
WHERE 1=1
<choose>
<when test="sal >= 5000">
and job ='PRESIDENT'
</when>
<when test="sal >=3000">
View rescan_device.sh
find /sys/ -regex ".*/scan" | xargs -i{} -P 10 sh -c "echo '- - -' > {}"
View CounterForVisibility.java
public class CounterForVisibility extends Thread {
private volatile static int count = 0;
public static synchronized int getCount() {
return count;
}
public synchronized void setCount(int count) {
this.count = count;
View Counter.java
public class Counter {
private static int count = 0;
public static synchronized int getCount() {
return count;
}
public synchronized void setCount(int count) {
this.count = count;
View pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cn.lihongjie</groupId>
<artifactId>learn_http_by_testing</artifactId>
<version>1.0-SNAPSHOT</version>
View 身份证校验.java
/**
* 身份证校验规则
*/
@Target({FIELD, METHOD, PARAMETER, ANNOTATION_TYPE})
@Retention(RUNTIME)
@Constraint(validatedBy = IDCard.Validator.class)
@Documented
//注解名称
public @interface IDCard {
View sms.py
from androidhelper import Android
from time import sleep
import json
import urllib2
d = Android()
url = "youserver/sms/notify"
while(True):
messages = d.smsGetMessages(False)
for i in messages.result:
View PollutantCodeEnum.java
public enum PollutantCodeEnum {
PM10("001"),
SO2("002"),
NO2("005"),
CO("006"),
O3("007"),
PM25("022"),
Unknown("");
View CoordinateTransformUtil.java
/**
* 百度坐标(BD09)、国测局坐标(火星坐标,GCJ02)、和WGS84坐标系之间的转换的工具
*
* 参考 https://github.com/wandergis/coordtransform 实现的Java版本
* @author geosmart
*/
public class CoordinateTransformUtil {
static double x_pi = 3.14159265358979324 * 3000.0 / 180.0;
// π
static double pi = 3.1415926535897932384626;
You can’t perform that action at this time.