layout | title | description | tags | ||
---|---|---|---|---|---|
default |
SQL Style Guide |
A guide to writing clean, clear, and consistent SQL. |
|
'use strict'; | |
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; | |
var localtunnel = require('localtunnel'); | |
var request = require('request'); | |
var qs = require('querystring'); | |
var url = require('url'); | |
var http = require('http'); |
#!/usr/bin/env python | |
""" | |
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction. | |
""" | |
from __future__ import print_function, division | |
import numpy as np | |
from keras.layers import Convolution1D, Dense, MaxPooling1D, Flatten | |
from keras.models import Sequential |
import akka.actor._ | |
import akka.stream.scaladsl.Flow | |
import org.apache.spark.streaming.dstream.ReceiverInputDStream | |
import org.apache.spark.streaming.receiver.ActorHelper | |
import akka.actor.{ ExtensionKey, Extension, ExtendedActorSystem } | |
import scala.reflect.ClassTag | |
object AkkaStreamSparkIntegration { |
This is a collection of information on PostgreSQL and PostGIS for what I tend to use most often.
Detailed walk through of building extraction using postgis
First lets pull a data layer from of openstreetmap. You can do this any which way you’d like, as there are a variety of methods for pulling openstreetmap data from their database. Check the [wiki] (http://wiki.openstreetmap.org/wiki/Downloading_data) for a comprehensive list. My favourite method thus far is pulling the data straight into QGIS using the open layers plugin. For those who may want to explore this method, check [this tutorial] (http://www.qgistutorials.com/en/docs/downloading_osm_data.html). For building extraction you only need building footprints, and include the building tags. Not all polygons are of type building in OSM, so we can download all the polygons, and then filter the layer for only polygons tagged as buildings.
LiDAR data was pulled from USGS via the Earth Explorer site. [Here] (http://earthobservatory.nasa.gov/blogs/ele
import matplotlib.pyplot as plt | |
import numpy as np | |
from shapely.geometry import LineString | |
from shapely.ops import triangulate | |
def uniform_sample(poly, n=100): | |
""" | |
Uniformly sample the Delaunay triangulation of a polygon. If the polygon | |
is convex, this will uniformly sample its area. |
--- | |
version: 1 | |
disable_existing_loggers: False | |
formatters: | |
simple: | |
format: "%(name)-20s%(levelname)-8s%(message)s" | |
handlers: | |
console: | |
class: logging.StreamHandler | |
level: DEBUG |
### Important note: I'm no longer maintaining this gist, since this code is incorporated into the | |
### VulnToolkit package. | |
### Because it's not being maintained, the code below might not work. The latest, updated version | |
### is available at https://github.com/troyhill/VulnToolkit/blob/master/R/HL.r | |
### Function to pick out high and low tides from a dataset of tidal water levels | |
### | |
### Arguments: |
#!/usr/bin/env python | |
import wx | |
from wx import EVT_CLOSE | |
import wx.grid as gridlib | |
EVEN_ROW_COLOUR = '#CCE6FF' | |
GRID_LINE_COLOUR = '#ccc' | |
class PandasTable(wx.Frame): |