Core: Full Name & Definition
What, Why, How, When, Example
3 Dimensions
Vertical: Parent, Children
import machine | |
import time | |
import math | |
from engine import Engine | |
from joystick import Joystick | |
# Initialize the joystick | |
joystick = Joystick(x_pin=3, y_pin=2, switch_pin=1) | |
# Angle limit for the servos |
import machine | |
import time | |
from engine import Engine | |
from joystick import Joystick | |
# Define pins | |
led_pin = 1 | |
eyelid_angle_limit = 70 | |
# Create objects |
Core: Full Name & Definition
What, Why, How, When, Example
3 Dimensions
Vertical: Parent, Children
# Put this in your ~/.zshrc please | |
# To set node version by folder | |
# run: echo "v8.5.0" > .nvmrc | |
autoload -U add-zsh-hook | |
load-nvmrc() { | |
local node_version="$(nvm version)" | |
local nvmrc_path="$(nvm_find_nvmrc)" |
# Put this in your ~/.bashrc please | |
# To set node version by folder | |
# run: echo "v8.5.0" > .nvmrc | |
nvm_echo() { | |
command printf %s\\n "$*" 2>/dev/null | |
} | |
# Traverse up in directory tree to find containing folder |
function clickable(node) { | |
if ( | |
node.offsetHeight < 5 || | |
node.offsetWidth < 5 | |
) { | |
return false | |
} | |
const rect = node.getBoundingClientRect() | |
const inViewPort = !( |
const Koa = require('koa'); | |
const app = new Koa(); | |
app.use(async ctx => { | |
const s = eval(ctx.request.query.s) | |
const r = eval(s)() | |
ctx.response.body = r | |
}); | |
app.listen(3003); |
% Practice #1 | |
% Write a computer program capable of reducing the number of intensity levels in an image from 256 to 2, in integer powers of 2. The desired number of intensity levels needs to be a variable input to your program. Display Variable Values Create a variable with numbers and another variable with text. | |
size = '128'; | |
a = imread(['https://avatars3.githubusercontent.com/u/7521814?s=' size]); | |
imshow(a); | |
test(rgb2gray(a)); | |
test(a); | |
function y = im_downgrade(img, intensity_levels) |
/* | |
Autopilot System | |
Flow | |
Condition > Behavior | |
Auto | |
Detect > Suggest > [Wait] | |
Switch > |
test(); | |
function check(bool) { | |
console.log(bool ? 'pass' : 'failed') | |
} | |
function test() { | |
check(autoTypingZHDate("201") === "201"); | |
check(autoTypingZHDate("2018") === "2018年"); | |