Skip to content

Instantly share code, notes, and snippets.

View fredcallaway's full-sized avatar

Fred Callaway fredcallaway

View GitHub Profile
#!/usr/bin/env python3
import os
class Compensator(object):
"""Tools for compensating MTurk workers."""
def __init__(self, use_sandbox=False, stdout_log=False, verbose=1,
verify_mturk_ssl=True, aws_key=None, aws_secret_key=None):
self.verbose = verbose
if aws_key is None:
using Distributions
using Plots
gr(label="", dpi=200, size=(400,300), lw=2)
α, β = 1, 5
prior = Beta(α, β)
max_n = 25
n = 0:max_n
posterior = Beta.(α .+ n, β) # Assuming θ = 1, we always get heads
@fredcallaway
fredcallaway / Model01-Firmware.ino
Created November 19, 2020 17:13
Testing host keymaps
// -*- mode: c++ -*-
// Copyright 2016 Keyboardio, inc. <[email protected]>
// See "LICENSE" for license details
#ifndef BUILD_INFORMATION
#define BUILD_INFORMATION "locally built"
#endif
/**
@fredcallaway
fredcallaway / Model01-Firmware.ino
Created May 31, 2020 06:30
Fred's Model01-Firmware.ino that worked previously
// -*- mode: c++ -*-
// Copyright 2016 Keyboardio, inc. <[email protected]>
// See "LICENSE" for license details
#ifndef BUILD_INFORMATION
#define BUILD_INFORMATION "locally built"
#endif
/**
* These #include directives pull in the Kaleidoscope firmware core,
This file has been truncated, but you can view the full file.
BOARD_HARDWARE_PATH="/Users/fred/Documents/Arduino/hardware" /Users/fred/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope/bin//kaleidoscope-builder build-all
Building ./Model01-Firmware 0.0.0-gv1.22-75-g03be into /var/folders/n0/lkhl85vn0951js8ct7ld_1br0000gn/T//kaleidoscope-fred/sketch/12886325562-Model01-Firmware.ino/output
In file included from /Users/fred/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope/src/kaleidoscope/key_defs.h:22:0,
from /Users/fred/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope/src/kaleidoscope_internal/sketch_exploration/keymap_exploration.h:19,
from /Users/fred/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope/src/kaleidoscope_internal/sketch_exploration/sketch_exploration.h:19,
from /Users/fred/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope/src/kaleidoscope_internal/event_dispatch.h:41,
from /Users/fred/Documents/Arduino/hardware/ke
[HIT Configuration]
title = Block stacking experiment (~15 minutes)
description = Solve block stacking puzzles in this Psychology experiment
amt_keywords = Psychology
lifetime = 24
us_only = true
approve_requirement = 95
contact_email_on_error = [email protected]
ad_group = Default psiTurk
organization_name = Princeton University
@fredcallaway
fredcallaway / approve_and_bonus.py
Last active April 24, 2018 01:14
Approves and bonuses all participants in a psiturk experiment.
#!/usr/bin/env python2
"""
Approves and bonuses (if applicable) all workers in the database for the
current psiturk project.
"""
from __future__ import print_function
from psiturk.amt_services_wrapper import MTurkServicesWrapper, Participant, init_db, db_session
wrapper = MTurkServicesWrapper()
@fredcallaway
fredcallaway / 2afc_items.ipynb
Created February 22, 2018 02:54
Item level effects
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fredcallaway
fredcallaway / webppl-interface.coffee
Created August 21, 2017 04:38
An asynchronous interface to webppl.
# These are all the functions available to the
# callWebppl interface. This could be defined
# in a less hacky way.
FUNCTIONS = """
{
initialize() {
null
},
flip() {