Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍🚀

Vishal Devireddy TwoTau

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

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 Nov 28, 2018
Ayy this is the Best Tree implementation
View BestTree.java
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 Sep 27, 2018
LevDistance
View Main.java
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 Aug 6, 2018
Code for a physical binary clock with an Arduino, an LED dot matrix, and an RTC module.
View binary_clock.ino
#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);
View drivetrain.java
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 Jan 11, 2017
How to configure a CANTalon
View CANTalon Configuration.md

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 Sep 27, 2016
Shows how to use sensors with RobotC
View sensors.c
#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];
}
You can’t perform that action at this time.