Skip to content

Instantly share code, notes, and snippets.

This is a dialog between a writer named Alex and his wise, helpful friend Taylor who is giving him advice on his work. Taylor is very perceptive, and gives detailed and thoughtful feedback on the details of what Alex has written.
Alex: Hi Taylor, could you please give me some detailed feedback on this poem I've written?
Taylor: Sure thing, I'd love to help. Can you show me the poem?
Alex: Here is the poem.
import random
p_friend_infected = 0.1
q_friend_transmission = 0.1
s_spouse_transmission = 0.3
DRAWS = 10000000
same_friend = {0: 0,
1: 0,
import scipy.stats
import math
# From He et al https://www.nature.com/articles/s41591-020-0869-5#MOESM1
# Infection-to-symptom-onset (incubation period) is log-normal distributed with
incubation_period = scipy.stats.lognorm(0.6612, scale=math.exp(1.434065))
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(incubation_period.ppf(0.001), incubation_period.ppf(0.999), 100)
# CAR (Case Ascertainment Ratio) hand-entered by CO from https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7239078/bin/NIHPP2020.04.29.20083485-supplement-1.pdf
# PTR (Positive Test Rate) hand-entered by CO from https://covidactnow.org/?s=830154
CAR_and_PTR = {
'AK': [0.18, 0.032],
'AR': [0.13, 0.071],
'AZ': [0.09, 0.115],
'DE': [0.09, 0.179],
'HI': [0.13, 0.019],
'IA': [0.08, 0.129],
@catherio
catherio / keybase.md
Last active April 5, 2019 03:46
keybase.md

Keybase proof

I hereby claim:

  • I am catherio on github.
  • I am catherio (https://keybase.io/catherio) on keybase.
  • I have a public key ASDFN1yEDxzbTXEyVQK3b-kmGji5CEdbplXXAmWPTmPuggo

To claim this, I am signing this object:

{"version": 1, "_debug_version": "0.0.1"}
{"timestamp": 1483257603.6930635, "from_rewarder": true, "message": {"method": "v0.env.describe", "body": {"env_state":
"running", "env_id": "wob.mini.DragBox-v0", "fps": 8}, "headers": {"message_id": 0, "sent_at": 1483257623.692235,
"episode_id": "2"}}}
{"timestamp": 1483257603.7219646, "from_rewarder": false, "message": {"method": "v0.control.ping", "body": {},
"headers": {"message_id": 0, "sent_at": 1483257603.7219946}}}
{"timestamp": 1483257603.7240255, "from_rewarder": true, "message": {"method": "v0.reply.control.ping", "body": {},
"headers": {"message_id": 1, "sent_at": 1483257623.724698, "parent_message_id": 0}}}
{"timestamp": 1483257603.7253041, "from_rewarder": false, "message": {"method": "v0.control.ping", "body": {},
"headers": {"message_id": 1, "sent_at": 1483257603.725811}}}
@catherio
catherio / gist:af700fc7d7f1011c228eec4793817276
Created January 25, 2017 00:40
Example session (search for "XYZ")
vnc_recorder] [2017-01-01 08:00:55,959] [0] Connection received from VNC client
[tigervnc]
[tigervnc] Wed Jan 25 00:35:42 2017
[tigervnc] Connections: accepted: 127.0.0.1::52168
[tigervnc] SConnection: Client needs protocol version 3.3
[tigervnc] VNCSConnST: Server default pixel format depth 24 (32bpp) little-endian rgb888
[vnc_recorder] [2017-01-01 08:00:55,967] [0-client] Marking server as connected
[vnc_recorder] [2017-01-01 08:00:58,468] [vnc_proxy] logfile_dir = /tmp/demo/1483257658-0szy3q7vq9w5nj-0
[vnc_recorder] [2017-01-01 08:00:58,469] [vnc_proxy] [0] Creating log directory /tmp/demo/1483257658-0szy3q7vq9w5nj-0
[vnc_recorder] [2017-01-01 08:00:58,478] [0] Requested 16 unsupported encodings: unsupported=[-223, -308, -307, -224, -313, -312, -305, 1, 16, 5, 2, -224, -255, -23, -417, -768] supported=[-239, 7, 0]
@catherio
catherio / ovpnconvert.sh
Created August 29, 2016 20:04
Convert .ovpn config file for use with Ubuntu's network manager
#!/bin/bash
# This script will extract the certificate and key from an .ovpn file
# into their own files, which makes it possible to use them to configure
# the VPN using Ubuntu's network manager
# Usage example:
# >> ovpnconvert username.dev.ovpn
# You can keep following these instructions here:
from csc import divisi2
# Build conceptnet
cnet_graph = divisi2.load('data:graphs/conceptnet_en.graph')
A = divisi2.network.sparse_matrix(cnet_graph, 'nodes', 'features', cutoff=5)
# Build analogyspace
U,S,V= A.normalize_all().svd()
predictions = divisi2.reconstruct(U,S,V) # lazy
#A_approx = divisi2.dot(U*S, V.T) # the 'real deal', very slow if A is big