Skip to content

Instantly share code, notes, and snippets.

View TestDelete.java
public int removeAllOlderThan(int batchSize, DateTime date) {
try (Connection c = dc.getConnection()) {
PreparedStatement s1 = c.prepareStatement(String.format("SELECT %s FROM %s WHERE created_at < ?",
KEY, dc.getTableName(tableName)));
s1.setLong(1, date.getMillis());
ResultSet rs = s1.executeQuery();
List<String> list = new ArrayList<>(batchSize);
PreparedStatement s2 = null;
int executeUpdateCount = 0;
while (true) {
View an_idea_for_vehicle_profiles.md

Loose statements

properties: compact, self-explanatory, declarative "no-loop", native yaml (?)

very specific to influence only the cost and time calculation:

calcMillis:
  time = distance_in_m / speed_in_kmh * 3.6 + delay_in_sec + turn_cost_delay_in_sec
calcWeight:
  if (isInfinity(time)) return infinity
View MyBenchmark.java
/*
* Copyright (c) 2014, Oracle America, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
View import-edge-based.log
This file has been truncated, but you can view the full file.
2019-07-08 19:17:08.753 [main] INFO c.g.r.tomtom.TTGraphHopperFactory - No tomtom config detected
2019-07-08 19:17:08.793 [main] INFO c.g.matrix.http.GraphHopperEEManaged - Loaded landmark splitting collection from
View style.json
{
"version": 8,
"name": "gh-mvt",
"sources": {
"gh-mvt-tiles": {
"type": "vector",
"tiles": [
"http://127.0.0.1:8989/mvt/{z}/{x}/{y}.mvt?details=max_speed&details=road_class&details=road_environment"
]
},
@karussell
karussell / output.log
Last active Jun 12, 2019
stats edge based CH: prepare.ch.edge_based: edge_or_node, 2 threads, 4 profiles, no LM => ~65h per profile
View output.log
2019-06-08 18:07:54.182 [fastest_small_truck_edge] INFO c.g.r.c.PrepareContractionHierarchies - took: 180935s, graph now - num edges: 227?362?802, num nodes: 173?012?687, num shortcuts: 633?753?377
2019-06-09 08:32:32.522 [fastest_car_edge] INFO c.g.r.c.PrepareContractionHierarchies - took: 232813s, graph now - num edges: 227?362?802, num nodes: 173?012?687, num shortcuts: 749?629?202
2019-06-10 21:58:44.572 [fastest_truck_edge] INFO c.g.r.c.PrepareContractionHierarchies - took: 186650s, graph now - num edges: 227?362?802, num nodes: 173?012?687, num shortcuts: 603?320?037
2019-06-12 03:07:34.821 [fastest_scooter_edge] INFO c.g.r.c.PrepareContractionHierarchies - took: 239702s, graph now - num edges: 227?362?802, num nodes: 173?012?687, num shortcuts: 747?637?733
7.7G edges
8.4G geometry
3.3G nodes
1.4G location_index
View highlight-tunnels.js
var lineLayer = L.geoJson().addTo(mapLayer.getMap());
lineLayer.options.style = function (feature) {
var p = feature.properties || {};
return {color:p.color||"gray", weight:p.weight||2, opacity:0.5};
}
var counter = 0;
var timeLimit = 10 * 30;
var Papa = require("papaparse");
Papa.parse("http://127.0.0.1:8989/spt?point=51.351201,12.398071&time_limit="+timeLimit+"&columns=prev_longitude,prev_latitude,longitude,latitude,time,road_environment", {
@karussell
karussell / install-android-sdk-linux.txt
Last active May 31, 2019
Install Android SDK for graphhopper/android
View install-android-sdk-linux.txt
https://developer.android.com/studio/#downloads => sdk-tools-linux-4333796.zip
mkdir android-sdk-linux
cd android-sdk-linux
unzip ~/Downloads/sdk-tools-linux-4333796.zip
android-sdk-linux/tools/bin/sdkmanager "build-tools;27.0.3"
android-sdk-linux/tools/bin/sdkmanager "platforms;android-27"
# building with JDK 11 fails currently with javax/xml/something not available
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
mvn -P include-android clean install -DskipTests=true
@karussell
karussell / initial_default
Last active Apr 18, 2019
nginx + acme.sh
View initial_default
server {
listen 80;
server_name sub.mydomain.com;
root /var/www/html;
location ~ /\.ht {
deny all;
}
}
You can’t perform that action at this time.