Companies often represent their organization structure in a hierarchical org chart. These charts start at the top with the President/CEO. From there, they sprawl down and out through the ranks to those doers and newbies at the “bottom” of the org. Charts like this look like a squid. I am not a fan of drawing things this way. An alternative to the hierarchical org chart is the org tree. The org…
On Saturday, May 9, 2015 at 9:19pm we welcomed our second baby boy into the family. Lucas Clay Saints was born in the water at the Birth Center of Boulder to a happy healthy Mom and an excited Dad. He was born after nearly two weeks of cloudy spring rains, capped off by a May snow storm on the Eve of Mother’s Day. As the second-born, baby Luca joins our family mid-stream, representing new growth…
Postgres makes it easy to export a query a remote server and save the results to CSV on your local machine. First, connect to the remote database server: psql -h REMOTE_SERVER_ADDRESS -U DB_USER -W Then, export a query to CSV… \copy makes the file go to your local machine rather than the database server file system \copy (select * from my_table limit 10) TO '~/Downloads/export.csv' CSV HEADER
UPDATE: I’ve spent some time using the method that I outlined below and found some problems with it. I now have a new prefered way of querying postgres from python and getting results as a dictionary. You should use the new way in most cases. Here are the problems with the previous method: The previous method requires sqlalchemy which is a large dependency The previous method was using a…
Install Ubuntu 14.04 Start with a fresh install of Ubuntu 14.04 Trusty. (AWS or vagrant might be a good way.) Install Postgresql On the server run the commands below. sudo apt-get update sudo apt-get install -y postgresql postgresql-contrib Create a database and a user to access it I prefer to create one user per database for security. Replace DATABASE_NAME_HERE and USER_NAME_HERE with the values…
Recently I needed to install libgeos with PHP5 bindings on Ubuntu 14.04 LTS. The PHP5 bindings are not available as a package in Ubuntu. Here is how I installed it from source. apt-get install -y apache2 php5 libapache2-mod-php5 php5-dev phpunit wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2 tar -xjvf geos-3.4.2.tar.bz2 cd geos-3.4.2/ ./configure --enable-php make make install cat >…
Summary Often on Heroku your app might depend on a system package that is not installed in the base Heroku system. Including an external binary dependency in your Heroku app is easy. These binaries are called vendored binaries. Here is a quick summary of how to do this: Compile the binary on the heroku platform using a one-off dyno bash prompt heroku run /bin/bash Copy the compiled package to your…
If you hang out with developers enough, you will hear this refrain: “Premature optimization is the root of all evil” The idea is don’t spend time fixing problems that you don’t have because you are more likely to make your code clumsy and more complicated than it needs to be. In my recent work on www.tomnod.com we were hit with a huge amount of traffic during the search for missing Malaysia…
Recently I read Things You Should Never Do, Part I . One line really stood out to me: It’s harder to read code than to write it. In fact, I think it is a lot harder. I bet that it is at least 10x harder to read and understad code than it is to write it. If this is the case, we need to value readability of our code almost just as much as we value it working. Readability is what makes it possible to…
I helped teach the hackathon at Lafayette Teen Tech Week. The students learned to encrypt and decrypt Ceasar ciphers. The decrypted messages sent them on a scavenger hunt around the Lafayette Public Library. Here are some photos of Lafayette Teen Tech Week 2014 !