November 30, 2004

Using STL Binders

You can use STL binders to use binary function objects as unary function objects in many STL algorithms which need them. Suppose you need to find the count of strings in a vector of strings who are equal to a certain strings: vector vecstr; vecstr.push_back(“aaaa”); vecstr.push_back(“bbbb”); vecstr.push_back(“zzzz”); vecstr.push_back(“bbbb”); You need

Use java.util.Observable to Monitor Object State changes

The Java API provides a class called java.util.Observable which can be extended by any Java class. The child class can then be an “observable” class and other objects can “observe” changes in state of this object. The class that performs the “observing” must implement the java.util.Observer interface. There is a