Skip to content

Instantly share code, notes, and snippets.

@jimmitt
jimmitt / calculator.htm
Created August 3, 2020 03:35
Calculator
<html>
<head>
<title>Calculator</title>
</head>
<body>
<table width="100px" style="text-align: center; vertical-align: middle;" border="2px">
<tr>
<td colSpan="4"><input type="text" id="display" style="width: 110px;" disabled/></td>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Jigsaw puzzle</title>
<script type="text/javascript">
function save(filename, data)
{
var blob = new Blob([data], {type: "text/csv"});
@jimmitt
jimmitt / pingTest.ps1
Last active April 2, 2018 17:56
Pings an address and saves the results.
#Created By James Trimble, 29 March 2018 - http://www.jamestrimble.info
#Based on a script by Martin9700 posted to a forum on 17 May 2013, https://community.spiceworks.com/topic/337701-ping-via-powershell-log-results-with-timestamp
Param (
[int32]$count = 5,
[Parameter(ValueFromPipeline=$true)]
[String[]]$destination = "8.8.8.8",
[Int]$threshold = 50,
[string]$resultsFile = ".\pingResults.csv",
[string]$dataFile = ".\pingData.csv"
)
@jimmitt
jimmitt / keybase.md
Created April 14, 2015 22:17
keybase.md

Keybase proof

I hereby claim:

  • I am jimmitt on github.
  • I am jamestrimble (https://keybase.io/jamestrimble) on keybase.
  • I have a public key whose fingerprint is A765 6A36 B5B3 ED11 ED95 ED4A 49BC 93B5 936E 7149

To claim this, I am signing this object:

/*
* MotorController by James Trimble, Capt, USAF
* USAFA ECE Automata Club
* Description: Uses the Analog-to-Digital Converter to read the voltage from a voltage divider (100K resistor w/ 100K pot).
* Sets the PWM duty cycle based on the ADC value to allow controlling a DC motor's speed using the potentiometer.
*/
#include <msp430.h>
int main(void) {
/*
* IRProximitySensor by James Trimble, Capt, USAF
* USAFA ECE Automata Club
* Description: Uses the Analog-to-Digital Converter to read the voltage from an IR Proximity
* Sensor circuit and then turns on 0,1, or 2 on-board LEDs based on the reading.
*/
#include <msp430.h>
int main(void)
/*
* ButtonTest by James Trimble, Capt, USAF
* USAFA ECE Automata Club
* Description: Uses polling to detect button presses, then increments a 2-bit counter
* which is displayed on the on-board LEDs tied to P1.0 and P1.6
*/
#include <msp430.h>
/*
@jimmitt
jimmitt / erraticants.java
Created October 16, 2013 22:52
Erratic Ants problem from ACM competition qualification
// Created by James Trimble (On Twitter @jamestrimble)
// Original problem can be found here, https://icpc-qual-13.contest.scrool.se/problems/erraticants
public class erraticants {
public static Room[][] map;
public static void main(String[] args) {
int problem = 2;
String path;
switch (problem) {
@jimmitt
jimmitt / trapezoidwalkway.java
Last active December 25, 2015 16:08
Trapezoid Walkway problem from ACM competition qualification
// Created by James Trimble (on Twitter @jamestrimble)
// View the original problem here, https://icpc-qual-13.contest.scrool.se/problems/walkway
import java.util.LinkedList;
public class trapezoidwalkway {
public static Integer iterations = 0;
public static Double memo[];
public static void main(String[] args) {
@jimmitt
jimmitt / rodcut.java
Last active December 25, 2015 16:08
Rod Cutting Problem
// Created by James Trimble (on Twitter @jamestrimble)
// A description of the problem is available here, http://users.csc.calpoly.edu/~dekhtyar/349-Spring2010/lectures/lec09.349.pdf
public class rodcut {
static int iterations = 0;
static int goal = 20;
static Integer memo[][] = new Integer[goal+1][10];
public static void main(String[] args) {
Integer pieces[][] = {{1,2,3,4,5,6,7,8,9,10},{1,5,4,9,10,17,17,20,24,30}};