Tutorial: Exporting Messages from WhatsApp and Graphing with R

This tutorial is posted with permission by Prometheus09 on Reddit. It was originally posted as an album on Imgur.

Number of messages sent per week throughout the relationship

Number of messages sent per week throughout the relationship

So here is a quick tutorial on how to construct the graph shown above, showing the distribution of messages over a given time period. First of all we must obtain the dataset we are going to use, which for this tutorial is the chat history obtained from WhatsApp. This can be obtained following these instructions or for iMessages or FaceTime data you can use this (paid) software.
Continue reading

Connecting Remotely to MySQL Database on an Amazon EC2 Server

While this was tested using a TurnKey LAMP Server build (Debian Linux), it applies to any Debian/Ubuntu server with MySQL.

Top-Level View of Tutorial

  • Enable MySQL access through server’s firewall (Amazon AWS-EC2 Security Groups)
  • Create non-root MySQL user with % (any) Host permissions
  • Alter the bind-address in the MySQL configuration file (my.cnf) file
  • Restart MySQL

Continue reading

Perfecting Prints with a Printrbot Simple Metal

Printrbot Simple Metal

The Printrbot Simple Metal can be purchased (assembled) for as little as $599 making it a remarkable unit for even the most timid maker.

I’ve had my PSM for almost a year now and printed 2kg worth of PLA on it in that time, so I’ve got a bit of experience under my belt. This was also my very first 3d printer, and I’ve used it for my business making custom chocolates. In that time I’ve learned that, out-of-the-box, the PSM needs a few additional items to really make great prints.

To that end, I wanted to write this post to help other owners get the most out of their little printer. Alas, currently a faulty wire for the auto-level probe (induction sensor) has also given me a little spare time before dealing with that repair (not uncommon unfortunately). There are 3 categories for this guide: Printed add-ons, temperature and curling, and software settings.
Continue reading

Setup OctoPi (US Edition) – OctoPrint on a Raspberry Pi

OctoPrint-GCode-ViewerFirst and foremost, OctoPi is a fantastic pre-built image for a Raspberry Pi (Model A, B, or B+) that is designed to connect to your 3d printer and provide a web interface to interacting with your printer, all using the simple and powerful OctoPrint software. In my case, I’m connecting it to my Printrbot Simple Metal.

OctoPrint is incredibly powerful: you can connect a Raspberry Pi camera, print out a camera mount to attach it to your bed and actually watch your printer through the OctoPrint webpage (or record video, if that’s your thing). You could even do it in complete darkness (with IR LEDs). I have my printer in the same room, but it’s good to dream.
Continue reading

jQuery Mobile Filterable Collapsible Listview with Smart Expansion

Wow, that’s a mouthful. Basically, I wanted to make use of the data-filter option to search a listview, but instead of a listview, I wanted it to be a collection of collapsible elements. Do accomplish this I needed some custom CSS to make it look right. Here is the example code with the ID iamalist. The page’s content section ID is iama, which is used in the CSS.
Continue reading

Using AutoHotKey and Ditto with PHP

I’m a purist I suppose. I write PHP, Javascript, CSS, and HTML in Notepad++. I don’t use an IDE (such as NetBeans), but I do have some shortcuts to make things go faster for me. The first one, Ditto, is a clipboard program that remembers the last 10 things put into the clipboard. This means you don’t have to worry about losing that copy/paste because it was overwritten. It’s simple, open, and a no-brainer addition. For those on OSX, Jumpcut is a great option.

The second one is AutoHotKey, which is crazy powerful, but for this example, I’m using its simple text replacement features. For instance, when I type qwhi, it is replaced with this:

while ($row = mysqli_fetch_assoc($result)){

You can imagine how handy this can be. Below are some of the shortcodes I use in my AutoHotKey file. Enjoy.
Continue reading

Mysqli and BLOB binary database fields

This post exists to save you hours of research on the web. The following things may be true about you:

  • You recently transitioned from mysql PHP functions to mysqli functions (staying current)
  • You prefer procedural PHP over object-oriented PHP (functions and arrays are cooler than classes)
  • You are storing some data in a MySQL BLOB, MEDIUMBLOB, or LONGBLOB field, which is Binary

Continue reading