devxlogo

Tip Bank

Use Functor for Callbacks in C++

Using the callback function in C is pretty straightforward, but in C++ it becomes little tricky. If you want to use a member function as a callback function, then the

Two Ways to Chain Servlets

In Servlets/JSPs, there are two ways to achieve servlet chaining using javax.servlet.RequestDispatcher: Include: RequestDispatcher rd = req.getRequestDispatcher(“Servlet2”);rd.include(req, resp); Forward, where req is HttpServletRequest and resp is HttpServletResponse: RequestDispatcher rd =

The reverse() Algorithm

You can use this algorithm to reverse the order of elements in any sequence container. It takes two bidirectional iterators as argument: int iArr [] = {1, 2, 3, 4,

Monitor a Java Application in 1.5 JVM

Simply start your application with: -Dcom.sun.management.jmxremote This allows you to monitor the GC, thread, and memory status of the application throughout: [jdk_home]/bin/jconsole