Monday, August 19, 2013

Do we want other humans?

At work I was listening to one of NPR’s TED Radio Hour Podcast entitled “Do we need humans?” This talk was a presentation by Sherry Turkle, a professor of the “social studies of science” at M.I.T. and was based on her book Alone Together
 
A quick search on Google turned up a statement from the book in a New York Times Book Review:
“Dependence on a robot presents itself as risk free. But when one becomes accustomed to ‘companionship’ without demands, life with people may seem overwhelming.” Then the author of the book review states, “A blind date can be a fraught proposition when there’s a robot at home that knows exactly what we need. And all she needs is a power outlet.” 
 
Do we prefer technology to one another since human relationships take work, can be messy, and cannot be controlled?

Wednesday, August 14, 2013

R for Your Foursquare History

I was looking through twitter posts and came across one dealing with a presentation at the Quatified Self Bay Area Meetup by John Schrom. Watching the video Mr. Schrom described how he acquired his personal checkin data from Foursquare via an R program. Looking further I noted that the information about the presentation included a link to his personal site included a link to his Github repository of the code that he used to gather his personal Foursquare history. With this information in hand I figured that I would attempt to data mine my own checkin data.

The repo's readme file contained the steps that he took to get a Foursquare app setup and obtain his access code to his checkin history. After following the steps I was ready for the next step.

Then, I installed R and proceeded to add the packages that John's code required. First you will need RCurl. I issued the following command in R:
install.packages("RCurl", dependencies = TRUE)

However, I found that I needed to install libcurl due to the following error: ERROR: configuration failed for package 'RCurl'
So here is what I did to remedy the problem:
sudo apt-get install libcurl4-openssl-dev

Next, I installed the rjson package via:
install.packages("rjson", dependencies = TRUE)

Then I pulled down the rpi.R and secrets.R files and per the Github readme I ran:
source('rpi.R');
checkins <- getFoursquare('YOUR_ACCESS_TOKEN_HERE');

After this I wrote the function output to a CSV file:
out <- file("output.csv", "wt")
write.table(checkins, file=out)

Looking at the rpi.R code, I noted the getFoursquare function includes the createdAt attribute of the checkin object (of the Foursquare API which states the createdAt attribute is "Seconds since epoch when this checkin was created"). Since this element is in the form of the number of seconds, for example 1376335108, and it is a data item that I want, I will need to convert it into a human, readalbe format.
 
This was simple enough for me since I use Open Office to view CSV files in that I found this handy formula to convert the data to a human readable date/time: 
=(CellIdHere/86400)+25569+(-4/24)

From the CSV file I can inspect the checkin history for correlations with other data or look for patterns that before the review I was unaware existed. 

Finally, next steps could also include learning more R to visualize the data via plotting the data into charts and graphs.