https://www.w3schools.com/jquery/jquery_callback.asp
Thursday, 31 January 2019
package.json infromation
https://www.journaldev.com/7553/importance-of-package-json-in-node-js-applications
Tuesday, 29 January 2019
how to return isert ids from batch insert :MySQL
PreparedStatement ps = null;
ps = connection.prepareStatement(sql,ps.RETURN_GENERATED_KEYS);
results = ps.executeBatch();
ResultSet rs= ps.getGeneratedKeys();
while(rs.next()){
playerIds.add(rs.getInt(1));
}
ps = connection.prepareStatement(sql,ps.RETURN_GENERATED_KEYS);
results = ps.executeBatch();
ResultSet rs= ps.getGeneratedKeys();
while(rs.next()){
playerIds.add(rs.getInt(1));
}
date formatting in java
https://stackoverflow.com/questions/18480633/java-util-date-format-conversion-yyyy-mm-dd-to-mm-dd-yyyy
Monday, 28 January 2019
prepared statment date exception in java
https://stackoverflow.com/questions/30280494/why-do-i-get-a-com-mysql-jdbc-mysqldatatruncation-data-truncation-incorrect-d
PreparedStatement prep = con
.prepareStatement("REPLACE INTO bus(mac, route, latitude, longitude, created_at)"
+ "VALUES( ?, ?, ? , ?, now())");
convert array into list
https://stackoverflow.com/questions/1073919/how-to-convert-int-into-listinteger-in-java
https://www.techiedelight.com/convert-int-array-list-integer/
int[] ints = {1,2,3};
List<Integer> list = Arrays.stream(ints).boxed().collect(Collectors.toList());
int[] ints = {1, 2, 3};
List<Integer> intList = new ArrayList<Integer>();
for (int i : ints)
{
intList.add(i);
}
Tuesday, 22 January 2019
JAVA wildcard tutorial
https://www.geeksforgeeks.org/wildcards-in-java/
//Java program to demonstrate Upper Bounded Wildcards
import java.util.Arrays;
import java.util.*;
class Main
{
public static void main(String[] args)
{
//Upper Bounded Integer List
List<Integer> list1= Arrays.asList(4,5,6,7);
//printing the sum of elements in list
System.out.println("Total sum is:"+sum(list1));
// Double list
List<Double> list2=Arrays.asList(4.1,5.1,6.1);
//printing the sum of elements in list
System.out.print("Total sum is:"+sum(list2));
}
private static double sum(List<? extends Number> list)
{
double sum=0.0;
for (Number i: list)
{
sum+=i.doubleValue();
}
return sum;
}
}
Monday, 21 January 2019
jedis libarary for java
https://www.baeldung.com/jedis-java-redis-client-library
http://www.javadoc.io/doc/redis.clients/jedis/3.0.1
http://www.javadoc.io/doc/redis.clients/jedis/3.0.1
Thursday, 17 January 2019
Wednesday, 16 January 2019
Java arraylist implaemention and contains example
import java.util.ArrayList;
class Main {
public static void main(String[] args) {
ArrayList<Integer> al1 = new ArrayList<Integer>();
al1.add(56);
al1.add(88);
ArrayList<Integer> al2 = new ArrayList<Integer>();
al2.add(1);
al2.add(99);
al2.add(56);
al2.add(13);
al2.add(44);
al2.add(6);
for(Integer number : al2) {
if( al1.contains(number)){
System.out.println("player exist");
return ;
}
System.out.println(number);
}
// System.out.println("'55' is present in arraylist: "+al2.contains(55));
// System.out.println("'44' is there in arraylist: "+al2.contains(44));
// System.out.println("'7' is there in arraylist: "+al2.contains(7));
}
}
Friday, 11 January 2019
Thursday, 10 January 2019
SSO who works
https://stackoverflow.com/questions/35663357/how-does-sso-single-sign-on-work
Well, there are certainly many ways to achieve it, and it can be tricky. I can give you one solution as an example:
Consider two apps on different subdomains:
The Fine Corinthian Turkey Shop (turkey.example.com)
Rent a Baboon (monkey.example.com)
These two web apps want to share signon, and arrange for a third hosted website for their single sign-on:
sso.example.com
Then the flow is:
- Frank visits http://turkey.example.com/orders/12
- Turkey redirects to https://sso.example.com/login
- SSO presents user with login form, validates and issues token
- The token is saved in a cookie on SSO.
- User is now validated on SSO, but needs to get the token back to turkey.
- SSO stores a combination of (Guid, Token, Expiry) on the server, where Guid is a random guid and Expiry is something like 30 seconds.
- SSO sets a secure cookie on *.example.com containing the Guid
- SSO redirects back to http://turkey.example.com/orders/12
- Turkey can now retrieve the ticket from the cookie
- Turkey calls SSO server and exchanges the ticket for the token.
- Turkey stores token in the browser (typically a cookie)
Now let's imagine that Frank wants some nice juicy baboons to go with that turkey:
- Frank visits: http://monkey.example.com/order-in-bulk
- Monkey sees that Frank has no stored token and redirects to https://sso.example.com/login
- SSO sees that Frank is already logged in as he has a stored token.
- SSO stores a new (Guid, token, expiry) triple on the server
- Process is identical to the initial login the rest of the way
paypal new express checkout documention
https://developer.paypal.com/docs/classic/api/merchant/DoExpressCheckoutPayment_API_Operation_NVP/
https://developer.paypal.com/docs/classic/express-checkout/ht_ec-orderAuthPayment-curl-etc/#step-6-capture-the-first-payment-future
express checkout method
https://developer.paypal.com/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NVP/
1.SetExpressCheckout
https://developer.paypal.com/docs/classic/api/merchant/GetExpressCheckoutDetails_API_Operation_NVP/
2.GetExpressCheckoutDetails
https://developer.paypal.com/docs/classic/api/merchant/DoExpressCheckoutPayment_API_Operation_NVP/
3.DoExpressCheckoutPayment
https://gist.github.com/xcommerce-gists/4121491
https://github.com/GeorgeOld/Paypal-NVP-PHP-code-examples
https://developer.paypal.com/docs/classic/express-checkout/ht_ec-orderAuthPayment-curl-etc/#step-6-capture-the-first-payment-future
express checkout method
https://developer.paypal.com/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NVP/
1.SetExpressCheckout
https://developer.paypal.com/docs/classic/api/merchant/GetExpressCheckoutDetails_API_Operation_NVP/
2.GetExpressCheckoutDetails
https://developer.paypal.com/docs/classic/api/merchant/DoExpressCheckoutPayment_API_Operation_NVP/
3.DoExpressCheckoutPayment
https://gist.github.com/xcommerce-gists/4121491
https://github.com/GeorgeOld/Paypal-NVP-PHP-code-examples
Wednesday, 9 January 2019
encode decode url in javascript
let url ="{{base_url_laravel}}/api/rest/v1.6/question/retrieve_question?question_title=testQuestion2+4@@~$&limit=20&order=asc&sort_by=card_number&start_index=1";
let encodeUrl=encodeURIComponent(url);
console.log(`enodeurl----${encodeUrl}`);
let decodedUrl=decodeURIComponent(encodeUrl);
console.log(`decodedurl-----${decodedUrl}`);
Tuesday, 8 January 2019
paasing argument in node js module
https://stackoverflow.com/questions/35087024/what-does-requiremoduleparameter-mean
var mod = require('module'),
module = mod(parameter);
https://stackoverflow.com/questions/13151693/passing-arguments-to-require-when-loading-module
Monday, 7 January 2019
HTTP vs HTTP2
https://medium.com/@factoryhr/http-2-the-difference-between-http-1-1-benefits-and-how-to-use-it-38094fa0e95b