Today, many datas are geolocalised (meaning that they have a position in space). They're named GIS datas.
It's not rare that we need to do operations on those, such as aggregations, and there are many optimisations existing to do that.
Today, many datas are geolocalised (meaning that they have a position in space). They're named GIS datas.
It's not rare that we need to do operations on those, such as aggregations, and there are many optimisations existing to do that.
function long2tile(lon,zoom) { | |
return (((lon+180)/360*Math.pow(2,zoom))); | |
} | |
function lat2tile(lat,zoom) { | |
return (((1-Math.log(Math.tan(lat*Math.PI/180) + 1/Math.cos(lat*Math.PI/180))/Math.PI)/2 *Math.pow(2,zoom))); | |
} | |
function tile2long(x,z) { | |
return (x/Math.pow(2,z)*360-180); | |
} | |
function tile2lat(y,z) { |
source 'https://rubygems.org' | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '5.0.0.alpha', git: "https://github.com/rails/rails" | |
gem 'rack', '~> 2.x', git: "https://github.com/rack/rack" | |
gem 'arel', git: "https://github.com/rails/arel" | |
gem 'rack-test', git: 'https://github.com/brynary/rack-test' | |
gem 'sprockets', github: 'rails/sprockets', branch: 'master' |
# https://docs.docker.com/compose/yml/ | |
# Each service defined in docker-compose.yml must specify exactly one of | |
# image or build. Other keys are optional, and are analogous to their | |
# docker run command-line counterparts. | |
# | |
# As with docker run, options specified in the Dockerfile (e.g., CMD, | |
# EXPOSE, VOLUME, ENV) are respected by default - you don't need to | |
# specify them again in docker-compose.yml. | |
# | |
service_name: |
3rdParty
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.
This should get rid of the rvm dir and any installed rubies:
$ rvm implode
GitLab is open source software to collaborate on code (a GitHub clone to run on your own server). Clicking a blob (a file in a repository) in GitLab shows a nice rendering if GitLab supports the file type (e.g., images, Markdown documents), or its content as plain text otherwise. The patch described here adds support to GitLab for rendering IPython notebooks (.ipynb files).
# Add this to config/environments/development.rb | |
# Limit your development log file to 5 MB | |
config.logger = Logger.new(config.paths["log"].first, 1, 5242880) # 5 megabytes |
'''List loaded modules and packages, and show their version numbers | |
and/or Git repository's HEAD commit SHA. | |
''' | |
# Standard library modules | |
import types | |
# Third-party packages | |
import git # GitPython |