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
function LiveWatcher(watch_posts, watch_users) { | |
var self = this; | |
var _oldListener; | |
function newListener(d) { | |
var el = document.createElement('div'); | |
el.innerHTML = JSON.parse(d.data).data; | |
var post_id = parseInt(el.childNodes[0].getAttribute("data-post_id")); | |
var user_login = el.childNodes[0].getAttribute("data-user_login"); |
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
# Namespace package | |
try: | |
__import__('pkg_resources').declare_namespace(__name__) | |
except ImportError: | |
__path__ = __import__('pkgutil').extend_path(__path__, __name__) |
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
[buildout] | |
# Egg names | |
project-eggs = | |
# my-module | |
# Egg directories | |
#develop = | |
# my-module | |
# Build parts (add develop eggs if needed) |
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
# -*- coding: utf-8 -*- |
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
# Recreational computational human bananology. | |
# Copyright (c) 2015, Konstantin Tretyakov | |
# http://fouryears.eu/2015/04/12/two-bananas-make-a-human/ | |
# ------------------------ Imports and utility functions ---------------- # | |
import gzip | |
import csv | |
import urllib | |
from ucscgenome import Genome | |
from Bio import SeqIO |
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
# "Paul-and-Simon sort" | |
# http://fouryears.eu/2017/07/25/sorting-in-linear-time/ | |
# http://www-wjp.cs.uni-saarland.de/publikationen/PS80.pdf | |
# | |
# Copyright 2017, Konstantin Tretyakov | |
# License: MIT | |
from math import log2, ceil | |
def paul_and_simon_sort(a): |
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
# Figure 5 from http://fouryears.eu/2016/11/17/the-secrets-of-spring-motion/ | |
# Intended to be run from a Jupyter notebook cell | |
%pylab inline | |
g = 9.18 | |
k = 2.0 * 8 | |
L = 1.0 | |
m = 1.0/9 |
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
# Executable transcript of https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-16-04 | |
sudo apt update | |
sudo apt install -y openvpn easy-rsa python | |
make-cadir ~/openvpn-ca | |
cd ~/openvpn-ca | |
cat <<EOT >> vars | |
# New values | |
export KEY_COUNTRY="EE" | |
export KEY_PROVINCE="Some Province" |
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 sqlalchemy as sa | |
import pandas as pd | |
e = sa.create_engine("sqlite:///raw_data.sqlite") | |
pd.read_csv("raw_data.csv").to_sql("raw_data", 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
select | |
s.Key | |
v1.AverageTimeSpent, | |
v1.NumberOfClicks, | |
v2.Country | |
v3.Purchase as Target | |
from vw_TrainSample s | |
left join vw_BehaviourFeatures v1 on v1.Key = s.Key | |
left join vw_ProfileFeatures v2 on v2.Key = s.Key | |
left join vw_TargetFeatures v3 on v3.Key = s.Key |
OlderNewer