setup variables for commands
echo -e "\n
export image=redroid/redroid:11.0.0-amd64
export image_tar=${HOME}/redroid:11.0.0-amd64" >> ${HOME}/.bashrc
source ${HOME}/.bashrc
echo -e "\n
export image=redroid/redroid:11.0.0-amd64
export image_tar=${HOME}/redroid:11.0.0-amd64" >> ${HOME}/.bashrc
source ${HOME}/.bashrc
import numpy as np | |
import cv2 | |
import torch | |
from torch import nn | |
import math | |
a = np.zeros((100, 100, 3), dtype=np.float32) | |
a[25:75, 25:75] = np.array((1, 1, 1), dtype=np.float32) | |
cv2.imshow('Source', (a*255).astype(np.uint8)) |
import android.os.Bundle | |
import androidx.lifecycle.Lifecycle | |
import androidx.lifecycle.LifecycleRegistry | |
import androidx.savedstate.SavedStateRegistry | |
import androidx.savedstate.SavedStateRegistryController | |
import androidx.savedstate.SavedStateRegistryOwner | |
internal class MyLifecycleOwner : SavedStateRegistryOwner { | |
private var mLifecycleRegistry: LifecycleRegistry = LifecycleRegistry(this) | |
private var mSavedStateRegistryController: SavedStateRegistryController = SavedStateRegistryController.create(this) |
fun triggerRestart(context: Activity) { | |
val intent = Intent(context, MainActivity::class.java) | |
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) | |
context.startActivity(intent) | |
if (context is Activity) { | |
(context as Activity).finish() | |
} | |
Runtime.getRuntime().exit(0) | |
} |
from __future__ import print_function | |
import requests | |
import threading | |
import sys | |
def eprint(*args, **kwargs): | |
print(*args, file=sys.stderr, **kwargs) |
# Maintainer: Chris <christopher.r.mullins g-mail> | |
# Contributor: Andrzej Giniewicz <[email protected]> | |
# Contributor: Thomas Dziedzic < gostrc at gmail > | |
# Contributor: joel schaerer <[email protected]> | |
pkgname=insight-toolkit | |
pkgver=4.13.0 | |
pkgrel=10 | |
pkgdesc='Cross-platform system that provides developers with an extensive suite of software tools for image analysis' | |
arch=('i686' 'x86_64') |
# if input image is in range 0..1, please first multiply img by 255 | |
# assume image is ndarray of shape [height, width, channels] where channels can be 1, 3 or 4 | |
def imshow(img): | |
import cv2 | |
import IPython | |
_,ret = cv2.imencode('.jpg', img) | |
i = IPython.display.Image(data=ret) | |
IPython.display.display(i) |
# /usr/share/BasiliskII/keycodes | |
# | |
# Basilisk II (C) 1997-2005 Christian Bauer | |
# | |
# This file is used to translate the (server-specific) scancodes to | |
# Mac keycodes depending on the window server being used. | |
# | |
# The format of this file is as follows: | |
# | |
# sdl <driver string> |
Updated 4/11/2018
Here's my experience of installing the NVIDIA CUDA kit 9.0 on a fresh install of Ubuntu Desktop 16.04.4 LTS.
Suppose you have weird taste and you absolutely want: