Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
doing open source

esc esc

:octocat:
doing open source
View GitHub Profile
@vincentdavis
vincentdavis / gist:8588879
Last active Jan 4, 2016
De Bruijn sequence
View gist:8588879
def debruijn(k, n):
"""
De Bruijn sequence for alphabet size k (0,1,2...k-1)
and subsequences of length n.
From wikipedia Sep 22 2013
"""
a = [0] * k * n
sequence = []
def db(t, p,):
if t > n:
@minrk
minrk / piphub.py
Created Apr 23, 2013
piphub - simple shortcut for installing projects from GitHub
View piphub.py
#!/usr/bin/env python
"""
piphub - shortcut for user-only editable install from GitHub
usage:
piphub org[/repo] [name]
`name` only needs to be specified if it differs from `repo`.
If the organization, repo, and name all have the same value (e.g. ipython),
@esc
esc / bloscpack_new_header.rst
Created Jun 27, 2012
Bloscpack new header
View bloscpack_new_header.rst

RFC for the new Bloscpack Header

Author: Valentin Haenel
Contact: valentin.haenel@gmx.de

The following 32 bit header is proposed for bloscpack as of version 0.2.0. The design goals of the new header format are to contain as much information as possible to achieve interesting things in the future and to be as general as possible such that the new persistence layer of CArray is compatible with

@GaelVaroquaux
GaelVaroquaux / 00README.rst
Last active Feb 25, 2022
Copy-less bindings of C-generated arrays with Cython
View 00README.rst

Cython example of exposing C-computed arrays in Python without data copies

The goal of this example is to show how an existing C codebase for numerical computing (here c_code.c) can be wrapped in Cython to be exposed in Python.

The meat of the example is that the data is allocated in C, but exposed in Python without a copy using the PyArray_SimpleNewFromData numpy