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
/* | |
This class converts any Layout or View to image and saves in Phone. | |
In one of my projects, I had a requirement of saving whatever is being displayed on the Screen as an image. | |
I created a class for it so that in future it becomes easy to reuse. | |
Usage Example | |
----------------------------------------------------------------------------------------------------------- | |
FrameLayout mLin_FramePreview1 = (FrameLayout)findViewById(R.id.lin_FramePreview1); | |
ViewToImage v = new ViewToImage(mLin_FramePreview1); |
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
/* | |
OkHttp class for making REST calls. | |
Here the method is POST, you can change it to GET in 'request' below | |
*/ | |
public class ResponseOKhttp | |
{ | |
OkHttpClient client = new OkHttpClient(); |
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
/** | |
The Runtime permissions helper class | |
**/ | |
public class RuntimePermissions { | |
private Context mContext; | |
private String[] permissions; | |
public RuntimePermissions(String[] permissions, Context context){ |
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. Coroutines in Kotlin - | |
/* Coroutines in Kotlin is the simplest way to do asynchronous tasks which we do in asynctask or using multiple threads | |
in RxJava. | |
*/ | |
2(a). Calling a method of Activity inside Fragment - | |
// i. define mContext like 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
class DummyViewModel : ViewModel() { | |
var data : MutableLiveData<String> = MutableLiveData() | |
internal fun setData(some_value : String){ | |
data.value = some_value | |
} | |
} | |
------------------------------------------------------------------------------------------------------------------------ |
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.io.IOException; | |
import java.lang.reflect.Constructor; | |
import java.lang.reflect.Field; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
import android.graphics.Bitmap; | |
import android.graphics.Matrix; | |
import android.os.Build; |
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. BINARY SEARCH | |
public class BinarySearch { | |
int number_to_find; | |
public BinarySearch(Integer[] arr, int number_to_find){ | |
this.number_to_find = number_to_find; | |
int start_pos = 0; | |
int last_pos = arr.length-1; | |
BinarySearch(arr, start_pos, last_pos); |
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. Learning Rate - https://www.youtube.com/watch?time_continue=179&v=lif_qPmXvWA | |
2. Perceptron - The model of neural network that we have having neurons connected to each other with input and output | |
3. Why do we need bias in deep learning - | |
Bias is like the intercept added in a linear equation. It is an additional parameter in the Neural Network which is used to adjust the output along with the weighted sum of the inputs to the neuron. Therefore Bias is a constant which helps the model in a way that it can fit best for the given data. | |
y = wx + b |
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.asutosh.trials | |
import `in`.novopay.los.ui.offlinekyc.WebViewActivity | |
import android.app.PendingIntent | |
import android.content.Context | |
import android.content.Intent | |
import android.content.pm.PackageManager | |
import android.net.Uri | |
import android.text.TextUtils | |
import android.widget.RemoteViews |
OlderNewer