Compare structures of two databases?

For MySQL database you can compare view and tables (column name and column type) using this query: SET @firstDatabaseName=”[first database name]”; SET @secondDatabaseName=”[second database name]”; SELECT * FROM (SELECT CONCAT(cl.TABLE_NAME, ‘ [‘, cl.COLUMN_NAME, ‘, ‘, cl.COLUMN_TYPE, ‘]’) tableRowType FROM information_schema.columns cl, information_schema.TABLES ss WHERE cl.TABLE_NAME = ss.TABLE_NAME AND cl.TABLE_SCHEMA = @firstDatabaseName AND ss.TABLE_TYPE IN(‘BASE TABLE’, … Read more

How to compare two java objects [duplicate]

You need to provide your own implementation of equals() in MyClass. @Override public boolean equals(Object other) { if (!(other instanceof MyClass)) { return false; } MyClass that = (MyClass) other; // Custom equality check here. return this.field1.equals(that.field1) && this.field2.equals(that.field2); } You should also override hashCode() if there’s any chance of your objects being used in … Read more

Why is Erlang slower than Java on all these small math benchmarks?

Erlang was not built for math. It was built with communication, parallel processing and scalability in mind, so testing it for math tasks is a bit like testing if your jackhammer gives you refreshing massage experience. That said, let’s offtop a little: If you want Erlang-style programming in JVM, take a look at Scala Actors … Read more

How can I verify that an array of strings contain a certain string? [duplicate]

Convert the array of valid directions to a list: List valid = Arrays.asList(directions) Or just declare it directly as: List valid = Arrays.asList(“UP”, “DOWN”, “RIGHT”, “LEFT”, “up”, “down”, “right”, “left”) You can then use the contains method: if (valid.contains(input)) { // is valid } else { // not valid } Note that this won’t match … Read more

Flyway and liquibase together? [closed]

A small correction, before I answer question. The assumption Liquibase seems to have everything Flyway has isn’t correct. Flyway shines when it comes to parsing SQL. You can use unmodified SQL files generated by your native tools containing all kinds of complexity like PL/SQL packages and procedures, MySQL delimiter changes, T-SQL, PostgreSQL procedures, … With … Read more

Compare binary files in C#

static bool FileEquals(string fileName1, string fileName2) { // Check the file size and CRC equality here.. if they are equal… using (var file1 = new FileStream(fileName1, FileMode.Open)) using (var file2 = new FileStream(fileName2, FileMode.Open)) return FileStreamEquals(file1, file2); } static bool FileStreamEquals(Stream stream1, Stream stream2) { const int bufferSize = 2048; byte[] buffer1 = new byte[bufferSize]; … Read more

How to compare the content of a tarball with a folder

–compare (-d) is more handy for that. tar –compare –file=archive-file.tar works if archive-file.tar is in the directory it was created. To compare archive-file.tar against a remote target (eg if you have moved archive-file.tar to /some/where/) use the -C parameter: tar –compare –file=archive-file.tar -C /some/where/ If you want to see tar working, use -v without -v … Read more

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