What is the formal difference in Scala between braces and parentheses, and when should they be used?

I tried once to write about this, but I gave up in the end, as the rules are somewhat diffuse. Basically, you’ll have to get the hang of it. Perhaps it is best to concentrate on where curly braces and parenthesis can be used interchangeably: when passing parameters to method calls. You may replace parenthesis … Read more

What is /dev/null 2>&1?

>> /dev/null redirects standard output (stdout) to /dev/null, which discards it. (The >> seems sort of superfluous, since >> means append while > means truncate and write, and either appending to or writing to /dev/null has the same net effect. I usually just use > for that reason.) 2>&1 redirects standard error (2) to standard … Read more

Why avoid increment (“++”) and decrement (“–“) operators in JavaScript?

My view is to always use ++ and — by themselves on a single line, as in: i++; array[i] = foo; instead of array[++i] = foo; Anything beyond that can be confusing to some programmers and is just not worth it in my view. For loops are an exception, as the use of the increment … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)