Java获取字符编码

  1. Apache Commons Codec:CharacterEncodingDetector

    1
    2
    3
    4
    String str = "字符串内容";
    InputStream inputStream = new ByteArrayInputStream(str.getBytes());
    CharacterEncodingDetector detector = new CharacterEncodingDetector();
    Charset charset = detector.detectCharset(inputStream, null);
  2. cpdetector.jar

Read more

kotlin-functions

fabiomsr:from-java-to-kotlin

FUNCTIONS

Basic Function

Java

1
2
3
public void hello() {
System.out.print("Hello, World!");
}

Kotlin

1
2
3
fun hello() {
println("Hello, World!")
}

Arguments

Java

1
2
3
public void hello(String name){
System.out.print("Hello, " + name + "!");
}

Kotlin

1
2
3
fun hello(name: String) {
println("Hello, $name!")
}
Read more

python3

python -m http.server 8080
启动http服务(prot:8080)

python-is-python3
使用python代替python3(创建python3的软连接)

Read more