Categories
Tech

Outlook to Google Calendar Sync

Ah, the travails of academia. Like many universities, USC uses Microsoft Outlook as its email and calendar provider. This presents some integration challenges for those of us, like me, who use Google Calendar everywhere else in life. It’s effectively impossible to sync an Outlook Calendar with a Google Calendar, so I had to juggle between both when trying to schedule anything. Chaos ensues.

So, I created a script to perform an ongoing one-way sync from my USC Microsoft Office 365 Outlook calendar to my personal Google calendar, handling new, updated, and deleted events. I had to develop my own solution because Microsoft/Google inexplicably can’t get their own acts together. For example, you can publish your Outlook calendar’s ICS URL and add it to Google, but it only syncs roughly once per day so you miss any new appointments in the meantime. Microsoft Flow used to work (clumsily) for syncing, but even their official recipes are now broken. So I had to roll my own.

Categories
Data

Geoff vs Jeff

My life in one chart:

Geoff vs Jeff Google Ngram

This chart comes from Google’s Ngram viewer. In computational linguistics, an n-gram is a consecutive set of n items in order in some sequence of text. Here, we are comparing the frequency of the 1-gram “Geoff” to the 1-gram “Jeff” across Google’s corpus of books. As you can see, Jeff has been more popular than Geoff since, well, ever… leading to my endless problems trying to get people to spell and pronounce my name correctly. The good news is Jeff has recently taken a downturn. Score one for the Geoffs!

Categories
Data

OSMnx and Street Network Elevation Data

Check out the journal article about OSMnx.

OSMnx can now download street network elevation data for anywhere in the world. In one line of code it downloads the elevation in meters of each network node, and in one more line of code it can calculate every street (i.e., edge) grade. Here is the complete street network of San Francisco, California, with nodes colored according to their elevation:

OSMnx street network elevation data for San Francisco, California to calculate street grade and steepness

Categories
Data

Mapping Everywhere I’ve Ever Been in My Life

I recently wrote about visualizing my Foursquare check-in history and mapping my Google location history, and it inspired me to mount a more substantial project: mapping everywhere I’ve ever been in my life (!!). I’ve got 4 years of Foursquare check-ins and Google location history data. For everything pre-smart phone, I typed up a simple spreadsheet of places I’d visited in the past and then geocoded it with the Google Maps API. All my Python and Leaflet code is available in this GitHub repo and is easy to re-purpose to visualize your own location history.

I’ll show the maps first, then run through the process I followed, below. First off, I used Python and matplotlib basemap to create this map of everywhere I’ve ever been:

Location History World Map, data from Foursquare and Google, made with Python matplotlib basemap

Categories
Data

Mapping Your Google Location History with Python

Small map of my Google location history data in the San Francisco Bay Area, 2012-2016I recently wrote about visualizing my Foursquare check-in history and it inspired me to map my entire Google location history data – about 1.2 million GPS coordinates from my Android phone between 2012 and 2016. I used Python and its pandas, matplotlib, and basemap libraries. The Python code is available in this notebook in this GitHub repo, and it’s simple to re-use to visualize your own location history.

Just download your JSON file from Google then run the code. First I load the JSON file and parse the latitude, longitude, and timestamp with pandas. Then I map my worldwide data set:

Map of my Google location history data worldwide, 2012-2016

Categories
Data

Visualizing a Gmail Inbox

Google Takeout lets you download an archive of your data from various Google products. I downloaded my Gmail archive as an mbox file and visualized all of my personal Gmail account traffic since signing up back in July 2004. This analysis excludes work and school email traffic (as well as my other Gmail account for signing up for web sites and services), as I have separate dedicated email accounts for each. It also excludes the Hangouts/chats that Google includes in your mbox archive. So, this analysis just covers personal communication.

This also demonstrates working with time series in Python and pandas. All of my code is on GitHub as an IPython notebook. You can re-purpose it for your own inbox – just download your Gmail archive then run my code.

Visualizing Gmail inbox email traffic volume by day with Python, pandas, and matplotlib

Categories
Data

Reverse Geocode a Set of Lat-Long Coordinates to City + Country

This tutorial demonstrates how to reverse geocode a set of latitude-longitude coordinates to city and country using Python and the Google Maps API.

I have previously written about my GPS location data from this summer’s travels. The data set, gathered with the OpenPaths app, contains lat-long coordinates and timestamps. Without city or country data, any visualizations would be very simplistic because all I have is coordinates and timestamps. It would be nice to reverse geocode these coordinates to add city and country data to each point. Then, I could create richer, more informative marker popups that include this new geographical information.

Categories
Tech

Pattern Unlock an Encrypted Android Phone

We’re all familiar with the possibility of data security breaches. Web sites get hacked, passwords get compromised, laptops get stolen. To mitigate these risks, we (try to) use strong passwords, keep our computers under lock and key, and encrypt our personal data. But what about our phones? They are increasingly relied on as mini-computers in our pockets, replete with email accounts, banking apps, and sensitive Dropbox files. Many apps store usernames and passwords in plain text.

What happens if your phone gets stolen? Many people don’t have any security or lock screen enabled at all. Others simply use a pattern or short PIN that is easily cracked in minutes. Android offers encryption, but it’s turned off by default. It’s also very inconvenient. To be effective, encryption requires a strong password, and Android (4.x) requires that you enter this password to unlock your phone when it boots-up, and also every time you unlock the screen.

The problem is that once you encrypt your phone, Android (again, versions 4.x – maybe this will change in a future release!) disables the ability to lock/unlock it with a pattern (annoyingly) or with a different, shorter PIN (perhaps understandably). Having to type in a long password every time you want to use your phone makes this is a non-starter for most users.

Ideally, we would enter a strong password to unlock and decrypt the phone at boot-up, and then use a simpler, user-friendly security mechanism (such as a pattern) to unlock the phone throughout the day. This would balance the benefits of strong-password encryption with the practicalities of making the phone accessible throughout the day.

Categories
Tech

How to Root a Nexus 4 in (Almost) Plain English

Unlock and root a Nexus 4One of the major benefits of owning an Android phone is its flexibility. You’re not boxed into Apple’s heavily circumscribed walled garden. Your phone is part of a fairly wide-open ecosystem and you can have total administrative control to tinker with its powerful hardware and software. How? By rooting the phone to give yourself administrative root access.

The main hurdle for most users is the confusing technical process to go about rooting the phone. There are plenty of tutorials online, but most of them rely on jargon, use imprecise language, or skip steps while assuming the user is familiar with the nuts and bolts of what the author means. The purpose of this tutorial is to provide a clear, precise, plain-English procedure to beginners for rooting an Android phone. Please give me any feedback you have if a step should include clearer language or needs to be updated in any way.

I validated this tutorial with a Nexus 4 running Android 4.4.4 and a computer running 64-bit Windows 8.1. However, the same basic steps apply to Linux and Mac as well as other versions of Android and Android phones. Rooting your phone carries some risk. You may invalidate your warranty, and following the procedure incorrectly could render your phone inoperable. Nevertheless, it is a common process that has been done by many, many Android users. Follow this tutorial at your own risk (disclaimer: the author accepts no responsibility) and make sure you backup all of your data first. Let’s begin.