Skip to content

Instantly share code, notes, and snippets.

View stevengj's full-sized avatar

Steven G. Johnson stevengj

View GitHub Profile
# Automatically generated using Clang.jl
const JPEG_LIB_VERSION = 62
const LIBJPEG_TURBO_VERSION = ".1."
const LIBJPEG_TURBO_VERSION_NUMBER = 2001000
const C_ARITH_CODING_SUPPORTED = 1
const D_ARITH_CODING_SUPPORTED = 1
const MEM_SRCDST_SUPPORTED = 1
const WITH_SIMD = 1
2020-12-03T18:37:45.7964313Z ##[section]Starting: Request a runner to run this job
2020-12-03T18:37:46.5083864Z Can't find any online and idle self-hosted runner in current repository that matches the required labels: 'macOS-latest'
2020-12-03T18:37:46.5083966Z Can't find any online and idle self-hosted runner in current repository's account/organization that matches the required labels: 'macOS-latest'
2020-12-03T18:37:46.5666676Z Found online and idle hosted runner in current repository's account/organization that matches the required labels: 'macOS-latest'
2020-12-03T18:37:46.6885736Z ##[section]Finishing: Request a runner to run this job
2020-12-03T18:37:59.8116280Z Current runner version: '2.274.2'
2020-12-03T18:37:59.8163910Z ##[group]Operating System
2020-12-03T18:37:59.8164730Z Mac OS X
2020-12-03T18:37:59.8165090Z 10.15.7
2020-12-03T18:37:59.8165420Z 19H15
@stevengj
stevengj / libqhull_r.jl
Last active November 20, 2020 21:52
libqhull_r Julia bindings
module LibQhull
using Qhull_jll, CEnum
const realT = Cdouble
const DBL_MAX = floatmax(realT)
const DBL_MIN = floatmin(realT)
const DBL_EPSILON = eps(floatmax(realT))
const INT_MAX = typemax(Cint)
@stevengj
stevengj / definitive derivative BesselJ.ipynb
Created April 29, 2019 15:56
Bessel J derivative with respect to order
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stevengj
stevengj / globalize.jl
Last active August 21, 2018 19:52
draft julia function to make ASTs use soft global scope
using Base.Meta: isexpr
const assignments = Set((:(=), :(+=), :(-=), :(*=), :(/=), :(//=), :(\=), :(^=), :(÷=), :(%=), :(<<=), :(>>=), :(>>>=), :(|=), :(&=), :(⊻=), :($=)))
localvar(ex::Expr) = isexpr(ex, :(=)) ? ex.args[1] : nothing
localvar(ex) = nothing
function soft_globals(ex::Expr, globals, insertglobal=false)
if isexpr(ex, :for) || isexpr(ex, :while)
return Expr(ex.head, ex.args[1], soft_globals(ex.args[2], globals, true))
@stevengj
stevengj / appdata.jl
Created August 3, 2018 21:38
appdata
function appdata()
path = zeros(UInt32, 300)
result = ccall((:SHGetFolderPathW,:shell32), stdcall, Cint,
(Ptr{Cvoid},Cint,Ptr{Cvoid},Cint,Ptr{UInt8}),C_NULL,0x0005,C_NULL,0,path)
return result == 0 ? transcode(String, resize!(path, findfirst(iszero, path)-1)) : homedir()
end
@stevengj
stevengj / blosc-sum.ipynb
Last active May 4, 2018 18:06
Blosc.jl-based summation benchmark
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stevengj
stevengj / BEM-kernelgen.ipynb
Created March 24, 2018 23:15
BEM-kernelgen
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stevengj
stevengj / Bug.jl
Created March 7, 2018 19:45
module that makes 0.7 hang
module Bug
import Base: size, ndims, similar, copy, getindex, setindex!, stride,
convert, pointer, summary, convert, show, haskey, keys, values,
eltype, get, delete!, empty!, length, isempty, start, done,
next, filter!, hash, splice!, pop!, ==, isequal, push!,
append!, insert!, prepend!, mimewritable, unsafe_convert
import Base: pushfirst!, popfirst!
import Base: sigatomic_begin, sigatomic_end
; from libctl/base/utils.scm:
(define (vector-map func . v)
(list->vector (apply map (cons func (map vector->list v)))))
(define (first list) (list-ref list 0))
(define (second list) (list-ref list 1))
(define (third list) (list-ref list 2))
; functions from libctl/base/vector3.scm:
(define (ctl-exact->inexact x)
(if (real? x) (exact->inexact x) x))
(define (vector3->inexact v) (vector-map ctl-exact->inexact v))