Sunday, December 15, 2013

refresh parent window while closing child popup window using javascript


parent script:
===========
win = window.open(mypage,myname,settings);

in child window code:
 ==============
window.onunload = function() {              
    window.opener.location.reload();
};

or

window.onbeforeunload  = function() {               
  window.opener.location.reload(); 
};

Difference between onunload and onbeforeunload is

using window.onunload , able to get an event called when user navigates to a different page from onepage to another . However nothing happens when the tab is closed from the minimized view (X)

Using window.onbeforeunload, I neither get an an event called even if the user navigates to a different page from onepage to another OR if he closes the tab (X) from the minimized view.

Friday, November 2, 2012

Reset Lost/Forgotten root password for MySQL

The following are the steos to restore MySQL root password that is lost/forgotten.

Step 1: Stop MySQL daemon if it is currently running    
     Command to find the MySQL Pid and kill the MySQL process
                ps –ax|grep mysql
                kill -9 pid
Step 2: Run MySQL safe daemon with skipping grant tables
                 mysqld_safe --skip-grant-tables & 
Step 3: Login to MySQL as root with no password
                 mysql -u root mysql
Step 4: Run UPDATE query to reset the root password
          UPDATE user SET password=PASSWORD("ualue=42") WHERE user="root";
      FLUSH PRIVILEGES; 
Step 5: Stop MySQL safe daemon
         Command to find the MySQL safe daemon Pid and kill the MySQL process
               ps –ax|grep mysqld_safe
               kill -9 pid
Step 6: Start MySQL
                            /etc/init.d/mysql start
Step 7: Login into MySQL using root password                          
                           mysql -uroot -proot
 

Thursday, August 16, 2012

Tomcat version 6.0 only supports J2EE 1.2, 1.3, 1.4, and Java EE 5 Web modules”


    While Adding/Removing the projects in tomcat server from eclipse , I am getting issue as “ Tomcat version 6.0 only supports J2EE 1.2, 1.3, 1.4, and Java EE 5 Web modules”. We are unable to add the project in server.
Its occuring since mismatch of jst version.

  

Solution

In project, “.settings” folder, find this file “org.eclipse.wst.common.project.facet.core.xml“, change the version of facet="jst.web" to 2.4 or 2.5.
File : org.eclipse.wst.common.project.facet.core.xml



<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="java" version="1.6"/>
<installed facet="jst.web" version="2.5"/>
<installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>



"There are no resources that can be added or removed from the server eclipse tomcat"


      I have created the Appfuse project . Its running fine in maven jetty server. I would like to run this project in tomcat server. I have added the tomcat server in eclipse and I have tried by right clicking tomcat server and Add remove..., it says "There is no resources that can be added or removed from the server".

Solution:

      I think eclipse is not recognizing our project as a Dynamic Web Application.
I have followed the following steps for fixing this issue.

    Select Project ==> Properties ==> Project Facets and make sure Dynamic Web Module check box is checked


 

Monday, July 30, 2012

org.codehaus.mojo:buildnumber-maven-plugin:maven-plugin:1.0-beta-1-SNAPSHOT - ubuntu 11.10

      A required plugin was not found: Plugin could not be found - check that the goal name is correct: Unable to download the artifact from any repository

    org.codehaus.mojo:buildnumber-maven-plugin:maven-plugin:1.0-beta-1-SNAPSHOT

Problem:

       if ubuntu and Ant tool version is mismatch, we could not download the maven repository.

Solution:

          Use the following latest Ant dependency version and try.
       <dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.8.2</version>
<scope>compile</scope>
</dependency>

 

libglib2.0-0 : Breaks: gnome-control-center (< 1:3) but 1:2.32.1-0ubuntu15 is to be installed E: Broken packages

    I got the following error while installing mysql-server in ubuntu 11 version

   The following packages have unmet dependencies:  libglib2.0-0 : Breaks: gnome-control-center (< 1:3) but 1:2.32.1-0ubuntu15 is to be installed E: Broken packages

Solution:
    
         sudo apt-get install gnome-control-center

Wednesday, July 25, 2012

Tamil Font support in Google Chrome Browser in ubuntu.

Go to freefont directory
  cd /usr/share/fonts/truetype/freefont/

Remove the following fonts

  rm -rf FreeSans.ttf
  rm -rf FreeSerif.ttf