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 | |
| # [1,2,3,5,6,7,9,101,102,500] --> [[1,2,3],[6,7],[9],[101,102],[500]] | |
| # assumes sorted | |
| def consecs(nums): | |
| def np_pop_front(array): | |
| last, array = array[0], array[1:] | |
| return last, array | |
| cons_outer = [] | |
| cons_inner = [] |
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
| // Written by Jacob Schwartz, [email protected], September 2018, edited & published May 2019 | |
| // In September 2018, I worked with the EPOC+ as part of a project for the MedHacks Hackathon. | |
| // It was extremely counterintuitive to work with, and if anyone else comes across issues with | |
| // it I figure this code might be helpful. It was awhile ago but I'd be willing to try to to help | |
| // if anyone experiences issues with the device - just open an issue on my project's repo | |
| // (github.com/jhschwartz/medhacks-zzg) and I'll see if I can help. | |
| // EMOTIV docs: https://emotiv.github.io/cortex-docs/ | |
| // see https://github.com/jhschwartz/medhacks-zzg for my failed project that used the EPOC+ |
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
| // | |
| // RingBuffer.cpp | |
| // | |
| // Created by Jacob Schwartz on 10/23/17. | |
| // | |
| #include "RingBuffer.hpp" | |
| #include <cassert> | |
| RingBuffer::RingBuffer() {} |
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/python | |
| from abc import ABCMeta, abstractmethod | |
| class abstractstaticmethod(staticmethod): | |
| # https://stackoverflow.com/questions/4474395/staticmethod-and-abc-abstractmethod-will-it-blend | |
| __slots__ = () | |
| def __init__(self, function): | |
| super(abstractstaticmethod, self).__init__(function) |