Skip to content

Instantly share code, notes, and snippets.

View aviatorBeijing's full-sized avatar
💭
I may be slow to respond.

aviatorBeijing

💭
I may be slow to respond.
  • ThomsonReuters
  • Beijing
View GitHub Profile
@aviatorBeijing
aviatorBeijing / Neo4j shortest path
Created August 19, 2016 07:34 — forked from mauget/Neo4j shortest path
Emits a Google KML stream of the shortest path between two points. A "point" is a Neo4j node having latitude and and longitude properties. The Neo4j A* algorithm does the work.
public void findShortestPath(PrintStream ps, long startNode, long endNode) {
try {
RouterService router = Initializer.getApplicationContext().getBean(RouterService.class);
router.emitShortestPathKML(ps, startNode, endNode);
} catch (Exception e) {
e.printStackTrace();
}
}
public void emitShortestPathKML(PrintStream ps, long keyValueA, long keyValueB)
@aviatorBeijing
aviatorBeijing / logstash-bikehare-status.conf
Created July 1, 2016 09:49 — forked from derickson/logstash-bikehare-status.conf
Logstash config for http_poller pulling of DC Capital bikeshare data and doing an XML split of the contents.
## Example of pulling data from DC Capital bikeshare to Elasticsearch in real time
## HTTP Poller -> XML Splitting -> Elasticsearch
input {
## pull data from Capital Bikeshare every 60 seconds
http_poller {
urls => {
bikeshare_dc => "https://www.capitalbikeshare.com/data/stations/bikeStations.xml"
}
request_timeout => 30