This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// makeThumbnails6 makes thumbnails for each file received from the channel. | |
// It returns the number of bytes occupied by the files it creates. | |
func makeThumbnails6(filenames <-chan string) int64 { | |
sizes := make(chan int64) | |
var wg sync.WaitGroup // number of working goroutines | |
for f := range filenames { | |
wg.Add(1) | |
// worker | |
go func(f string) { | |
defer wg.Done() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def point_in_polygon(x, y, verts): | |
""" | |
- PNPoly算法 | |
- xyverts [(x1, y1), (x2, y2), (x3, y3), ...] | |
""" | |
try: | |
x, y = float(x), float(y) | |
except: | |
return False | |
vertx = [xyvert[0] for xyvert in verts] |