Skip to content

Instantly share code, notes, and snippets.

Avatar

Mustafa M musm

View GitHub Profile
View compare.jl
import Base.Math: rem_pio2_kernel, sin_kernel, cos_kernel
function nansin(x::T) where T<:Union{Float64}
absx = abs(x)
if absx < T(pi)/4 #|x| ~<= pi/4, no need for reduction
if absx < sqrt(eps(T))
return x
end
return sin_kernel(x)
elseif isnan(x)
View compare.jl
import Base.Math: rem_pio2_kernel, sin_kernel, cos_kernel
function nansin(x::T) where T<:Union{Float64}
absx = abs(x)
if absx < T(pi)/4 #|x| ~<= pi/4, no need for reduction
if absx < sqrt(eps(T))
return x
end
return sin_kernel(x)
elseif isnan(x)
View gist:9671d346eb1e1fccb1bec9b96d5ed87e
import Base.Math: significand_bits,exponent_bias
@inline exp_kernel(x::Float64) = evalpoly(x, (1.0, 1.0, .5, .1666666666666666666))
const J_TABLE = Float64[2^((j-1)/1024) for j in 1:1024]
function myexp(x::T) where T<:Float64
# Negation so NaN gets caught
if !(abs(x) < 708.3964185322641)
x <= -708.3964185322641 && return 0.0
@musm
musm / README.md
Last active Jul 4, 2020 — forked from nickbudi/README.md
Cygwin git compatibility with VS Code (or other Windows programs) using cygpath
View README.md

Cygwin Git + VS Code compatibility

Thanks and credit to mattn and ferreus on GitHub.

Check out wslpath if you're using the Windows Subsystem for Linux.

View vs code theme tweaks
// the following disables italic comments!
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": ["comment"],
"settings": {
"fontStyle": ""
}
}
View gist:8f60a31a775a72411f9173637bba0642
In file included from H5PLint.c:32:0:
H5PLint.c: In function ‘H5PL__open’:
H5PLpkg.h:97:30: warning: implicit declaration of function ‘dlopen’; did you mean ‘fdopen’? [-Wimplicit-function-declaration]
# define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_LAZY)
^
H5PLint.c:326:27: note: in expansion of macro ‘H5PL_OPEN_DLIB’
if (NULL == (handle = H5PL_OPEN_DLIB(path))) {
^~~~~~~~~~~~~~
H5PLpkg.h:97:40: error: ‘RTLD_LAZY’ undeclared (first use in this function)
# define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_LAZY)
View gist:7b51c83e56bfc1a4de58df23be3db3f0
julia> versioninfo()
Julia Version 0.7.0-DEV.1208
Commit 952dc93489* (2017-08-02 23:54 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: Intel(R) Core(TM) i7-4510U CPU @ 2.00GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: libopenblas64_
LIBM: libopenlibm
View gist:be8d8b3f9e89d5d1d4b7ae7d3118cb94
[00:00:00] Build started
[00:00:00] git config --global core.autocrlf input
[00:00:00] git clone -q --depth=50 https://github.com/JuliaLang/julia.git C:\projects\julia
[00:00:06] git fetch -q origin +refs/pull/23046/merge:
[00:00:08] git checkout -qf FETCH_HEAD
[00:00:11] Restoring build cache
[00:00:11]
[00:00:12] Cache 'C:\cygdownloads' - Downloading (515,651,150 bytes)...1%
[00:00:13] Cache 'C:\cygdownloads' - Downloading (515,651,150 bytes)...10%
[00:00:14] Cache 'C:\cygdownloads' - Downloading (515,651,150 bytes)...20%
View gist:117d2a64cc8dc874455de45283b230df
[00:00:00] Build started
[00:00:02] git config --global core.autocrlf input
[00:00:02] git clone -q --depth=50 https://github.com/JuliaLang/julia.git C:\projects\julia
[00:00:07] git fetch -q origin +refs/pull/21540/merge:
[00:00:09] git checkout -qf FETCH_HEAD
[00:00:16] Restoring build cache
[00:00:16]
[00:00:16] Cache 'x86_64-4.9.2-release-win32-seh-rt_v4-rev3.7z' - Downloading (63,558,997 bytes)...1%
[00:00:16] Cache 'x86_64-4.9.2-release-win32-seh-rt_v4-rev3.7z' - Downloading (63,558,997 bytes)...10%
[00:00:16] Cache 'x86_64-4.9.2-release-win32-seh-rt_v4-rev3.7z' - Downloading (63,558,997 bytes)...20%
@musm
musm / cracking.md
Created Jun 18, 2017 — forked from vertexclique/cracking.md
Cracking guide for Sublime Text 3 Build 3059 / 3065 ( Mac / Win x86_64 / Windows x86 / Linux x64 / Linux x86 )
View cracking.md

MacOS

Build 3059

MD5: 59bab8f71f8c096cd3f72cd73851515d

Rename it to: Sublime Text

Make it executable with: chmod u+x Sublime\ Text