Archive | Cut-n-Paste Code RSS feed for this section

10 December 2012 3 Comments

Quick & Dirty Address Geocoding and Formatting with Google Maps API

Howdy. Cheers to all ya’ll down there in internet land. I got in a conversation earlier today regarding geocoding addresses in data-sets – it’s a pretty common thing, and I’ve done it numerous times for a WIDE variety of data-points (Bigfoot, Sex Offenders, Concert Venues, etc.), so I figured hell, I’ll clean it up and offer it to the Google gods. Maybe someone will find it useful…

4 December 2012 15 Comments

SQL Server Query to Tableau Data Extract LIKE A BOSS – Some more TDE API fun with Python & Tableau 8

Coming off the excitement of my last post about writing a simple bare-bones python usage of Tableau’s brand-new Data Extracts API from version 8.0 – I figured that it was time to build on that. Let’s take a step forward and get a little more complicated – AND a little more useful…. Let’s do this.

26 July 2012 2 Comments

Python Snippet: Sending HTML email with an attachment via Google Apps SMTP (or Gmail)

This is just one of those things that I had to do in a project (as part of a much bigger system), and wish I had it all laid out for me like this when I was writing it.

Here it is for your cut-n-paste hacking pleasure…

5 July 2012 18 Comments

How to Harvest Facebook updates with Python, MySQL or SQL Server

Data Party! Most people focus on search.twitter.com (or automated pulls from their API) for data collection regarding the “pulse” on a particular topic or brand – they often overlook the fact that the public Facebook timeline can be a useful source of data as well. I’ll show you how to harvest it and store it in a database of your choosing for later analysis.

13 March 2012 38 Comments

Harvesting Twitter Search Results for Analysis using Python & SQL Server

Twitter. It’s everywhere. It’s Data. Realtime, Social, Contextual Data. But, if you want to do any real trending, data mining, post-processing, or even simple analysis on it – you really need to be making a historical record of what you’re looking for and store it in a usable way. I will show you how to create SQL Server tables and use a simple Python script to pull out tweets and save them for future analysis.

8 September 2010 8 Comments

Cut-N-Paste Corner: PHP function – Dynamically Round up to nearest 10, 100, 1000 or whatever (Graphing Axis Sex Toy)

One from the “Random-Shit-Pulled-Out-of-the-Junk-Drawer” Department… as I sit here and watch my beloved Red Sox cement their way OUT of playoffs… {sigh} Here’s a little function I use when building sexy little graphs in my PHP Reporting / Web Interfaces. Its good to calculate a MAX value for the graph axis. Since we never know […]

17 August 2010 17 Comments

Running Python script(s) as a Windows Service – Keep your Python Mojo Engines Running while you Sleep!

Now any Python duct-taper integrate-anything junkie like me has a need to schedule their things (in production) every once in awhile. Usually this is not a problem – Unix / Linux cron jobs handle this nicely – but for a client or job that runs on a Windows server – the built-in “Scheduled Tasks” just […]