Skip to content

Instantly share code, notes, and snippets.

View rhizoome's full-sized avatar
💭
Gluing elephants to the ceiling

Jean-Louis Fuchs rhizoome

💭
Gluing elephants to the ceiling
View GitHub Profile
@rhizoome
rhizoome / gist:7630826
Last active December 29, 2015 06:39
Token Size
{
"metadata": {
"name": "Token Size"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@rhizoome
rhizoome / git.sh
Last active October 2, 2019 02:00
GIt branching, bugfixing, backporting
$> mkdir test
$> cd test/
$> git init
Initialized empty Git repository in /home/ganwell/Repositories/test/.git/
$> git checkout -b stable
Switched to a new branch 'stable'
@rhizoome
rhizoome / gist:8063489
Created December 20, 2013 23:48
freeze.dump
{
"metadata": {
"name": "freeze.dump"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@rhizoome
rhizoome / gist:8064723
Created December 21, 2013 02:38
Overhead
{
"metadata": {
"name": "Overhead"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@rhizoome
rhizoome / gist:9f5d49931b57acabfb4c
Created November 27, 2014 14:20
Card Complete with noise
{
"metadata": {
"name": "",
"signature": "sha256:9e533461c3971d0ca543d09b07e7430683b57758b8768a2c2718424791da3e54"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@rhizoome
rhizoome / bug.py
Last active December 9, 2015 09:19
import gc
import asyncio
import traceback
import inspect
loop = asyncio.get_event_loop()
class A(object):
def __del__(self):
print("Del A")
Host OS: 10.11.2 (15C50)
Host Hardware:
MacBook Air (13-inch, Early 2015)
2.2 GHz Intel Core i7
8 GB 1600 MHz DDR3
Intel HD Graphics 6000 1536 MB
Guest OS: Linux 3.19.0-43-generic #49-Ubuntu (15.04)
Guest Image: Ubuntu Vagrant Cloud Image
Task: Heavy Disk IO (Indexing Files)
Happend 3 times over 3 months
@st.composite
def provide_require_st(draw):
commands = draw(range_intagers_st)
provides = draw(
st.lists(
st.lists(range_intagers_st),
min_size = commands,
max_size = commands
)
)
"""Testing dependency graphs"""
import random
import pyDatalog.pyDatalog as pd
from hypothesis import strategies as st
from hypothesis import given
pd.create_terms('follows, is_root, is_command, requires, provides, X, '
'Y, Z, N, order')
Here my first improvements:
subset([], List2) <= (List2 == List2)
subset(L1, L2) <= (
(len_(L1) > 0) &
(L1[0]._in(L2)) & # first element in L2
subset(L1[1:], L2) # remainder is a subset of L2
)
I still get DatalogError: Syntax error: Incorrect use of aggregation. And of course there has to be a more elegant way of saying True (List2 == List2).