Created
July 13, 2020 10:03
-
-
Save jwscook/8df8ea24b421f23d7cc87269947d9339 to your computer and use it in GitHub Desktop.
This file contains 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
using Random | |
const seed = hash(time()) | |
Random.seed!(seed) | |
searchstring = "const seed = " | |
open("$(@__FILE__)" * ".reproducible", "w") do io | |
for line in readlines(open(@__FILE__)) | |
if length(line) > length(searchstring) && line[1:length(searchstring)] == searchstring | |
write(io, searchstring * "$seed\n") | |
else | |
write(io, line * "\n") | |
end | |
end | |
end | |
@show seed | |
@show rand() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And
ReproduceExample.jl.rerunnable
is identical toReproduceExample.jl.rerunnable.rerunnable