Java logical operators shorct-circuiting

The && and || operators “short-circuit”, meaning they don’t evaluate the right-hand side if it isn’t necessary. The & and | operators, when used as logical operators, always evaluate both sides.

There is only one case of short-circuiting for each operator, and they are:

  • false && ... - it is not necessary to know what the right-hand side is because the result can only be false regardless of the value there
  • true || ... - it is not necessary to know what the right-hand side is because the result can only be true regardless of the value there. 1

Quoting quotes and answers with code from Stack Overflow

Clicking on “improve this answer”, even when not logged in, gives access to the source markdown that I can copy here preserving most formatting.

Stand-off markup (NLP)

Stand-off markup (also known as remote markup or stand-off annotation) is the kind of markup that resides in a location different from the location of the data being described by it. It is thus the opposite of inline markup, where data and annotations are intermingled within a single location. 2

The wiki it’s from is also nice: TEIWiki It’s All pages - TEIWiki would be interesting to look through, NB it has a non-intuitive “next page” link there.

taskwarrior TODO

I need either a command or an alias for “create task and start immediately”, along with some nice way to create boilerplate code for tasks

Intellij idea debugging “Drop Frames”

“In case if you want to “go back in time” while debugging you can do it via Drop Frame action. This is a great help if you mistakenly stepped too far. This will not revert the global state of your application but at least will get you back by stack of frames.” 3 (Icon with a red X on top left.)

Java declaring variables inside or outside a loop

Does it make a difference if I declare variables inside or outside a loop in Java? - Software Engineering Stack Exchange - TL;DR it doesn’t, if you are not creating complex objects. The way to learn this is to look at the generated bytecode, using javap.