Why JSF calls getters multiple times

This is caused by the nature of deferred expressions #{} (note that “legacy” standard expressions ${} behave exactly the same when Facelets is used instead of JSP). The deferred expression is not immediately evaluated, but created as a ValueExpression object and the getter method behind the expression is executed everytime when the code calls ValueExpression#getValue(). … Read more

Is it safe to shallow clone with –depth 1, create commits, and pull updates again?

Note that Git 1.9/2.0 (Q1 2014) has removed that limitation. See commit 82fba2b, from Nguyễn Thái Ngọc Duy (pclouds): Now that git supports data transfer from or to a shallow clone, these limitations are not true anymore. The documentation now reads: –depth <depth>:: Create a ‘shallow’ clone with a history truncated to the specified number … Read more

Why is Haskell (GHC) so darn fast?

I agree with Dietrich Epp: it’s a combination of several things that make GHC fast. First and foremost, Haskell is very high-level. This enables the compiler to perform aggressive optimisations without breaking your code. Think about SQL. Now, when I write a SELECT statement, it might look like an imperative loop, but it isn’t. It … Read more

Is recursion ever faster than looping?

This depends on the language being used. You wrote ‘language-agnostic’, so I’ll give some examples. In Java, C, and Python, recursion is fairly expensive compared to iteration (in general) because it requires the allocation of a new stack frame. In some C compilers, one can use a compiler flag to eliminate this overhead, which transforms … Read more

HTTP vs HTTPS performance

There’s a very simple answer to this: Profile the performance of your web server to see what the performance penalty is for your particular situation. There are several tools out there to compare the performance of an HTTP vs HTTPS server (JMeter and Visual Studio come to mind) and they are quite easy to use. … Read more

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