Skip to content

Instantly share code, notes, and snippets.

View rfdickerson's full-sized avatar
:octocat:
Reticulating splines

Robert F. Dickerson rfdickerson

:octocat:
Reticulating splines
View GitHub Profile
@rfdickerson
rfdickerson / SpeechToTextTests.swift
Created December 16, 2015 22:29
Example of using AVAudioRecorder
func testRecording() {
let recordExpectation = expectationWithDescription("Record")
let recordSettings = [
// AVFormatIDKey: NSNumber(unsignedInt:kAudioFormatLinearPCM),
AVNumberOfChannelsKey: 1,
AVSampleRateKey : 16000.0
]
@rfdickerson
rfdickerson / cool-minion.tex
Created March 5, 2018 19:18
LaTeX with Minion Font
\documentclass{amsart}
\usepackage{amssymb}
\usepackage[no-math]{fontspec}
%\usepackage[mathlf,footnotefigures]{MinionPro}
\usepackage{amsmath}
\usepackage{MnSymbol}
\usepackage[USenglish]{babel}
@rfdickerson
rfdickerson / newton.py
Created February 27, 2021 20:54
ik- newton
@jit
def forward(state):
return forward_ik(state["angles"], state["lengths"])
@jit
def checker(state):
end_location = forward(state)
distance = jnp.linalg.norm(end_location - state["target"])
return distance > 0.00001
@rfdickerson
rfdickerson / forward.py
Last active February 27, 2021 20:52
ik-forward
@jit
def forward_ik(angles, lengths):
x = jnp.cos(angles)
y = jnp.sin(angles)
d = jnp.stack([x,y], axis=0)
return jnp.dot(d, lengths)
@jit
def forward(state):
return forward_ik(state["angles"], state["lengths"])
@rfdickerson
rfdickerson / ik.py
Last active January 11, 2021 14:54
ik
import numpy as np
# forward kinematics
def forward(theta, l):
ex = np.dot(l, np.cos(theta))
ey = np.dot(l, np.sin(theta))
return np.array([ex, ey])
job "toaster-mnist" {
datacenters = ["us-aep-1-prod-multipaas-1"]
type = "batch"
group "toaster-mnist-group" {
task "toaster-mnist-task" {
driver = "docker"
@rfdickerson
rfdickerson / opencv-build.sh
Created January 26, 2019 15:49
Build OpenCV with CUDA
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D WITH_CUDA=ON \
-D ENABLE_FAST_MATH=1 \
-D CUDA_FAST_MATH=1 \
-D WITH_CUBLAS=1 \
-D INSTALL_C_EXAMPLES=OFF \
-D OPENCV_ENABLE_NONFREE=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/Libraries/opencv_contrib-4.0.1/modules \
@rfdickerson
rfdickerson / kd_tree.cpp
Created July 1, 2018 19:53
KD Tree implementation
#include <iostream>
#include <algorithm>
#include <vector>
#include <iterator>
#include <memory>
using namespace std;
typedef vector<float> Point;
@rfdickerson
rfdickerson / environment.yml
Created March 28, 2018 15:40
Sample Environment.yml
name: travelbug
channels:
- anaconda
- conda-forge
- defaults
dependencies:
- pandas
- pyarrow
- arrow-cpp
- parquet-cpp
@rfdickerson
rfdickerson / pthreads.swift
Last active December 15, 2017 03:17
Example of Forking a thread in Swift
import Foundation
func sayHello2() {
//sleep(5)
print("Hello!")
}
#if false
public func pthread_create(