July 8, 2015

Stop or disable skype Auto-launching in Windows 8 on startup

We can stop/disable skype on windows startup by following steps:
 
Method 1: Ctrl+Shift+Esc (open Task manager) > Startup > Disable Skype

Method 2: Open Run > type msconfig > System Configuration (Disable Skype here or it will give open task manager link) >Task Manager > Startup > Disable Skype
(See Picture)

Error [solved] The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path

Problem : The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path.
Faced this error while using maven integration with eclipse. 
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
First found this error on the start of JSP page with one red mark over above piece of code.

Solution : Below, I have written three solution for this problem. I guess, one will work for you.

Method 1: Add Maven dependency(pom.xml)
Include servlet-api-3.1.jar in your dependencies.
 <dependency>  
  <groupId>javax.servlet</groupId>  
  <artifactId>javax.servlet-api</artifactId>  
  <version>3.1.0</version>  
  <scope>provided</scope>  
 </dependency>  

Method 2: Add a Runtimes
Properties > Project Facets > Runtimes > Check Server name > Apply > OK (As shown in Image)

Method 3: Select a Runtime to add to the classpath
Java Build Path > Libraries > Add Library > Server Runtime > Next (As shown in Image)
then select a Runtime(Apache Tomcat Server) > Finish > OK (As shown in Image)

July 6, 2015

How to Disable Text Selection on Web Page using JavaScript

This JavaScript will Disable select, copy and paste of the content. Put below given JavaScript in <script></script> tag inside <head></head>  tag of your webpage.

If you want to use this script on your blog then go-to Layout > Add a Gadget > Use HTML/JavaScript Gadget and Paste below given code inside it.

JavaScript Code:
 
//Script open tag 
 //form tags to omit in NS6+:  
 var omitformtags=["input", "textarea", "select"]  
 omitformtags=omitformtags.join("|")  
 function disableselect(e){  
 if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)  
 return false  
 }  
 function reEnable(){  
 return true  
 }  
 if (typeof document.onselectstart!="undefined")  
 document.onselectstart=new Function ("return false")  
 else{  
 document.onmousedown=disableselect  
 document.onmouseup=reEnable  
 }  
 //Script close tag  

June 29, 2015

Block or stop connecting Peers or IP Addresses to utorrent

uTorrent is one of the more popular free torrent clients. The installer size is tiny and only a fraction of system resources are used when the program is running.

µTorrent is Very Easy Way to Download Files. Its Very Convenient to Download through this Software. The Main & very Excellent Feature of this Software is that you don't have to worry about your Link Breakdown or wait to Shutdown your Computer till your Download is Completed. It works when it gets the Internet Connection and Starts its Work. It Resumes the Downloads from where it was Interrupted.

Steps to block connecting Peers or IP Addresses:

Step 1: Options > Preferences > Advanced or press (CTRL+ P) and set the value of ipfilter.enable to true.


Step 2: Click the Peers tab. Right-click anywhere inside the Peers tab and uncheck “Resolve IPs” Tab.

Step 3: Open a Notepad window and manually type in any IP address per line that you wish to block, you can also block range of IPs eg. 192.168.2.xxx-192.168.2.xxx. Save the Notepad window (with the IP addresses) as “ipfilter.dat” (including the quotes).

Save/Paste this file on following location :
C:\Documents and Settings\<username>\Application Data\uTorrent (For Windows XP, 2003 and 2000).

C:\Users\<username>\AppData\Roaming\uTorrent (For Windows Vista, 7 and 8, 8.1).

Shortcut : Click Windows+R to open RUN an type %AppData%\uTorrent to open location.

Step 4: Right click anywhere on the Peers Tab and select Reload IP Filter:

This will block all IP Addresses that are present in your ipfilter.dat file.

June 26, 2015

Oracle and MySql : Find Top 3rd highest salary row from employee table

In Oracle using ROWNUM :
For each row returned by a query, the ROWNUM pseudocolumn returns a number indicating the order in which Oracle selects the row from a table or set of joined rows. The first row selected has a ROWNUM of 1, the second has 2, and so on.

You can use ROWNUM to limit the number of rows returned by a query, as in this example:

SELECT Cols |* FROM table_name WHERE ROWNUM < Number;

Example to find the 3rd highest salary using Oracle Database:
Employee Table :

Sql Command in action in Oracle Database
In SQL using SELECT TOP clause :

The SELECT TOP clause is used to specify the number of records to return, as in this example:

SELECT TOP number|percent column_name(s) FROM table_name;

Example to find the 3rd highest salary using MySql Database:
Query 1: SELECT MIN(SALARY) AS Salary FROM Employee WHERE SALARY IN (SELECT DISTINCT TOP 3 SALARY FROM Employee ORDER BY SALARY DESC);

Query 2 : SELECT Top 1 Salary AS Salary FROM Employee WHERE SALARY IN (SELECT DISTINCT TOP 3 SALARY FROM Employee ORDER BY SALARY DESC) ORDER BY SALARY;

Also Read : SQL : Find 2nd or 3rd highest salary from employee table without ROWNUM or TOP

June 15, 2015

Maven Installation under Windows: “JAVA_HOME is set to an invalid directory”

Problem : JAVA_HOME is set to an invalid directory. please set the java_home variable in your environment variable to match the location of your java installation.

Solution :  
Computer > Properties > Advanced System Settings > System Properties > Advanced > Environment Variables



In System Variables :
Variable Name : JAVA_HOME
Variable Value :  C:\Program Files\Java\jdk1.8.0_45 (Set your JDK)

In System Variable:
Variable Name : path or PATH
Variable Value : [already there+];%JAVA_HOME%\bin

If You are getting still this error then:
To Set JAVA_HOME : go to Command Prompt and Execute following command
set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_45

Restart your IDE and Command Prompt then install mvn again. 

Please Comment Thanks to us if this topic is helpful :)

Disclaimer

We shall not be liable for the improper or incomplete transmission of the information contained in this communication nor for any delay in its response or damage to your system. We do not guarantee that the integrity or security of this communication has been maintained or that this communication is free of viruses, interceptions or interferences. Anyone communicating with us by email accepts the risks involved and their consequences. We accept no liability for any damage caused by any virus transmitted by this site.