Get current ativity:
dumpsys activity activities | grep mResumedActivity
Uninstall app example:
pm uninstall -k --user 0 com.aura.oobe.samsung.gl
Restore removed app example:
pm install-existing com.aura.oobe.samsung.gl
#!/usr/bin/env python3 | |
from pathlib import Path | |
import os | |
import sys | |
from subprocess import Popen, PIPE, getoutput | |
from shlex import split | |
from contextlib import redirect_stdout | |
import argparse |
#!/usr/bin/env python3 | |
from argparse import ArgumentParser | |
from functools import partial | |
from shutil import copy | |
from subprocess import Popen, PIPE | |
from shlex import split | |
import os | |
import re | |
import atexit |
from pathlib import Path | |
import logging | |
import sys | |
def set_logger(error_file: Path, info_file: Path): | |
error_file = Path(error_file).expanduser().resolve() | |
error_file.parent.mkdir(exist_ok=True, parents=True) | |
info_file = Path(info_file).expanduser().resolve() | |
info_file.parent.mkdir(exist_ok=True, parents=True) |
[includeIf "gitdir:~/Projects/work/"] | |
path = .gitconfig_job | |
[includeIf "gitdir:~/Projects/personal/"] | |
path = .gitconfig_personal | |
[filter "lfs"] | |
clean = git-lfs clean -- %f | |
smudge = git-lfs smudge -- %f | |
process = git-lfs filter-process |
type ~/.ssh/id_rsa.pub | ssh USER@HOST "mkdir -p ~/.ssh && LANG=C sed 's/[\d128-\d255]//g' >> ~/.ssh/authorized_keys && chmod 0600 ~/.ssh/authorized_keys" |
# FLASK Webapp for Image Segmentation Model | |
import os, sys, io | |
sys.path.append(".") | |
import webapp | |
from flask import Flask | |
import flask | |
import numpy as np | |
import pandas as pd |
from dataclasses import dataclass, fields as datafields | |
from ujson import dumps, loads | |
# Note: ujson seamlessly serializes dataclasses, unlike stdlib's json | |
@dataclass | |
class Point: | |
x: float | |
y: float | |
# Shallow dataclass can be rebuilt from dict/json: |
from keras import layers | |
def residual_block(y, nb_channels, _strides=(1, 1), _project_shortcut=False): | |
shortcut = y | |
# down-sampling is performed with a stride of 2 | |
y = layers.Conv2D(nb_channels, kernel_size=(3, 3), strides=_strides, padding='same')(y) | |
y = layers.BatchNormalization()(y) | |
y = layers.LeakyReLU()(y) |
The tutorial Use OpenCL in Android camera preview based CV application show us how we can use the Transparent API to dramatically increase the performance of some expensive operations.
The first step in order to be able to execute the tutorial example is to re-compile opencv with the correct flags:
# Export your NDK, it will be looked for OpenCV to compile your project. In my case
export ANDROID_NDK=~/graffter/libs/android-ndk-r10d/
# Download the necessary code