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
| #!/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 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
| 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 numpy as np | |
| import matplotlib.pyplot as plt | |
| data = [] | |
| with open("output.txt", "r") as f: | |
| for line in f.readlines(): | |
| data.append(float(line)) | |
| x = [] |
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
| 1. brew install libusb | |
| 2. brew install librtlsdr | |
| 3. brew install python | |
| 4. pip install pyrtlsdr | |
| 5. pip install numpy | |
| 6. pip install pandas | |
| 7. git clone https://github.com/roger-/pyrtlsdr.git | |
| 8. cd pyrtlsdr && python demo_waterfall.py |
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 numpy as np | |
| import pandas as pd | |
| import data_generator as dg | |
| def reduce_data(): | |
| result = [] | |
| for day in dg.group_data(): |
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
| #include <stdio.h> | |
| #define SQUARE(a) (a * a) | |
| int main() { | |
| printf("%d\n", SQUARE(4)); | |
| int x = 3; | |
| printf("%d\n", SQUARE(++x)); | |
| return 0; | |
| } |
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
| In [54]: a = [i for i in range(10)] | |
| In [58]: zip(*[iter(a), iter(a), iter(a), iter(a), iter(a)]) | |
| Out[58]: | |
| [(0, 0, 0, 0, 0), | |
| (1, 1, 1, 1, 1), | |
| (2, 2, 2, 2, 2), | |
| (3, 3, 3, 3, 3), | |
| (4, 4, 4, 4, 4), | |
| (5, 5, 5, 5, 5), | |
| (6, 6, 6, 6, 6), |
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
| In [37]: a = iter(range(45)) | |
| In [38]: zip(*[a, a, a]) | |
| Out[38]: | |
| [(0, 1, 2), | |
| (3, 4, 5), | |
| (6, 7, 8), | |
| (9, 10, 11), | |
| (12, 13, 14), | |
| (15, 16, 17), |