Skip to content

Instantly share code, notes, and snippets.

View m0a0t0's full-sized avatar

Matthew Hall m0a0t0

  • England
View GitHub Profile
test_data = '1¦2¦"Blah\nBlah\nBlah"\n4¦5¦6'
in_quote = False
data = []
row = []
cell = []
for char in test_data:
if char != '¦':
if char == '"':
in_quote = not in_quote
elif char == '\n':
@m0a0t0
m0a0t0 / artificial_neural_network.clj
Last active December 13, 2015 21:18
An implementation of artificial neural network and back-propagation in Clojure.
(ns ann.core)
; usage:
; (train-many (generate-neural-network 2 3 1) [[0 0] [1 1] [1 0] [0 1]] [[0] [0] [1] [1]] 0.1 900000)
; for XOR
(defn sum
[col]
(reduce + col))
@m0a0t0
m0a0t0 / gist:4111926
Created November 19, 2012 17:05
Brainfuck
import System.Environment
import Control.Monad.State
import Data.Char (ord, chr)
data BFState = BFState [Int] Int [Int]
type BFT a = StateT BFState IO a
sanitise [] = []
sanitise (x:xs)