Hands on the Stream Object in Java 8
Comemnts¶
Stream (introduced in Java 8) brings functional programming into Java so that coding in Java is easier and faster but at the cost of performance. Code written in Stream is slower than non-stream and lambda based Java code, generally speaking.
The method
Stream.mapis not friendly on conversion to Arrays.Stream.mapToInt
Use SnakeYaml in Scala
moultingyaml: Scala wrapper for SnakeYAML
Comment¶
If the input YAML doc has multiple formats,
you can first load it as an Object
and then use Object.isInstanceOf to check its type
and use Object.asInstanceOf[SomeType] to cast it to the right type.
Make A Dot Match Newline in the re Module in Python
Comment¶
- Pass
re.DOTALLto the optionflagsto make a dot match newlines as well.