This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//----------------------------------------------------------------------------- | |
// 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 | |
//----------------------------------------------------------------------------- |