Skip to content

Instantly share code, notes, and snippets.

View Kaushal28's full-sized avatar
🎯
Focusing

Kaushal Shah Kaushal28

🎯
Focusing
  • Juniper Networks
  • Bangalore
View GitHub Profile
@Kaushal28
Kaushal28 / Main2Activity.java
Last active August 30, 2016 13:11
This is my activity from where the place picker activity is called on button click. (Main2Activity)
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;
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;
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)&&
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);
}
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();
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();
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;
}
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++){
/**
* 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
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