Skip to content

Instantly share code, notes, and snippets.

@paulhendricks
paulhendricks / miniCRAN.R
Created January 20, 2016 20:00 — forked from stephlocke/miniCRAN.R
Getting a local CRAN that combines internal and external packages
## ------------------------------------------------------------------------
# Set the repo for use throughout
cran <- "https://cran.rstudio.org"
# Install
if(!require(miniCRAN)){
install.packages("miniCRAN", repos = cran)
}
## ------------------------------------------------------------------------
--
-- A simple genetic algorithm for function optimization, in lua
-- Copyright (c) 2009 Jason Brownlee
--
-- It uses a binary string representation, tournament selection,
-- one-point crossover, and point mutations. The test problem is
-- called one max (a string of all ones)
--
-- configuration
@paulhendricks
paulhendricks / mario.lua
Created November 18, 2015 19:01 — forked from mathhun/mario.lua
MarI/O by SethBling http://pastebin.com/ZZmSNaHX
-- MarI/O by SethBling
-- Feel free to use this code, but please do not redistribute it.
-- Intended for use with the BizHawk emulator and Super Mario World or Super Mario Bros. ROM.
-- For SMW, make sure you have a save state named "DP1.state" at the beginning of a level,
-- and put a copy in both the Lua folder and the root directory of BizHawk.
if gameinfo.getromname() == "Super Mario World (USA)" then
Filename = "DP1.state"
ButtonNames = {
"A",
@paulhendricks
paulhendricks / genetic.py
Created November 18, 2015 18:35 — forked from bellbind/genetic.py
[python]Genetic Algorithm example
"""Genetic Algorithmn Implementation
see:
http://www.obitko.com/tutorials/genetic-algorithms/ga-basic-description.php
"""
import random
class GeneticAlgorithm(object):
def __init__(self, genetics):
self.genetics = genetics
pass