Skip to content

Instantly share code, notes, and snippets.

@marius311
marius311 / dynamic_imports.jl
Last active April 1, 2022 21:13
An idea for putting imports inside of Julia functions
using Profile
"""
@dynamic import Foo[: bar, baz, ...]
Allows you to put an import inside of a function. The package won't be
loaded until the first time the function gets run. Note that, in order
to avoid world-age errors, the function is effectively "restarted from
@marius311
marius311 / clvariance.ipynb
Created May 5, 2021 19:44
Cl variance example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<scheduler_request>
<authenticator>f45d2862ed21aca86b1cd540a2499470</authenticator>
<hostid>0</hostid>
<rpc_seqno>0</rpc_seqno>
<core_client_major_version>7</core_client_major_version>
<core_client_minor_version>6</core_client_minor_version>
<core_client_release>31</core_client_release>
<resource_share_fraction>1.000000</resource_share_fraction>
<rrs_fraction>1.000000</rrs_fraction>
<prrs_fraction>1.000000</prrs_fraction>
module Issue22125
import Base: convert
# Define some "Field" types which are basically a wrapper around a 2-D matrix,
# whose size is known at compile-time (i.e. "Nside"), which can converted
# between "map" and "fourier" bases via FFT
abstract type Pix end
abstract type Flat{Nside} <: Pix end
WARNING: An error occurred during inference. Type inference is now partially disabled.
Base.MethodError(f=typeof(Core.Inference.convert)(), args=(Base.AssertionError, "invalid age range update"), world=0x0000000000000ac2)
rec_backtrace at /home/centos/buildbot/slave/package_tarball64/build/src/stackwalk.c:84
record_backtrace at /home/centos/buildbot/slave/package_tarball64/build/src/task.c:245
jl_throw at /home/centos/buildbot/slave/package_tarball64/build/src/task.c:564
jl_method_error_bare at /home/centos/buildbot/slave/package_tarball64/build/src/gf.c:1476
jl_method_error at /home/centos/buildbot/slave/package_tarball64/build/src/gf.c:1494
jl_lookup_generic_ at /home/centos/buildbot/slave/package_tarball64/build/src/gf.c:1907 [inlined]
jl_apply_generic at /home/centos/buildbot/slave/package_tarball64/build/src/gf.c:1927
Type at ./coreimg.jl:14
Tuple{Tuple{Int64, Void}, Tuple{Tuple{Int64, Void}, Tuple{Int64, Tuple{Tuple{Int64, Void}, Tuple{Tuple{Int64, Void}, Tuple{Int64, Tuple{Tuple{Int64, Void}, Tuple{Tuple, Tuple}}}}}}}}
Tuple{Tuple{Int64, Void}, Tuple{Tuple{Int64, Void}, Tuple{Int64, Tuple{Tuple{Int64, Void}, Tuple{Tuple{Int64, Void}, Tuple{Int64, Tuple{Tuple{Int64, Void}, Tuple{Tuple{Any}, Tuple{Any}}}}}}}}}
WARNING: An error occurred during inference. Type inference is now partially disabled.
Base.MethodError(f=typeof(Base.string)(), args=(Expr(:||, Expr(:call, :!, Expr(:call, :isa, :t, :Type)::Any)::Any, Expr(:<:, :t, :r)::Any)::Any,), world=0x0000000000000abf)
rec_backtrace at /home/marius/src/julia/src/stackwalk.c:84
record_backtrace at /home/marius/src/julia/src/task.c:245
jl_throw at /home/marius/src/julia/src/task.c:564
jl_method_error_bare at /home/marius/src/julia/src/gf.c:1476
jl_method_error at /home/marius/src/julia/src/gf.c:1494
jl_lookup_generic_ at /home/marius/src/julia/src/gf.c:1907 [inlined]
@marius311
marius311 / output2
Created May 16, 2017 09:49
output2
Tuple{Tuple{Int64, Void}, Tuple{Tuple{Int64, Void}, Tuple{Int64, Tuple{Tuple{Int64, Void}, Tuple{Tuple{Int64, Void}, Tuple{Int64, Tuple{Tuple{Int64, Void}, Tuple{Tuple, Tuple}}}}}}}}
Tuple{Tuple{Int64, Void}, Tuple{Tuple{Int64, Void}, Tuple{Int64, Tuple{Tuple{Int64, Void}, Tuple{Tuple{Int64, Void}, Tuple{Int64, Tuple{Tuple{Int64, Void}, Tuple{Tuple{Any}, Tuple{Any}}}}}}}}}
WARNING: An error occurred during inference. Type inference is now partially disabled.
Base.MethodError(f=typeof(Base.string)(), args=(Expr(:||, Expr(:call, :!, Expr(:call, :isa, :t, :Type)::Any)::Any, Expr(:<:, :t, :r)::Any)::Any,), world=0x0000000000000abf)
rec_backtrace at /home/marius/src/julia/src/stackwalk.c:84
record_backtrace at /home/marius/src/julia/src/task.c:245
jl_throw at /home/marius/src/julia/src/task.c:564
jl_method_error_bare at /home/marius/src/julia/src/gf.c:1476
jl_method_error at /home/marius/src/julia/src/gf.c:1494
jl_lookup_generic_ at /home/marius/src/julia/src/gf.c:1907 [inlined]
Tuple{typeof(Base.:(*)), CMBLensing.LazyBinaryOp{typeof(Base.:(*))(), CMBLensing.FullDiagOp{CMBLensing.Field2Tuple{CMBLensing.FlatS2QUMap{Float64, CMBLensing.Flat{3, 64}}, CMBLensing.FlatS0Map{Float64, CMBLensing.Flat{3, 64}}, CMBLensing.QUMap, CMBLensing.Map}, CMBLensing.Pix, CMBLensing.Spin, CMBLensing.Basis2Tuple{CMBLensing.QUMap, CMBLensing.Map}}, CMBLensing.LazyBinaryOp{typeof(Base.:(*))(), Int64, CMBLensing.LazyBinaryOp{typeof(Base.:(+))(), CMBLensing.LazyBinaryOp{typeof(Base.Ac_mul_B)(), CMBLensing.δfϕₛ_δfϕₜ{1, 0, CMBLensing.PowerLens{7, CMBLensing.FlatS0Map{Float64, CMBLensing.Flat{3, 64}}}}, CMBLensing.LazyBinaryOp{typeof(Base.:(*))(), CMBLensing.FuncOp{getfield(CMBLensing, Symbol("##281#283")){NamedTuples._NT_d_CN_Cf_Cϕ_Md_Mf_Mϕ{CMBLensing.FlatS2QUMap{Float64, _}, CMBLensing.FullDiagOp{_, _, CMBLensing.S2, CMBLensing.QUMap}, CMBLensing.FullDiagOp{_, _, CMBLensing.S2, CMBLensing.QUMap}, CMBLensing.FullDiagOp{_, _, CMBLensing.S0, CMBLensing.Map}, CMBLensing.LazyBinaryOp{typeof(Base.:(*))(), _, _}, CMB
/usr/local/bin/dockerd -D -g "/var/lib/docker" -H unix:// -H tcp://0.0.0.0:2376 --tlsverify --tlscacert=/var/lib/hostB/tls/ca.pem --tlscert=/var/lib/hostB/tls/server.pem --tlskey=/var/lib/hostB/tls/serverkey.pem >> "/var/lib/hostB/docker.log"
time="2017-01-08T13:06:17.177971262Z" level=debug msg="Trusting 174 certs"
time="2017-01-08T13:06:17.178612132Z" level=debug msg="docker group found. gid: 100"
time="2017-01-08T13:06:17.178628803Z" level=debug msg="Listener created for HTTP on unix (/var/run/docker.sock)"
time="2017-01-08T13:06:17.178712878Z" level=debug msg="Listener created for HTTP on tcp (0.0.0.0:2376)"
time="2017-01-08T13:06:17.184229383Z" level=info msg="libcontainerd: new containerd process, pid: 1065"
time="2017-01-08T13:06:17.198125325Z" level=debug msg="containerd: read past events" count=0
time="2017-01-08T13:06:17.198214507Z" level=debug msg="containerd: supervisor running" cpus=1 memory=2002 runtime=docker-runc runtimeArgs=[] stateDir="/var/run/docker/libcontainerd/containerd"
time="
Jan 08 14:06:56 hostA dockerd[8953]: time="2017-01-08T14:06:56.096638774+01:00" level=debug msg="Calling GET /_ping"
Jan 08 14:06:56 hostA dockerd[8953]: time="2017-01-08T14:06:56.097295704+01:00" level=debug msg="Calling GET /v1.25/version"
Jan 08 14:07:24 hostA dockerd[8953]: time="2017-01-08T14:07:24.525640581+01:00" level=debug msg="Calling GET /_ping"
Jan 08 14:07:24 hostA dockerd[8953]: time="2017-01-08T14:07:24.526276681+01:00" level=debug msg="Calling POST /v1.25/swarm/init"
Jan 08 14:07:24 hostA dockerd[8953]: time="2017-01-08T14:07:24.526387729+01:00" level=debug msg="form data: {\"AdvertiseAddr\":\"<hostA's public IP>\",\"AutoLockManagers\":false,\"ForceNewCluster\":false,\"ListenAddr\":\"wlp3s0:2377\",\"Spec\":{\"CAConfig\":{},\"Dispatcher\":{},\"EncryptionConfig\":{\"AutoLockManagers\":false},\"Orchestration\":{},\"Raft\":{\"ElectionTick\":0,\"HeartbeatTick\":0},\"TaskDefaults\":{}}}"
Jan 08 14:07:24 hostA dockerd[8953]: time="2017-01-08T14:07:24.552327066+01:00" level=debug msg="generated CA key