Skip to content

Instantly share code, notes, and snippets.

@RJ722
RJ722 / .spacemacs
Created Apr 20, 2020
SpaceMacs config
View .spacemacs
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@RJ722
RJ722 / .spacemacs
Created Apr 17, 2020
Spacemacs configuration for Operation Manhattan
View .spacemacs
;; Add the following inside (defun dotspacemacs/user-config ()
;; Load the scrum.el file.
(load-file "~/emacs-pack/scrum.el")
(define-skeleton insert-org-manhattan-entry
"Prompt for task, estimate and category"
nil
'(setq task (skeleton-read "Task: "))
'(setq estimate (skeleton-read "Estimate: "))
View check_quotes.py
import sys
import tokenize
class DoubleQuotesChecker:
msg = "single quotes detected, use double quotes instead"
def __init__(self):
self.violations = []
def find_violations(self, filename, tokens):
View 291.txt
266701458199987534227508222248914208869950686164274993404448882365065600282169239302670896789938746319778520327090150582689705651906481809911644824102697951060294431920631547867091808395803600406888851887419688757256807058337784692213479830097883557904643438347731372901138432
@RJ722
RJ722 / vulture.log
Created Oct 26, 2019
Output when running Vulture on cpython
View vulture.log
Doc/conf.py:20: unused variable 'doctest_global_setup' (60% confidence)
Doc/conf.py:27: unused variable 'manpages_url' (60% confidence)
Doc/conf.py:42: unused variable 'today_fmt' (60% confidence)
Doc/conf.py:45: unused variable 'highlight_language' (60% confidence)
Doc/conf.py:48: unused variable 'needs_sphinx' (60% confidence)
Doc/conf.py:57: unused variable 'smartquotes_excludes' (60% confidence)
Doc/conf.py:62: unused variable 'master_doc' (60% confidence)
Doc/conf.py:68: unused variable 'html_theme' (60% confidence)
Doc/conf.py:69: unused variable 'html_theme_path' (60% confidence)
Doc/conf.py:70: unused variable 'html_theme_options' (60% confidence)
View complex.c
struct ComplexNumber{
float Real;
float Im;
};
struct ComplexNumber init_complex_number(float Real, float Im){
struct ComplexNumber out;
out.Real = Real;
out.Im = Im;
View NOTES.md

NOTES on how to structure future code for AUV 2020 (Meeting on July 7, 2019):

  • Use a logger rather than random print statements.
  • We should use rosbags to record mock data (for testing in simulation) and make an abstract class (eg. mocking NodeRead), which would throw that random data.
  • Install flake8 on vim to prevent badly written code.
  • Don't leave any data unattended (like z-axis data from IMU).
  • Make tearDown for ever sensor so that it clears every resource they are using, therefore freeing up memory for other things.
View four_ask.py
import numpy as np
import matplotlib.pyplot as plt
BIT_DURATION = 1
MODULATION_FREQ = 3 / BIT_DURATION
N_SAMPLES = 1000
ALPHABET = ['00', '01', '10', '11']
def generate_random_sequence(length):
View binary_antipodal_signaling.py
import numpy as np
import matplotlib.pyplot as plt
BIT_DURATION = 1
MODULATION_FREQ = 3 / BIT_DURATION
N_SAMPLES = 10000
def generate_random_sequence(length):
return np.random.randint(0, 2, (length, ))
View thruster.ino
#include <Servo.h>
Servo left_servo, right_servo;
int ESC_PIN_1 = 8;
int ESC_PIN_2 = 10;
int HIGH_SPEED = 1600;
int LOW_SPEED = 1400;
int STOP_SPEED = 1500;