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
| # Python3: bytes(raw 8-bit values), str V.S. Python2: str(raw 8-bit values), unicode | |
| # In Python3 | |
| def to_str(bytes_or_str): | |
| if isinstance(bytes_or_str, bytes): | |
| value = bytes_or_str.decode('utf-8') | |
| else: | |
| value = bytes_or_str | |
| return value # Instance of str |
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
| If you encountered some installation issue, try to use `pyside_postinstall.py -install` to solve this issue. |
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 sys | |
| import calendar | |
| import time | |
| import math | |
| from PyQt4.QtGui import * | |
| from PyQt4.QtCore import * |
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
| total_x, total_y, total_yerr = draw_errorbar() | |
| color = ['c', 'g', 'w', 'k'] | |
| label = ("1 day pattern", "1 week pattern", '2 weeks pattern', '3 weeks pattern') | |
| hatch = ['', 'x', 'o', '/'] | |
| fig, ax = plt.subplots() | |
| width = 0.2 | |
| widths = [-0.4, -0.2, 0, 0.2] | |
| for i in range(4): | |
| ax.bar(np.array(total_x[i]) + widths[i], total_y[i], width, |
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), |
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
| #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
| #!/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
| 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
| 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 = [] |