Skip to content

Instantly share code, notes, and snippets.

View Sleepingwell's full-sized avatar

Simon Knapp Sleepingwell

  • Canberra, ACT, Australia
View GitHub Profile
@ajsierra
ajsierra / TopoJson.js
Last active November 4, 2016 10:20
OpenLayers.Format.TopoJSON.js extended from https://gist.github.com/alexmuro/5600606 to include Point type as well as Polygons and LineString
/**
* Class: OpenLayers.Format.TopoJSON
* A parser to read/write TopoJSON safely. Create a new instance with the
* <OpenLayers.Format.TopoJSON> constructor.
*
* Inherits from:
* - <OpenLayers.Format.JSON>
*/
OpenLayers.Format.TopoJSON = OpenLayers.Class(OpenLayers.Format.JSON, {
@sftrabbit
sftrabbit / beta_distribution.hpp
Last active July 24, 2024 10:22
A beta distribution random number distribution for C++11. Conforms to the requirements for a random number distribution (§26.5.1.6 [rand.req.dist]) and is therefore compatible with the <random> C++ library header. Implemented in terms of two gamma distributions (std::gamma_distribution): if X and Y are independently distributed Γ(α, θ) and Γ(β, …
#include <iostream>
#include <sstream>
#include <string>
#include <random>
namespace sftrabbit {
template <typename RealType = double>
class beta_distribution
{