Skip to content

Instantly share code, notes, and snippets.

View premithk's full-sized avatar
🏠
Working from home

Premith premithk

🏠
Working from home
View GitHub Profile
import random
import numpy as np
TRIALS = 100000
URN_A = 'red', 'red', 'red' , 'red' , 'black', 'black', 'black'
URN_B = 'red', 'red', 'red' , 'red' , 'red', 'black', 'black', 'black', 'black'
URN_C = 'red', 'red', 'red' , 'red' , 'black', 'black', 'black', 'black'
success = 0
for i in range(TRIALS):

Keybase proof

I hereby claim:

  • I am premithk on github.
  • I am premith (https://keybase.io/premith) on keybase.
  • I have a public key ASCq3JgytZe9rohk3HjfOqkkUGzShdYROk0rjAFTx-ajjgo

To claim this, I am signing this object:

MSBuild /t:Install ProjectName.csproj /p:AdbTarget=-e
const factorial = n => (n === 0 ? 1 : n * factorial(n - 1));
const factorial_iter = n => fact_iter(1, 1, n);
const fact_iter = (product, counter, max) => {
return counter > max
? product
: fact_iter(counter * product, counter + 1, max);
};
const map_recursive = (map_function, array) =>
!array.length
? []
: [map_function(array[0])].concat(
map_recursive(map_function, array.slice(1))
);
map_recursive(x=>x+1, [1,2,3,4])
@premithk
premithk / FireBaseRequestHandler.java
Created January 21, 2017 16:02
A request handler for picasso that will handle firebase storage location like this gs://appname.appspot.com/Images/1.JPG
/**
* Created by premith on 21/01/17.
*/
import android.graphics.BitmapFactory;
import android.util.Log;
import com.google.android.gms.tasks.Tasks;
import com.google.firebase.storage.FirebaseStorage;