Skip to content

Instantly share code, notes, and snippets.

Avatar
🐼
I am a panda.

George Datseris Datseris

🐼
I am a panda.
View GitHub Profile
@Datseris
Datseris / forward.jl
Created Apr 21, 2019
Method forwarding macro from Lazy
View forward.jl
"""
@forward T.x functions...
Define methods for `functions` on type `T`, which call the relevant function
on the field `x`.
# Example
```julia
struct Wrapper
x
end
@Datseris
Datseris / color_palletes.jl
Created Mar 15, 2019
Color palletes for plotting
View color_palletes.jl
# Based on Fresh:
["#65ADC2", "#233B43", "#E84646",
"#C29365", "#168E7F", "#985CC9",
"#B74305", "#56727A"]
@Datseris
Datseris / simple.jl
Last active Dec 22, 2018
simple select rectangle
View simple.jl
using Makie, AbstractPlotting
using AbstractPlotting: RefValue, absrect
scene = scatter(rand(10), rand(10))
const key = Mouse.left
# Create an initially hidden rectangle
function select_rectangle(scene)
@Datseris
Datseris / error.jl
Created Nov 24, 2018
Exception: EXCEPTION_ACCESS_VIOLATION at 0x43a2e5a91
View error.jl
Please submit a bug report with steps to reproduce this fault, and any error messages that follow (i
n their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x43a2e5a91 -- jl_gc_pool_alloc at /home/Administrator/buil
dbot/worker/package_win64/build/src\gc.c:964 [inlined]
jl_gc_alloc_ at /home/Administrator/buildbot/worker/package_win64/build/src\julia_internal.h:274 [in
lined]
jl_gc_alloc at /home/Administrator/buildbot/worker/package_win64/build/src\gc.c:2668
in expression starting at C:\Users\datseris\SimpleDiffEq.jl\src\tsit5_integrator.jl:224
jl_gc_pool_alloc at /home/Administrator/buildbot/worker/package_win64/build/src\gc.c:963 [inlined]
@Datseris
Datseris / error.jl
Created Nov 23, 2018
EXCEPTION_ACCESS_VIOLATION at 0x43a2e5a91
View error.jl
Please submit a bug report with steps to reproduce this fault, and any error messages that follow (i
n their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x43a2e5a91 -- jl_gc_pool_alloc at/home/Administrator/buil
dbot/worker/package_win64/build/src\gc.c:964 [inlined]
jl_gc_alloc_ at /home/Administrator/buildbot/worker/package_win64/build/src\julia_internal.h:274 [in
lined]
jl_gc_alloc at /home/Administrator/buildbot/worker/package_win64/build/src\gc.c:2668
in expression starting at C:\Users\datseris\.julia\dev\DynamicalSystemsBase\src\minimal_ode.jl:169
jl_gc_pool_alloc at /home/Administrator/buildbot/worker/package_win64/build/src\gc.c:963 [inlined]
View compare with recurrent analysis.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Datseris
Datseris / debug_logger.jl
Created Sep 30, 2018
using debug logger
View debug_logger.jl
julia> foo() = @debug "Hello, World!";
julia> foo()
julia> withenv("JULIA_DEBUG" => "all") do
@Datseris
Datseris / subtypes.jl
Created Sep 7, 2018
get all concrete subtypes of a Julia abstract type
View subtypes.jl
julia> function _subtypes(type::Type)
out = Any[]
_subtypes!(out, type)
end
_subtypes (generic function with 1 method)
julia> function _subtypes!(out, type::Type)
if !isabstracttype(type)
@Datseris
Datseris / tuple32.jl
Created Sep 7, 2018
Julia tuples have performance hinderances for sizes > 32
View tuple32.jl
f(t) = +(t...,)
@code_typed f(ntuple(identity, 5)) # what you expect
@code_typed f(ntuple(identity, 18)) # something is going on
@code_typed f(ntuple(identity, 33)) # _apply
@Datseris
Datseris / old_vs_new_psos.jl
Created Jul 26, 2018
New poincare section using Roots and integrator stepping
View old_vs_new_psos.jl
const PSOS_ERROR =
"the Poincaré surface of section did not have any points!"
function poincaresos2(ds::CDS{IIP, S, D}, plane, tfinal = 1000.0;
direction = +1, Ttr::Real = 0.0, warning = true,
diffeq...) where {IIP, S, D}
integ = integrator(ds; diffeq...)
planecrossing = PlaneCrossing{D}(plane, direction > 0 )