Wednesday, October 17, 2007

KDE/Kubuntu Hide/Restore Menu Bar

Menu Bar in KDE/Kubuntu Konquerer can be hidden by Settings->Hide Menu Bar. But there is no way to restore it without the keyboard shortcut for hide/restore Ctrl+M

Wednesday, September 26, 2007

Amarok MP3 support in Kubuntu

For Kubuntu 6.10 (Edgy Eft)

• Open Amarok and play an MP3 file. Amarok will ask if you would like to add MP3 support.
• Open Synaptic Package Manager and install the libxine-extracodecs package.

For Kubuntu 7.04 (Feisty Fawn)

• Open Synaptic Package Manager, search and install the package libxine1-ffmpeg.

For more information goto How to Repair MP3 Support in Kubuntu

Kubuntu Linux FTP

sudo apt-get install vsftpd

vi /etc/vsftp.conf

set local_enable=YES

For more information visit Ubuntu Linux vsftpd ftp service / server install, configuration howto

Wednesday, August 29, 2007

Wednesday, August 22, 2007

How to print Hello World ! without using main in Java?

This is probably a very old question, but as the blog title goes, I just discovered it today.


//Example.java

public class Example
{
static {
System.out.println( "Hello World" );
System.exit(0);
}
}

javac Example.java
java Example

The code is stunningly simple. But there are some good concepts involved in it.
1. Always static blocks are executed first.
On typing java Example, JVM first loads that class, which starts with initializing static variables followed by static blocks and then static methods.
2. JVM searches for public static void main(String[] abc) while executing a class.
If JVM does not find it, it throws a java.lang.NoSuchMethodError. But here in the above example, even before letting the JVM do that, System.exit(0) is called.

Solution might look easy after seeing it. But its always the case, isnt it ???

Tuesday, August 14, 2007

How to modify Oracle LOBS/BLOBS/CLOBS

To modify a LOB,
SELECT id, blob FROM test FOR UPDATE

Note that you must use "FOR UPDATE" in the select statement or you will receive "ORA-22920: row containing the LOB value is not locked" when writing to the LOB.

The above lines are taken from the below link :
How to use Oracle LOBS/BLOBS/CLOBS

Tuesday, August 7, 2007

Java Runtime.exec() - a few exceptions :)

Java's Runtime.exec() wont work always as expected. Here is a link which describes those situations and give a solution to workaround them.
When Runtime.exec() won't work