Skip to content

Instantly share code, notes, and snippets.

View mindbound's full-sized avatar
💭
I may be slow to respond.

Arets Paeglis mindbound

💭
I may be slow to respond.
View GitHub Profile
@mindbound
mindbound / izhikevich.py
Created September 5, 2012 00:54
Compact implementation of the Izhikevich neuron model
import numpy
class IzhikevichNeuron(object):
def __init__(self, a, b, c, d, v, u = None):
self.a = a
self.b = b
self.c = c
self.d = d
self.v = v
self.u = u if u is not None else b * v
@mindbound
mindbound / tturing.cpp
Created August 19, 2012 12:40
Turing completeness of C++ templates
#include <cstdio>
template <int D, int A, typename B>
struct K
{
static const int x = K<D + 1, 0, K<D, A, B>>::x
+ K<D + 1, 1, K<D, A, B>>::x
+ K<D + 1, 2, K<D, A, B>>::x
+ K<D + 1, 3, K<D, A, B>>::x
+ K<D + 1, 4, K<D, A, B>>::x;
{-# LANGUAGE BangPatterns #-}
module Main where
import qualified Data.IntMap as IM
import Data.Char (chr, ord)
import Data.Array
type State = (Int, IM.IntMap Int)
data Dir = Up | Down