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
mak@localhost:~/dev/coala (master) +1 ~0 -0 $ py.test | |
Test session starts (platform: linux, Python 3.4.3, pytest 2.8.7, pytest-sugar 0.5.1) | |
rootdir: /home/mak/dev/coala, inifile: setup.cfg | |
plugins: timeout-1.0.0, sugar-0.5.1, xdist-1.14, doc-0.0.1, env-0.6.0, cov-2.2.1 | |
docs/index.rst ⚫ 0% | |
docs/General_Dev_Info/git_tutorial_1.rst ⚫ 0% ▏ | |
docs/Getting_Involved/Codestyle.rst ⚫ 1% ▏ | |
docs/Getting_Involved/MAC_Hints.rst ⚫ 1% ▏ | |
docs/Getting_Involved/Newcomers.rst ⚫ 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
mak@localhost:~/dev/coala (master) +1 ~0 -0 $ py.test | |
Test session starts (platform: linux, Python 3.4.3, pytest 2.8.7, pytest-sugar 0.5.1) | |
rootdir: /home/mak/dev/coala, inifile: setup.cfg | |
plugins: timeout-1.0.0, sugar-0.5.1, xdist-1.14, doc-0.0.1, env-0.6.0, cov-2.2.1 | |
docs/index.rst ⚫ 0% | |
docs/General_Dev_Info/git_tutorial_1.rst ⚫ 0% ▏ | |
docs/Getting_Involved/Codestyle.rst ⚫ 1% ▏ | |
docs/Getting_Involved/MAC_Hints.rst ⚫ 1% ▏ | |
docs/Getting_Involved/Newcomers.rst ⚫ 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
# TODO Don't think I need this, but maybe we switch to a simpler system instead | |
# TODO of grabbing function metadata. So idea is grab metadata but parse them | |
# TODO into these BearSetting's for easier use. | |
class BearSetting: | |
@enforce_signature | |
def __init__(self, name: str, typ: type, default=None): | |
if default is not None and type(default) is not typ: | |
raise ValueError("Default is not of given type.") | |
self._name = name |
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
from multiprocessing import Pool | |
if __name__ == "__main__": | |
# Initialize pool workers already | |
# | |
# Instantiate bears (params: the section and list of files that contains proxy objects serving the file as a string, presplitted lines and the file name, maybe other parameters) | |
# | |
# The file proxy objects contains lazy functions! So memory is only reserved on need | |
# for specific stuff. For that purposes maybe one can create a | |
# "MultiRepresentationObject" class that needs one specific "representation" of an |
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 <CE3D2/render/TextSurface.h> | |
#include <iostream> | |
#include <string> | |
using TextSurface = CE3D2::Render::TextSurface; | |
void print_surface(TextSurface const& surf) | |
{ | |
std::string border = "--"; | |
for (TextSurface::size_type x = 0; x < surf.width(); 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
from timeit import * | |
def conditional_check(a, b): | |
if a is None or b is None: | |
return 10 | |
else: | |
return 24 | |
def tuple_check(a, b): |
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 _absolute_position_to_line_column(string, pos): | |
""" | |
Converts an absolute char-position to a line-column position. | |
:param string: The string where the position is associated to. | |
:param pos: The position to convert (starts from 0). | |
:returns: A pair with (line, column). Line and column start with 1. | |
""" | |
line = string.count("\n", 0, pos) + 1 | |
column = string.rfind("\n", 0, pos) |
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 unittest | |
from multiprocessing import Event | |
from InterruptableProcess import InterruptableProcess | |
class InterruptableProcessTest(unittest.TestCase): | |
def test_normal_run(self): | |
def worker(e1, e2, e3): | |
e1.wait() |
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
# Prototype for an InterruptableProcess. | |
# 8.10.2015 --> Makman2 | |
import ctypes | |
import multiprocessing | |
import threading | |
def _wait_for_single(*events): | |
""" | |
Waits for at least one event being set. |
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
^Cmak@localhost:~/dev/gitmate-satellizer (master)$ ./runserver.sh | |
* Running on http://127.0.0.1:3000/ | |
* Restarting with reloader | |
127.0.0.1 - - [05/Oct/2015 17:36:48] "GET / HTTP/1.1" 200 - | |
127.0.0.1 - - [05/Oct/2015 17:36:48] "GET /stylesheets/angular-toastr.css HTTP/1.1" 304 - | |
127.0.0.1 - - [05/Oct/2015 17:36:48] "GET /stylesheets/styles.css HTTP/1.1" 304 - | |
127.0.0.1 - - [05/Oct/2015 17:36:48] "GET /vendor/angular.js HTTP/1.1" 304 - | |
127.0.0.1 - - [05/Oct/2015 17:36:48] "GET /vendor/angular-animate.js HTTP/1.1" 304 - | |
127.0.0.1 - - [05/Oct/2015 17:36:48] "GET /vendor/angular-messages.js HTTP/1.1" 304 - | |
127.0.0.1 - - [05/Oct/2015 17:36:48] "GET /vendor/angular-resource.js HTTP/1.1" 304 - |