Skip to content

Instantly share code, notes, and snippets.


Dan Jarvis daj

View GitHub Profile
daj /
Last active Aug 29, 2015
Example IdlingResource for use with the JobManager in
* Used by Espresso tests to tell when it should wait because some background work needs to be done.
* Based on advice from the priority-job-manager maintainer:
public class JobManagerIdlingResource implements IdlingResource {
private static final String TAG = "JobManagerIdlingResource";
Last active Feb 21, 2017
WORKSPACE configuration for building TensorFlow Android demo in a Docker container
# My example WORKSPACE configuration, based on following the instructions in the TensorFlow README:
# The lines below have already been uncommented
name = "androidsdk",
api_level = 23,
build_tools_version = "25.0.2",
path = "/android",
daj /
Last active Apr 25, 2018
Build all architectures of required for use on Android, using selective registration
# This script assumes your /tensorflow/core/framework/ops_to_register.h file is already in place
mkdir /tf_files/armeabi-v7a
bazel build --local_resources 4096,4.0,1.0 -j 1 -c opt --copt="-DSELECTIVE_REGISTRATION" --copt="-DSUPPORT_SELECTIVE_REGISTRATION" //tensorflow/contrib/ --host_crosstool_top=@bazel_tools//tools/cpp:toolchain --crosstool_top=//external:android/crosstool --verbose_failures --cpu=armeabi-v7a
cp bazel-bin/tensorflow/contrib/android/ /tf_files/armeabi-v7a
mkdir /tf_files/arm64-v8a
bazel build --local_resources 4096,4.0,1.0 -j 1 -c opt --copt="-DSELECTIVE_REGISTRATION" --copt="-DSUPPORT_SELECTIVE_REGISTRATION" //tensorflow/contrib/ --host_crosstool_top=@bazel_tools//tools/cpp:toolchain --crosstool_top=//external:android/crosstool --verbose_failures --cpu=arm64-v8a
cp bazel-bin/tensorflow/contrib/android/ /tf_files/arm64-v8a
daj /
Last active Aug 1, 2018
Check Python can import TensorFlow dependencies
# This script assumes you are running from Terminal / command line
import tensorflow as tf
hello = tf.constant('Hello from TensorFlow. Everything seems to be working!')
sess = tf.Session()
daj / ops_to_register.h
Created Oct 7, 2017
Example ops_to_register.h file for the TensorFlow model in the AndroidTensorFlowMNISTExample (
View ops_to_register.h
// This file was autogenerated by
namespace {
constexpr const char* skip(const char* x) {
return (*x) ? (*x == ' ' ? skip(x + 1) : x) : x;
constexpr bool isequal(const char* x, const char* y) {
daj /
Last active Dec 20, 2018 — forked from xrigau/AndroidManifest.xml
The set of changes required to disable animations any time Espresso tests run. These instructions will only work on emulators and on rooted devices. This is based on the instructions in:
public abstract class BaseStatelessBlackBoxEspressoTest<T extends Activity> extends ActivityInstrumentationTestCase2<T> {
private SystemAnimations mSystemAnimations;
public BaseStatelessBlackBoxEspressoTest(Class clazz) {
protected void setUp() throws Exception {
daj /
Last active Sep 25, 2021 — forked from joezen777/
How to run DeepRacer locally on Mac

I took all my instructions from this page.

Here are the revised instructions for OSX (bold is console command)

  1. Change to a folder in terminal that is not case-sensitive. ~/ should be fine
  2. git clone --recurse-submodules
  3. brew install minio/stable/minio -- you may need to install brew first -- /usr/bin/ruby -e "$(curl -fsSL"
  4. install vncviewer from here