Skip to content

Instantly share code, notes, and snippets.

View victoryforphil's full-sized avatar
:shipit:
Simulating stuff

Alex Carter victoryforphil

:shipit:
Simulating stuff
View GitHub Profile
@victoryforphil
victoryforphil / FRQ-121318.java
Created December 13, 2018 17:08
Questions for FRQ in APCSA, turned in 12/13/2018. Alex Carter
/*
Alex Carter @ GTHS
12/13/2018
VictoryForPhil@gmail.com
*/
// Question 1
public int[] replaceHighAndLow(int[] arr){
for(int i=0;i<arr.length;i++){
@victoryforphil
victoryforphil / jade2018.java
Created July 24, 2018 01:38
Jade 2018 Code
package org.usfirst.frc.team4151.robot;
/*Team coding work to post later, look into code with basic Java FRC Drive Code
Will be added to GitHub, but all edits and comments should be made on here.*/
//Comment like this or like I did above
import java.util.concurrent.TimeUnit;
import edu.wpi.first.wpilibj.*;
import edu.wpi.first.wpilibj.CounterBase.EncodingType;
@victoryforphil
victoryforphil / Details
Last active March 19, 2018 21:31
Pathfinder #1
Encoder Left: no reversal
Encoder Right: no reversal
Profile:
#pragma once
#pragma once
namespace DriveProfile {
const double WHEELBASE_WIDTH = 0.6;
const double WHEEL_CIRCUMFERENCE = 18.49;
const double MAX_VELOCITY = 5;
@victoryforphil
victoryforphil / CryptoBox.java
Created December 17, 2017 03:15
Dated 12/16/17 7:15PM
package com.disnodeteam.dogecv.detectors;
import com.disnodeteam.dogecv.OpenCVPipeline;
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.MatOfPoint;
import org.opencv.core.Point;
import org.opencv.core.Rect;
public Mat processFrame2(Mat frame)
{
// if the frame is not empty, process it
if (!frame.empty())
{
// init
//Mat flippedImage = new Mat();
Mat resizedImage = new Mat();
Mat blurredImage = new Mat();
Mat hsvImage = new Mat();
#This is prototpying code used to figure out the logic nessary to find the position of CryptoBoxes
#in the FTC Relic Recovery Game. The logic and parameters found here will then be transfered to
#the FTC App running on the Java Phone. When that is finished, our code will be made avalible to all.
import cv2
import numpy
#Load Test Image
raw = cv2.imread("row2.jpg")
const tmi = require('tmi.js');
const sleep = require('system-sleep');
const io = require('socket.io-client');
const IRCUtils = require('./IRCUtils.js');
class IRCPlugin {
constructor() {
var self = this;
self.DB = {};
self.utils = {};
@victoryforphil
victoryforphil / TitanLogger.cs
Created February 12, 2017 00:02
GUI C# TCP Logger
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net.Sockets;
using System.Threading;
@victoryforphil
victoryforphil / TitanLogger.cs
Created February 11, 2017 08:20
Working on GUI Logger #1
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net.Sockets;
using System.Threading;
@victoryforphil
victoryforphil / Server.js
Last active February 11, 2017 06:58
TCP Code Tests - Android
var net = require('net')
var port = 7777;
var server = net.createServer();
server.listen(port, function(err,err2){
console.log(err2);
});
server.on('connection', function(socket) { //This is a standard net.Socket
console.log("Conneted!");
socket.on('data', function(message) {