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
// Hats off to https://gist.github.com/hackable/1294667 | |
var express = require('express'), | |
request = require('request'), | |
BufferList = require('bufferlist').BufferList, | |
sys = require('sys'), | |
fs = require('fs'); | |
var app = express.createServer(); |
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
function tweet($status){ | |
$oauth_consumer_key = "key"; | |
$oauth_token = "token"; | |
$oauth_signature_method = "HMAC-SHA1"; | |
$oauth_timestamp = time(); | |
$oauth_nonce = hash("md5","Random" . $oauth_timestamp . "32 bit string"); | |
$baseurl = "https://api.twitter.com/1.1/statuses/update.json"; | |
$url= ''; | |
$url.= "?oauth_consumer_key=".rawurlencode($oauth_consumer_key); | |
$url.= "&oauth_nonce=" . rawurlencode($oauth_nonce); |
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
to20 = [ | |
'zero' | |
,'one' | |
,'two' | |
,'three' | |
,'four' | |
,'five' | |
,'six' | |
,'seven' |
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
public class Palindrome{ | |
int firstNum = 999; | |
int secondNum = 100; | |
int result = 0; | |
int x = 0; | |
int holder; | |
public Palindrome(){ |
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
// I normally use python for quick hacks like these- but javascript is so familiar at this point | |
var cipher = "ni xiph btffbo ytf iw liin azoho xip vho tf r fziro btffbo ytfr iw liin spf filofzoh fzvf imohazobg fzo aihbn norgijn fpfp".split('') | |
, i = cipher.length - 1 | |
, dictionary = {} | |
, rank = ["E","T","A","O","I","N","S","H","R","D","L","C","U","M","W","F","G","Y","P","B","V","K","X","Q","J","Z"]; | |
// based off of http://www.math.cornell.edu/~mec/2003-2004/cryptography/subs/frequencies.html | |
// Probably find a way to sort as populating, but quicksort is so easy.. and I'm pretty lazy.. | |
do{ |
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
canvas{ | |
height:300px; | |
width:300px; | |
} |
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
/* | |
* | |
* Full step motor procedure | |
* | |
*/ | |
#include <elapsedMillis.h> | |
// Constants | |
#define STEP_PER_REVOLUTION 4 // Probably has more to do with current than steps, but will determine relationship at later point |
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
import math | |
G = 6.67e-11 | |
class Point: | |
def __init__(self,m,x,y): | |
self.m = m | |
self.x = x | |
self.y = y |
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
% Second stab at matlab | |
function out = biSect(funct,hi,lo,x) | |
if hi < lo, | |
err = MException('MATLAB:ambiguousSyntax','Usage biSect(funct,hi,lo,x). hi cannot be lower rhar low.'); | |
throw(err); | |
end | |
new = lo + (hi - lo)/2; | |
apprx = funct(new); | |
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
% Third stab at matlab | |
function out = newtonRaphson(funct,old) | |
delta = 0.001; | |
y = funct(old); | |
m = (funct(old+delta)-y)/delta; | |
new = (m*old-y)/m; | |
apprx = funct(new); | |
OlderNewer