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 os | |
import pickle | |
import warnings | |
import numpy as np | |
import pandas as pd | |
from sklearn.model_selection import train_test_split | |
from tensorflow.keras.callbacks import EarlyStopping | |
from tensorflow.keras.layers import Dense | |
from tensorflow.keras.layers import Dropout |
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
""" | |
A standalone version of the server started by `python3 -m http.server`. | |
Copied from Python 3.9 source. | |
""" | |
import contextlib | |
from functools import partial | |
import http.server | |
import os | |
import socket |
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
Year | HK Population | HK PPPGDP | HK per capita PPPGDP | CN Population | CN PPPGDP | CN per capita PPPGDP | HK/CN per capita PPPGDP | |
---|---|---|---|---|---|---|---|---|
1980 | 5096000 | 34607000000 | 6791.0125588697 | 987050000 | 305579000000 | 309.588166759536 | 21.9356334899726 | |
1981 | 5217000 | 41364000000 | 7928.69465209891 | 1000720000 | 351548000000 | 351.295067551363 | 22.5699003045058 | |
1982 | 5297000 | 45187000000 | 8530.67774211818 | 1016540000 | 406864000000 | 400.243964821847 | 21.3136948758622 | |
1983 | 5388000 | 49781000000 | 9239.23533778768 | 1030080000 | 468460000000 | 454.780211245729 | 20.3158253356708 | |
1984 | 5469000 | 56737000000 | 10374.2914609618 | 1043570000 | 559140000000 | 535.795394654887 | 19.3624125262294 | |
1985 | 5539000 | 58949000000 | 10642.5347535656 | 1058510000 | 654702000000 | 618.512815183607 | 17.2066519760086 | |
1986 | 5605000 | 66814000000 | 11920.4281891169 | 1075070000 | 727324000000 | 676.536411582502 | 17.6197880631931 | |
1987 | 5637000 | 77637000000 | 13772.7514635444 | 1093000000 | 832515000000 | 761.678865507777 | 18.0820974392703 | |
1988 | 5712000 | 87217000000 | 15269.0826330532 | 1110260000 | 958404000000 | 863.224830219948 | 17.6884191678808 |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>SVG whitespace example</title> | |
</head> | |
<body> | |
<p style="max-width:100px;border:1px solid red">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> | |
<?xml version="1.0" encoding="utf-8" standalone="no"?> | |
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" |
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 copy | |
import datetime | |
import pickle | |
# Each quarter corresponds to the following month and day combinations: | |
_q1 = (3, 31) | |
_q2 = (6, 30) | |
_q3 = (9, 30) | |
_q4 = (12, 31) |
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
CREATE TABLE things_versioned ( | |
id integer not null, | |
name varchar not null, | |
version timestamp with time zone default now(), | |
PRIMARY KEY (id, version) | |
) | |
CREATE VIEW things AS | |
SELECT | |
DISTINCT ON (id) |
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
package main | |
import ( | |
"database/sql" | |
"encoding/json" | |
"log" | |
"net/http" | |
"os" | |
"time" |
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
package main | |
import "database/sql" | |
import "log" | |
import _ "github.com/lib/pq" | |
func main() { | |
conn, err := sql.Open("postgres", "user=aaronoellis dbname=bar sslmode=disable") | |
if err != nil { | |
log.Fatal(err) |
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
#!/usr/bin/env python | |
# vim: ts=4:sw=4:expandtab:autoindent: | |
import os | |
import sys | |
import requests | |
import filecmp | |
from fabric.context_managers import hide, settings, prefix | |
from fabric.api import sudo, task, run, cd, env | |
from fabric.contrib.console import confirm | |
from fabric.colors import green |
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
# Plotting the Gamma distribution and sample as a normalize histogram | |
using Distributions | |
using Gadfly | |
pdf(d::Gamma, x) = (x ^ (d.α - 1) * e ^ (-x / d.α)) / (d.θ ^ d.α * gamma(d.α)) | |
n = 500 | |
g = Gamma(2., 2.) |