STORED PROCEDURE FOR FINDING COLUMNS IN MYSQL

Looking for instances particular column in a large schema can be a pain. Fortunately the information schema makes this pretty easy, if your columns have a consistent naming convention. SELECT table_schema, table_name, column_name FROM information_schema.columns WHERE column_name LIKE ‘%some_name%’; Now, if we want to wrap this up into an easy to use stored procedure, we can do something like this: drop procedure find_column; delimiter // CREATE PROCEDURE find_column(c varchar(255)) begin SET @a = CONCAT("%", c, "%"); SELECT table_schema, table_name, column_name, column_type FROM information_schema.

IP ADDRESS GEOLOCATION SQL DATABASE

I’m sick of looking through chat logs to find an IP geo lookup database. Now it’s here, possibly forever, or until I stop paying for hosting.

SETTING UP A REMOTE GIT REPOSITORY

Here’s a great guide for setting up a new remote git repo. Thank you, Tool Man Tim.

PYDEV TUTORIAL

I found a good tutorial on IBM on doing Python development with Eclipse. It might be a little out of date, but I think only the screens got moved around a little bit. It includes details on how to use ant, which I’ve recently started using with cruise control and PHP, so I’m becoming a fan. I did run into an issue where I’d get the error ‘Variable references empty selection: ${project_loc}”, but a quick google brought me to a solution here.

'AWESOME PROJECT: SPARKUP'

Sparkup is a TextMate and Vim plugin for expanding short CSS style tags into HTML, written by my man Rico Sta Cruz. From the github page: You can write HTML in a CSS-like syntax, and have Sparkup handle the expansion to full HTML code. It is meant to help you write long HTML blocks in your text editor by letting you type less characters than needed. Sparkup is written in Python, and requires Python 2.

USING KICKSTART TO AUTOMATE CENTOS VM CREATION

I’ve done this using CentOS, but I’m pretty sure the same thing will work with RedHat the exact same way. Virtualization is now a commodity with several free tools available from Sun, VMWare and Xen. If you’re like me, you like to create a new, clean VM for each experiment. However, this comes with a drawback - the installation process, choosing your timezone, putting in the same password every time, etc… takes a while.

VIRTUALBOX - SSH'ING INTO A VM FROM AN OUTSIDE MACHINE

Note: The terminology used below also applies to VMWare. The screens are different, but the issue and the solution are the same. When creating a new VM through VirtualBox, you might have a problem SSH’ing into the box. You also might notice you get a 10.0.x.xx type address, even though the rest of your network is a 192.168.xx.xxx deal. Yes, the two are related. Essentially what’s happening is the VM is sitting on it’s on little private line, where it can go out but nothing can reach it.

PYTABLES USER'S GUIDE

I finally found the manual for PyTables. In case anyone else is as blind as I am, I’m linking to it here.

INSTALLING NUMPY ON MACOS X SNOW LEOPARD

NumPy is a requirement to work with PyTables. This is the second step in the install process, after getting HDF5 set up. These instructions are based on the ones found on the NumPy site, but I’m summarizing things for my own use later on. First, you’ll need to install the Fortran compiler for OSX (gFortran). Fortunately there’s a Fortran universal binary installer. Next, get the NumPy source. You can find it on Sourceforge.

ISSUES COMPILING HDF5 1.8.3 ON MACOS X SNOW LEOPARD

I’m trying to evaluate pytables as a replacement for very large Python dictionaries, but having some issues getting HDF5 installed on my Mac (OS X Snow Leopard). I’ve been getting this error: configure: error: C compiler cannot create executables I haven’t been able to figure out what’s wrong yet - anyone have any ideas? I’ve got XCode Tools installed, I’ve compiled Apache, PHP and Memcached without issue (prior to Snow Leopard Update).