Skip to content

Instantly share code, notes, and snippets.

@sixtenbe
sixtenbe / analytic_wfm.py
Last active May 1, 2024 02:29 — forked from endolith/peakdet.m
Peak detection in Python
#!/usr/bin/python2
# Copyright (C) 2016 Sixten Bergman
# License WTFPL
#
# This program is free software. It comes without any warranty, to the extent
# permitted by applicable law.
# You can redistribute it and/or modify it under the terms of the Do What The
# Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See
@alextp
alextp / bayesopt.py
Created November 29, 2011 01:18
A trivial implementation of Bayesian optimization
# coding: utf-8
# An attempt at implementing Bayesian optimization according to
# Brochu, Cora, and de Freitas' tutorial
# http://haikufactory.com/files/bayopt.pdf
from sklearn import gaussian_process
import numpy as np
import scipy.optimize, scipy.stats as st
@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@arvearve
arvearve / gist:4158578
Created November 28, 2012 02:01
Mathematics: What do grad students in math do all day?

Mathematics: What do grad students in math do all day?

by Yasha Berchenko-Kogan

A lot of math grad school is reading books and papers and trying to understand what's going on. The difficulty is that reading math is not like reading a mystery thriller, and it's not even like reading a history book or a New York Times article.

The main issue is that, by the time you get to the frontiers of math, the words to describe the concepts don't really exist yet. Communicating these ideas is a bit like trying to explain a vacuum cleaner to someone who has never seen one, except you're only allowed to use words that are four letters long or shorter.

What can you say?

@dyoo
dyoo / unicode-name.rkt
Last active December 17, 2015 09:19
A function for getting the name of unicode code points
#lang racket/base
(provide unicode-name)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; We want to compute the table at compile-time, so that the result can be saved
;; by using raco make.
(require (for-syntax net/url
racket/base
@MathieuDuponchelle
MathieuDuponchelle / mixit.py
Last active October 17, 2016 22:16
Gstreamer-editing-services used to make a fancy mixing script.
from gi.repository import GstPbutils
from gi.repository import Gtk
from gi.repository import Gst
from gi.repository import GES
from gi.repository import GObject
import sys
import signal
def handle_sigint(sig, frame):
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
anonymous
anonymous / clfflame.nt.d
Created December 6, 2014 08:39
clfflame.nt
module clfflame;
import c.CL.cl;
import sys, std.(file, string, util, random, math, time, thread, channel, hashmap, png, macros.(switchover, where));
pragma(lib, "OpenCL");
alias NUMFUNS = 10; // functions implemented
alias numfuns = 3; // function set size, must be constant because compiled into shader
alias SPEED = 1.0;
-- Originally an Idris translation of copumpkin's Agda code:
-- https://gist.github.com/copumpkin/8758586
-- Extended using Matthew Brecknell's proof which only needs two properties:
-- https://gist.github.com/mbrcknl/bfaa72c2ec6ff32a2826
-- Proves that List reverse is completely specified by:
-- 1. f [x] = [x]
-- 2. f (xs ++ ys) = f ys ++ f xs