Skip to content

Instantly share code, notes, and snippets.

import random
N = 4 # Number of chores
p = 2 # Number of players
preferences = []
for i in range(p):
vs = list(range(N))
random.shuffle(vs)
preferences.append(vs)
www.youtube.com##ytd-watch-next-secondary-results-renderer.style-scope.ytd-watch-flexy
www.youtube.com###comments.ytd-watch-flexy.style-scope
www.youtube.com##ytd-browse.ytd-page-manager.style-scope[page-subtype="home"]
www.youtube.com##ytd-guide-renderer
www.youtube.com##ytd-vertical-channel-section-renderer
@madhadron
madhadron / merge.py
Created February 26, 2021 19:15
Merge a set of commits to track diffs
local_commits = [
{'hash': 11, 'diff': 'a'},
{'hash': 12, 'diff': 'b'},
{'hash': 20},
{'hash': 13, 'diff': 'c'},
{'hash': 14, 'diff': 'd'},
{'hash': 15, 'diff': 'e'},
{'hash': 16},
{'hash': 17},
{'hash': 18},
let v20210301 : Version = [2021, 3, 1]
let tr : Resource = {
path: "databaseAccounts/{accountName}",
resourceKind: ResourceType.Tracked,
previewVersion: v20210301,
properties: {
delegatedManagementSubnetId: {
description: "Subnet to attach NICs to",
type: StringT,
type Mutability = Read | Update | Create
type FieldType =
| Bool
| String
| Int32
| Int64
| Float
| Array of FieldType
| Object of List<Property>
> One issue I see is that you want to have a debate in your terms where the questions make sense if you already have the beliefs you have. Rosen it proposing a perspective that is different.
> <snip>
> These are not the questions that Rosen answers. He is concerned with science and examining the assumptions of physics to find ways to broaden its application to biology. His main goal was to understand what life is. That lead to fundamental work on problems in modern science. But he is first and foremost a scientist not a philosopher.
> The first step, as I see it, is to understand the current limitations of the modern scientific paradigm. Before worrying about whether Rosen provides a "better" alternative. Even if he only shows the problems it is of huge value. But he does much more.
I've only spent four or five hours digging into Rosen's work and that of his students, and I have to say that I found nothing that would encourage me to go further. I originally trained as a theoretical physicist, and then retrai
import sets
import tables
type
Direction = enum E, W, NE, NW, SE, SW
Point = tuple[q, r: int]
proc go(p: Point, d: Direction): Point =
var (q, r) = p
return case d
const N = 1_000_000
type ArrayRing = ref object
ring: array[1..N, int]
head: int
proc toHashRing(xs: openArray[int]): ArrayRing =
var hr: ArrayRing
new(hr)
var last = xs[0]
import tables
import streams
import strutils
import parseutils
const N: int = 12
type Tile = array[0..9, array[0..9, bool]]
type Offset = tuple[x, y: int]
type TileSide = enum TTop, TLeft, TRight, TBottom
import strutils
type ParseState = seq[tuple[this, remaining: string]]
type Parser = proc(s: string): ParseState
proc literal(m: string): Parser =
return proc(s: string): ParseState =
if s.startsWith(m):
return @[(m, substr(s, len(m)))]
else: