Skip to content

Instantly share code, notes, and snippets.

View cdr6934's full-sized avatar

Chris Ried cdr6934

View GitHub Profile
@cdr6934
cdr6934 / 0_reuse_code.js
Created July 22, 2014 13:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@cdr6934
cdr6934 / file
Created March 2, 2012 22:42
Example for Dennis
<html>
<head>
<title>Stacked Bar Chart</title>
<script type="text/javascript" src="protovis.js"></script>
</head>
<body>
<div id="figure-wrapper">
<div id="figure">
<script type="text/javascript+protovis">
@cdr6934
cdr6934 / edit_distance_perl
Created March 9, 2012 21:27
Edit Distance
#!/usr/bin/perl
#The purpose of this algorithm is to identify
# the edit distance of two words in similarity.
#Enter both words for alignment
print "Please enter first word: ";
chomp($one = <STDIN>);
print "Please enter second word: ";
chomp($two = <STDIN>);
@cdr6934
cdr6934 / DivvyRides.R
Created December 1, 2016 13:53
Divvy Rides
library(dplyr)
library(ggplot2)
library(viridis)
library(ggthemes)
#import all the files
temp <- list.files(pattern="*.csv")
alldata<- do.call(rbind, lapply(temp, function(x) read.csv(x, stringsAsFactors = FALSE)))
res <- sqlQuery(dbhandle, query1)
odbcClose(dbhandle)
result <- data.frame(res)
result
@cdr6934
cdr6934 / import_csv.R
Created December 5, 2019 17:40
Import CSV file
import(readr)
online_orders <- read_csv("online_orders.csv",
col_types = cols(ORDER_DATE = col_datetime(format = "%Y-%m-%d %H:%M:%S"),
STATUS_DATE = col_datetime(format = "%Y-%m-%d %H:%M:%S")))
@cdr6934
cdr6934 / Processing
Created November 14, 2020 14:43
chinese_dreams
int cnt = 100;
int[][] color_collection = new color[5][5];
FingerMonster[] fm = new FingerMonster[cnt];
int t,i,j;
color c, c1, c2;
int[] colors = new int[5];
void setup(){
size(3000,2000);
noStroke();
@cdr6934
cdr6934 / circular_wealth.pde
Created November 28, 2020 21:53
Circlular Wealth
float n,r, div,margin;
int iter;
color a, b;
void setup()
{
size(1000,1000);
background(255);
n = 6;
r = 5;
a = getColor();
@cdr6934
cdr6934 / noiseField.pde
Last active December 19, 2020 16:14
Following noise field that looks over the entire spectrum
/*
Programing: Noise Field
Name: @Generate.Collective
Color functions are tewmplates used by @manolode
*/
///////////////////////////////////////////////////////////
int move, n;
@cdr6934
cdr6934 / Spiraling Arc
Created March 1, 2021 14:58
Spiraling Arc
/*
Programing: Explorations in the Arc Realm
Name: Chris Ried
*/
ArcLine[][] al;
float start_arc, stop_arc, r, diff, margin, x, y, nf;
float noise_factor;
int n;
void setup()