Distrusting New WoSign and StartCom Certificates
chrome和firefox从最新版本开始不再信任沃通和startCom的证书,所以从最新版本开始,这两个证书将会提示net::ERR_CERT_DATE_INVALID. 换https证书厂商吧。
chrome和firefox从最新版本开始不再信任沃通和startCom的证书,所以从最新版本开始,这两个证书将会提示net::ERR_CERT_DATE_INVALID. 换https证书厂商吧。
最近看了一下天凤的牌效算法,发现他的js文件加密了,然后就研究了一下。最后大概摸清了每个函数的功能,对其二次封装成了天凤牌效计算接口。
下面是接口的用法
———————–
GET : https://t2t2.cc/tenhou/getResult
参数 q
参数值 : 手牌
例:https://t2t2.cc/tenhou/getResult?q=2468m567p3567s24z4m
返回
-xts 一般形/标准型向听数
-px 牌效
— “h”: 打出的牌
— “e”: 打出后有效牌数量,
— “c”:可以摸的有效牌
— “i”: 剩余手牌
GET : https://t2t2.cc/tenhou/getPai
参数 q
参数值 : 牌的数字编号(h和c返回的数字)
例子:https://t2t2.cc/tenhou/getPai?q=3,4,10,13,15,20,23
返回
翻译过后牌的数组
备忘
Files.lines(Paths.get("FILE_PATH"), StandardCharsets.UTF_8).forEach(System.out::println);
StringBuffer stringBuffer = new StringBuffer();
Files.lines(Paths.get("FILE_PATH"), StandardCharsets.UTF_8).forEach(stringBuffer::append);
在知乎上看到一回答
public static void main(String ... args) {
System.out.println(randomString(-229985452)+' '+randomString(-147909649));
}
public static String randomString(int seed) {
Random rand = new Random(seed);
StringBuilder sb = new StringBuilder();
for(int i=0;;i++) {
int n = rand.nextInt(27);
if (n == 0) break;
sb.append((char) ('`' + n));
}
return sb.toString();
}
跑了一下。。。麻辣个鸡的。。。
作者:jason christ
链接:https://www.zhihu.com/question/37760140/answer/74523291
来源:知乎
著作权归作者所有,转载请联系作者获得授权。
想起了1+1=3的那个
代码大概是这个样子…
—————————————-
public static void main(String[] args) throws Exception {
Class integer = Integer.class.getDeclaredClasses()[0];
Field field = integer.getDeclaredField("cache");
field.setAccessible(true);
Integer[] array = (Integer[]) field.get(integer);
array[130] = array[131];
System.out.printf("%d", 1 + 1);
}
———————————————————————————————-
解解释一下,前面几步是反射就不说了,java里面有一个int常量池,也就是field.get(integer);这句代码所拿到的,它的长度是256,里面存着[-128-127]之间的数字.这个有什么用?看了下面的代码你就会理解了
Integer a = -128;
Integer b = -128;
Integer c = -129;
Integer d = -129;
System.out.println(a == b);
//true
System.out.println(c == d);//false
然后,System.out.printf这个方法并没有做验证,而是如果值在这个范围就直接从池中拿出来.
也就是说,如果我这样写
for (int i = 0; i < array.length; i++) {
array[i] = 12450;
}
for (int i = -128; i <= 127; i++) {
System.out.printf("%d\n", i);
}
输出的将都会是12450.
println就不会用这个问题,因为它用的是String.valueOf(i).
1 关于Integer int
Integer t1 = 111;
Integer t2 = 111;
Integer t3 = new Integer(111);
Integer t4 = Integer.valueOf(111);
Integer s1 = 222;
Integer s2 = 222;
Integer s3 = new Integer(222);
Integer s4 = Integer.valueOf(222);
System.out.println(t1 == t2); //true
System.out.println(t1 == t3); //false
System.out.println(t1 == t4); //true
System.out.println(s1 == s2); //false
System.out.println(s1 == s3); //false
System.out.println(s1 == s4); //false
2 String
String a = "JAVA";
String b = "JAVA";
String c = new String("JAVA");
String d = "JA";
String e = "VA";
String f = "JA"+"VA";
String g = d+e;
String h = c ;
System.out.println(a==b); //true
System.out.println(a==c); //false
System.out.println(a==f); //true
System.out.println(a==g); //false
System.out.println(c==f); //false
System.out.println(c==g); //false
System.out.println(c==h); //true
3.数组,=
int a=0;
int b[]=new int[5];
int c=3;
b[a]=a=c;
System.out.println(b[0] + " " + b[3]); //3 0
4 static
static {
name = "B";
}
static String name = "A";
static {
System.out.println(name); //A
}
输出的name 是什么呢?
5.short
short a = 1;
a = a ++;//会报错吗? 不会
short a = 1;
a = a + 1;//会报错吗? 会
short a = 1;
a += 1;// 会报错吗? 不会
简要说明:改hosts,目前可用的hosts我保存了一份,在 hosts
正常步骤:
1.首先百度搜索“谷歌hosts”,找一个可用的hosts,注意更新日期,越新越好,下载到本地。
2. windows找到C:\Windows\System32\drivers\etc\hosts文件,右键属性设置文件权限可读写,用文本编辑器打开下载好的hosts文件,覆盖到系统的hosts文件中。mac和linux(包括安卓)的hosts文件在/etc/hosts,可以使用su root 命令然后vi /etc/hosts 编辑hosts覆盖粘贴,或者使用命令 “
cat 下载的hosts文件路径 >> /etc/hosts
” 把下载的hosts追加到源文件结尾。
3.测试是否生效,如果不生效请刷新dns或者重启。
特别注意:访问谷歌推特等网站请使用https加密协议,谷歌请访问谷歌加拿大 https://www.google.ca 或者 https://www.google.com/?ncr 禁止自动国别跳转。由于dns污染严重,非https协议无法打开。
忽略字段
Jackson : @JsonIgnore 都会忽略
fastJson: @JSONField(serialize=false) or @JSONField(deserialize=false)
格式化日期
Jackson : @JsonFormat(locale=”zh”, timezone=”GMT+8″, pattern=”yyyy-MM-dd”)
fastJson: @JSONField(format=”yyyyMMdd”)
JDK1.8 HashMap存储结构由链表改成了平衡树,复杂度 o(n) –> o(log n).看来还是应该跟进最新版。