- important parts of "algorithm engineering"
- "effective c++"
- 6.046
- 6.889
- lectures 1-4
- psets 1, 2
// ==UserScript== | |
// @name Show Total Number of Lines Modified in Diff | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Show total number of lines modified in diff at bottom of table of contents | |
// @author lyahdav | |
// @match https://phabricator.dropboxer.net/D* | |
// @grant none | |
// ==/UserScript== |
some_big_prime = 16908799 | |
def hash_string(s: str) -> int: | |
hash_val = 0 | |
for letter in s: | |
hash_val = ((127 * hash_val) + ord(letter)) % some_big_prime | |
return hash_val | |
hash_table = [None for _ in range(size_of_my_hash_table)] | |
value = 'foobar' |
<hmtl> | |
<div id="map-canvas"></div> | |
<style> | |
html, body, #map-canvas { | |
height: 90%; | |
margin: 5px; | |
padding: 1px; | |
} | |
</style> | |
<script src="https://maps.googleapis.com/maps/api/js?sensor=false&libraries=geometry,places&ext=.js"></script> |
""" | |
python3 jfk.py | |
""" | |
from collections import namedtuple | |
Stop = namedtuple('Stop', ['sid', 'seq']) | |
stops_data = [ | |
Stop(sid=0, seq=0), | |
Stop(sid=1, seq=1), |
For flask servers using gunicorn, which can be configured to use any type of worker. We use gevent workers (flag -k) (which use the libuv event loop under-the-hood, see http://flask.pocoo.org/docs/0.12/deploying/wsgi-standalone/): http://docs.gunicorn.org/en/latest/settings.html#worker-class
This means we can push tasks into the gevent event loop and have them execute outside of a flask request context. As long as all the gunicorn workers aren’t processing these tasks and blocking flask request execution, this should not affect performance.
$$T(\omega) = \begin{cases} | |
1, & \text{if } \omega > \$0, \\ | |
0, & \text{otherwise}. | |
\end{cases}$$ |
Adapted from https://coreos.com/etcd/docs/latest/op-guide/v2-migration.html#migrate-data
Note that this strategy results in kube-apiserver downtime, but this should not affect the state of the cluster, it will only prevent changes during the migration
ETCDCTL_API=3 etcdctl get "" --from-key --keys-only --limit 1 | wc -l
Incidents | |
11 | |
14 | |
6 | |
39 | |
3 | |
9 | |
6 | |
1 | |
8 |