Skip to content

Instantly share code, notes, and snippets.

View vrootic's full-sized avatar
🏠
Working from home

Vic vrootic

🏠
Working from home
View GitHub Profile
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'])
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'
#!/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)
import datetime
import time
from BeautifulSoup import BeautifulSoup
import requests
def get_content(url):
res = requests.get(url)
return res.content
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)
<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>
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')
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):
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);
set encoding=utf-8
syntax on
set nocompatible
set ai
set shiftwidth=2
set tabstop=4
set softtabstop=4
set expandtab