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
struct uv_loop_s { | |
/* User data - use this for whatever. */ | |
void* data; | |
/* Loop reference counting. */ | |
unsigned int active_handles; | |
void* handle_queue[2]; | |
void* active_reqs[2]; | |
/* Internal flag to signal loop stop. */ | |
unsigned int stop_flag; | |
UV_LOOP_PRIVATE_FIELDS |
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
//uv.h | |
struct uv_loop_s { | |
/* User data - use this for whatever. */ | |
void* data; | |
/* Loop reference counting. */ | |
unsigned int active_handles; | |
void* handle_queue[2]; | |
void* active_reqs[2]; | |
/* Internal flag to signal loop stop. */ | |
unsigned int stop_flag; |
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 datetime | |
def iso_first_week_start(iso_year, tzinfo=None): | |
"""The gregorian calendar date of the first day of the given ISO year | |
:param iso_year: Year to find the date of the first week. | |
:type iso_year: int""" | |
fourth_jan = datetime.datetime(iso_year, 1, 4, tzinfo=tzinfo) | |
delta = datetime.timedelta(fourth_jan.isoweekday() - 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
RES_COUNT = 35 | |
range_intagers_st = st.integers(min_value=0, max_value=RES_COUNT) | |
@st.composite | |
def provide_require_st(draw, filter_=True): | |
commands = draw(range_intagers_st) | |
provides = draw( | |
st.lists( |
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 tempfile | |
import sys | |
import os | |
import subprocess | |
proc = None | |
try: | |
tmp = tempfile.NamedTemporaryFile(delete=False) | |
tmp.write(sys.stdin.read().encode("UTF-8")) |
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
Traceback (most recent call last): | |
File "/home/ganwell/.pyenv/versions/3.5.1/bin/structureshrink", line 9, in <module> | |
load_entry_point('structureshrink==0.0.1', 'console_scripts', 'structureshrink')() | |
File "/home/ganwell/.pyenv/versions/3.5.1/lib/python3.5/site-packages/click/core.py", line 716, in __call__ | |
return self.main(*args, **kwargs) | |
File "/home/ganwell/.pyenv/versions/3.5.1/lib/python3.5/site-packages/click/core.py", line 696, in main | |
rv = self.invoke(ctx) | |
File "/home/ganwell/.pyenv/versions/3.5.1/lib/python3.5/site-packages/click/core.py", line 889, in invoke | |
return ctx.invoke(self.callback, **ctx.params) | |
File "/home/ganwell/.pyenv/versions/3.5.1/lib/python3.5/site-packages/click/core.py", line 534, in invoke |
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
"""Testing dependency graphs""" | |
import random | |
import sys | |
from . import Command, FunctionCommand, test | |
if not sys.version_info < (2, 7): | |
from hypothesis import strategies as st | |
from hypothesis import given |
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
typedef struct { | |
// Network data, has to be sent in network order | |
char identity[16]; | |
char serial[16]; | |
int8_t message_type; | |
int16_t header_len; | |
int16_t actor_len; | |
int32_t data_len; | |
// These fields follow the message in this order (see _len above) | |
char* header; |
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
File "/home/ganwell/.pyenv/versions/pypy-5.1/site-packages/finja/__init__.py", line 966, in parse_file | |
f.seek(0) | |
File "/home/ganwell/.pyenv/versions/pypy-5.1/lib-python/2.7/codecs.py", line 709, in seek | |
self.writer.reset() | |
IOError: File not open for writing |
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 timeit | |
def memoize(function): | |
"""Caching results of a function""" | |
# This is bad of course, it just to be able to compare the solutions | |
memoize.cache = {} | |
def memoizer(*args, **kwargs): | |
"""Memoize helper""" |