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
//Compass Bracelet GPS | |
//This reads the heading from HMC6352, reads your current location (hardcoded), | |
//and your destination (hardcoded), and turns the pin high pointing to | |
//your destination | |
//HMC6352 compass is hooked up this way: SDA is on analog input pin 4, and SCL is on analog pin 5 | |
//To customize, change destinationLat, destinationLon, currentLat, currentLon | |
#include <SoftwareSerial.h> |
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
//This reads the heading from HMC6352, spit it out via serial and lights up 1-2 lights to show North | |
//HMC6352 compass is hooked up this way: SDA is on analog input pin 4, and SCL is on analog pin 5 | |
#include <Wire.h> | |
int HMC6352SlaveAddress = 0x42; | |
int HMC6352ReadAddress = 0x41; //"A" in hex, A command is: | |
int headingValue; | |
int EPin = 13;//east |
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
#Final Data Exploration | |
#Grameen Foundation, CKWs | |
ix.data = read.csv("/Users/michelleboisson/Documents/ITP/* Data without Borders/final/search_logs.csv", header=TRUE, as.is=TRUE) | |
head(ix.data) | |
dim(ix.data) | |
#[1] 334718 11 | |
ckws = read.csv("/Users/michelleboisson/Documents/ITP/* Data without Borders/final/ckw.csv", header=TRUE, as.is=TRUE) | |
head(ckws) |
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
/** | |
* <p>This uses the Ketai Sensor Library for Android: http://ketaiMotion.org</p> | |
* | |
* | |
*/ | |
import ketai.sensors.*; | |
KetaiSensor sensor; |
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
#Describing Distributions | |
snf = read.csv("http://jakeporway.com/teaching/data/snf_4.csv", head=T, as.is=T) | |
#Make a “height” column for your data that is the total number of inches tall each person is. | |
heights = apply(snf,1, function(x) { as.numeric(x['feet'])*12 + as.numeric(x['inches']) }) | |
snf$fullheight = heights | |
mean(heights) | |
#[1] 68.57884 |
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
# CRIME MAPPING | |
#We’ve done some basic analysis of our Stop and Frisk data this semester, looking at | |
#basic statistics (e.g. number of stops by race or most common crimes by race) and | |
#timeseries information. We haven’t yet touched geography though. Let’s spend this | |
#week’s assignment answering the question: Where are Stop n Frisks happening in New | |
#York? | |
snf = read.csv("/Users/michelleboisson/Documents/ITP/* Data without Borders/snf_3.csv", as.is=TRUE) | |
geo = read.csv("/Users/michelleboisson/Documents/ITP/* Data without Borders/geo.csv", as.is=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
# Let’s breakdown our tweets around a certain topic. How about, oh, say, Iran? | |
# So how do we pull tweets out that have a certain word in them? | |
# grep() to the rescue! If you’ve used the grep function on the command-line, this | |
# should look familiar. grep() takes as arguments a phrase you’re searching for, a | |
# set of text to look through, and optional arguments about how to search. It will | |
# then return the row numbers of any rows that match your search. To pull out Iran | |
# tweets, we can use the code: | |
iran.tweets <- tweets[grep(“iran”, ignore.case=TRUE, tweets$text), ] |
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
#include <Servo.h> // include the servo library | |
Servo servoMotor; // creates an instance of the servo object to control a servo | |
int servoPin = 2; // Control pin for servo motor | |
int pos = 0; // variable to store the servo position | |
int now, previousTime, interval = 0; | |
//for smoothing of values |
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
video | time | person | behavior | id | real_time | |
---|---|---|---|---|---|---|
1 | 5:00 | girl in white hoodie | stretched shoulders | 1 | 12:35:00 | |
1 | 8:00 | sean | arms up stretch | 2 | 12:38:00 | |
1 | 9:30 | guy in green shirt infront of sean | arms up stretch | 3 | 12:39:30 | |
1 | 13:31 | sean | stretched back | 2 | 12:43:31 | |
1 | 15:38 | plaids shirt guy | brisk back bend | 4 | 12:45:38 | |
1 | 16:01 | guy in green shirt in front of sean | brisk back bend | 3 | 12:46:01 | |
1 | 17:57 | girl in white hoodie | wrist stretch | 1 | 12:47:57 | |
1 | 19:43 | girl in white hoodie | wrist stretch | 1 | 12:49:43 | |
1 | 20:48 | guy in green | hands behind neck stretch | 3 | 12:50:48 |
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
#How many unique users have more than 100000 followers? What are their screen names? | |
tweets <- read.csv("/Users/michelleboisson/Documents/ITP/* Data without Borders/hw3/libya_tweets.csv", as.is=TRUE) | |
unique(tweets$screen_name[which(as.numeric(tweets$followers) >= 100000)]) | |
# [1] "detikcom" "DonLemonCNN" "HuffingtonPost" "Dputamadre" "WorldRss" "AlMasryAlYoum" | |
# [7] "theobscurant" "fadjroeL" "TPO_Hisself" "CAPAMAG" "TwittyAlgeria" "foxandfriends" | |
# [13] "PranayGupte" | |
NewerOlder