Skip to content

Instantly share code, notes, and snippets.

View TwoTau's full-sized avatar
👨‍🚀

Vishal Devireddy TwoTau

👨‍🚀
View GitHub Profile
@TwoTau
TwoTau / resource-management-research.md
Created March 26, 2019 19:44
Resource Management Research (CompSci HL)

Identifying and evaluating resources

Resources include:

  • processors (sound, graphics, CPU)
  • storage (primary, secondary memory, cache)
  • bandwidth (of peripherals, network)
  • bus bandwidth
  • screen resolution

Resources vary in mainframes, servers, PCs, laptops, netbooks, tablets, phones, cameras, and music players.

@TwoTau
TwoTau / BestTree.java
Last active November 28, 2018 22:05
Ayy this is the Best Tree implementation
import java.util.Scanner;
public class BestTree<E extends Comparable<E>> {
private TreeNode overallRoot;
public BestTree(TreeNode root) {
overallRoot = root;
}
public BestTree() {
this(null);
@TwoTau
TwoTau / Main.java
Last active September 27, 2018 19:49
LevDistance
import java.io.*;
import java.sql.SQLOutput;
import java.util.*;
public class Main {
private static Set<String> words;
private static Map<String, Set<String>> neighbors;
private static final char[] ALPHABET = "qwertyuiopasdfghjklzxcvbnm".toCharArray();
@TwoTau
TwoTau / binary_clock.ino
Created August 6, 2018 06:40
Code for a physical binary clock with an Arduino, an LED dot matrix, and an RTC module.
#include "LedControl.h"
#include <DS3231.h>
// Initialize the dot matrix and the clock
LedControl lc = LedControl(7, 5, 6, 1);
DS3231 clock;
void setup() {
// Start up and clear the matrix
lc.shutdown(0, false);
package org.usfirst.frc.team2976.robot.subsystems;
import org.usfirst.frc.team2976.robot.RobotMap;
import edu.wpi.first.wpilibj.AnalogGyro;
import edu.wpi.first.wpilibj.CANTalon;
import edu.wpi.first.wpilibj.Encoder;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SpeedController;
import edu.wpi.first.wpilibj.command.Subsystem;
@TwoTau
TwoTau / CANTalon Configuration.md
Last active January 11, 2017 02:53
How to configure a CANTalon

Connect computer to roboRIO

  1. Connect your computer to the roboRIO's USB A port
  2. Go to command prompt and run ping 172.22.11.2
    • If the ping doesn't work:
      • Make sure the robot is turned on and powered
      • Ensure that you are connected via USB
      • Try a different computer
  3. Go to the address 172.22.11.2 in Firefox (or IE)
    • Click "Tap here to active plugin" if Firefox blocked Silverlight from running
  4. Once the webpage loads, you should see something like this:
@TwoTau
TwoTau / sensors.c
Created September 27, 2016 22:19
Shows how to use sensors with RobotC
#pragma config(Hubs, S1, HTMotor, HTServo, none, none)
#pragma config(Motor, mtr_S1_C1_1, leftWheel, tmotorTetrix, openLoop, driveLeft)
#pragma config(Motor, mtr_S1_C1_2, rightWheel, tmotorTetrix, openLoop, driveRight)
#pragma config(Sensor, S2, gyroscope, sensorI2CHiTechnicGyro)
#pragma config(Sensor, S3, sonar, sensorSONAR)
#pragma config(Sensor, S4, compass, sensorI2CHiTechnicCompass)
int getCompass() {
return SensorValue[compass];
}