Thursday, 24 May 2012

Convert String to Integer and vise versa

We easily convert String to Integer use of parseInt method and Integer to String use of  toString() method.

String To Integer
Syntax
   Integer.parseInt(Str);
Example :
  String name = "ram";
  Int  i = Integer.parseInt(name);


Integer To String
Syntax
   Integer.toString(intValue);
Example :
  int i = 10;
  String no = Integer.toString(i);


 that's all !!!

Tuesday, 15 May 2012

Resolving PacketTooBigException in MYSQL

Sometime if you use MySql you  may get the following error when,Installing and migration of your project.that error like  com.mysql.jdbc.PacketTooBigException:Packet for query is too large (4739923 > 1048576).
 For that you have to excute the following Query in MySql


                    set global max_allowed_packet=1817776

ReStore MYSQL Dump in Linux

ReStoring  MySql dump use of the following command

mysql -u[UserName] -p[Password] dbName < /<directory of file saved>/filename.sql

MYSQL Dump in linux

You can take MYSQL Dump using the following command

mysqldump  -u[UserName] -p[Password] dbName > /<directory to save>/filename.sql

Taking multiple databases dump at the same time

mysqldump  -u[UserName] -p[Password] [dbName1] [dbName2] ... > /<directory to save>/filename.sql

Taking dump of  Particular table in databases

mysqldump  -u[UserName] -p[Password] [dbName] [table_Name] > /<directory to save>/filename.sql

Takinge dump of  all databases

mysqldump  -u[UserName] -p[Password] -all-databases > /<directory to save>/filename.sql

Monday, 14 May 2012

Fixing problem of Eclipse WorkSpace failed to Startup


There can be a lot of issues in Eclipse startup . But there is one of the quite common one is eclipse resources cache or state gets out of sync/corrupted.This can happen when your IDE crashes OR also without crashing. For fixing that bug just remove ".snap" file from Workspace. See below how to delete
these ".snap" file.

<directory of workspace>/.metadata/.plugins/org.eclipse.core.resources/ 

inside of that you will find ".snap" file just delete that file.Then  Eclipse started fine.

OR You can use use this command also
                  " sudo eclipse -clean"
it also working fine


Overcome Problem of SVN Working Copy xxx locked and cleanup failed

Sometime You will get error in svn update or commit like
svn: Working copy '/home/test/IdeaMed/Project/src/main' locked; try performing 'cleanup'.


For that just go Team--->cleanup then that error will go away

Sometime You will get error like that also
svn: Working copy '/home/test/IdeaMed/Project/src/main' locked; and cleanup failed .


We should also be careful not to interrupt SVN operations, though sometimes a error may occur and this  could cause the ".lock" file to not be removed.

Generally  ".lock" file is created and it decides lock/unlock state checking the existince of this file. If you delete this ".lock" file only, then the problem will go away.

".lock" normally Placed in WorkSpace folder.Go to WorkSpace folder and press Ctrl+h  then you will find ".metaData".Inside of  ".metaData" delete the ".lock" file 


Otherwise in command window simply give the following command it will work
          "svn cleanup"

Uninstall Firefox in ubuntu

We can uninstall firefox in ubuntu two ways.

1 .Synaptic Package Manager

         just Go System-->Administration-->Synaptic Package Manager


It shows how many packages installed in ubuntu.


In that menu search firefox use of QuickFilter .Then select that  application right click select mark for completly removal then click apply.That's it application removed.

or you can Go ubuntu software center in application menu and search firefox then select that application and click uninstall.But its not working fine.

2.Terminal

      You can remove firefox via terminal using these following command.
                   "sudo apt-get purge firefox"
      Delete .mozilla/firefox/ , macromedia,adobe into your home directory.these can contain "Flash Cookies" stored by the browser.Finally delete add ons in etc folder.
          "rm -rf /home/<user>/.mozilla/firefox/  /home/<user>/.adobe/  /home/<user>/.macromedia/ /etc/firefox/ /usr/lib/firefox/  /usr/lib/firefox-addons/"