import lxml.html
myfile = open('index.html', 'r')
data=myfile.read()
h=lxml.html.fromstring(data)
from lxml import etree
tree=etree.ElementTree(h)
ft=tree.xpath(u"//text()[contains(., '')]")
id,name,amount | |
109,"building",1456894 | |
164,"house",1383613 | |
7,"Shopping and services",839415 | |
17,"store / shop",831628 | |
203,"school",676869 | |
4,"dining and leisure",671035 | |
74,"restaurant",385073 | |
194,"park",283545 | |
163,"sport venue",274433 |
#du on Directories with Spaces
To get the sizes of all subdirectories including the hiddsn ones I typically use the command:
du -sh $(ls -A)
However, this command does not work well if you have directory names with spaces. Here is how you can do it:
Display walls (compound flat monitors with a very large number of pixels) is a very useful tool for geovizualization because of their unique ability to display multiple geographic scales at once. My paper on the topic:
Sorokine, Alexandre. “Implementation of a Parallel High-Performance Visualization Technique in GRASS GIS.” Computers & Geosciences 33, no. 5 (2007): 685–95. doi:http://dx.doi.org/10.1016/j.cageo.2006.09.008.
Also display walls have a very strong Wow! factor if you are interested in that.
I hereby claim:
- I am sorokine on github.
- I am sorokine (https://keybase.io/sorokine) on keybase.
- I have a public key whose fingerprint is 32FB CE7C D47C 3C10 3785 561F 207E 07E9 A4D3 4B70
To claim this, I am signing this object:
Existing function for generating of random point in polygon in PostGIS may take a very long time in narrow and long polygons because the functions have to test lots of points that fall within bounding rectangle but outside actual polygon. Examples are here and here.
The idea is to use a function to subdivide bounding rectangle recursively and process only tiles that overlap with the polygon:
- subdivide the bounding rectangle into smaller rectangles (2, 4, or more, whichever is easier)
- randomly pick a rectangle
- create an intersection of the rectangle with the original polygon, return to the previous step if intersection is empty
- check if the ratio between the areas of the rectangle and intersection is big enough
#!/bin/bash | |
convert_dir=$1 | |
output_dir=$2 | |
bitrate=$3 | |
# Ensure require params are passed in | |
if [ -z $convert_dir ] || [ -z $output_dir ]; | |
then | |
echo "Usage: flac2mp3 rip_dir output_dir [bitrate]" | |
exit |