Skip to content

Instantly share code, notes, and snippets.

Avatar

David P. Sanders dpsanders

View GitHub Profile
View multidim_functions.jl
# 0.4 ONLY
type MultidimFunction
components::Vector{Function}
end
Base.getindex(f::MultidimFunction, i::Integer) = f.components[i]
Base.call(f::MultidimFunction, x) = (T=eltype(x); T[f_i(x) for f_i in f.components])
View Sketch of agent-based model in Julia.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Sketch of agent-based model in Julia.jl
abstract Person
type Adult <: Person
age::Int
height::Float64
position::Int
end
type Child <: Person
age::Int
View Sketch of agent-based model in Julia.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Interactive visualization in Julia using mpld3.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View FloatingPointExceptions.jl
# From Simon Byrne's pull request https://github.com/JuliaLang/julia/pull/6170
module FloatingPointExceptions
include("fenv_constants.jl")
## floating point exceptions ##
import Base: show, in, convert
export FloatExceptions, FEInexact, FEUnderflow, FEOverflow, FEDivByZero, FEInvalid, FloatExceptionSet,
View mxcsr.jl
function getmxcsr()
Base.llvmcall("""%ptr = alloca i32
call void @llvm.x86.sse.stmxcsr(i32 * %ptr)
%curval = load i32 * %ptr
ret i32 %curval""", UInt32, ())
end
function setmxcsr(u::UInt32)
Base.llvmcall("""%ptr = alloca i32
store i32 %0, i32 * %ptr
View Calculating pi rigorously with floating-point arithmetic.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View full_julia_compilation.txt
This file has been truncated, but you can view the full file.
Submodule 'deps/Rmath' (git://github.com/JuliaLang/Rmath.git) registered for path 'deps/Rmath'
Submodule 'deps/libmojibake' (git://github.com/JuliaLang/libmojibake.git) registered for path 'deps/libmojibake'
Submodule 'deps/libuv' (git://github.com/JuliaLang/libuv.git) registered for path 'deps/libuv'
Submodule 'deps/openlibm' (git://github.com/JuliaLang/openlibm.git) registered for path 'deps/openlibm'
Submodule 'deps/openspecfun' (git://github.com/JuliaLang/openspecfun.git) registered for path 'deps/openspecfun'
Cloning into 'deps/Rmath'...
Submodule path 'deps/Rmath': checked out '226598f63af75e8bc3568f01e34932caebce6064'
Cloning into 'deps/libmojibake'...
Submodule path 'deps/libmojibake': checked out 'df71da45dfbdf68bcc6fd656d1260d609c728ad7'
View sw_lib.txt
total 109248
drwxr-xr-x 260 root admin 8840 Jun 5 2013 .
drwxr-xr-x 13 root wheel 442 Jul 16 2013 ..
drwxr-xr-x 3 root admin 102 Jun 5 2013 apt
drwxr-xr-x 5 root admin 170 Jun 5 2013 cairo
drwxr-xr-x 7 root admin 238 Jun 5 2013 dpkg
drwxr-xr-x 8 root admin 272 Jun 5 2013 emacsen-common
drwxr-xr-x 14 root admin 476 Jun 5 2013 engines100
drwxr-xr-x 8 root admin 272 Jun 5 2013 fink
drwxr-xr-x 5 root admin 170 Jun 5 2013 fontconfig2