Saturday, 14 July 2018

hyperlink in HTML

<!DOCTYPE html>
<html>
<body>

<h2>hyperlink in  HTML </h2>
<p><a href="http://localhost:8080/addCarDetails">Visit our AddCarDetails</a></p>

</body>
</html>

How to Check whether number is even or odd

import java.text.ParseException;

public class TestOddEvenExample {
    public static void main(String args[]) throws ParseException {

        int x = 24;
        oddEvenChecker(x);

        int xx = 3;
        oddEvenChecker(xx);
    }

    static void oddEvenChecker(int x) {
        if (x % 2 == 0)
            System.out.println("You entered an even number." + x);
        else
            System.out.println("You entered an odd number." + x);
    }
}


Friday, 13 July 2018

simple date format in java

simple date format in java example for bellow date format

yyyy-MM-dd HH:mm:ss.SSSSSS.

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

//TODO OutPut should LIKE in this format yyyy-MM-dd HH:mm:ss.SSSSSS.
public class TestDateExample {

public static void main(String args[]) throws ParseException {

SimpleDateFormat changeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSSSS");

java.util.Date temp = changeFormat.parse("2012-07-10 14:58:00.000000");
Date thisDate = changeFormat.parse("2012-07-10 14:58:00.000000");
System.out.println(thisDate);
System.out.println("----------------------------");
System.out.println("After applying formating :");
String strDateOutput = changeFormat.format(temp);
System.out.println(strDateOutput);

}

}



Saturday, 7 July 2018

invalid loc header (bad signature)

invalid loc header (bad signature) This error we will get due to bad or corrupt maven dependency.

Solution is Just delete that maven dependency. from .m2 location

Saturday, 21 October 2017

fixed spark setup : error : not found spark

error : not found spark

When I run my spark-shell, I encounter this error:
<console>:14: error: not found: value spark
       import spark.implicits._
              ^
<console>:14: error: not found: value spark
       import spark.sql
              ^

to resolve this 
give "chmod 777" basically permission for this folder to
 spark access "C:\tmp\hive"
Here is full command as flows:-
"C:\spark\Hadoop\bin\winutils.exe chmod 777 C:\tmp\hive"

Saturday, 30 September 2017

convert maven project to eclipse

use this command in command prompt


mvn eclipse:eclipse

Fixed - Exception in thread "main" java.lang.IllegalStateException: Failed to read Class-Path attribute from manifest of jar file:

Exception in thread "main" java.lang.IllegalStateException: Failed to read Class-Path attribute from manifest of jar file:

file:/C:/Users/User1/.m2/repository/ch/qos/logback/logback-classic/1.1.11/logback-classic-1.1.11.jar
to fix this issue
try deleting this jar file and run your app and keep a backup of this jar file.