Skip to content

Instantly share code, notes, and snippets.

View chrisfosterelli's full-sized avatar
💻
Building exciting things!

Chris Foster chrisfosterelli

💻
Building exciting things!
View GitHub Profile
@chrisfosterelli
chrisfosterelli / AccountContext.js
Last active September 1, 2022 13:28
Context Example
import { createContext } from 'react'
export default createContext(null)
""" Web application for serving agent """
import time
import json
import bottle
import numpy as np
import battlesnake.agent
def map_state(player, state, width, height):
<?xml version="1.0" encoding="UTF-8"?>
<TrainingCenterDatabase xmlns:ns5="http://www.garmin.com/xmlschemas/ActivityGoals/v1" xmlns:ns3="http://www.garmin.com/xmlschemas/ActivityExtension/v2" xmlns:ns2="http://www.garmin.com/xmlschemas/UserProfile/v2" xmlns="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns4="http://www.garmin.com/xmlschemas/ProfileExtension/v1" xsi:schemaLocation="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2 http://www.garmin.com/xmlschemas/TrainingCenterDatabasev2.xsd">
<Activities>
<Activity Sport="Biking">
<Id>2017-10-15T03:00:00.000Z</Id>
<Lap StartTime="2017-10-15T03:04:19.000Z">
<TotalTimeSeconds>8106.0</TotalTimeSeconds>
<DistanceMeters>60.0000</DistanceMeters>
<Calories>820</Calories>
<AverageHeartRateBpm>
#!/usr/bin/env python3
""" Convert MEG data to the 2vs2 CSV input file format """
import csv
import tables
file = tables.open_file('../data/meg_data_averaged.mat')
def get_word(file, word):
/* Update records to clear UTF8 characters
* May 29th, 2017
*/
const r = require('./server/r')
function run(cb) {
r.table('Student')
.replace(student => {
@chrisfosterelli
chrisfosterelli / dataset.txt
Created May 25, 2017 23:17
Neural network workshop #2
https://github.com/karpathy/char-rnn/raw/master/data/tinyshakespeare/input.txt
@chrisfosterelli
chrisfosterelli / network.py
Created May 25, 2017 23:07
Neural Network Workshop
# Backprop on the Seeds Dataset
from random import seed
from random import randrange
from random import random
from csv import reader
from math import exp
# Load a CSV file
def load_csv(filename):
dataset = list()
@chrisfosterelli
chrisfosterelli / subj1.txt
Created May 8, 2017 18:36
Subject Word Counts
ANGRY has 9 trials
ARTIST has 5 trials
BE has 34 trials
CAKE has 4 trials
CAMPING has 2 trials
CAR has 5 trials
CATS has 2 trials
CINEMA has 8 trials
COMPUTER has 2 trials
DANCE has 4 trials
@chrisfosterelli
chrisfosterelli / README.md
Last active May 5, 2017 22:33
Attention Questions

Attention Questions

This export contains a csv file that can be used for testing that the subject is paying attention to the words. The file is available in questions.csv.

The word vectors operate on a scale of 1 to 5, but this export only returns questions that all or the vast majority of mechanical turk users agreed upon as being one of the extremes (1 for always no and 5 for always yes). The yes/no answers are split approximately 50% for yes and 50% for no so the subject cannot learn a response pattern.

0 IS IT AN ANIMAL?
1 IS IT A BODY PART?
2 IS IT A BUILDING?
3 IS IT A BUILDING PART?
4 IS IT CLOTHING?
5 IS IT FURNITURE?
6 IS IT AN INSECT?
7 IS IT A KITCHEN ITEM?
8 IS IT MANMADE?
9 IS IT A TOOL?