Skip to content

Instantly share code, notes, and snippets.

@dmelancon
dmelancon / mc-validate.js
Created January 12, 2019 22:47 — forked from asuozzo/mc-validate.js
mc validation
/*!
* jQuery Form Plugin
* version: 3.51.0-2014.06.20
* Requires jQuery v1.5 or later
* Copyright (c) 2014 M. Alsup
* Examples and documentation at: http://malsup.com/jquery/form/
* Project repository: https://github.com/malsup/form
* Dual licensed under the MIT and GPL licenses.
* https://github.com/malsup/form#copyright-and-license
// Import libraries (BLEPeripheral depends on SPI)
#include <SPI.h>
#include <BLEPeripheral.h>
#include <TimerOne.h>
// define pins (varies per shield/board)
#define BLE_REQ 6
#define BLE_RDY 7
#define BLE_RST 4
#include "cinder/app/AppBasic.h"
#include "cinder/Serial.h"
#include "cinder/Text.h"
#include "cinder/gl/Texture.h"
#include "OscSender.h"
#include "cinder/System.h"
#include <sstream>
using namespace ci;
const int coinIntPin = 0; //interruptPin 0 is digital pin 2
volatile boolean newCoin = false;
volatile int pulseCount; //counts pulse for
volatile int timeOut = 0; //counts timeout after last coin inserted
String coinType;
int coinTypeInt;
void setup(){
Serial.begin(9600);
attachInterrupt(coinIntPin, coinInserted, RISING);
@dmelancon
dmelancon / gist:10013457
Last active August 29, 2015 13:58
diffusion
int w=500;
int h=500;
float[][] aVal = new float[w][h];
float[][] bVal = new float[w][h];
float[][] newA = new float[w][h];
float[][] newB = new float[w][h];
float[] lapA = new float[w*h];
import sys
import urllib
import random
import json
import nltk
from time import sleep
api_key = sys.argv[1]
files = sys.argv[2]
text = open(files)