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
#!/usr/bin/python3 | |
class Graph(): | |
def __init__(self, edge_list): | |
self.E = set(edge_list) | |
self.V = range(self._n_vertices()) | |
def _n_vertices(self): | |
max = 0 | |
for edge in self.E: |
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
#!/usr/bin/perl | |
# | |
# 14 October 2017 | |
# Author: Mark Jason Dominus | |
# | |
# This program is in the public domain. | |
# You may use, modify, copy, or distribute it | |
# in any way for any purpose, without restriction. | |
# |
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
data Branch = Branch { branch_length :: Int, branch_structure :: Mobile } deriving Show | |
data Mobile = Weight Int | Mobile { left_branch :: Branch, right_branch :: Branch } deriving Show | |
total_branch_weight (Branch { branch_structure = str }) = total_weight str | |
total_weight (Weight wt) = wt | |
total_weight (Mobile lt rt) = | |
(total_branch_weight lt) + (total_branch_weight rt) | |
-- Verbose constructor syntax |
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 -e | |
# Send a private message to someone on slack | |
# from the command line. | |
# Print a usage message and exit. | |
usage(){ | |
local name=$(basename "$0") |
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 qualified Data.Map as Map | |
newtype NestedMap k = NestedMap (Map.Map k (NestedMap k)) | |
instance (Show k) => Show (NestedMap k) | |
where | |
show (NestedMap m) = | |
if (Map.null m) | |
then "{}" | |
else listToString | |
(\e -> "{ " ++ e ++ ", ") |
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
1729: 1 12; 9 10 | |
4104: 2 16; 9 15 | |
13832: 2 24; 18 20 | |
20683: 10 27; 19 24 | |
32832: 4 32; 18 30 | |
39312: 2 34; 15 33 | |
40033: 9 34; 16 33 | |
46683: 3 36; 27 30 | |
64232: 17 39; 26 36 | |
65728: 12 40; 31 33 |
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
[ 0.000000] Initializing cgroup subsys cpuset | |
[ 0.000000] Initializing cgroup subsys cpu | |
[ 0.000000] Initializing cgroup subsys cpuacct | |
[ 0.000000] Linux version 3.13.0-32-generic (buildd@kissel) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 (Ubuntu 3.13.0-32.57-generic 3.13.11.4) | |
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.13.0-32-generic.efi.signed root=UUID=955da1a0-707a-4705-be99-02b2551d91c8 ro quiet splash vt.handoff=7 | |
[ 0.000000] KERNEL supported cpus: | |
[ 0.000000] Intel GenuineIntel | |
[ 0.000000] AMD AuthenticAMD | |
[ 0.000000] Centaur CentaurHauls | |
[ 0.000000] e820: BIOS-provided physical RAM map: |
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
56. Ford and Aboodowieh arrange for persons employed by MWDC, whose identity is known to Ford and Aboodowieh but not known to the | |
plaintiff, to facilitate the exposure of the plaintiff to Petros, and to facilitate the attack on the plaintiff on March 23, 2012, | |
and more particularly, to arrange for the plaintiff's detention in range 1B, and to ensure that there was no supervision or | |
surveillance of the area where the plaintiff was assaulted. | |
(A followup tweet adds “MWDC is Metro West Detention Centre”.) |
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
starting | |
defined giant structure | |
Use of uninitialized value in concatenation (.) or string at (null) line 465. | |
Use of uninitialized value in concatenation (.) or string at (null) line 465. | |
YAML Error: Error in require YAML::Dumper - Can't find 'boot___B' symbol in /vol/home/mjd/.plenv/versions/5.18.2/lib/perl5/5.18.2/x86_64-linux/auto//B/B.so | |
at line . | |
BEGIN failed--compilation aborted at (null) line 28. | |
Compilation failed in require at (null) line 22. | |
BEGIN failed--compilation aborted at (null) line 22. | |
Compilation failed in require at (null) line 132. |
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
#!/usr/bin/perl | |
use Test::More; | |
# Binomial coefficients | |
sub choose { | |
my ($n, $k) = @_; | |
return 0 if $k > $n; | |
my $r = 1; |
NewerOlder