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
// 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: |
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
#! /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 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 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 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
<?xml version="1.0" encoding="utf-8" standalone="no"?> | |
<!--This file represents the results of running a test suite--> | |
<!--example comment--> | |
<!--another example comments. TFS VSO is a wonderful and intuitive test collection and reporting tool. --> | |
<test-results name="C:\Program Files\NUnit 2.6\bin\tests\mock-assembly.dll" total="2" errors="0" failures="1" not-run="0" inconclusive="0" ignored="0" skipped="0" invalid="0" date="2015-10-07" time="11:22:00"> | |
<environment nunit-version="" clr-version="" os-version="Microsoft Windows NT 6.1.7600.0" platform="Any CPU" cwd="C:\Program Files\NUnit 2.6\bin" machine-name="CHARLIE-LAPTOP" user="charlie" user-domain="charlie-laptop" /> | |
<culture-info current-culture="en-US" current-uiculture="en-US" /> | |
<test-suite type="Assembly" name="FOO" executed="True" result="Failure" success="False" time="0.094" asserts="0"> | |
<results> | |
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
""" | |
a stupid population model | |
Simplifying assumptions: | |
assume everyone in each country behaves the same | |
everyone lives until their birth life expectancy | |
everyone has same number of kids [1] | |
uniform life expectancy (take geom average men and women) [2m 2f] | |
everyone pair-bonds into a couple and has kids |
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
# HG changeset patch | |
# User Reuben Fletcher-Costin <[email protected]> | |
# Date 1409866198 -36000 | |
# Fri Sep 05 07:29:58 2014 +1000 | |
# Branch windows_support | |
# Node ID 88290ca7505a15b8f4a1fe1a4f94fafebd747d8e | |
# Parent 9051b4b72737edcd7b483716471c070c917c5fde | |
windows_support - use setuptools console_scripts entry point; combine wake.py and vulture into vulture.py | |
diff --git a/ez_setup.py b/ez_setup.py |
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
this is the way to go: | |
https://wiki.debian.org/skype | |
it Just Worked. | |
to enable your mic, open `mate-volume-control` and ensure the input device is unmuted... | |
this is also interesting: it gives you a way to meddle with webcam brightness / contrast / sharpening filters: |
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 numpy | |
import py.test | |
MIN_SIZE = 2 # you cant have an unsorted array of size 1 ! | |
MAX_SIZE = 1000 | |
def is_sorted(a): | |
sa = numpy.sort(a) | |
return numpy.all(sa == a) |
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
// goal: typeDefinitions = {"FIDO" : {864 : ["SUPER_864"]}, "SPOT" : {432 : ["LUCKY_SPOT_432"], 576 : ["MERRY_SPOT_576"]}} | |
// works with g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 | |
// | |
// g++ -Wall -Werror -pedantic -Wconversion --std=c++0x % && ./a.out | |
#include <vector> | |
#include <map> | |
#include <tuple> | |
#include <utility> |
NewerOlder