This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// by dave w | |
int[][] result; | |
float t, c; | |
float ease(float p) { | |
return 3*p*p - 2*p*p*p; | |
} | |
float ease(float p, float g) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// these methods should be fully "functional" in that they | |
// work, they have no known "side effects", and that they | |
// will return the same outputs given the same inputs (unless | |
// the temperature at the thermocouple changes, of course.) | |
// in setup() add these lines: | |
// SPI.setBitOrder(MSBFIRST); | |
// SPI.setDataMode(SPI_MODE0); | |
// SPI.begin(); | |
// then use these methods in your application. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Original Spark Community Thread: http://community.spark.io/t/how-to-access-the-core-via-we-browser/9711 | |
// Code adapted from: http://arduino.cc/en/Tutorial/WebServer | |
/* Includes ------------------------------------------------------------------*/ | |
#include "application.h" | |
SYSTEM_MODE(AUTOMATIC); | |
TCPServer server = TCPServer(80); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// lol forgive me for this code | |
int[][] result; | |
float t; | |
float ease(float p) { | |
return 3*p*p - 2*p*p*p; | |
} | |
float ease(float p, float g) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int[][] result; | |
float t; | |
float ease(float p) { | |
return 3*p*p - 2*p*p*p; | |
} | |
float ease(float p, float g) { | |
if (p < 0.5) | |
return 0.5 * pow(2*p, g); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// yikes not the prettiest code. by dw @ bees & bombs | |
int[][] result; | |
float t; | |
float ease(float p) { | |
return 3*p*p - 2*p*p*p; | |
} | |
float ease(float p, float g) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// by david whyte >:) | |
int[][] result; | |
float t; | |
float ease(float p) { | |
return 3*p*p - 2*p*p*p; | |
} | |
float ease(float p, float g) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// by david whyte | |
int[][] result; | |
float t; | |
float ease(float p) { | |
return 3*p*p - 2*p*p*p; | |
} | |
float ease(float p, float g) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// by dw don't steal >:) | |
int[][] result; | |
float t; | |
float ease(float p) { | |
return 3*p*p - 2*p*p*p; | |
} | |
float ease(float p, float g) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void sixteenRandomBytes(unsigned char buf[16]) { | |
for (int i = 0; i < 16; i++) { | |
buf[i] = rand() & 0xff; | |
} | |
} | |
// PKCS #7 padding | |
// Do this before encrypting to get the message | |
// up to a multiple of 16 bytes. | |
size_t pad(unsigned char *buf, size_t messageLength) { |