This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.cogindo.ssl; | |
import java.io.IOException; | |
import java.net.InetAddress; | |
import java.net.Socket; | |
import java.net.UnknownHostException; | |
import java.security.KeyManagementException; | |
import java.security.NoSuchAlgorithmException; | |
import javax.net.ssl.SSLContext; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//1 | |
let numbers = [10,20,30,40]; | |
let first = numbers[0]; //10 | |
let second = numbers[1]; //20 | |
let [first,second] = numbers; | |
console.log(first); //10 | |
console.log(second); //20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//1 | |
let sum = function(){ | |
var method = (prev,curr)=>{ | |
return prev+curr; | |
}; | |
return Array.prototype.reduce.call(arguments,method); | |
}; | |
console.log(sum(1,2,3,4)); | |
/* | |
output: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1 | |
let add = (a,b) => { | |
return a+b; | |
} | |
console.log(add(4,5)); | |
// 2 | |
let add = (a,b) => a+b; | |
console.log(add(4,5)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.support.v4.view.ViewPager; | |
import android.util.AttributeSet; | |
import android.view.View; | |
/** | |
* Created by DSK02 on 7/4/2016. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Input: {252, 11, 9, 17545} | |
Output: 92521754511 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* package codechef; // don't place package name! */ | |
import java.util.*; | |
import java.lang.*; | |
import java.io.*; | |
/* Name of the class has to be "Main" only if the class is public. */ | |
class Codechef | |
{ | |
public static void main (String[] args) throws java.lang.Exception |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BaseActivity extends Activity implements DetectsSoftKeyboardLayout.OnSoftKeyboardListener | |
{ | |
DetectsSoftKeyboardLayout rootlayout; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
rootLayout.setOnSoftKeyboardListener(this); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Age { | |
private int days; | |
private int months; | |
private int years; | |
public Age(int days, int months, int years) { | |
this.days = days; | |
this.months = months; | |
this.years = years; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* onAttach(Context) is not called on pre API 23 versions of Android and onAttach(Activity) is deprecated | |
* Use onAttachToContext instead | |
*/ | |
@TargetApi(23) | |
@Override | |
public void onAttach(Context context) { | |
super.onAttach(context); | |
onAttachToContext(context); | |
} |