This file contains hidden or 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 itertools import izip | |
def decompose(b, n): | |
k = 0 | |
while n: | |
r = n % b | |
q = (n-r)/b | |
yield (r, k) | |
k += 1 | |
n = q |
This file contains hidden or 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
<<< optimiser debug gibberish >>> | |
0000044880 ACCEPT 105 --> 104 (('grow', frozenset({1, 2, 14, 18, 26, 27}), 13)) | |
{frozenset({33, 3, 6, 7, 8, 9, 10, 11, 19, 29}), frozenset({1, 2, 18, 26, 27, 13, 14}), frozenset({1, 2, 3, 12, 13, 20, 22, 23}), frozenset({16, 17, 21, 24, 25, 31}), frozenset({5, 15, 28, 29, 30}), frozenset({32, 17, 18, 4, 15})} | |
transation: on iteration 44880 i accepted the proposed move from a state with loss 105 to a new state with loss 104 via the move (('grow', frozenset({1, 2, 14, 18, 26, 27}), 13)) resulting in a new state containing the groups | |
{frozenset({33, 3, 6, 7, 8, 9, 10, 11, 19, 29}), frozenset({1, 2, 18, 26, 27, 13, 14}), frozenset({1, 2, 3, 12, 13, 20, 22, 23}), frozenset({16, 17, 21, 24, 25, 31}), frozenset({5, 15, 28, 29, 30}), frozenset({32, 17, 18, 4, 15})} | |
<<< results >>> |
This file contains hidden or 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
#! /bin/bash | |
set -x -e | |
# In the beginning there was nothing, just hopes, dreams, | |
# a modest development budget. | |
mkdir -p demo | |
cd demo | |
git init . |
This file contains hidden or 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
// 2020/09/01 - this code is placed in the public domain. | |
// | |
// This is a hypothetical refactor of state machine code from | |
// ivanilves's fun self-opening trash can project. | |
// | |
// Ref: https://github.com/ivanilves/arduino-sketches/blob/d0e965ebae1b98fa23b833fed2e2e28b21ef8863/basurito/basurito.ino | |
// | |
// The code below is incomplete, has not been tested and will not work! it's a sketch of an idea. | |
// | |
// Rough principles of this refactor: |
OlderNewer