Skip to content

Instantly share code, notes, and snippets.

💭
🐱‍🐉

ueliwechsler

💭
🐱‍🐉
  • Switzerland, Zurich
View GitHub Profile
View MeetupFreiburg_Lorenz_Attractor_Example.jl
# Example for Plots.jl http://docs.juliaplots.org/latest/#simple-is-beautiful
using Plots
# define the Lorenz attractor
mutable struct Lorenz
dt; σ; ρ; β; x; y; z
end
function step!(l::Lorenz)
dx = l.σ*(l.y - l.x) ; l.x += l.dt * dx
View MeetupFreiburg_Lotka_Volterra_Example.jl
using DifferentialEquations
α = 1
β = 0.1
γ = 0.05
δ = 0.02
function lotka_voltera!(dx, x, p, t)
dx[1] = α*x[1] - β*x[1]*x[2]
dx[2] = δ*x[1]*x[2] - γ*x[2]
@ueliwechsler
ueliwechsler / workingWithDateTimes.jl
Created Jul 5, 2018
Shows some ways, how to work with DateTime format in Julia. #Julia #DateTime #time, #Dates
View workingWithDateTimes.jl
year, month, day = Dates.yearmonthday(now(Dates.UTC)); hour = Dates.Hour(now(Dates.UTC))
timeNow = DateTime(year,month,day,hour)
utc_start = [timeNow:Dates.Hour(1):timeNow+Dates.Hour(n-1)...]
timeNow = now(Dates.UTC)
utc_start = [Dates.format(value, "yyyy-m-dd HH:00:00") for value in timeNow:Dates.Hour(1):timeNow+Dates.Hour(n-1)]
@ueliwechsler
ueliwechsler / readJSON.jl
Last active Jun 21, 2018
Julia: read .json to strict #Julia, #JSON
View readJSON.jl
using JSON
file = normpath(joinpath(@__DIR__,"..\\dsl\\historic_query.json"))
dict = open(file, "r") do f
dict = JSON.parse(f)
end
You can’t perform that action at this time.