Skip to content

Instantly share code, notes, and snippets.

@fastrocket
fastrocket / understanding-word-vectors.ipynb
Created October 28, 2022 02:59 — forked from aparrish/understanding-word-vectors.ipynb
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fastrocket
fastrocket / MersennePrimeRandom.cs
Created April 15, 2018 12:09 — forked from adamveld12/MersennePrimeRandom.cs
Mersenne prime random number generator in C#
/// <summary>
/// Implementation of Mersenne Twister random number generator
/// </summary>
public class MersennePrimeRandom
{
private readonly uint[] _matrix = new uint[624];
private int _index = 0;
public MersennePrimeRandom() : this((uint)(0xFFFFFFFF & DateTime.Now.Ticks)) { }
@fastrocket
fastrocket / MersenneTwister.cs
Created April 15, 2018 12:08 — forked from cuixin/MersenneTwister.cs
Mersenne Twister in c# & golang
using System;
public class MT19937
{
private const ulong N = 312;
private const ulong M = 156;
private const ulong MATRIX_A = 0xB5026F5AA96619E9L;
private const ulong UPPER_MASK = 0xFFFFFFFF80000000;
private const ulong LOWER_MASK = 0X7FFFFFFFUL;
private static ulong [] mt = new ulong[N+1];