Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:
Permalink: git.io/vps
| Provider | Type | RAM | Cores | Storage | Transfer | Network | Price |
|---|
| import numpy as np | |
| import pandas as pd | |
| from collections import defaultdict | |
| from scipy.stats import hmean | |
| from scipy.spatial.distance import cdist | |
| from scipy import stats | |
| import numbers | |
| def weighted_hamming(data): |
| # how to separate items in a list from separators | |
| parsley.makeGrammar(''' | |
| a_list = ('a':it ','? -> it)* | |
| ''', {})('a,a,a').a_list() | |
| # result is ['a', 'a', 'a'] | |
| # strict comma-delimeted items (at least one item) | |
| parsley.makeGrammar(''' | |
| a_list = 'a':first (',' 'a')*:rest -> [first] + rest |
Permalink: git.io/vps
| Provider | Type | RAM | Cores | Storage | Transfer | Network | Price |
|---|
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from matplotlib.colors import ListedColormap | |
| from sklearn.cross_validation import train_test_split | |
| from sklearn.preprocessing import StandardScaler | |
| from sklearn.datasets import make_moons, make_circles, make_classification | |
| from sklearn.svm import SVC | |
| h = .02 # step size in the mesh |
| /** | |
| * USB HID Keyboard scan codes as per USB spec 1.11 | |
| * plus some additional codes | |
| * | |
| * Created by MightyPork, 2016 | |
| * Public domain | |
| * | |
| * Adapted from: | |
| * https://source.android.com/devices/input/keyboard-devices.html | |
| */ |
Inspired to do some spring cleaning today, I reviewed my archived gists to see if there's anything noteworthy. I was pleasantly surprised to find a few nuggets buried amongst random error logs and git diffs.
Some of them are interesting technical guides that took hours to write, and it's a shame that they've rotted away in obscurity. Several others were picked up by google, and turns out they even got a few comments and a bunch of stars.
| # The following construct evaluates "$@" and saves output on stdout in the | |
| # parameter stdout, output on stderr in the parameter stderr, and return value | |
| # in the parameter return. | |
| # | |
| # The idea was based on http://stackoverflow.com/a/18086548/1944784, but this | |
| # implementation is completely race-condition-free. The implementation was | |
| # refined during my exchange with Mathias Fredriksson @mafredri, in | |
| # https://github.com/mafredri/zsh-async/issues/1. See mainly | |
| # https://github.com/mafredri/zsh-async/issues/1#issuecomment-121468958, where | |
| # the advantage of this implementation is explained. |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
This post also appears on lisper.in.
Reader macros are perhaps not as famous as ordinary macros. While macros are a great way to create your own DSL, reader macros provide even greater flexibility by allowing you to create entirely new syntax on top of Lisp.
Paul Graham explains them very well in [On Lisp][] (Chapter 17, Read-Macros):
The three big moments in a Lisp expression's life are read-time, compile-time, and runtime. Functions are in control at runtime. Macros give us a chance to perform transformations on programs at compile-time. ...read-macros... do their work at read-time.