STEPS
-
Click on Help menu
-
Select Enter License
-
Then paste given KEY given at bottom
-
Finally click on Use License
STEPS
Click on Help menu
Select Enter License
Then paste given KEY given at bottom
Finally click on Use License
package test; | |
import java.nio.charset.Charset; | |
import org.apache.commons.codec.binary.Base64; | |
import org.springframework.security.crypto.encrypt.BytesEncryptor; | |
import org.springframework.security.crypto.encrypt.Encryptors; | |
/** | |
* 简易的字段隐藏工具,用于选择性地对原值做全部、部分加密/解密; 用于一些页面展示/表单提交的信息展示场景 |
public class TypeReference<T> { | |
private final Type type; | |
protected TypeReference(){ | |
Type superClass = getClass().getGenericSuperclass(); | |
type = ((ParameterizedType) superClass).getActualTypeArguments()[0]; | |
} |
192.168.0.1 | |
xxx.xxx.xxx.xxx | |
..... |
package xxx; | |
import java.util.HashMap; | |
import java.util.HashSet; | |
import java.util.Map; | |
import java.util.Set; | |
import org.apache.oro.text.regex.MalformedPatternException; | |
import org.apache.oro.text.regex.Pattern; | |
import org.apache.oro.text.regex.Perl5Compiler; |
import java.lang.reflect.Field; | |
import java.lang.reflect.Method; | |
import java.net.InetAddress; | |
import java.net.UnknownHostException; | |
import java.util.ArrayList; | |
import java.util.ConcurrentModificationException; | |
import java.util.List; | |
import java.util.Map; | |
public class GatewayUrgentDnsSwitchServiceImpl implements GatewayUrgentDnsSwitchService { |
/** | |
* A data structure which have both stack & set features, especially useful to | |
* detect 'circles' in trees or graphs. | |
* | |
* @author pf-miles | |
* | |
*/ | |
public class SetStack<E> extends LinkedHashSet<E> { | |
private static final long serialVersionUID = -3159906489148656808L; | |
private Deque<E> innerStack = new ArrayDeque<E>(); |
// 1.查找相同主键对象 | |
DBObject old = col.findOne(qo); | |
if (old == null) { | |
// 2.若不存在,尝试插入, 若出错"duplicate 主键",则转到3.更新操作 | |
try { | |
col.insert(newObj, WriteConcern.SAFE); | |
} catch (DuplicateKey e) { | |
// 2.1 瞬间又被插了一条记录,尝试更新操作 | |
BasicDBObject upObj = new BasicDBObject(); | |
WriteResult rst = null; |
public class ComputeUtil { | |
/** | |
* 根据已有平均值、总量、新增值递推新平均值的公共函数, 计算公式: newAvg = (oldAvg * oldCount)/(oldCount+1) + newVal/(oldCount+1); | |
* 另外由于目前的需求是保留2位小数,所以当oldCount大到一定程度时,oldCount/(oldCount+1) 趋近于 1 且 1/(oldCount+1) 趋近于 0,就不必执行某些实际计算以减少不必要操作 | |
* | |
* @param oldAvg 老平均值 | |
* @param oldCount 老的总量 | |
* @param newVal 新值 | |
* @return 新平均值 |