Force a class to override the .equals method

No, you can’t. What you can do, however, is use an abstract base class instead of an interface, and make equals() abstract: abstract class Command { // put other methods from Command interface here public abstract boolean equals(Object other); public abstract int hashCode(); } Subclasses of Command must then provide their own equals and hashCode … Read more

Programmatically install NLTK corpora / models, i.e. without the GUI downloader?

The NLTK site does list a command line interface for downloading packages and collections at the bottom of this page : http://www.nltk.org/data The command line usage varies by which version of Python you are using, but on my Python2.6 install I noticed I was missing the ‘spanish_grammar’ model and this worked fine: python -m nltk.downloader … Read more

Setuptools “development” Requirements

For more info on using setup.py vs requirements.txt, I found this article helpful. Update: September 2016 I no longer use requirements.txt (see original answer below) for installing development only packages. The prevailing wisdom seems to be that requirements.txt should be used to pin deployments to specific version numbers, typically using pip freeze > requirements.txt. This … Read more

What is the difference between functional and non-functional requirements? [closed]

A functional requirement describes what a software system should do, while non-functional requirements place constraints on how the system will do so. Let me elaborate. An example of a functional requirement would be: A system must send an email whenever a certain condition is met (e.g. an order is placed, a customer signs up, etc). … Read more

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