Skip to content

Instantly share code, notes, and snippets.

Guilhem Saurel nim65s

Block or report user

Report or block nim65s

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Effet_de_peau.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:b2ef27cb3d56398c1ebcccefb36e3cf8
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
@nim65s
nim65s / Dockerfile
Last active Sep 12, 2018
`boost::python::exec_file` segfault on python2 on ubuntu 16.04, but not on python 3 or ubuntu 14.04 / 18.04
View Dockerfile
ARG UBUNTU
FROM ubuntu:${UBUNTU}
RUN DEBIAN_FRONTEND=noninteractive apt-get update -qqy \
&& apt-get install -qqy g++ python-dev python3-dev libboost-python-dev
ADD test.cpp test.py /
RUN g++ test.cpp -I/usr/include/python2.7 -lpython2.7 -lboost_python-py27 -o two
View keybase.md

I hereby claim:

  • I am nim65s on github.
  • I am nim65s (https://keybase.io/nim65s) on keybase.
  • I have a public key ASCgd5mnNlKwrj1d3uXD72ROcdHfDMX83nDK_iIoNVJIago

To claim this, I am signing this object:

{
@nim65s
nim65s / gist:5e9902cd67f094ce65b0
Created Jan 5, 2015
distance from point to line segment…
View gist:5e9902cd67f094ce65b0
from numpy import arccos, array, dot, pi
from numpy.linalg import det, norm
def distance(A, B, P):
""" segment line AB, point P, where each one is an array([x, y]) """
if all(A == P) or all(B == P):
return 0
if arccos(dot((P - A) / norm(P - A), (B - A) / norm(B - A))) > pi / 2:
return norm(P - A)
if arccos(dot((P - B) / norm(P - B), (A - B) / norm(A - B))) > pi / 2:
View Github Push CGI
#!/usr/bin/env python
from __future__ import print_function
from hashlib import sha1
from hmac import new
from os import environ, system
from sys import stdin
KEY_FILE = '/etc/github.key'
You can’t perform that action at this time.