Skip to content

Instantly share code, notes, and snippets.

View Synthetica9's full-sized avatar

Patrick Hilhorst Synthetica9

View GitHub Profile
@Synthetica9
Synthetica9 / pyg.py
Last active May 16, 2016 15:34
An interpeter for pyg, the golfed python. Fully backwards compatible with python.
#A golfed python 'accent'. Fully backwards compatible with python.
#NOT SUITED FOR DAY-TO-DAY PROGRAMMING!
#If you DO use it for a production (non-challenge/codegolf) program, I'm not
#responsible for anything bad that happens to you, your computer,
#your spare time, your code maintainability, any kittens that god might kill,
#or the tears of blood you will weep.
import sys
from math import *
__author__ = 'Synthetica'
from ctypes import *
import numpy as np
import itertools
import os
from inspect import getsourcefile
type_table = {1: c_bool,
2: c_char,
4: c_int,
#!/usr/bin/env python
# from TypeConversions import JRepr
# TODO: Fix implicit string conversions caused by str.format
__author__ = 'Synthetica'
import ctypes as ct
import jBindings.locals as lc
from jBindings import tools
#!/usr/bin/env python
# from TypeConversions import JRepr
# TODO: Fix implicit string conversions caused by str.format
__author__ = 'Synthetica'
import ctypes as ct
import jBindings.locals as lc
from jBindings import tools
@Synthetica9
Synthetica9 / locals.py
Created April 3, 2015 05:33
Dependency of the old version
__author__ = 'Synthetica'
#Types
#TODO: sparse support
BOOL = 1
STRING = 2
INT = 4
FLOAT = 8
COMPLEX = 16
BOXED = 32
@Synthetica9
Synthetica9 / tools.py
Created April 3, 2015 05:33
Dependency of the old version
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# <[email protected]> wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return. Synthetica
# ----------------------------------------------------------------------------
import operator
__author__ = 'patrick'
cabal install --enable-tests
Resolving dependencies...
In order, the following will be installed:
idris-1.0 *test (reinstall) (changes: libffi-0.1 removed, tagged-0.8.5 added, tasty-0.11.2.1 added, tasty-golden-2.3.1.1 added, tasty-rerun-1.1.6 added)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
Notice: installing into a sandbox located at
/home/synthetica/build/Idris-dev/.cabal-sandbox
Configuring idris-1.0...
Failed to install idris-1.0
Build log ( /home/synthetica/build/Idris-dev/.cabal-sandbox/logs/idris-1.0.log ):
#!/usr/bin/env nix-shell
#!nix-shell -i python3 -p "with python36Packages; [networkx numpy python3]"
import networkx as nx
import numpy as np
import sys
def main():
assert(len(sys.argv) == 3)
these derivations will be built:
/nix/store/8jn7jnvzkxwpz2asygf9q2v1zxl6x0hl-perl-5.24.3.drv
/nix/store/ksn3825pgy6ygxnmqfaq1f6sz6j4c4b7-gnum4-1.4.18.drv
/nix/store/59mn6pcbyamb598lccplwj5g7k20h307-bison-3.0.4.drv
/nix/store/p5ah323qv8bb07d1q4ss2xjw1gr50h91-binutils-2.28.1.drv
/nix/store/yvaxaskhp4albd0ibpdww9aym7hwr9n5-binutils-wrapper-2.28.1.drv
/nix/store/l984r55z5zhxmbg0jciql5plg94bzpf9-bootstrap-gcc-wrapper.drv
/nix/store/7c1gq4md8p6hs6fk4gn5380rdx6j5xpw-linux-headers-4.4.10.drv
/nix/store/h90rjv5i1nyw5cnp5b9cdzfj1pybsqn6-stdenv-linux-boot.drv
/nix/store/21r0x08bdflvfw321kny4l3qr85vw0qf-glibc-2.26-75.drv
#! /usr/bin/env nix-shell
#! nix-shell -i python -p "with python3Packages; [python hypothesis]"
from hypothesis import *
from hypothesis.strategies import *
from heapq import *
from itertools import count
from string import ascii_uppercase