Skip to content

Instantly share code, notes, and snippets.

View matiskay's full-sized avatar

Edgar Marca matiskay

View GitHub Profile
@matiskay
matiskay / README.mkd
Last active July 2, 2016 12:41
Hello World in Fortran

Compile

gfortran -ffree-form helloworld.f

@matiskay
matiskay / o.tex
Created November 10, 2014 02:26
How to add hat to a text in LaTeX.
\documentclass[11pt]{article}
\usepackage{amsmath}
\begin{document}
It$\hat{\text{o}}$
It\^{o}
\end{document}

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns                     on recent CPU
L2 cache reference ........................... 7 ns                     14x L1 cache
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns                     20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs 4X memory

Creating a circle using CSS

Keybase proof

I hereby claim:

  • I am matiskay on github.
  • I am matiskay (https://keybase.io/matiskay) on keybase.
  • I have a public key whose fingerprint is A664 47F5 EC4D CDA4 FB4D 9B41 E9EA 1F47 2D5E 87B1

To claim this, I am signing this object:

#!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL2Tiles, Google Summer of Code 2007 & 2008
# Global Map Tiles Classes
# Purpose: Convert a raster into TMS tiles, create KML SuperOverlay EPSG:4326,
# generate a simple HTML viewers based on Google Maps and OpenLayers
# Author: Klokan Petr Pridal, klokan at klokan dot cz
# Web: http://www.klokan.cz/projects/gdal2tiles/
@matiskay
matiskay / download.sh
Created October 22, 2014 22:02
Download South America files from Geofabrik in parallel using the technique mentioned in http://stackoverflow.com/questions/7577615/parallel-wget-in-bash#answer-11850469
URL_LIST="
http://download.geofabrik.de/south-america-140101.osm.pbf
http://download.geofabrik.de/south-america-140501.osm.pbf
http://download.geofabrik.de/south-america-140601.osm.pbf
http://download.geofabrik.de/south-america-140701.osm.pbf
http://download.geofabrik.de/south-america-140801.osm.pbf
http://download.geofabrik.de/south-america-140901.osm.pbf
http://download.geofabrik.de/south-america-141001.osm.pbf
http://download.geofabrik.de/south-america-141014.osm.pbf
http://download.geofabrik.de/south-america-141015.osm.pbf

When there are so many other projections to chose from, why is it that today the Mercator projection is still such a widely recognized image used to represent the globe? The answer may be simply convention or habit. The inertia of habit is a powerful force.

^Alberto Rios

The main reason Mercator's projection became so popular was because of its navigational usefulness; in his map, straight lines represent lines of constant compass bearing. However, in manipulating the map to ensure this feature, the sizes of countries become hugely distorted. In particular, the southern hemisphere appears much smaller than it is in reality.

^The Guardian

Map projections have become a popular new-journalism meme. With a quick article, you can recap centuries of cartographic history and open peoples eyes to a variety of unusual ways to shape the world. The