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
var addBinary = function(a, b) { | |
let binaryStringA = a.split('').reverse() | |
let binaryStringB = b.split('').reverse() | |
let valA = 0n | |
for (let i = 0n; i < binaryStringA.length; i++) { | |
if (binaryStringA[i] == 1) valA += 2n ** i | |
} | |
let valB = 0n |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import { py, python, PyClass } from "JSPyBridge" | |
const tf = await python('tensorflow') | |
class KerasCallback extends PyClass { | |
constructor() { | |
super(tf.keras.callbacks.Callback()) | |
} | |
on_epoch_end(epoch, logs) { | |
if (logs.loss < 0.4) { |
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
import { python } from 'JSPyBridge' | |
const tk = await python('tkinter') | |
let expression = '' | |
let equation | |
async function press(num) { | |
if (num === '=') { | |
try { | |
console.info('Evaluating:', expression) |
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 JSPyBridge import require, On | |
mineflayer = require('mineflayer') | |
pathfinder = require('mineflayer-pathfinder') | |
RANGE_GOAL = 1 | |
BOT_USERNAME = 'python' | |
bot = mineflayer.createBot({ | |
'host': '127.0.0.1', | |
'port': 25565, |
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
[ | |
{ | |
"inp": [ | |
"339,-1", | |
"345,-1" | |
], | |
"id": 0, | |
"out": "395,2" | |
}, | |
{ |
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
{ | |
"potion_container_change": [ | |
{ | |
"ingredient": { | |
"id": 289 | |
}, | |
"input_item_id": 373, | |
"output_item_id": 438 | |
}, | |
{ |
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
>python java113convgen.py | |
no blockstate for minecraft:air | |
$ minecraft:air => None | |
$ minecraft:stone[variant=stone] => minecraft:stone | |
$ minecraft:stone[variant=granite] => minecraft:granite | |
$ minecraft:stone[variant=smooth_granite] => minecraft:polished_granite | |
$ minecraft:stone[variant=diorite] => minecraft:diorite | |
$ minecraft:stone[variant=smooth_diorite] => minecraft:polished_diorite | |
$ minecraft:stone[variant=andesite] => minecraft:andesite | |
$ minecraft:stone[variant=smooth_andesite] => minecraft:polished_andesite |
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
template <unsigned int NBitsPerBlock, typename Word = unsigned int> | |
struct PalettedBlockStateStorage { | |
static const int wordByteSize = sizeof(Word)/*4*/; | |
static const int wordBitSize = wordByteSize * 8; | |
static const byte blocksPerWord = NAIVE_FLOOR(wordBitSize / NBitsPerBlock); | |
static const byte paddingPerWord = wordBitSize % NBitsPerBlock; | |
static const int wordsCount = NAIVE_CEIL(4096.0 / blocksPerWord); |
NewerOlder