Skip to content

Instantly share code, notes, and snippets.

View drscotthawley's full-sized avatar
Solving environment /

Scott H. Hawley drscotthawley

Solving environment /
View GitHub Profile
@drscotthawley
drscotthawley / TestRenderMan_DexedVST.ipynb
Created April 28, 2018 02:17
Slight modification of RenderMan demo, made for Python 3 and MacOS
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@drscotthawley
drscotthawley / Gamepad_Eyes_OSC.pde
Last active October 4, 2022 18:25
"Gamepad" Input example for Wekinator, e.g. for Xbox 360 controller
// Gamepad_Eyes_OSC: demo of using game controller for OSC input.
// Uses the two thumb-sticks and either the left or right bumper buttons.
//
// Peter Lager maintains the Game Control Plus library (for Processing),
// which provides control data for joysticks and other game controllers
// ...such as my Xbox 360 controller.
//
// This is a quick mash-up using Lager's Gcp_gamepad animated eyes example code,
// (which is in the GCP library: In Processing, go to File > Examples..., then Contributed Libraries > Game Control Plus)
// and Rebecca Fiebrink's Simple_Mouse_DraggedObject_2Inputs example code for Wekinator.
@drscotthawley
drscotthawley / WebAudioFreqGain.html
Last active February 19, 2023 13:31
WebAudio OSC Output for use with Wekinator
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html> <head>
<title>WebAudio OSC Output Example - 2 Variables</title>
<!-- By Scott Hawley @drscotthawley. Modified from https://github.com/automata/osc-web/blob/master/web-side/app.html
No additional license restrictions are introduced with these modifications; the automata/osc-web site gives no license info.
Thus as far as this author is concerned: "unlimited license": feel free to use & modify in any way you wish! -->
</head>
<body>
<h2>WebAudio OSC Output Example - 2 Variables</h2>
@drscotthawley
drscotthawley / faves2bibtex.py
Last active February 6, 2024 10:43
Generate BibTex from list of Tweets you (or another user) have favorited ('liked'), tweeted or RT'd
#! /usr/bin/env python3
"""
faves2bibtex.py
Author: Scott Hawley
Scrapes URLs contained in tweets you (or another user) favorited ('liked') for DOI & other bibliographic info,
and tries to generate a set of BibTex entries to stdout.
Status messages go to stderr
Sample usage:
@drscotthawley
drscotthawley / tictactoe_policy.py
Last active August 17, 2017 14:28
My implementation of a temporal difference policy method for playing Tic Tac Toe, after seeing Shlomo Bauer speak at the Brentwood A.I. meetup.
#! /usr/bin/env python3
# Uses temporal difference policy method
# See, e.g., http://www.cs.dartmouth.edu/~lorenzo/teaching/cs134/Archive/Spring2009/final/PengTao/final_report.pdf
# In this code, X plays randomly whereas O 'learns'. (Feel free to change that)
# Thus we expect O to outperform X eventually
# Author: Scott Hawley http://drscotthawley.github.io
# Unlimited License: Feel free to use any or all of this code however you like.
@drscotthawley
drscotthawley / greenscreen.py
Last active December 10, 2021 07:21
greenscreen.py: Greenscreen effect without a physical green screen, via OpenCV and Python
#! /usr/bin/env python
'''
greenscreen.py: Greenscreen effect without a physical green screen
This performs background subtraction, and sets the background to "green" for use with "key frame" video editing software
Author: Scott Hawley, https://github.com/drscotthawley
Requirements:
Python, NumPy and OpenCV
I got these via Macports, but Homebrew, etc. work.