- important parts of "algorithm engineering"
- "effective c++"
- 6.046
- 6.889
- lectures 1-4
- psets 1, 2
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}$$ |
Incidents | |
11 | |
14 | |
6 | |
39 | |
3 | |
9 | |
6 | |
1 | |
8 |
{ | |
"name": "items", | |
"children": [ | |
{ | |
"name": "Home Furnishings", | |
"children": [ | |
{ | |
"name": "Wall and Window Covering", | |
"value": 98 | |
}, |
check_for_opening () { | |
res=`curl --silent "https://unionpt.fullslate.com/employees/4320?iid=7959&services%5B%5D=208" | grep "Next opening"` | |
if [ -n "`echo $res | grep -e '.*Thursday, September 5.*'`" ] | |
then | |
echo "No openings found, sleeping..." | |
else | |
say "Found an appointment opening" | |
fi | |
} |