Compare version numbers without using split function

Can you use the Version class? https://learn.microsoft.com/en-us/dotnet/api/system.version It has an IComparable interface. Be aware this won’t work with a 5-part version string like you’ve shown (is that really your version string?). Assuming your inputs are strings, here’s a working sample with the normal .NET 4-part version string: static class Program { static void Main() { … Read more

What is the difference between == and Equals() for primitives in C#?

Short answer: Equality is complicated. Detailed answer: Primitives types override the base object.Equals(object) and return true if the boxed object is of the same type and value. (Note that it will also work for nullable types; non-null nullable types always box to an instance of the underlying type.) Since newAge is a short, its Equals(object) … Read more

Compare two data.frames to find the rows in data.frame 1 that are not present in data.frame 2

sqldf provides a nice solution a1 <- data.frame(a = 1:5, b=letters[1:5]) a2 <- data.frame(a = 1:3, b=letters[1:3]) require(sqldf) a1NotIna2 <- sqldf(‘SELECT * FROM a1 EXCEPT SELECT * FROM a2’) And the rows which are in both data frames: a1Ina2 <- sqldf(‘SELECT * FROM a1 INTERSECT SELECT * FROM a2’) The new version of dplyr has … Read more

What is best tool to compare two SQL Server databases (schema and data)? [duplicate]

I use schema and data comparison functionality built into the latest version Microsoft Visual Studio 2015 Community Edition (Free) or Professional / Premium / Ultimate edition. Works like a charm! http://channel9.msdn.com/Events/Visual-Studio/Launch-2013/VS108 Red-Gate’s SQL data comparison tool is my second alternative: (source: spaanjaars.com) http://www.red-gate.com/products/sql-development/sql-compare/ http://www.red-gate.com/products/sql-development/sql-data-compare/

How to compare two colors for similarity/difference

See Wikipedia’s article on Color Difference for the right leads. Basically, you want to compute a distance metric in some multidimensional colorspace. But RGB is not “perceptually uniform”, so your Euclidean RGB distance metric suggested by Vadim will not match the human-perceived distance between colors. For a start, L*a*b* is intended to be a perceptually … Read more