6/22/2010

Kill all process of a binary

for i in `pidof render_eos.par`; do echo $i; done

9/04/2008

IE png issue

http://labs.unitinteractive.com/unitpngfix.php

shell for loop

for ((i = 0; i < 6; i++))
do
echo $i
done

7/22/2008

django internalization trans gettext doesn't work

I had the problem and figure out the problem.

1. The locale folder should be in the application folder.
2. Take a look at the language folder name in django/conf/locale, it should have the same folder name in your locale folder. For example: if you want to translate Chinese, you use zh_CN as the folder name in your locale folder. zh-cn, zh-CN, zh_cn won't work.
3. If you make any changes to the message file (*.po file) or you change the folder names, you must restart the development server to make it take affect.

2/27/2008

create database world_borders

shp2pgsql world_borders.shp world_borders.sql
createdb world_borders
createlang plpgsql world_borders
psql -d world_borders -f /usr/local/pgsql/share/lwpostgis.sql
psql -d world_borders -f /usr/local/pgsql/share/spatial_ref_sys.sql
psql -d world_borders -f path-to/world_borders.sql