Skip to content

Instantly share code, notes, and snippets.

View JeffBezanson's full-sized avatar

Jeff Bezanson JeffBezanson

View GitHub Profile
View threads.jl
using Images
import Base.Threads: @threads, @spawn
function escapetime(z; maxiter=80)
c = z
for n = 1:maxiter
if abs(z) > 2
return n-1
end
z = z^2 + c
View infedges.jl
const CC = Core.Compiler
using Base: IdSet
# count total number of nodes reachable from a given point
function edgecount(G, from, counts = IdDict{Any,Int}())
if haskey(counts, from)
return 0
end
if !CC.haskey(G, from)
return 0
View Artifacts.jl
function do_artifact_str(name, sfile, __module__)
local artifacts_toml = find_artifacts_toml(sfile)
if artifacts_toml === nothing
error(string(
"Cannot locate '(Julia)Artifacts.toml' file when attempting to use artifact '",
name,
"' in '",
__module__,
"'",
))
View pfib.jl
# run in commit c35d1d7f7c9d90e0a00ded1980d6fcd5d06f5433
# fixed by commit f81d4d21862c99e1c0452bdf2613ab9e20da9935
macro par(expr)
thunk = esc(:(()->($expr)))
quote
local task = Task($thunk)
task.sticky = false
schedule(task)
task
View badmod.llvm
; ModuleID = 'convert'
source_filename = "convert"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:10:11:12"
target triple = "x86_64-unknown-linux-gnu"
%jl_value_t = type opaque
@llvm.compiler.used = appending global [2 x i8*] [i8* bitcast (%jl_value_t addrspace(10)* (i8*, i32, i32)* @jl_gc_pool_alloc to i8*), i8* bitcast (%jl_value_t addrspace(10)* (i8*, i64)* @jl_gc_big_alloc to i8*)], section "llvm.metadata"
; Function Attrs: sspstrong
View flatten.patch
diff --git a/base/iterators.jl b/base/iterators.jl
index 1c2ab13..4e5d1b5 100644
--- a/base/iterators.jl
+++ b/base/iterators.jl
@@ -694,28 +694,30 @@ function start(f::Flatten)
d = done(f.it, s)
# this is a simple way to make this function type stable
d && throw(ArgumentError("argument to Flatten must contain at least one iterator"))
+ done_inner = false
while !d
View dispatch_timings.jl
immutable Myo{C}
c::C
function (::Type{Myo{C}}){C}(c)
if 2 == 2 # expansion of @assert 2==2
nothing
else
throw(Base.AssertionError("2 == 2"))
end
return new{C}(c)
end
View 21514failure
travis_fold:start:worker_info
Worker information
hostname: wjb-1.macstadium-us-se-1.travisci.net:fbee6be9-3545-4d4b-98ad-d0fb4f031325
version: v2.6.2 https://github.com/travis-ci/worker/tree/fdccca4efd347ebc889baae641ccbf55bb871d19
instance: a349cd59-a02e-46c9-8c28-ece0f707dfc7:travis-ci-osx10.11-xcode8-1479248015
startup: 1m54.291250744s
travis_fold:end:worker_info
travis_fold:start:system_info
Build system information
View gcerror-32bit
INFO: Installing Example v0.4.0
INFO: Package database updated
INFO: METADATA is out-of-date — you may not have the latest version of Example
INFO: Use `Pkg.update()` to get the latest versions of your packages
INFO: Initializing package repository /tmp/o8xgwvMS/v0.6
INFO: Cloning METADATA from https://github.com/JuliaLang/METADATA.jl
INFO: No packages to install, update or remove
INFO: Cloning cache of Example from https://github.com/JuliaLang/Example.jl.git
INFO: Installing Example v0.4.1
INFO: Package database updated
View Str.jl
import Base: endof, sizeof, pointer, next
using Base: UTF_ERR_INVALID_INDEX, is_valid_continuation, utf8_trailing, utf8_offset
type Str <: AbstractString
len::Int
function Str(p::Union{Ptr{Int8},Ptr{UInt8}}, n::Integer)
s = ccall(:jl_gc_allocobj, Any, (Csize_t,), n+sizeof(Int))
ps = pointer_from_objref(s)
unsafe_store!(convert(Ptr{Ptr{Void}}, ps), pointer_from_objref(Str), 0)
unsafe_store!(convert(Ptr{Int}, ps), n)