Skip to content

Instantly share code, notes, and snippets.

View leondz's full-sized avatar
🏗️
vibing

Leon Derczynski leondz

🏗️
vibing
View GitHub Profile
@leondz
leondz / mayday.md
Created October 5, 2021 18:39
Recommended viewing order for "Mayday"

recommended order

episode numbering follows https://en.wikipedia.org/wiki/List_of_Mayday_episodes

  • cali, s2e5 "Lost" - the automation we imagine relies on design + humans, and is fallible
  • gimli, s5e2 "Gimli Glider" - very cool
  • tenerife, s16e3 "Disaster at Tenerife" - the big one
  • transasia, s17e17 "Caught on Tape"
  • ba 5390, s2e1 "Blown Out" - wow, and good interviews
  • jal 123, s3e3 "Out of Control"
@leondz
leondz / fbeta_anim.py
Last active August 10, 2021 10:23
F-beta score variation animation
#!/usr/bin/env python3
import imageio
import math
import matplotlib.pyplot as plt
import numpy as np
from pathlib import Path
def fscore(p, r, beta=1):
if p == r == 0:
#!/usr/bin/env python3
# Script to create directories and index.md files for publications
# for Academic Kickstart or Research Group Kickstart, taking reference
# info from a Google Scholar CSV export.
# Templates found here, https://wowchemy.com/templates/
# input: one csv file from command line e.g. from scholar export
# output: a dir structure of the publications for import to kickstart
@leondz
leondz / id_str-time.py
Created May 30, 2018 14:53
Extract unix time to nearest millisecond from Twitter tweet ID
# use id_str instead of id to avoid overflows when accidentally casting to int
def twitter_id_to_epoch(id_str):
# credit to "On the endogenesis of Twitter’s Spritzer and Gardenhose sample streams" Kergl et al., Proc ASONAM 2014 (IEEE)
id_str = id_str.replace("'", "")
id_i = int(id_str)
bitstring = "{:064b}".format(id_i)
timestamp_b = bitstring[1:42]
snowflake_epoch = int(timestamp_b, 2)
epoch_ms = snowflake_epoch + 1288834974657
@leondz
leondz / keras-test-case.py
Last active September 29, 2016 11:46
Demonstrate failure to load with custom metrics defined
from keras.models import load_model, Sequential
from keras.layers import Dense
def x(y_true, y_pred):
return 0.0 * y_pred
model = Sequential([
Dense(1, input_dim=1),
])
model.compile(optimizer='rmsprop',
Hi guys,
please feel free to pass this on to other ACL attendees.
The web site already advises to take authorised taxis from the airport, for
your safety and to avoid being double charged. What it doesn't tell you is how.
So here it is.
On arrival, look in the hall for a stand of OK taxi (next to car rental stands
in Terminal 2 (major airlines), can't remember exactly where in Terminal 1
@leondz
leondz / gist:6108176
Last active December 20, 2015 09:29
ACL 2013 taxi tips
Hi guys,
please feel free to pass this on to other ACL attendees.
The web site already advises to take authorised taxis from the airport, for your safety and to avoid being double charged. What it doesn't tell you is how. So here it is.
On arrival, look in the hall for a stand of OK taxi (next to car rental stands in Terminal 2 (major airlines), can't remember exactly where in Terminal 1 (only if arriving by EasyJet or similar low cost)). Go there and speak to the lady, to pre-book your cab. You give her your destination and she gives you the ID number of your cab and shows you where it is.
That way, even if you have to queue, you are safe that you will get a legit taxi and will not be double charged. A lady going to a meeting recently was charged 25 leva (£12) for what should have been no more than 10 leva. There are plenty of people asking you if you need help or a taxi. I don't recommend it.
@leondz
leondz / gist:6082658
Created July 25, 2013 18:52
Comparing the results over Ritter's twitter tagging dataset with Owoputi et al.'s NAACL 2013 paper
Comparing the results over Ritter's twitter tagging dataset
with Owoputi et al.'s NAACL 2013 paper
c.f. https://gist.github.com/brendano/6070886
The Ritter dataset is small, single-annotator, and there are
arguments against using PTB on this genre. As twitter pos tagging was
difficult, we took a principled approach to improving it, based on
empirical investigations and error analysis which form a core
part of the work.