Skip to content

Instantly share code, notes, and snippets.

// Variables used by Scriptable. These must be at the very top of the file. Do not edit.
// icon-color: green; icon-glyph: hockey-puck;
/*************************************************
* script     : NHL-Gameday-Widget.js
* version    : 2.1
* description: Widget for Scriptable.app, which
*              shows the next regular season games
* for your NHL teams.
*              Widget parameter should be 1-4
% Plotting of Bitalino plots
% Unnas Hussain (modified from Alex Yeh Lab 2 code)
dataFiles=["data/hand_2d_old.txt","data/chest_2d_old.txt"];
n=2;
sr=1000;
time=120; % in secs
titles=["Hand Electrodes at Rest","Chest Electrodes at Rest"];
class Main {
public static void main(String[] args) {
Car cadillac = new Car("cadillac");
Car beamer = new Car("beemer");
System.out.println(cadillac.getBrand2()); // prints "float like a cadillac"
System.out.println(beamer.getBrand1()); // prints "sting like a beemer"
}
}
interface ILo{
boolean sameList(ILo other);
boolean sameListCons(ConsLo other);
boolean sameListMt(MtLo other);
boolean hasElement(Element e); //not shown, but behaves as you would expect it to
}
class ConsLo extends ILo{
boolean sameListCons(ConsLo other){
// this is the key part. Once you have processed the first item of this list,
@unbun
unbun / CircuitsReportTemplate.tex
Created January 17, 2019 23:59
LaTeX template for Circuits&Signals lab reports
%Unnas Hussain
%This is mostly just so I have this Preamble set up somewhere, the actual document stuff
%isn't that important except for stuff like tabs and good tables and equations and stuff
\documentclass[letterpaper,12pt]{article}
\usepackage{caption}
\usepackage{float}
@unbun
unbun / CS 2500 Cheat Sheet.md
Last active July 6, 2018 21:34
Fundies notes

Functions:

  • Define a function:
  • (define (funct-name arg-name)
      ;;body
    )
  • Call a function:
  • @unbun
    unbun / LightController.java
    Last active January 8, 2018 19:24
    light controller for whileheld state leds
    import edu.wpi.first.wpilibj.DigitalOutput
    public class LightController{
    private DigitalOutput pin1,pin2,pin3;
    private boolean active1, active2, active3;
    /**
    *@param the roboRIO DIO ports being used
    */
    public LightController(int dio1, int dio2, int dio3){
    @unbun
    unbun / CommandSelector.java
    Last active January 8, 2018 19:23
    A class used to store the different Auto Commands in an ArrayList so that we can initialize and access them w/o messing with stuff in Robot.java. There is also stuff in Robot.java that is used to access it
    package org.usfirst.frc.team2791.robot.util;
    import java.util.ArrayList;
    import edu.wpi.first.wpilibj.command.Command;
    import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
    /**
    * Allows user to list a group of Commands and then select from them based on a key </br>
    * Also has team color choosing capabilities</br>