SQL Server RowVersion/Timestamp – Comparisons

From MSDN: Each database has a counter that is incremented for each insert or update operation that is performed on a table that contains a rowversion column within the database. This counter is the database rowversion. This tracks a relative time within a database, not an actual time that can be associated with a clock. … Read more

javascript / jquery – select the larger of two numbers

You’re looking for the Max function I think…. var c = Math.max(a, b); This function will take more than two parameters as well: console.log(Math.max(4,76,92,3,4,12,9)); //outputs 92 If you have a array of arbitrary length to run through max, you can use apply… var arrayOfNumbers = [4,76,92,3,4,12,9]; console.log(Math.max.apply(null, arrayOfNumbers)); //outputs 92 OR if you’re using ES2015+ … Read more

Most efficient way to compare a variable to multiple values?

Here’s a way in C++11, using std::initializer_list: #include <algorithm> #include <initializer_list> template <typename T> bool is_in(const T& v, std::initializer_list<T> lst) { return std::find(std::begin(lst), std::end(lst), v) != std::end(lst); } with that, you can do: if (is_in(num, {1, 2, 3})) { DO STUFF } It is not very efficient though when not used with built-in types. int … Read more

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