A hash table is a data structure that implements an dictionary abstract data type, and is used to map keys to values.
array (key) ┌───┐
interface=$(networksetup -listnetworkserviceorder | grep "Hardware Port: Wi-Fi" | grep -o -E "en[0-9]") | |
for ip in "78.31.8.0/24" "78.31.12.0/24" "193.182.8.0/24" "193.235.0.0/16" "193.182.0.0/16" "194.68.0.0/16" "193.235.232.103"; do | |
sudo route delete $ip 2 &>1 >/dev/null | |
sudo route -n add $ip -interface $interface >/dev/null | |
done |
# Install MacOS Xcode Command Line Tools (even if you've done it, run to make sure you're up-to-date) | |
xcode-select --install | |
# let's get rid of any existing python install | |
brew uninstall python --ignore-dependencies > /dev/null 2>&1 | |
brew uninstall python2 --ignore-dependencies > /dev/null 2>&1 | |
brew uninstall python3 --ignore-dependencies > /dev/null 2>&1 | |
# just back-up your virtualenvs to be safe | |
mkdir $HOME/.virtualenvs |
MapReduce is a programming model and an associated implementation for processing and generating large data sets. Users specify a map function that processes a key/value pair to generate a set of intermediate key/value pairs, and a reduce function that merges all intermediate values associated with the same intermediate key. Many real world tasks are expressible in this model, as shown in the paper.
Programs written in this functional style are automatically parallelized and executed on a large cluster of commodity machines. The run-time system takes care of the details of partitioning the input data, scheduling the program's execution across a set of machines, handling machine failures, and managing the required inter-machine communication. This allows programmers without any experience with parallel and distributed systems to easily utilize the resources of a large distributed system
@mixin for-res($size) { | |
@if $size == ldpi-up { | |
// 2017 LG 34" Ultrawide | |
@media | |
(min-resolution: 90dpi), | |
(min-resolution: 1dppx), | |
(-webkit-min-device-pixel-ratio: 1), | |
(min--moz-device-pixel-ratio: 1) { | |
@content; | |
} |
# -*- coding: utf-8 -*- | |
""" | |
4.1: Implement a function to check if a tree is balanced. For the purposes of | |
this question, a balanced tree is defined to be a tree such that no two leaf | |
nodes differ in distance from the root by more than one. | |
""" | |
class Node(object): | |
def __init__(self, value): |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
def main(): | |
args = sys.argv[1] | |
# start here | |
if __name__ == '__main__': | |
main() |