Skip to content

Instantly share code, notes, and snippets.

python3 -m prodigy terms.teach seedterms_march11 ./radioner_with_bodypart_batch_trained -se seedterms.text
Initialising with 24 seed terms from seedterms.text
✨ Starting the web server at http://localhost:8080 ...
Open the app in your browser and start annotating!
15:15:54 - Task queue depth is 1
15:15:54 - Task queue depth is 2
^C
Saved 112 annotations to database SQLite
<!doctype html>
<html lang="en, ru">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<title>Experiment</title>
@marchdown
marchdown / setup_p2_on_eu-west-1_with_ami-b43d1ec7.sh
Created August 5, 2017 19:03
Fast.ai setup script modified to use AMI available in eu-west-1 region.
export vpcId=`aws ec2 create-vpc --cidr-block 10.0.0.0/28 --query 'Vpc.VpcId' --output text`
aws ec2 modify-vpc-attribute --vpc-id $vpcId --enable-dns-support "{\"Value\":true}"
aws ec2 modify-vpc-attribute --vpc-id $vpcId --enable-dns-hostnames "{\"Value\":true}"
export internetGatewayId=`aws ec2 create-internet-gateway --query 'InternetGateway.InternetGatewayId' --output text`
aws ec2 attach-internet-gateway --internet-gateway-id $internetGatewayId --vpc-id $vpcId
export subnetId=`aws ec2 create-subnet --vpc-id $vpcId --cidr-block 10.0.0.0/28 --query 'Subnet.SubnetId' --output text`
export routeTableId=`aws ec2 create-route-table --vpc-id $vpcId --query 'RouteTable.RouteTableId' --output text`
aws ec2 associate-route-table --route-table-id $routeTableId --subnet-id $subnetId
aws ec2 create-route --route-table-id $routeTableId --destination-cidr-block 0.0.0.0/0 --gateway-id $internetGatewayId
export securityGroupId=`aws ec2 create-security-group --group-name my-security-group --description "Generated by setu
@marchdown
marchdown / reflexivity.idr
Created August 1, 2017 14:34
reflexivity in Idris
infixl 5
data (⇔) : a -> b -> Type where
Refl_ : x ⇔ x -- there is an identity, a function/path/morphism from a value of x of Type a to itself. /or to a value of an isomorphic type!/
fiveIsFive : 5 ⇔ 5
-- this is a function of type "equality" parametrized by "5" and "5" and since it has a constructor and is thus populated (by Refl), the Type with this parameters is populated and it is a proof that five does, indeed, equal itself.
fiveIsFive = Refl_
import rtmidi_python as rtmidi
from time import sleep
midi_out = rtmidi.MidiOut()
for port_name in midi_out.ports:
print port_name
midi_out.open_virtual_port("foo")
# now launch a DAW and connect to MIDI input "foo"
void draw () {
ellipse(37,39,41,43);
}
import Prelude hiding (takeWhile)
sum :: Num a => [a] -> a
sum = foldr (+) 0
product :: Num a => [a] -> a
product = foldr (*) 1
and :: [Bool] -> Bool
and = foldr (&&) True
-- NB pointful function definitions compile just fine without type annotations
and' xs = foldr (&&) True xs
main = do
getLine
pss <- read . lines . getContents
print $ foldr1 pss
-- list of numbers in the form of prime-power pairs
-- e.g. 35 would be [5 1 7 1]
gcd' _ [] = []
gcd' [] _ = []
from functools import partial
def reduce(reducing_function, fs, initial_value=None):
fs = iter(fs)
v = fs.next() if initial_value is None else initial_value
for f in fs:
v = reducing_function(v, f)
return v
square = lambda x: x**2
from functools import partial
def reduce(reducing_function, fs, initial_value=None):
fs = iter(fs)
v = fs.next() if initial_value is None else initial_value
for f in fs:
v = reducing_function(v, f)
return v
square = lambda x: x**2