Skip to content

Instantly share code, notes, and snippets.

View kwichmann's full-sized avatar

Kristian Wichmann kwichmann

View GitHub Profile
@kwichmann
kwichmann / blockchain.md
Last active August 17, 2022 02:37
Blockchain and Ethereum resources
@kwichmann
kwichmann / swirl.html
Last active February 12, 2017 01:05
School of meiamsome #1
<!DOCTYPE html>
<html>
<head>
<title>Swirl</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.6/p5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.6/addons/p5.dom.js"></script>
</head>
<body>
<script type="text/javascript">
var siz = 600;
// https://api.mapbox.com/styles/v1/mapbox/streets-v8/static/0,0,2/600x600?access_token=pk.eyJ1IjoiY29kaW5ndHJhaW4iLCJhIjoiY2l6MDJ0Mjk5MDQ1dzJ3bzRiM29zaW16ayJ9.guiqnHMGUq196Zxa1d3UPg
var mapimg;
var zoom = 1;
var data;
var ww = 900;
var hh = 900;
var clat = 0; //37.7749;
var clon = 0; //-122.4194;
@kwichmann
kwichmann / build_neural_net.py
Created January 27, 2017 01:21
Building a neural net
import numpy as np
class NeuralNetwork():
def __init__(self, input_layer_size):
self.layer_sizes = [input_layer_size]
self.w = []
def add_layer(self, number_of_neurons):
neurons_in_previous_layer = self.layer_sizes[-1]
@kwichmann
kwichmann / die_roll_simulator.R
Created September 16, 2016 08:55
Simulates rolling two dice pools against each other. Most sixes win, if tied, most fives win, if tied most fours win ... and so on.
roll <- function(n)
sample(1:6, n, replace = T)
number_of <- function(roll, n)
sum(roll == n)
win <- function(roll1, roll2) {
for (n in 6:1) {
if (number_of(roll1, n) > number_of(roll2, n)) return(1)
if (number_of(roll1, n) < number_of(roll2, n)) return(2)
@kwichmann
kwichmann / springer-free-maths-books.md
Created December 29, 2015 23:39 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links