Occasionally, while programming, one may want to create constant sets and store them in final variables for public use. Such a desire can lead to all sorts of problems.
In this article we’ll talk about how to get process list in Java by running standard Unix commands.
Recently released Java 7 has a lot of useful API enhancements such as the automatic resource management, multi-catch statements, switch statement with strings, binary literals and improved numeric literals. This post is a quick roundup of the new features, which should help you to get a full picture of Java 7 syntax in a short time.
Authorize.Net is a popular payment gateway service provider allowing merchants to accept credit card and electronic check payments.
Using such a gateway to issue a one-time transactions doesn't raise any great troubles, but serving returning customers or managing complex subscriptions requires you either to be compliant with the Payment Card Industry Data Security Standard (PCI DSS) or to ask your customer to re-enter his or her billing info every time. Neither is always what you want. Well, among other Authorize's features there is a Customer Information Manager (CIM), which targets that particular problem.
The database query log could be a crucial part of a database restoring process required after data corruption caused by either an illegal update operation or a damage of database files. The main task here is to find the right format for storing the queries.
This article is devoted to very popular framework Spring. It’s very necessary theme for beginners in Java, because Spring is widespread technology.
First of all let's consider wiring - dynamical assembling of separated beans, most important part of Spring framework technology. It's important to keep in mind, that a good understanding of fundamental things is a irreplaceable skill for really cool programmer.
Java driver for MongoDB does not provide any utility classes that could help with building update queries. If you want to create a query to update or increment field values, you usually have to use BasicDBObjectBuilder
. This is intuitive approach, but queries defined in such a way are quite hard to read and maintain.
Recently I had a task to develop the application which will have large work queue and which need to survive the restarts. The application need to be lightweight. After trying several different persistent engines for Java I''ve chosen to stick with Berkley DB Java edition. This persistent engine is pretty lightweight it is fast, optimized for multi-threaded usage and have no problems with reclaiming free space.
As I needed the fast persistent queue at a cost of possible data loss on system crash I've chosen non-transactional API for Berkley DB. With non-transactional API the great speed can be achieved for persistent queue at a price of loss of some data at system crash. The more data you allow to be lost the greater speed of the queue you will have. Though you can opt to sync to disk each operation on the queue and in that case your data loss will be minimal.
Log4j doesn't allow to catch stdout and stderr messages out of the box. However, you can still intercept them with a custom output stream, which is especially useful when you have to log data that third-party libraries write to the standard streams.
This has already been done by Jim Moore (have a look at the LoggingOutputStream
in the log4j source code). The issue is that this LoggingOutputStream
requires org.apache.log4j.Category
and org.apache.log4j.Priority
which are now partially deprecated.