Skip to content

Instantly share code, notes, and snippets.

🐢

Jean-Gabriel Young jg-you

🐢
Block or report user

Report or block jg-you

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
@jg-you
jg-you / bernstein.stan
Last active Oct 30, 2018
Evaluate a Bézier curve in Bernstein form at a point, using De Casteljau's algorithm, in the STAN language
View bernstein.stan
functions {
/**
* Computes the value of a Bernstein polynomial of degree N at point t,
* using De Casteljau's algorithm.
*
* @param t Point in [0, 1] where the the polynomial will be evaluated.
* @param beta Vector of the real N + 1 coefficients of the polynomial.
* @param N Degree of the polynomial.
*
* @return Value of the polynomial at point t.
@jg-you
jg-you / main_master_slave.cpp
Last active Mar 5, 2019
Master / Slave example with boost::mpi
View main_master_slave.cpp
// STL
#include <cstdlib>
#include <iostream>
// boost::mpi
#include <boost/mpi/environment.hpp>
#include <boost/mpi/communicator.hpp>
#include <boost/mpi/status.hpp>
namespace mpi = boost::mpi;
// Definitions
#define NUMBER_OF_JOBS 12
@jg-you
jg-you / draw_nx_beautiful.py
Last active Jul 9, 2019
Beautiful networkx graph
View draw_nx_beautiful.py
import copy
import networkx
import matplotlib.pyplot as plt
# Generate a graph.
# Here I chose an ER graph.
g = nx.erdos_renyi_graph(20, 0.3)
# Get positions.
# Here I use the spectral layout and add a little bit of noise.
You can’t perform that action at this time.