Skip to content

Instantly share code, notes, and snippets.

package class09;
import java.io.BufferedReader;
import java.io.InputStreamReader;
// UVa 352 - The Seasonal War
public class Main00352TheSeasonalWar {
public static void main(String[] args) throws Exception {
new Main00352TheSeasonalWar().execute();
@boxysean
boxysean / Main00441.java
Created August 9, 2013 17:13
Lotto UVa 441
package homework04;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Stack;
// 441 Lotto
public class Main00441 {
public static void main(String[] args) throws Exception {
@boxysean
boxysean / gist:6441636
Created September 4, 2013 19:24
cordova exception
boxysean@boxysean-ubook:~/workspace/BikeFIRMA-mobile$ cordova --verbose ripple android
Wrote out Android application name to "BikeFIRMA"
Wrote out Android package name to "com.dash7design.bikefirma"
Error: Invalid listen argument:
at Server.listen (net.js:1098:13)
at Function.app.listen (/usr/local/lib/node_modules/cordova/node_modules/ripple-emulator/node_modules/express/lib/application.js:533:24)
at Object.module.exports.start (/usr/local/lib/node_modules/cordova/node_modules/ripple-emulator/lib/server/index.js:33:13)
at Object.module.exports.start (/usr/local/lib/node_modules/cordova/node_modules/ripple-emulator/lib/server/emulate.js:31:26)
at /usr/local/lib/node_modules/cordova/src/ripple.js:27:24
at /usr/local/lib/node_modules/cordova/src/serve.js:130:9
@boxysean
boxysean / gist:6884552
Created October 8, 2013 13:22
Trying to make an Arduino blink sketch for the Universal LED Driver
int clockPin = 2;
int dataPin = 3;
void setup() {
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(13, OUTPUT);
}
void loop() {
@boxysean
boxysean / pwm_sketch.ino
Created December 4, 2013 19:52
why don't i get better resolution when i pwm?
#define PWM_PIN 2
#define BIT_RESOLUTION_READ 12
#define BIT_RESOLUTION_WRITE 12
void setup() {
pinMode(PWM_PIN, OUTPUT);
analogWriteResolution(BIT_RESOLUTION_WRITE);
analogReadResolution(BIT_RESOLUTION_READ);
Serial.begin(9600);
#include "testApp.h"
//--------------------------------------------------------------
void testApp::setup(){
ofSetVerticalSync(true);
bSendSerialMessage = false;
ofBackground(255);
ofSetLogLevel(OF_LOG_ERROR);
@boxysean
boxysean / TriacBlocDiagnostic.ino
Created December 11, 2013 17:19
Arduino code to control Mic's Triac Bloc, which Mic documented here: http://wemakethings.net/2013/10/27/triac-bloc/
/**
* Arduino code to control Mic's Triac Bloc, which Mic documented here:
* http://wemakethings.net/2013/10/27/triac-bloc/
*
* by boxysean, Dec 11 2013 -- Dash 7 Design
*/
#include <Wire.h>
#define COMMAND_CALIBRATE 'c'
#include "ofApp.h"
void ofApp::writejacks(int jacks) {
ofFile file(ofToDataPath("DocumentRoot/jumpingjacks.tmp"), ofFile::WriteOnly);
file << jacks/2;
file.close();
ofFile::moveFromTo(ofToDataPath("DocumentRoot/jumpingjacks.tmp"),ofToDataPath("DocumentRoot/jumpingjacks"), true, true);
}
void ofApp::writecalibrated(int calibrated) {
@boxysean
boxysean / avr-programming.sh
Created June 4, 2014 16:27
"Good looking" run of the make commands for Waterfall Swing
boxysean-mbpr:solenoid-controller boxysean$ avrdude -p m128 -B 50 -P usb -c dragon_isp
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.16s
avrdude: Device signature = 0x1e9702
avrdude: safemode: Fuses OK (E:FD, H:99, L:DE)
@boxysean
boxysean / photo2.sh
Created August 19, 2014 17:05
Raspberry Pi cannot see the Canon 5D Mark II (firmware v 2.1.2) it is connected to
pi@gifbooth ~/GIFBooth $ gphoto2 --list-ports
Devices found: 2
Path Description
--------------------------------------------------------------
ptpip: PTP/IP Connection
usb:001,003 Universal Serial Bus
pi@gifbooth ~/GIFBooth $ gphoto2 --auto-detect
Model Port
----------------------------------------------------------
pi@gifbooth ~/GIFBooth $ gphoto2 --capture-image-and-download