Skip to content

Instantly share code, notes, and snippets.

View jononon's full-sized avatar

Jonathan Damico jononon

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="wolfram1" />
<Content type="html"><![CDATA[
<script type="text/javascript" id="WolframAlphaScript57e20d06ef2e9ca00fe43ebbbdbc0f50" src="http://www.wolframalpha.com/widget/widget.jsp?id=57e20d06ef2e9ca00fe43ebbbdbc0f50"></script>
]]></Content>
</Module>
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="wolfram1" />
<Content type="html"><![CDATA[
<script type="text/javascript" id="WolframAlphaScriptc9e253055ef32f8efad9019df7961804" src="http://www.wolframalpha.com/widget/widget.jsp?id=c9e253055ef32f8efad9019df7961804"></script>
]]></Content>
</Module>
@jononon
jononon / DoorGuard
Created December 18, 2014 01:33
Door Guard for Robotics
#pragma config(Sensor, S1, Door, sensorEV3_Ultrasonic)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main() {
setLEDColor(ledOrangePulse);
wait1Msec(3000);
int threshold = SensorValue[Door]-10;
while(true) {
setLEDColor(ledGreenPulse);
#!/usr/bin/env python
import os
import sys
import subprocess
import argparse
import ConfigParser
import shlex
# Default config
DEFAULT_SOUND = 'beep-crisp'
@jononon
jononon / code-1.htm
Last active August 29, 2015 14:21 — forked from bennadel/code-1.htm
<script type="text/javascript">
// This will parse a delimited string into an array of
// arrays. The default delimiter is the comma, but this
// can be overriden in the second argument.
function CSVToArray( strData, strDelimiter ){
// Check to see if the delimiter is defined. If not,
// then default to comma.
strDelimiter = (strDelimiter || ",");
public class intester {
public static void main (String args[]) {
int testInt = 135;
int sum = 0;
sum = testInt%10; //adds 5 to the sum
testInt=testInt/10; //devides the test int by 10
sum = sum + testInt%10; //adds 3 to the sum
testInt=testInt/10; //devides the test int by 10
sum = sum + testInt%10; //adds 1 to the sum
System.out.println(sum); //returns 9
public class dogtagexample{
/**
* Checks that a dog tag is valid
* @param dogTag the dog tag to be checked
* @return true if the dog tag is a valid dog tag
*/
public static boolean checkDogTag (String dogTag) {
if(dogTag.length()!=4)
throw new IndexOutOfBoundsException();
import java.util.*;
public class Compat {
public static void main (String args[]) {
Random r = new Random(System.nanoTime());
System.out.println(""+r.nextInt(100)+"&");
}
}
#pragma config(Motor, port1, rightWheel1, tmotorVex393_HBridge, openLoop)
#pragma config(Motor, port2, rightWheel2, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port3, rightWheel3, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port4, leftWheel2, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port5, leftWheel3, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port10, leftWheel1, tmotorVex393_HBridge, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
#pragma platform(VEX)
repeat
-- Get the "hour"
set timeStr to time string of (current date)
set Pos to offset of ":" in timeStr
set theHour to characters 1 thru (Pos - 1) of timeStr as string
set timeStr to characters (Pos + 1) through end of timeStr as string
-- Get the "minute"
set Pos to offset of ":" in timeStr
set theMin to characters 1 thru (Pos - 1) of timeStr as string