Skip to content

Instantly share code, notes, and snippets.

View Art's full-sized avatar

Art Scott Art

View GitHub Profile
@KdotJPG
KdotJPG / OpenSimplex2S.java
Last active April 29, 2024 17:30
Visually isotropic coherent noise algorithm based on alternate constructions of the A* lattice.
/**
* K.jpg's OpenSimplex 2, smooth variant ("SuperSimplex")
*
* More language ports, as well as legacy 2014 OpenSimplex, can be found here:
* https://github.com/KdotJPG/OpenSimplex2
*/
public class OpenSimplex2S {
private static final long PRIME_X = 0x5205402B9270C86FL;

Keybase proof

I hereby claim:

  • I am cure53 on github.
  • I am cure53 (https://keybase.io/cure53) on keybase.
  • I have a public key whose fingerprint is F98B 0EC1 8640 2F60 292C 5877 C26C 8580 90F7 0ADA

To claim this, I am signing this object:

@palladin
palladin / gist:c5fca07b74da782832cb
Last active September 25, 2021 17:52
Parallel Streams Test
#time
#r "bin/Release/Streams.Core.dll"
open Nessos.Streams.Core
let data = [|1..10000000|] |> Array.map int64
#r "../../packages/FSharp.Collections.ParallelSeq.1.0/lib/net40/FSharp.Collections.ParallelSeq.dll"

#r @"E:\Assemblies\OpenTK\OpenTK.dll"
open System
open System.Drawing
open System.Collections.Generic
open OpenTK
open OpenTK.Graphics
open OpenTK.Graphics.OpenGL
@ninegrid
ninegrid / universe.fs
Last active March 26, 2016 14:03
1D 2-color cellular automata in F#
type cell = A | B
type 'cell U = U of 'cell LazyList * 'cell * LazyList<'cell>
module Universe =
open LazyList
let U left focus right = U (left, focus, right)
let initial () = U (repeat A) B (repeat A)
let shiftRight = fun (U (left,focus,Cons(focus',right))) -> U (cons focus left) focus' right
open System
type Cylinder =
| FourFourEight
| SixSixTwelve
| ThreeThreeSix
| TwoTwoTwo
type CylinderMeasurement =
{ WidthA: float
@lobrien
lobrien / gist:7273287
Last active December 27, 2015 05:19
let GetAsync(url : string, i : int) =
async {
let req = WebRequest.Create(url)
let! rsp = req.AsyncGetResponse()
use stream = (rsp :?> HttpWebResponse).GetResponseStream()
use zip = new GZipStream(stream, CompressionMode.Decompress)
use reader = new StreamReader(zip)
Console.WriteLine("Received page " + i.ToString())
return reader.ReadToEnd()
}
@CarstenKoenig
CarstenKoenig / lightsOut.py
Last active December 19, 2015 19:28
ligths Out for "Coding the Matrix: Linear Algebra through Computer Science Applications" You need pygame to run this and you have to place this file inside your matrix-folder (where it can find GF2.py and your vec.py) Then you can run it with "python3 ligthOut.py" Mouseclick will switch the ligth according to the rules of the game To exit click …
import pygame
import random
import math
from vec import Vec
from GF2 import *
pygame.init()
screen_width = 600
@CarstenKoenig
CarstenKoenig / Vec.hs
Last active December 19, 2015 16:19
Vec.hs
-- basic implementation of a vector type
-- modeled after the Vec type from Courseras "Coding the Matrix" class
-- | implementation of a sparse-vector representation based on the
-- Courseras "Coding the Matrix" MOOC class
-- this is in no way optimized and is just indended for learning
module Vec where
-- *** I worked with these imports ... you might want others (or not)
module test
(*
#r "Microsoft.Solver.Foundation.dll";;
#load "test.fs";;
test.computeProblem;;
*)
open Microsoft.SolverFoundation.Common
open Microsoft.SolverFoundation.Services