Merge multiple Shapefiles using OGR2OGR in windows Linux or OSX
Introduction This post is aimed at providing assistance to folks who are trying to merge many shapefiles into one single file in either windows or linux environment. Stuff like this may seem obvious to power users of GDAL/OGR, but not to those that are just new to using these great free tools.
Merging Shape (*.shp) Files on Windows Essentially, these commands will grab every shapefile in a directory, and merge them into a single file called “merged.
HTML Geolocation and Altitude
HTML5 Geolocation is a feature which allows the browser on a computer or a mobile phone, to acquire the position from the wifi,2g/3g/4g network or GPS.
The HTML Geolocation API is used to get the geographical position of a user. Since this can compromise user privacy, the position is not available unless the user approves it. The simplest way to use it through navigator.geolocation object ``` if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition);
Classes and Inheritance in EcmaScript 6 (ES6 Harmony)
So if you are a JavaScript geek and haven’t yet heard,(if every one is listening to ECMA announcements, who’s gonna drink beer :) ) ECMA 6 feature set has been drafted,its feature set is frozen, it is mostly being refined now. You can already program in it and compile it to current JavaScript . The JavaScript frameworks AngularJS and Ember.js will be based on it (with ways to opt out). Again, via cross-compilation.
print two-dimensional array in spiral order
So I saw this problem in a book today about printing a 2d matrix in spiral order
Here are two solutions to it
Solution one. def printSpiralTL(m,x1,y1,x2,y2): for i in range(x1,x2): print m[y1][i] for j in range(y1+1,y2+1): print m[j][x2-1] if x2-x1 > 0: printSpiralBL(m, x1, y1 + 1, x2-1, y2) def printSpiralBL(m,x1,y1,x2,y2): for i in range(x2-1,x1-1,-1): print m[y2][i] for j in range(y2-1,y1-1,-1): print m[j][x1] if x2-x1 > 0: printSpiralTL(m, x1+1, y1, x2, y2-1) m = [ [1, 2, 3, 4], [5, 6, 7, 8], [9, 0, 1, 2], [3, 4, 5, 6], [7, 8, 9, 1] ] Output: