Skip to content

Instantly share code, notes, and snippets.

View matham's full-sized avatar

Matt Einhorn matham

View GitHub Profile
// sdl2_test2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#define _USE_MATH_DEFINES
#include <cmath>
#include <SDL2/SDL.h>
@matham
matham / async_threads_test.py
Created December 14, 2017 01:29
timing of python trio external thread interactions
import threading
import queue as stdlib_queue
import trio
class Executor(object):
_thread = None
name = 'Executor'
class TrioPortal:
def __init__(self, trio_token=None):
if trio_token is None:
trio_token = _core.current_trio_token()
self._trio_token = trio_token
# This is the part that runs in the trio thread
def _run_cb_async(self, afn, args, task, token):
@_core.disable_ki_protection
python_version download_count
3.6 17276
2.7 13728
null 12301
3.5 5049
3.4 2202
3.2 306
3.7 240
1.17 55
3.3 34
'''
Graph
======
The :class:`Graph` widget is a widget for displaying plots. It supports
drawing multiple plot with different colors on the Graph. It also supports
axes titles, ticks, labeled ticks, grids and a log or linear representation on
both the x and y axis, independently.
To display a plot. First create a graph which will function as a "canvas" for
from timeit import timeit
from random import randint
class Base(object):
pass
class Derived1(Base):
pass

Due to recent abusive intrusions into our channel, we may need to temporarily restrict participation to users who have registered accounts on Freenode. If you have received a Cannot send to channel message when attempting to talk, you can validate that you are not a malicious user and regain the ability to send messages to the channel by registering your account. Please see the link below for instructions, and don't hesitate to stop by #freenode to ask for help.

https://freenode.net/faq.shtml#nicksetup

'''
FileChooser
===========
The FileChooser module provides various classes for describing, displaying and
browsing file systems.
Simple widgets
--------------
class FileChooserProgress(FileChooserProgressBase):
@KV()
def apply_kv(self):
with KVCtx():
self.pos_hint = {'x': 0, 'y': 0}
with self.canvas:
Factory.Color(rgba=(0, 0, 0, .8))
rect = Factory.Rectangle()
rect.pos ^= self.pos
class FileChooserProgress(FileChooserProgressBase):
@KV()
def apply_kv(self):
with KVCtx():
self.pos_hint = {'x': 0, 'y': 0}
with self.canvas:
Factory.Color(rgba=(0, 0, 0, .8))
rect = Factory.Rectangle()
rect.pos ^= self.pos