Skip to content

Instantly share code, notes, and snippets.

View kapilraj2436's full-sized avatar

Kapilraj chouhan kapilraj2436

View GitHub Profile
import datetime
Delimiter = " --> "
def addSecs(tm, secs):
fulldate = datetime.datetime(100, 1, 1, tm.hour, tm.minute, tm.second)
fulldate = fulldate + datetime.timedelta(seconds=secs)
return fulldate.time()
with open("E:\TLOR2002.srt") as f:
@kapilraj2436
kapilraj2436 / Set Header HTTP Request
Last active April 14, 2017 11:43
How to set or add HTTP Header in a SOAP Request. Simple create a Hashmap. Here it is an example.
when creating SOAP Request, in Stub class
for which method you want to add header, Under this method just add this hashmap and fill that hashmap with a key value pair if you want to send details in the form of key value. We can create a list also if we want to send List values in Header.
This is an example to send Headers in Http Request. Here I am sending client ID and Password to INDUSIND Bank at the time of sending SOAP Request.
Hashtable headers=new Hashtable();
headers.put("User-Id", "KapilrajChouhan");
headers.put("Password", "password");
_setProperty(HTTPConstants.REQUEST_HEADERS, headers);
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0093)https://10.72.12.63/cgi-bin/WebObjects/CSA.woa/16/wo/x7voSlseu4se2Pgxr532W5PvP0P/10.10.1.3.83 -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="Adobe GoLive">
<title>InstaPago Receipt Reprint / Reimpresion Del Recibo</title>
<link name="stylePage" rel="stylesheet" type="text/css" href="./receipt_style.css">
<link name="stylePrint" href="./receipt_style_print.css" rel="stylesheet" type="text/css" media="print">
</head>
<body>
Problem :- Error Occured when compilling my code which gives error -
Method parseDouble(java.lang.String) not found in class java.lang.Double.
double _contractNett = Double.parseDouble(_contractNet);
Solution :- After Reaserch I found that the runtime environment I was using belongs to an older version of Java, a pre-1.2 release for sure. The method 'parseDouble' was first introduced in Java 1.2. So if enyone is using Older version or Java 1.1 then he can Solve this Problem like this ....... :--
double _contractNett = Double.valueOf(_contractNet).doubleValue();
That's It.... Problem solved.
import org.json.JSONObject;
import org.json.XML;
import java.io.*;
public class ConvertXMLToJson{
public static void main(String[] args) throws Exception
{
String fileName = "D:\\temp.json";
try
{
File file = new File ("D:\\example.xml");
@kapilraj2436
kapilraj2436 / CandidateCode.java
Created July 6, 2016 09:45
Cadbury Problem in java Algorithm
import java.io.*;
public class CandidateCode
{
private static int cadbury(int m,int n,int p,int q)
{
if (m>n){
int temp=m;
m=n;
n=temp;
}if (p>q){
@kapilraj2436
kapilraj2436 / FindDuplicateNumberInSeries.java
Last active October 3, 2022 16:07
Program to find Duplicate elements in given Array.
import java.util.*;
public class FindDuplicateNumberInSeries
{
public static void main(String[] args)
{
Scanner scan= new Scanner(System.in);
int n = scan.nextInt();//Enter last number (Must have greater then 10)
1. Convert our ".jks" file to ".p12" (PKCS12 key store format):
keytool -importkeystore -srckeystore oldkeystore.jks -destkeystore newkeystore.p12 -deststoretype PKCS12
1.1. To List out new keysrore File :
keytool -deststoretype PKCS12 -keystore newkeystore.p12 -list
2. Extract pem (certificate) from ".p12" keysotre file: