Tips and Traps¶
- You cannot get the address of an object in Java (without hacking).
System.identityHashCode(obj)is the next best thing you can have. This trick (combined with the timestamp) is used to generate default seed for random number generators in Java.
Java IO
References¶
- Generally speaking, BufferedReader/BufferedWrite are preferred over InputStreamReader/InputStreamWriter.
https://docs.oracle.com/javase/8/docs/api/java/io/BufferedWriter.html
public static Stream\<String> java.nio.file.Files.lines¶
public static List\<String> java.nio.file.Files.readAllLines¶
Read all lines from a file.
Bytes from the file are decoded into characters using the UTF-8 charset.
Notice that this method returns a List of Strings,
which is different from the method java.nio.file.Files.lines (who returns a Stream of Strings).
Kotlin IO
User in Docker
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
User switching in Docker
USER some_userin Dockerfile, some_user has to existssuin Dockerfile or shell scriptsdocker run --user some_user
@pedrolucasoliva i am docker specialist i give you a …
Kotlin vs Scala
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
https://www.quora.com/Is-Kotlin-so-similar-to-Scala-What-are-the-differences/answer/Bruce-Richardson-4
Fix Xcrun Error in Mac
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcode-select --install
Reference
https://apple.stackexchange.com/questions/254380/why-am-i-getting-an-invalid-active-developer-path-when-attempting-to-use-git-a