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
package main | |
import ( | |
"github.com/sfreiberg/gotwilio" | |
"github.com/hoisie/web" | |
"strconv" | |
"io" | |
"bytes" | |
) |
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
var phys = require('phys'); | |
console.log(phys.mechanics.momentum(2, 3)); | |
console.log(phys.information.mechanics.momentum()); |
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
<script src="http://www.physjs.com/js/phys.min.js"></script> | |
<script> | |
console.log(phys.basic.changein(2, 3)); | |
console.log(phys.mechanics.momentum(2, 3)); | |
</script> |
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
// Gets Weather from the ForecastIO API and saves the JSON file | |
var set_weather = function() { | |
jquery.getJSON('https://api.forecast.io/forecast/'+ apiKeys.forecastIO + '/' + person.latitude + ',' + person.longitude, function(data) { | |
fs.writeJson('./files/weather' + datetime + '.json', data, function(err){ | |
if(err){ console.log(err);} | |
weather.time = datetime; | |
weather.summary = data.currently.summary; | |
weather.temperature = String(convert_fahrenheitTocelsius(String(data.currently.temperature))); | |
weather.file = true; | |
}); |
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
var queryAPI = function() { | |
$.ajax({ | |
// URL of the API you want to access | |
url: 'https://housing.nyu.edu/api/nyuapirooms/RoomSpaceDescription/AH-002E1-1', | |
// When the data comes back | |
success: function(data) { | |
// Go through all the data | |
for(var eachval in data) { | |
// and print all of it out | |
console.log(data[eachval]["HallName"]); |
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
''' | |
Finds all the circles within your eye | |
''' | |
import cv2 | |
import cv2.cv as cv | |
import numpy as np | |
image = cv2.imread('eye-image.jpg') | |
cv2.imshow('main_image', image) |
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 urllib2 | |
import simplejson | |
import urllib | |
import errno | |
import os | |
# Fixed | |
globalSearchURL = "http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=%s&start=%s" | |
fetch = urllib2.build_opener() |
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
// run using g++-mp-4.7 -fopenmp -std=c++11 openmp_example.cpp -o openmp_example | |
// on my mac. Not sure about everyone elses, but my g++ version doesn't have openp | |
// so I have to use that one | |
#include <iostream> | |
using namespace std; | |
#include <omp.h> | |
int main(int argc, char *argv[]) |
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
#!/usr/bin/env python | |
import sys | |
import os.path | |
if __name__ == "__main__": | |
if len(sys.argv) != 2: | |
print "usage: create_csv <base_path>" | |
sys.exit(1) |
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 numpy as np | |
import sklearn | |
from sklearn.tree import * | |
from sklearn.datasets import * | |
iris = load_iris() | |
X = iris.data | |
y = iris.target |
OlderNewer