Skip to content

Instantly share code, notes, and snippets.

Srikar Reddy gSrikar

Block or report user

Report or block gSrikar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gSrikar
gSrikar / All Permissions - Honor 9 Lite (8.0)
Last active Nov 28, 2018
Get List of all the permissions on a device using adb command. `adb shell pm list permissions`
View All Permissions - Honor 9 Lite (8.0)
android.permission.REAL_GET_TASKS
android.permission.ACCESS_CACHE_FILESYSTEM
android.permission.REMOTE_AUDIO_PLAYBACK
com.amazon.mp3.permission.UA_DATA
com.huawei.alarm.provider.writePermission
com.google.android.apps.photos.permission.C2D_MESSAGE
android.permission.REGISTER_WINDOW_MANAGER_LISTENERS
android.permission.INTENT_FILTER_VERIFICATION_AGENT
android.permission.BIND_INCALL_SERVICE
android.permission.PROVIDE_RESOLVER_RANKER_SERVICE
@gSrikar
gSrikar / Arithmetic Operations in TensorFlow
Last active Jul 24, 2017
Gist explains how to perform Arithmetic operations in Tensorflow and show it in a computational graph. For more detailed explanation, check out the my blog post https://gsrikar.blogspot.com/2017/07/arithmetic-operations-tensorflow.html
View Arithmetic Operations in TensorFlow
'''
Class performs arithmetic operations on multiple tensors and
shows the Computational graph with the help of Tensorboard.
Uses constants for arithmetic operations
'''
import tensorflow as tf
@gSrikar
gSrikar / Placeholders in TensorFlow
Last active Jul 24, 2017
Placeholders allow us to feed data to the model during the session. To get more detailed information about it, take a look at my blog post at http://gsrikar.blogspot.com/2017/06/tensorflow-how-to-use-placeholders.html
View Placeholders in TensorFlow
'''
Class uses placeholders instead of constants.
'''
import tensorflow as tf
def main():
'''
Main Method
@gSrikar
gSrikar / Tensor Rank and Tensor Shape - Tensorflow
Last active Jun 23, 2017
Tensors with different ranks shapes are created and printed out to the output. Tensor Ranks and Tensor Shapes are explained in detail at http://gsrikar.blogspot.com/2017/06/what-is-tensor-rank-and-tensor-shape.html
View Tensor Rank and Tensor Shape - Tensorflow
'''
Class creates tensors of different ranks and shapes
'''
import tensorflow as tf
def main():
'''
Main method
@gSrikar
gSrikar / Solution to TypeError or ValueError caused by Tensor dtype
Last active Apr 11, 2018
Example that resolves the TypeError: Input 'y' of 'Mul' Op has type float32 that does not match type int32 of argument 'x' or ValueError: Tensor conversion requested dtype int32 for Tensor with dtype float64 in Tensorflow.
View Solution to TypeError or ValueError caused by Tensor dtype
import tensorflow as tf
node1 = tf.constant(5) # dtype is int32
node2 = tf.constant(6.0) # dtype is float32
print('Node 1: ', node1) # Node 1: Tensor("Const:0", shape=(), dtype=int32)
print('Node 2: ', node2) # Node 2: Tensor("Const_1:0", shape=(), dtype=float32)
# Multiplication
# Convert the node1 type to float32 before multiplying
@gSrikar
gSrikar / Update Progress Bar Color Continously
Last active Jun 23, 2017
The gist updates the color of the progress bar every few seconds like Inbox by Gmail app. The detailed explanation can be found in my blog post http://gsrikar.blogspot.com/2017/01/how-to-update-circular-progressbar.html
View Update Progress Bar Color Continously
/**
* The amount of time that has to pass to update the progress bar color
*/
private static final long UPDATE_TIME_IN_MILLIS = 2000;
/**
* List of all the desired colors of the progress bar
*/
private ColorStateList[] colorsList;
@gSrikar
gSrikar / Resources Not Found Exception Example
Last active Jan 16, 2017
This gist shows when a Resources Not Found Exception is thrown especially when implementing CountDownTimer. I've explained about the exception in detail in my blog post http://gsrikar.blogspot.com/2017/01/resources-not-found-exception-in-android.html
View Resources Not Found Exception Example
new CountDownTimer(10000, 1000) {
@Override
public void onTick(long millisUntilFinished) {
Log.i(TAG, "Time in Milli until finished: " + millisUntilFinished);
int remainingTimeInSec = (int) (millisUntilFinished / 1000);
countDownTimeTextView.setText(remainingTimeInSec);
}
@Override
public void onFinish() {
@gSrikar
gSrikar / Solves Resources Not Found Exception
Last active Jan 16, 2017
This gist shows how to solve Resources Not Found Exception especially when implementing CountDownTimer. I've explained about the exception in detail in my blog post http://gsrikar.blogspot.com/2017/01/resources-not-found-exception-in-android.html
View Solves Resources Not Found Exception
new CountDownTimer(10000, 1000) {
@Override
public void onTick(long millisUntilFinished) {
Log.i(TAG, "Time in Milli until finished: " + millisUntilFinished);
int remainingTimeInSec = (int) (millisUntilFinished / 1000);
countDownTimeTextView.setText(String.valueOf(remainingTimeInSec));
}
@Override
public void onFinish() {
You can’t perform that action at this time.