Postgres/Postgis Tips

Tip 1: Importing DBF Files
shp2pgsql command is mainly to import shapefiles. However, it does come with an optional parameter -n that allows to import dbf files. You might need to install postgis in order to have shp2pgsql command.

> shp2pgsql -n filename > outfile.sql
> pgsql -h hostname -U username -d database -f outfile.sql

The above two commands [...]

Automating Interactive Shell Script (Mac)

Shell scripting is a powerful way to automate things. However, writing a shell script to automate interactive shell commands can be tricky. For instance, I weekly download log files from the server to my local machine. For this, I use scp command. While I had written shell script to automate this process, it wasn’t really [...]

Calculating Geographic Distance

Any geographical analysis almost invariably involves calculating distance between two points on the surface of the Earth (or two geographic coordinates). Below are four different options/formulas to calculate geographic distance. Each formula makes different assumption about the Earth’s shape and thereby has different accuracy and computational complexity.
Formula 1: Pythagorus’ distance formula
distance = ( (lat2 – [...]

Knee Surgery (ACL Reconstruction) Journal

17th June 2009
In an unfortunate event of mugging and assault, I severely damaged my left knee.There are four ligaments in and around a knee: ACL, PCL, MCL, and FCL. ACL and PCL corss each other and are at the center of the knee. They help prevent excessive forward and backward movement of the knee. MCL and FCL are [...]

30 Day Workout Challenge

Challenge: Go for 30 days workout streak.
Motivation: They say it takes 30 days to make a habit.
Starting Date: 17th May 2009
Rules:

Keep track of thoughts. Especially note down all the positive and negative thoughts.
No breaks. Although, on some days I can go for easy workout such as walking only. However, break days should be at-least 3 [...]