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
| import matplotlib.pyplot as plt | |
| x = all_set.keys() | |
| #y = mean_map | |
| y = std_map | |
| fig, ax = plt.subplots() | |
| heatmap = ax.pcolor(np.array(y), cmap=plt.cm.Greens) | |
| cbar = fig.colorbar(heatmap) | |
| #cbar.ax.set_yticklabels(['< -1', '0', '> 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
| import requests | |
| request_api = 'https://api.foursquare.com/v2/venues/search' | |
| your_client_id = '' | |
| your_client_secret = '' | |
| your_v = '20140902' | |
| your_near = 'New York, NY' | |
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 | |
| ''' | |
| sample input | |
| ['1-800-power.com', 'ca.shtml\n'] | |
| ''' | |
| record = [] | |
| for line in open("order.txt", "r").readlines(): | |
| for element in line.split("'"): | |
| record.append(element) |
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
| import datetime | |
| import time | |
| from BeautifulSoup import BeautifulSoup | |
| import requests | |
| def get_content(url): | |
| res = requests.get(url) | |
| return res.content |
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
| def packed_bytes_to_iq(self, bytes): | |
| ''' Convenience function to unpack array of bytes to Python list/array | |
| of complex numbers and normalize range. Called automatically by read_samples() | |
| ''' | |
| if has_numpy: | |
| # use NumPy array | |
| iq = np.empty(len(bytes)//2, 'complex') | |
| iq.real, iq.imag = bytes[::2], bytes[1::2] | |
| iq /= (255/2) | |
| iq -= (1 + 1j) |
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
| <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"> | |
| <div class="container"> | |
| <div class="navbar-header"> | |
| <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse" > | |
| <span class="sr-only">Toggle navigation</span> | |
| <span class="icon-bar"></span> | |
| <span class="icon-bar"></span> | |
| <span class="icon-bar"></span> | |
| </button> | |
| <a class="navbar-brand" href="#" style="">Lab212</a> |
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
| import os | |
| from flask import render_template, request, send_from_directory | |
| from werkzeug.utils import secure_filename | |
| from app import app | |
| @app.route('/') | |
| def index(): | |
| return render_template('index.html') |
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
| import requests | |
| from bs4 import BeautifulSoup | |
| import pycurl | |
| import io | |
| def get_content(url): | |
| res = requests.get(url) | |
| return res.content | |
| def html_parser(url): |
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
| public static void unzip(String zipFilePath, String dirPath, int bufferSize) throws IOException { | |
| int size; | |
| byte[] buffer = new byte[bufferSize]; | |
| try { | |
| if (!dirPath.endsWith("/")) { | |
| dirPath += "/"; | |
| } | |
| File f = new File(dirPath); |
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
| set encoding=utf-8 | |
| syntax on | |
| set nocompatible | |
| set ai | |
| set shiftwidth=2 | |
| set tabstop=4 | |
| set softtabstop=4 | |
| set expandtab |