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
// ==UserScript== | |
// @name gov.uk - paste travel dates | |
// @description Paste travel data from a spreadsheet into the gov.uk citizenship application pages. Make a four column spreadsheet with departure date (DD/MM/YYYY), return date, country and reason, then copy and paste the the first row into the page. The script will automatically submit the form and then return to it, ready for the next row. Disable the userscript when done adding additional trips. | |
// @match https://visas-immigration.service.gov.uk/* | |
// @version 1 | |
// @grant none | |
// @run-at document-end | |
// ==/UserScript== | |
function fillDate(date, prefix) { |
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 math | |
#start with population of size 10k | |
N_AF = 10000 | |
#when we split this into five, we should have initial size before growth of N/5 in each | |
N_EU0 = N_AF / 5 | |
#the five populations merged into the ancestral population 100 generations ago | |
T_merge = 100 | |
#assume growth rate of 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
popA = 1 | |
popB = 2 | |
samplesA = [sample for sample in tree_sequence.get_samples() if tree_sequence.get_population(sample) == popA] | |
samplesB = [sample for sample in tree_sequence.get_samples() if tree_sequence.get_population(sample) == popB] | |
piA = tree_sequence.get_pairwise_diversity(samples = samplesA) | |
piB = tree_sequence.get_pairwise_diversity(samples = samplesB) | |
piAB = tree_sequence.get_pairwise_diversity(samples = samplesA + samplesB) | |
print(piA, piB, piAB) | |
#56465.569079715795 56413.38735640868 57020.29606185412 |
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
#include <netdb.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <errno.h> | |
#define CANARY "in_the_coal_mine" | |
struct { | |
char buffer[1024]; |