Skip to content

Instantly share code, notes, and snippets.

@MaxBareiss
MaxBareiss / hacksburg-servo.ino
Last active April 26, 2020 15:08
Code for Hacksburg's Python Two class
#include <Servo.h>
// The actual location of Servo #1.
int position1 = 0;
// The actual location of Servo #2.
int position2 = 0;
// The target location of Servo #1.
int target1 = 0;
// The target location of Servo #2.
int target2 = 0;
PK ! Nœ=¦» »  prusa_i3_xl_eyeball settings[general]
version = 2
name = Eyeball Settings
definition = fdmprinter
[metadata]
setting_version = 2
quality_type = draft
type = quality_changes
<link rel="import" href="../paper-ripple/paper-ripple.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
@MaxBareiss
MaxBareiss / frechet.py
Last active July 7, 2023 13:36
Fréchet Distance in Python
# Euclidean distance.
def euc_dist(pt1,pt2):
return math.sqrt((pt2[0]-pt1[0])*(pt2[0]-pt1[0])+(pt2[1]-pt1[1])*(pt2[1]-pt1[1]))
def _c(ca,i,j,P,Q):
if ca[i,j] > -1:
return ca[i,j]
elif i == 0 and j == 0:
ca[i,j] = euc_dist(P[0],Q[0])
elif i > 0 and j == 0:
-(void) audioRecorderDidFinishRecording:(AVAudioRecorder *)recorder successfully:(BOOL)flag
{
static FFTSetupD fft_weights;
static DSPDoubleSplitComplex input;
static double *magnitudes;
ExtAudioFileRef fileRef;
ExtAudioFileOpenURL((__bridge CFURLRef)[recorder url], &fileRef);
@MaxBareiss
MaxBareiss / gist:5019766
Last active December 14, 2015 03:19
RobotC static variable test
int doStuff(){
static int b = 3;
return b++;
}
task main()
{
while(true) // Infinite loop:
{
writeDebugStreamLine("%d",doStuff());