Skip to content

Instantly share code, notes, and snippets.

View Particle Swarm Optimization Visualization
################################################################################
## Experiment with PSO
################################################################################
## make data
mu <- 5
sigma <- 10
Y <- rnorm(1000,mu,sigma)
@MarcoDVisser
MarcoDVisser / RandomFileRename.sh
Last active Aug 29, 2015
Random File Rename for random wallpaper in Linux
View RandomFileRename.sh
#!/bin/bash
# Seed random generator
RANDOM=$$$(date +%s)
# read all jpg files in folder
# replace the $( ) with '' for older versions
# creates an array of all the files in ~/bin/images/wp
FILES=(~/bin/images/wp/*)
View color_picker.R
doInstall <- TRUE # Change to FALSE if you don't want packages installed.
toInstall <- c("ggplot2", "proxy")
if(doInstall){install.packages(toInstall, repos = "http://cran.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
nIncrements <- 36
eachIncrement <- seq(0, 1, len = nIncrements)
colorSweep <- expand.grid(eachIncrement, eachIncrement, eachIncrement)
moduloRemainder <- with(colorSweep, Var1*(nIncrements-1)) %%
floor(sqrt(nIncrements))