Skip to content

Instantly share code, notes, and snippets.

View hugoledoux's full-sized avatar

Hugo Ledoux hugoledoux

View GitHub Profile
@hugoledoux
hugoledoux / gmlsolid.gml
Last active August 29, 2015 14:19
GML solid with one interior rings and one interior shell
<gml:Solid>
<gml:exterior>
<gml:CompositeSurface>
<gml:surfaceMember>
<gml:Polygon>
<gml:exterior>
<gml:LinearRing>
<gml:pos>0.000000 0.000000 1.000000</gml:pos>
<gml:pos>1.000000 0.000000 1.000000</gml:pos>
<gml:pos>1.000000 1.000000 1.000000</gml:pos>
@hugoledoux
hugoledoux / simplearticle.tex
Last active July 14, 2022 12:42
Skeleton for a simple LaTeX article
\documentclass[a4paper,11pt]{scrartcl}
\usepackage{graphicx}
\usepackage[utf8]{inputenc} %-- pour utiliser des accents en français
\usepackage{amsmath,amssymb,amsthm}
\usepackage[round]{natbib}
\usepackage{url}
\usepackage{xspace}
\usepackage[left=20mm,top=20mm]{geometry}
\usepackage{algorithmic}
@hugoledoux
hugoledoux / p2-template.tex
Last active November 21, 2022 06:24
A LaTeX template for the P2 proposal of the MSc Geomatics
\documentclass[a4paper,11pt]{scrartcl}
\usepackage{graphicx}
\usepackage[utf8]{inputenc} %-- pour utiliser des accents en français
\usepackage{amsmath,amssymb,amsthm}
\usepackage[round]{natbib}
\usepackage{url}
\usepackage{xspace}
\usepackage[left=20mm,top=20mm]{geometry}
\usepackage{algorithmic}
#include <iostream>
#include <fstream>
#include "json.hpp"
using json = nlohmann::json;
int main(int argc, const char * argv[]) {
std::ifstream input("/Users/hugo/projects/cityjson/example-datasets/dummy-values/example.json");
json j;
input >> j;
@hugoledoux
hugoledoux / semantics.json
Created October 12, 2017 12:49
CityJSON semantics proposals
"geometry": [
{
"type": "Solid",
"lod": 1.1,
"boundaries": [
[ [[0, 3, 2, 1]], [[4, 5, 6, 7]], [[0, 1, 5, 4]], [[1, 2, 6, 5]], [[2, 3, 7, 6]], [[3, 0, 4, 7]] ]
],
"semantics": [
[
{
@hugoledoux
hugoledoux / remove-cr.py
Last active April 25, 2019 09:43
remove carriage returns in an XML file
#!/usr/local/bin/python
from lxml import etree
import sys
fin = sys.argv[1]
parser = etree.XMLParser(remove_blank_text=True)
tree = etree.parse(fin, parser)
root = tree.getroot()
@hugoledoux
hugoledoux / lsfit.cpp
Created December 11, 2017 14:25
bug with linear_least_squares_fitting_3()?
// Example program for the linear_least_square_fitting function
// on a set of 3D triangles
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/linear_least_squares_fitting_3.h>
#include <vector>
#include <math.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Plane_3 Plane;
@hugoledoux
hugoledoux / cgal-eigen-fitting-to2d.cpp
Last active January 12, 2018 14:40
cgal-eigen-fitting-to2d
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/linear_least_squares_fitting_3.h>
#include <vector>
#include <math.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Plane_3 Plane;
typedef K::Point_3 Point3;
project( arggh )
cmake_minimum_required (VERSION 3.2)
add_definitions(-std=c++11)
set(CMAKE_CXX_FLAGS "-O2")
set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true )
@hugoledoux
hugoledoux / elsevier.md
Last active November 18, 2018 08:21 — forked from avandeursen/LICENSE.md
Reviewing for Elsevier

Dear Editor,

Thank you for your invitation to review for your journal, published by Elsevier.

Unfortunately, during negotiations about the cost of journal subscriptions and the cost of open access publishing, Elsevier has decided to block access to its latest publications for my colleagues working at universities in Germany and Sweden [1].

I support the position of the Swedish and German universities in these negotiations.