Friday, December 27, 2013

Powershell Parse Outlook Inbox

I try to keep my inbox pretty clean. I only keep 30 days in my inbox before archival, try to setup rules to route and filter the noise, etc. I thought it would be cool to analyze the stats on my inbox. My inbox is pretty small compared to others, however there are some cool insights to gain from just 30 days of email. This process will work for larger inboxes as well.

I wrote a Script to parse Outlook Inbox. The output is a CSV file that you can use to analyze various things about your inbox. To Parse a folder in you inbox you can do this Using a BULK INSERT Script to load the data into SQL Server I was able to start generating some graphs. Here is a graph showing the top 20 senders to my email box. I left off the names to protect the guilty.

Top Senders

 Hour of day Breakdown

Busy email hours are 8am, 9am, 4pm etc.

Here is a word cloud of all the subject lines in my inbox (some stuff redacted)

VBScript Parse

With an update to Office some of my PowerShell code stopped working so I am adding the VBScript to parse Outlook as well.

Kick It: Starting the morning off right

Every morning I kick off the same programs to get the day rolling at work. Instead of launching all these applications manually I wrote a script to launch everything I need to get the morning started. It is easy to add new programs or commands.

Monday, December 2, 2013

Aggressive Driving First Pass

As you may or may not know I have an OBD adapter the sends data from my car's computer to my phone. I import that data into a database for analysis and such. I stumbled on an interesting article the other day about a similar OBD connection that pairs up with software on an iPhone.

The thing that interested me was their Aggressive driving metric. They use measures to calculate instances of aggressive driving, so I started to wonder what my data showed as far as aggressive driving habits and such. I started a first attempt to try and figure out a way to measure aggressive driving with the following measures. 

  1. An increase of Engine RPM by X amount in a 2 second time period - this would indicate that I punched the accelerator.
  2. A count of all the instances where I was traveling over 75 MPH. Maximum speed limit on my route is 70 mph.
  3. A decrease in Speed by X amount in a 2 second time period - this would indicate that I had to hit the brake pretty hard.

After some averaging and aggregates I decided for the first attempt here to use 1500 RPMs as a gauge for measure 1. Below is a map of all the instances where I increased Engine RPM by 1500 RPM in a 2 second time interval.

Not surprising the majority of extreme accelerations occur near an on-ramp for the various highways I enter and exit on the route. Also not surprising is that the majority of extreme accelerations occur on the commute home instead of the commute to work. My fellow drivers are just as anxious to get home as I am.

Here is my current to hit against my Torque Data:

I found an issue with the data. For some reason dates before 4/01/2013 have cut off the time element of the data field. I am working to re-import that data to clean it up and then I will continue with the other 2 aspects of aggressive driving.