This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns daemon.visual-cortex.pushup-counter | |
(:require | |
[daemon.smart-atom :as smart-atom] | |
[daemon.voice.core :as voice] | |
[clojure.math.numeric-tower :as math]) | |
(:import org.httpkit.BytesInputStream | |
[org.opencv.core MatOfByte Core Mat Point Scalar] | |
[org.opencv.imgcodecs Imgcodecs] | |
[org.opencv.imgproc Imgproc] | |
[org.opencv.video Video]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
FILE * fifo; | |
char BUFF[500]; | |
struct a_header{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> a = np.array([[1,2,3],[4,5,6]]) | |
>>> a | |
array([[1, 2, 3], | |
[4, 5, 6]]) | |
>>> b = [1,2] | |
>>> a[:, b] | |
array([[2, 3], | |
[5, 6]]) | |
>>> a[np.arange(len(a)), b] | |
array([2, 6]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro infix [a b c] | |
`(~b ~a ~c)) | |
(defmacro python-fn-call [f a] | |
(if (not (nil? a)) | |
(cons f a) | |
f)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install -y build-essential | |
sudo apt-get install -y cmake | |
sudo apt-get install -y libgtk2.0-dev | |
sudo apt-get install -y pkg-config | |
sudo apt-get install -y python-numpy python-dev | |
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev | |
sudo apt-get install -y libjpeg-dev libpng-dev libtiff-dev libjasper-dev | |
sudo apt-get install -y libopencv-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun box-muler-sample () | |
(* (sqrt (* -2 (log (random 1.0)))) (cos (* 2 pi (random 1.0))))) | |
(defun simulate-height-expiriement () | |
(let ((count 0) | |
(max -9999)) | |
(dotimes (i 1000) | |
(let ((new-sample (box-muler-sample))) | |
(if (> new-sample max) | |
(progn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import serial | |
import time | |
ser = serial.Serial("/dev/ttyACM0") | |
time.sleep(2) | |
def write_pos(z,y): | |
ser.write(0) | |
ser.write(y) | |
ser.write(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Servo.h> | |
Servo y_rotate_servo; | |
Servo z_rotate_servo; | |
int toggle_motor_pin = 12; | |
unsigned long last_command_time = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns torque-sim.core) | |
;;I want to calculate the strenght of motors needed for a robot of various parameters | |
(defn get-motor-strength | |
[robot-femur-length robot-torso-weight] | |
() | |
) | |
(def g 9.8) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
from yattag import Doc | |
from flask import Flask | |
js_scripts = [] | |
app = (Flask(__name__)) | |
thread = None | |
def start(host='0.0.0.0', port = 6969): | |
"""Gets app listening on host:port. Call inject before starting the |