Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
doing open source

esc esc

:octocat:
doing open source
View GitHub Profile
View toy_mcmc.py
#!/usr/bin/env python
""" A toy mcmc sampler for a loaded dice.
Author: Valentin Haenel <esc@zetatech.org>
Adapted from Matlab code presented in the course:
'Probabilistic and Bayesian Modelling in Machine Learning and AI'
given by Prof. Manfred Opper at TU-Berlin in Summer 2009
"""
@esc
esc / git-ff-track
Created Oct 23, 2010
fast-forward local tracking branch
View git-ff-track
#!/bin/bash
# fast-forward local tracking branch if you get something like (on git checkout):
# Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
# Author: Valentin Haenel <valentin.haenel@gmx.de>
# Licence: wtfpl <http://sam.zoy.org/wtfpl/>
BRANCH=$( git branch | grep ^* | sed 's/^\* //' )
if [[ -z $BRANCH ]] ; then
# not a git repository
exit 1
@esc
esc / zmq_client.py
Created May 29, 2012
Example of Request Reply with zmq
View zmq_client.py
import zmq
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.connect("tcp://127.0.0.1:5000")
for i in range(10):
msg = "msg %s" % i
socket.send(msg)
print "Sending", msg
msg_in = socket.recv()
@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

View test.rst

Test

b, bart <bart>:bart simpson
-b, bart <bart>:bart simpson
b, -bart <bart>:bart simpson
@esc
esc / 0001-don-t-copy-large-buffers-only-small-ones.patch
Created Sep 11, 2012
Benchmark for python-blosc no-copy-on-compression patch
View 0001-don-t-copy-large-buffers-only-small-ones.patch
From 2aa62ca0f9b03df90202ef8c7a739939ba6f6395 Mon Sep 17 00:00:00 2001
From: Valentin Haenel <valentin.haenel@gmx.de>
Date: Tue, 11 Sep 2012 13:40:46 +0200
Subject: [PATCH] don't copy large buffers, only small ones
---
blosc/blosc_extension.c | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/blosc/blosc_extension.c b/blosc/blosc_extension.c
View README.rst

Testing syntax highlight

Python:

import this
for line in open(file):
    print line
@esc
esc / quine.py
Created Nov 21, 2012
Quine cheat
View quine.py
for line in open(__file__):
print line[:-1]
View test.md