Skip to content

Instantly share code, notes, and snippets.

@aewhite
aewhite / example.py
Created January 8, 2022 14:03
Inverse of extract Image Patches for TF 2.x
# Solution based on https://stackoverflow.com/a/51785735/278836
import tensorflow as tf
def extract_patches(images):
return tf.image.extract_patches(
images,
(1, 3, 3, 1),
(1, 1, 1, 1),
(1, 1, 1, 1),
padding="VALID")
from microbit import *
import random
def buildPattern(length):
formatString = '{0:0' + str(length) + 'b}'
binaryString = formatString.format(random.getrandbits(length))
letterPattern = ['A' if char == '0' else 'B' for char in binaryString]
return letterPattern
patternLength = random.randint(3, 5)
@aewhite
aewhite / GALV_DiagonalMovement.js
Created May 17, 2016 21:17
Modified GALV_DiagonalMovement plugin to prefer diagonal movement for stairs via magical region ids
//-----------------------------------------------------------------------------
// Galv's Diagonal Movement
//-----------------------------------------------------------------------------
// For: RPGMAKER MV
// GALV_DiagonalMovement.js
//-----------------------------------------------------------------------------
// 2016-05-17 - Version 1.1(AWhite) - added ability to force diagonal moves
// 2016-02-04 - Version 1.1 - added option to slow diagonal move speed
// 2015-12-12 - Version 1.0 - release
//-----------------------------------------------------------------------------