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 pandas as pd | |
| import datetime | |
| import csv | |
| import matplotlib.pyplot as plt | |
| headers = ['Date','time'] | |
| def time_convert(x): | |
| h,m,s = map(int,x.split(':')) | |
| return (h*60+m)*60+s |
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 <Python.h> | |
| long long | |
| _fib(long long n) { | |
| if (n < 2) | |
| return n; | |
| else | |
| return _fib(n - 1) + _fib(n - 2); | |
| } | |
| static PyObject * | |
| fib(PyObject *self, PyObject *args) { |
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 fib_recursive(n): | |
| if n <= 1: | |
| return n | |
| return fib_recursive(n - 1) + fib_recursive(n - 2) |
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 | |
| class Node(): | |
| def __init__(self): | |
| self.name = None | |
| self.files = [] | |
| self.sub_folders = [] | |
| self.drawn = False | |
| self.parent = None |
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 sys | |
| from io import StringIO | |
| def read_to_stdin(): | |
| """ | |
| Helper function for read file as stdin, | |
| Very helpful for Pycharm debug, because Pycharm does not support input redirection | |
| """ | |
| stdin = "".join(open('filename', "r").readlines()) |