This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int[][] result; | |
| float t, c; | |
| float ease(float p) { | |
| return 3*p*p - 2*p*p*p; | |
| } | |
| float ease(float p, float g) { | |
| if (p < 0.5) | |
| return 0.5 * pow(2*p, g); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def only_every(_f=None, *, interval=10): | |
| """Call the wrapped function at most every `interval` seconds. | |
| Useful when `f` is (very) expensive to compute and you are happy | |
| to have results which are possibly a few seconds out of date. | |
| """ | |
| last_time = time.monotonic() - interval - 1 | |
| last_result = None | |
| def caller(f): | |
| @wraps(f) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Implementation of NEAT. | |
| python neat.py --task {xor, lunar, cartpole} | |
| See the post at https://wellecks.wordpress.com/ for details. | |
| Parts of this implementation are based on Neat-Python. | |
| """ | |
| from itertools import count | |
| import numpy as np | |
| import math |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Discovered In C a few years ago thanks to Tero Parviainen (@teropa) 's great article: Terry Riley's "In C", A Journey Through a Musical Possibility Space | |
| # http://teropa.info/blog/2017/01/23/terry-rileys-in-c.html | |
| # Here is a Sonic Pi version with 5 synths and 1 sample, based on Jim Bumgardner's Chuck implementation. | |
| # http://electro-music.com/forum/viewtopic.php?t=14237&sid=dbb3ada88a20169e90ee4ce45d79f10 | |
| # A generated result can be heard here: https://soundcloud.com/makio135/sonic-pi-in-c | |
| use_debug false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Processing code by Etienne JACOB | |
| // motion blur template by beesandbombs | |
| // opensimplexnoise code in another tab might be necessary | |
| // --> code here : https://gist.github.com/Bleuje/fce86ef35b66c4a2b6a469b27163591e | |
| // note : I found (visually) that there is a little mistake in this rotation version but I haven't found where in the code | |
| // edit : I think I understood the mistake but it's quite annoying to fix :) | |
| int[][] result; | |
| float t, c; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
C++ links: Coroutines
https://github.com/MattPD/cpplinks / C++ Standard / C++20 / Coroutines
(draft; work in progress)
#coroutines (C++ Slack): https://cpplang.slack.com/archives/C5JS5JXT5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Download occurence data from GBIF - for few to many spp. | |
| #3/25/2019 KG Turner with assistance from S. Chamberlain, rOpenSci.org | |
| #Register at gbif.org. You will need to use this email address, user name, and password in the following script. | |
| #NB: DON'T COMMIT YOUR PASSWORDS. | |
| # R version 3.5.3 (2019-03-11) | |
| library(rgbif) #1.2.0 |