Static Block in Java

It’s a static initializer. It’s executed when the class is loaded (or initialized, to be precise, but you usually don’t notice the difference). It can be thought of as a “class constructor”. Note that there are also instance initializers, which look the same, except that they don’t have the static keyword. Those are run in addition to the code in the constructor … Read more

Section vs Article HTML5

In the W3 wiki page about structuring HTML5, it says: <section>: Used to either group different articles into different purposes or subjects, or to define the different sections of a single article. And then displays an image that I cleaned up: It also describes how to use the <article> tag (from same W3 link above): <article> is related to <section>, but is … Read more

choosing between $0 and BASH_SOURCE

Note: For a POSIX-compliant solution, see this answer. ${BASH_SOURCE[0]} (or, more simply, $BASH_SOURCE[1] ) contains the (potentially relative) path of the containing script in all invocation scenarios, notably also when the script is sourced, which is not true for $0. Furthermore, as Charles Duffy points out, $0 can be set to an arbitrary value by the caller.On the flip side, $BASH_SOURCE can be empty, if no named file is involved; e.g.:echo ‘echo “[$BASH_SOURCE]”‘ | … Read more