/* The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calculate the Hamming distance. Note: 0 ≤ x, y < 231. Example: Input: x = 1, y = 4 Output: 2 Explanatio
项目中遇到客户的需求变化,要验证某个数据的正确性,判断输入的两位字符,第一位是数字16进制的,第二位是I.O.Q.U除外的字母(A到Z). 本来对js不熟练,网上参考了一下js正则验证的规则,使用正则表达式完成了这个验证. function check() { var str = document.getElementById("txtEnglishName").value; var reg=/^[0-9a-fA-F][^IOQU]$/; if (str.length!=2) { my
把字符串数组转换为16进制字符串 import java.security.MessageDigest; public class StringUtil { public StringUtil() { super(); } public static String str; public static final String EMPTY_STRING = ""; private final static String[] hexDigits = { "0", &q
如上图:X Y Z 分别为传来的开始时间可能位于数据库中时间段的位置. X有三种可能 即传来的开始时间为与数据可中某条数据的开始位置! 这样他的结束时间就有三种可能 1.位于数据库中开始时间(start)之前 2.位于数据库中开始时间(start)与结束时间(end)之间 3.位于数据库中结束时间(end)之后 Y 有两种种可能 1.位于数据库中开始时间(start)与结束时间(end)之间 2.位于数据库中结束时间(end)之后 Z