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
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
#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 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
# 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
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
package coz | |
import com.jme3.app.SimpleApplication; | |
import com.jme3.material.Material; | |
import com.jme3.math.Vector3f; | |
import com.jme3.scene.Geometry; | |
import com.jme3.scene.shape.Box; | |
import com.jme3.math.ColorRGBA; | |
/** Sample 1 - how to get started with the most simple JME 3 application. |
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
Afterwork improvements: | |
- Catch regex.compile error and rethrow as ValueError? | |
- Implement GlobalBear support | |
- More intelligent metadata-merge that is not so merge-order-sensitive | |
- regex-output-format: Implement even more checks: | |
- Use of capturing groups | |
- Unknown named capturing groups | |
- prerequisite_check_command: Remove and let the user override it | |
himself + provide helper utilities (advanced custom command check, | |
derivations for specific stuff (java module check etc.) |
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@hp-elitebook:~/dev/coala (master)$ git pull | |
Already up-to-date. | |
mak@hp-elitebook:~/dev/coala (master)$ sudo pip3 install coala coala-bears --pre --upgrade | |
Requirement already up-to-date: coala in /usr/lib/python3.4/site-packages | |
Requirement already up-to-date: coala-bears in /usr/lib/python3.4/site-packages | |
Requirement already up-to-date: setuptools>=19.2 in /usr/lib/python3.4/site-packages (from coala) | |
Requirement already up-to-date: validators~=0.10 in /usr/lib/python3.4/site-packages (from coala) | |
Requirement already up-to-date: libclang-py3==0.2 in /usr/lib/python3.4/site-packages (from coala) | |
Requirement already up-to-date: PyPrint~=0.2.3 in /usr/lib/python3.4/site-packages (from coala) | |
Requirement already up-to-date: appdirs~=1.4.0 in /usr/lib/python3.4/site-packages (from coala) |