Welcome to my blog, hope you enjoy reading
RSS

Tuesday, 9 September 2014

Switching between installed Java versions in ubuntu


Switching between installed Java versions can be accomplished using the update alternatives command.

  •     To get a list of your installed Java platforms, run the following command from the terminal:

    sudo update-alternatives --config java
 
  This will give you a list output similar to this:
    There are 2 choices for the alternative java (providing /usr/bin/java).
       Selection    Path                                           Priority   Status
      ------------------------------------------------------------
      0            /usr/lib/jvm/java-6-oracle/jre/bin/java         1070      auto mode
      1            /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java   1051      manual mode
    * 2            /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java   1069      manual mode
    Press enter to keep the current choice[*], or type selection number:

In this case, the Open JDK 6 version is running. To switch to the Open JDK version 7, you would select option 1 at the prompt and press the Enter key.

You will now be running the OpenJDK 7 version. No other changes will be needed to switch your Java versions.
Share

Saturday, 30 August 2014

Temporarily disable Eclipse plugins in load-on-startup

Temporarily disable Eclipse plugins in load-on-startup

Eclipse :Windows-->Preferences-->General-->Startup and Shutdown

De-select unwanted plugins.
Select Apply-->Ok.

Share

Thursday, 3 July 2014

Running GWT's Super Dev Mode

Super dev mode is one of the feature given in GWT after 2.5 version.

Share

Thursday, 19 June 2014

How do upgrade GWT in Eclipse

How do upgrade GWT in Eclipse

  • Download the GWT SDK(s) you need from https://developers.google.com/web-toolkit/versions
  • Extract it anywhere you like
  • In Eclipse Preferences > Google > Web Toolkit, use the "Add..." button and navigate to the GWT SDK directory
  • Then, in each Eclipse project's properties page (Project > Properties > Google > Web Toolkit), you can choose one of your installed SDKs.  
source
Share

Saturday, 14 June 2014

Eclipse (ADT) crash Failed to write core dump. Core dumps have been disabled

I found my problem here: how to fix “Failed to write core dump. Core dumps have been disabled” error while running java and here: Eclipse crashing on startup and here: Eclipse continue crash
Share

Tuesday, 20 May 2014

replace() vs replaceAll()

Both replace() and replaceAll() replaces all the occurrence found. However, there is difference in the type of arguments they accept.

Share

Thursday, 15 May 2014

What is the size of ” null ” Operator in Java ?

When you write

String st1 = null;
You create a reference “str1″ to an object that still does not exist in the heap, but when you type :

Share

Wednesday, 30 April 2014

COALESCE FUNCTION IN PLSQL

The Oracle/PLSQL COALESCE function returns the first non-null expression in the list. If all expressions evaluate to null, then the COALESCE function will return null.
Syntax

The syntax for the Oracle/PLSQL COALESCE function is:

coalesce( expr1, expr2, ... expr_n )


Example

The COALESCE function can be used in Oracle/PLSQL.

You could use the coalesce function in a SQL statement as follows:

SELECT COALESCE( address1, address2, address3 ) result
FROM suppliers;

The above COALESCE function is equivalent to the following IF-THEN-ELSE statement:

IF address1 is not null THEN
   result := address1;

ELSIF address2 is not null THEN
   result := address2;

ELSIF address3 is not null THEN
   result := address3;

ELSE
   result := null;

END IF;

The COALESCE function will compare each value, one by one.
Share

Friday, 7 March 2014

Handling multiple updates in Mysql

Handling multiple updates in Mysql 

UPDATE yourtable
    SET updatefield = CASE id
        WHEN 1 THEN 'new value'
        WHEN 2 THEN 'new value'
        WHEN 3 THEN 'new value'
    END
WHERE id IN (1,2,3)
Share

Tuesday, 4 March 2014

CPU usage in ubuntu

CPU usage in ubuntu 

You first should figure out what process is eating away your CPU.
  •     open a terminal with ctrl+alt+t
  •     execute the command top
  •     note the process using the most cpu
If the process isn't a system process, kill it with sudo pkill [processname] with [processname] the name of the process you want to kill. If it is a system process, don't kill it, but try to google the name and figure out what functionality it has in Ubuntu. Then you can proceed to turn it of (in e.g. you system settings).
Share