This file contains hidden or 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 ( | |
| "encoding/json" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| ) | |
| const ( |
This file contains hidden or 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
| -----BEGIN PGP PUBLIC KEY BLOCK----- | |
| mQINBFshaEEBEACv7C8nIX1UznGII42v2SAWYYDZs19jxaZWRsM6VsPcL7hvUdUa | |
| OpJNvGDeLTacjt4vBu8xy9gmgeKGA5F48fOVOcasYtsB6tnaR5BnUHNoqtJnc7HY | |
| fMr6X3PAyWVUjp4OrvLBJsRLQY2GXv+5voQuftmVpIggNs9jjPM89jgAQkiHyeTh | |
| 47dO3vzCkBfIjDDBtua7hziPWU4ZPdMzJ/naklJviUjFEiyDpUtLYNXpjyJTy9M2 | |
| pdF0P3IgiVQXdhbnd41dve20GIit0QjqjOXLtfFwaUKzOLajgRQeYUGdEg83WGkY | |
| GsCH5B8b7MO/vfqhNFSq4GqsDNFVha13Qhf+ecfqPpruMj+CdH2Mj1K1dELsf7LB | |
| wy+30E3zRzxiozgGuVDtBeHttHKjs/rWzo9UiN/tEv5XhkDiAxVIO+mEfFt6/EJ/ | |
| MVPMUe8btXQEzdVdCVbDFl5VeGLVHwrLRQsPK/U0ROvV2xxkhdd+t/dRFFIL+T4E |
This file contains hidden or 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/python | |
| import sys | |
| import numpy.random as rand | |
| ''' | |
| Splits a dataset into an 80/20 train/test set by sampling from a binomial | |
| distribution with each datapoint deciding which set it belongs to. | |
| ''' |
This file contains hidden or 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
| #!/bin/sh | |
| tmux new-session -d 'ssh jbell30@lab1-13 ~/comp512/tcp/carRM.sh' | |
| tmux split-window -v 'ssh jbell30@lab1-12 ~/comp512/tcp/hotelRM.sh' | |
| tmux split-window -v 'ssh jbell30@lab1-11 ~/comp512/tcp/flightRM.sh' | |
| sleep 0.1 | |
| tmux split-window -v 'ssh jbell30@lab1-14 ~/comp512/tcp/middleware.sh' |
This file contains hidden or 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 | |
| import os | |
| import sys | |
| import hashlib | |
| def md5(fname): | |
| hash_md5 = hashlib.md5() | |
| with open(fname, "rb") as f: |
This file contains hidden or 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
| from random import uniform | |
| import sys | |
| def approx_pi(n): | |
| in_circle = 0 | |
| for i in range(0, n): | |
| x = uniform(-1, 1) | |
| y = uniform(-1, 1) | |
| if x**2 + y**2 <= 1: |
This file contains hidden or 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
| # remap prefix from 'C-b' to 'C-a' | |
| unbind C-b | |
| set-option -g prefix C-a | |
| bind-key C-a send-prefix | |
| # switch panes using Alt-arrow without prefix | |
| bind -n M-h select-pane -L | |
| bind -n M-l select-pane -R | |
| bind -n M-j select-pane -U | |
| bind -n M-k select-pane -D |
This file contains hidden or 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
| from flask import Flask, request, jsonify | |
| app = Flask(__name__) | |
| @app.route('/', methods=['POST']) | |
| def index(): | |
| json = request.json | |
| return jsonify(your_function(json)) | |
This file contains hidden or 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
| cd () { | |
| builtin cd $1 | |
| if [ -d ".env" ] ; then | |
| source .env/bin/activate | |
| elif [ -d "env" ] ; then | |
| source env/bin/activate | |
| fi | |
| } |