Skip to content

Instantly share code, notes, and snippets.

// Load fonts
require("Font7x11Numeric7Seg").add(Graphics);
// position on screen
const X = 160, Y = 140;
function draw() {
//g.setBgColor(0x33FF77);
//setColor("#0000FF")
g.setBgColor("#00FF00");
g.setColor("#00FF00");
// Load fonts
require("Font7x11Numeric7Seg").add(Graphics);
// position on screen
const X = 160, Y = 140;
function draw() {
var bgColor = "#9933FF";
var fontColor = "#7300E6";
g.setBgColor(bgColor);
g.setColor(bgColor);
@daj
daj / rundeepraceronmac.md
Last active September 22, 2022 04:17 — forked from joezen777/rundeepraceronmac.md
How to run DeepRacer locally on Mac

I took all my instructions from this page.  https://github.com/crr0004/deepracer

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 https://github.com/crr0004/deepracer.git
  3. brew install minio/stable/minio -- you may need to install brew first -- /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  4. install vncviewer from here https://www.realvnc.com/download/file/viewer.files/VNC-Viewer-6.19.325-MacOSX-x86_64.dmg
@daj
daj / build_all_architectures.sh
Last active April 25, 2018 01:26
Build all architectures of libtensorflow_inference.so required for use on Android, using selective registration https://medium.com/@daj/how-to-shrink-the-tensorflow-android-inference-library-cb698facf758
# 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/android:libtensorflow_inference.so --host_crosstool_top=@bazel_tools//tools/cpp:toolchain --crosstool_top=//external:android/crosstool --verbose_failures --cpu=armeabi-v7a
cp bazel-bin/tensorflow/contrib/android/libtensorflow_inference.so /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/android:libtensorflow_inference.so --host_crosstool_top=@bazel_tools//tools/cpp:toolchain --crosstool_top=//external:android/crosstool --verbose_failures --cpu=arm64-v8a
cp bazel-bin/tensorflow/contrib/android/libtensorflow_inference.so /tf_files/arm64-v8a
@daj
daj / ops_to_register.h
Created October 7, 2017 22:59
Example ops_to_register.h file for the TensorFlow model in the AndroidTensorFlowMNISTExample (https://github.com/daj/AndroidTensorFlowMNISTExample/commit/6e1b15ff6d3182be0e665c0456f356ffc2f62514)
// This file was autogenerated by print_selective_registration_header.py
#ifndef OPS_TO_REGISTER
#define OPS_TO_REGISTER
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
daj / WORKSPACE
Last active February 21, 2017 01:58
WORKSPACE configuration for building TensorFlow Android demo in a Docker container
# My example WORKSPACE configuration, based on following the instructions in the TensorFlow README:
# https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/android/README.md#edit-workspace
# The lines below have already been uncommented
android_sdk_repository(
name = "androidsdk",
api_level = 23,
build_tools_version = "25.0.2",
path = "/android",
)
@daj
daj / tensorflow_hello_world.sh
Last active August 1, 2018 22:51
Check Python can import TensorFlow dependencies
# This script assumes you are running from Terminal / command line
python
import tensorflow as tf
hello = tf.constant('Hello from TensorFlow. Everything seems to be working!')
sess = tf.Session()
print(sess.run(hello))
exit()
@daj
daj / JobManagerIdlingResource.java
Last active August 29, 2015 14:22
Example IdlingResource for use with the JobManager in https://github.com/yigit/android-priority-jobqueue
/**
* 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:
* https://github.com/path/android-priority-jobqueue/issues/49#issuecomment-45583487
*/
public class JobManagerIdlingResource implements IdlingResource {
private static final String TAG = "JobManagerIdlingResource";
@daj
daj / BaseStatelessBlackBoxEspressoTest.java
Last active December 20, 2018 09:44 — 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: https://code.google.com/p/android-test-kit/wiki/DisablingAnimations
public abstract class BaseStatelessBlackBoxEspressoTest<T extends Activity> extends ActivityInstrumentationTestCase2<T> {
private SystemAnimations mSystemAnimations;
public BaseStatelessBlackBoxEspressoTest(Class clazz) {
super(clazz);
}
@Override
protected void setUp() throws Exception {