SUSE Enterprise 10 video settings on VMware

Not sure why SUSE Enterprise 10 failed to automatically detect video/monitor configuration after I migrated virtual machines from Microsoft Virtual PC to VMware Workstation ACE Edition 6.0.0. I had to run x86config and provide the parameters below. Section "Monitor" HorizSync 31-38 Identifier "Monitor[0]" ModelName "800X600@60HZ" Option "DPMS" VendorName "--> VESA" VertRefresh 50-60 UseModes "Modes[0]" EndSection Section "Modes"  ... Read more

Search and Replace

Sometimes you just need to search all files in a folder and replace everything that matches to a regular expression. Here is a program that does this trick. Of course you need to update the regular expression and other constants with values that meet your requirements. ATTENTION: This program can (depending on the values you assign to the constants) screw up any/all of your files, so make yourself a favor before running it: backup the files under the target folder. [code ... Read more

How Evolution Harms a Programming Language

Java is a lovely programming language, but after its biggest evolutionary step (from 1.4 to 1.5) some awkward things started occurring, since the new compiler should be backwards compatible. Java programmers must recall about some backwards compatibility aspects in order to understand why the Java compiler acts in a somewhat strange way at times. Method overloading, for example, became pretty tricky. Guess what's the result for the program below... [code language='java'] public class MethodOverloading { void doSomething(Integer i) {  ... Read more


Lazy Singleton in Java: [code language='java'] public class Singleton { private static class SingletonHolder { private static Singleton INSTANCE = new Singleton(); } public static Singleton getInstance() { return SingletonHolder.INSTANCE; } }[/code] Read more

Transaction Management Using Spring

In order to effectively design and implement software that handles transactions using Spring, knowledge on the concepts below is vital: Isolation: the degree of isolation this transaction has from the work of other transactions. For example, can this transaction see uncommitted writes from other transactions? Propagation: normally all code executed within a transaction scope will run in that transaction. However, there are several options specifying behavior if a transactional method is executed when a transaction context already exists: for example, simply continue running ... Read more