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 com.example.kaushal28.locationbasedreminder; | |
import android.app.Activity; | |
import android.app.AlertDialog; | |
import android.content.Intent; | |
import android.graphics.Bitmap; | |
import android.os.Bundle; | |
import android.support.v4.app.NavUtils; | |
import android.support.v7.app.AppCompatActivity; |
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 purvil12c.musicplayer; | |
import android.app.AlarmManager; | |
import android.app.PendingIntent; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.os.AsyncTask; | |
import android.os.Handler; | |
import android.util.Log; | |
import android.widget.Toast; |
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 java.util.*; | |
import java.lang.*; | |
import java.io.*; | |
class GFG { | |
static boolean isSafe(int[][] mat, int i, int j, boolean[][] visited){ | |
return (i>=0) && (i<mat.length) && | |
(j >= 0) && (j<mat[0].length)&& |
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 noConsicutiveOnes{ | |
public static int find(String s, int n){ | |
if(s.length() == n){ | |
return 1; | |
} | |
if(s.length() == 0 || s.charAt(s.length()-1) == '0'){ | |
return find(s+"0", n) + find(s+"1",n); | |
} | |
return find(s+"0", n); | |
} |
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 java.util.Scanner; | |
import java.util.LinkedList; | |
class GFG { | |
public static int counter; | |
public static void BFS(int num, int x, int[] a){ | |
LinkedList<Integer> q = new LinkedList<>(); | |
q.add(num); | |
while(q.size()!=0){ | |
int current = q.poll(); |
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 java.util.Scanner; | |
class GFG { | |
public static void main (String[] args) { | |
Scanner in = new Scanner(System.in); | |
int t = in.nextInt(); | |
while(t-->0){ | |
int d = in.nextInt(); | |
int m = in.nextInt(); | |
int y = in.nextInt(); |
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
class GfG{ | |
boolean isLeaf(Node node){ | |
return node.left==null && node.right==null; | |
} | |
boolean isComplete(Node node){ | |
return node.left!=null && node.right!=null; | |
} | |
boolean isEmptyLeftButFullRight(Node node){ | |
return node.left==null && node.right!=null; | |
} |
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 java.util.*; | |
import java.math.*; | |
class GFG { | |
public static BigInteger binomial(int n, int k){ | |
if(n < k){ | |
return new BigInteger("0"); | |
} | |
BigInteger dp[][] = new BigInteger[n+1][n+1]; | |
for(int i=0;i<=n;i++){ |
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
/** | |
* Created by Zeeshan on 3/26/2016. | |
* Last updated by Zeeshan on 02/25/2018. | |
*/ | |
//------------------------------------------------------ | |
//direct upload to GridFS without saving on local disk | |
//Stack: node.js express mongoDB GridFS | |
//Run : node app.js | |
//Web Link=> http://stackoverflow.com/questions/20860005/storing-data-stream-from-post-request-in-gridfs-express-mongodb-node-js |
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 numpy as np | |
T = np.load('datasets/T.npy') | |
for i in range(12): | |
for j in range(4): | |
print (T[i,:,j]) | |
''' | |
[0.9 0.1 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. ] for starting state (1,1) and action Down | |
[0.9 0. 0. 0. 0.1 0. 0. 0. 0. 0. 0. 0. ] for starting state (1,1) and action Left | |
[0.1 0.1 0. 0. 0.8 0. 0. 0. 0. 0. 0. 0. ] for starting state (1,1) and action Up |
OlderNewer