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
| # sudo apt install llvm-3.9-dev libopenblas-dev libfftw3-dev libgmp3-dev libmpfr-dev libarpack2-dev libopenspecfun-dev libssh2-1-dev libcurl4-openssl-dev | |
| USE_SYSTEM_LLVM:=1 | |
| LLVM_CONFIG:=llvm-config-3.9 | |
| USE_SYSTEM_BLAS:=1 | |
| LIBBLAS:=-lopenblas | |
| LIBBLASNAME:=libopenblas | |
| USE_SYSTEM_LAPACK:=1 | |
| USE_SYSTEM_LIBM:=1 |
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
| const HI = prevfloat(log10(prevfloat(Inf))) | |
| function test(n) | |
| xx = 0.0 | |
| zz = 0.0 | |
| for i = 1:n | |
| x = reinterpret(Float64, rand(reinterpret(UInt64, 1e-18):reinterpret(UInt64, HI))) | |
| if rand(Bool) | |
| x = -x | |
| end |
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.
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
| using SenseHat | |
| function newblob(snake) | |
| while true | |
| x = rand(1:8) | |
| y = rand(1:8) | |
| if (x,y) ∉ snake | |
| return (x,y) | |
| end | |
| end |
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
| #include <stdio.h> | |
| #include <gmp.h> | |
| #include <mpfr.h> | |
| int main (void) | |
| { | |
| unsigned int i; | |
| mpfr_t u; | |
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
| using Distributions | |
| import ForwardDiff: Dual, value, partials | |
| @generated function get_values(a::NTuple{N}) where {N} | |
| return ForwardDiff.tupexpr(i -> :(value(a[$i])),N) | |
| end | |
| ForwardDiff.value(p::ForwardDiff.Partials) = | |
| ForwardDiff.Partials(get_values(p.values)) |
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
| git init --bare gitprob | |
| git clone gitprob gitprobwork | |
| cd gitprobwork | |
| echo "good" > aaaa | |
| GOOD=$(git hash-object -w aaaa) | |
| git add aaaa | |
| git commit -m "1" | |
| rm aaaa |
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
| n = 2_500_000 | |
| p = 1.9e-5 | |
| X = sprand(n,n,p) | |
| v = sprand(n,8/n) | |
| function fast_A_mul_B(X::SparseMatrixCSC{TX,IX},v::SparseVector{TV,IV}) where {TX,IX,TV,IV} | |
| X.n == v.n || throw(DimensionMismatch()) | |
| ind_out = promote_type(IX,IV)[] | |
| val_out = promote_type(TX,TV)[] |
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
| module Intrinsics | |
| tname(::Type{Float64}) = "double" | |
| tname(::Type{Float32}) = "float" | |
| fname(::Type{Float64}) = "f64" | |
| fname(::Type{Float32}) = "f32" | |
| for f in [:add, :sub, :mul, :div, :rem] |