Why doesn’t Java allow private members in interface?

From the Java Language Spec, (Access Control): “The Java programming language provides mechanisms for access control, to prevent the users of a package or class from depending on unnecessary details of the implementation of that package or class.” Access control is all about hiding implementation details. An interface has no implementation to hide.

HTML5 date picker doesn’t show on Safari

Safari does not include a native datepicker for its desktop version (although it does for iOS). Incidentally, neither does IE. It’s very frustrating as it could save developers a lot of time if they did. This is a useful link for tracking support for it: http://caniuse.com/#feat=input-datetime

Import single database from –all-databases dump

You can use the following command: mysql -u root -p –one-database destdbname < alldatabases.sql Where destdbname is your desired database which you want to restore. Another option which is IMHO much safer, is to extract the DB from an –all-databases dump. Example: sed -n ‘/^– Current Database: `dbname`/,/^– Current Database: `/p’ alldatabases.sql > output.sql Replace …

Read more

What does the fail keyword do in Ruby?

In Ruby, fail is synonymous with raise. The fail keyword is a method of the Kernel module which is included by the class Object. The fail method raises a runtime error just like the raise keyword. The fail method has three overloads: fail: raises a RuntimeError without an error message. fail(string): raises a RuntimeError with …

Read more