Skip to content

Instantly share code, notes, and snippets.

Avatar

Ole Kröger Wikunia

View GitHub Profile
@Wikunia
Wikunia / Manifest_1,5.toml
Created Jul 20, 2021
VideoIO duration issue
View Manifest_1,5.toml
# This file is machine-generated - editing it directly is not advised
[[AbstractFFTs]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "485ee0867925449198280d4af84bdb46a2a404d0"
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c"
version = "1.0.1"
[[Adapt]]
deps = ["LinearAlgebra"]
@Wikunia
Wikunia / fourier.jl
Created Nov 9, 2020
JuliaLang logo using Fourier series
View fourier.jl
#=
Drawing Julia using a Fourier series.
A high definition animation can be seen here: https://youtu.be/rrmx2Q3sO1Y
This code is based on code kindly provided by ric-cioffi (https://github.com/ric-cioffi)
But was rewritten for v0.3 by Ole Kröger.
=#
using Javis, FFTW, FFTViews
@Wikunia
Wikunia / vis_digits.jl
Created Jul 13, 2020
Visualzing digits
View vis_digits.jl
using Luxor, ColorSchemes
using UnicodeFun
using Primes
struct PNGScene
opts::Dict{Symbol, Any}
end
function get_coord(val, radius)
θ = 2π*0.1*val
@Wikunia
Wikunia / binet.jl
Created Jul 2, 2020
Binet Matt Parker
View binet.jl
using Plots
const Φ = (1+√5)/2
const ξ = (1-√5)/2
function binet(n)
c = Complex(n)
return^c - ξ^c)/√5
end
View numoku.jl
using JuMP, ConstraintSolver, Combinatorics
const CS = ConstraintSolver
"""
get_possible_splits(p, n, wished_sum, split_point)
p = possible numbers like 1:9 in a normal numoku
n = number of elements in a row
wished_sum = the sum of a row
split_point = index of where the left part should be a multiple of the right part or the other way around
View eternity.jl
using ConstraintSolver
using JuMP
const CS = ConstraintSolver
include("plot_search_space.jl")
function read_puzzle(fname)
lines = readlines("data/$fname")
npieces = length(lines)
puzzle = zeros(Int, (npieces, 5))
for i=1:npieces
@Wikunia
Wikunia / Manifest.toml
Last active Oct 12, 2021
Mandelbrot Set in Julia
View Manifest.toml
# This file is machine-generated - editing it directly is not advised
[[AbstractFFTs]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "051c95d6836228d120f5f4b984dd5aba1624f716"
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c"
version = "0.5.0"
[[AbstractTrees]]
deps = ["Markdown"]
@Wikunia
Wikunia / graph_coloring_mip.jl
Created Oct 15, 2019
Graph Coloring MIP using JuMP
View graph_coloring_mip.jl
using JuMP, GLPK
function graph_coloring(;fast=true, benchmark=false)
m = Model(with_optimizer(GLPK.Optimizer, msg_lev = 3))
@variable(m, max_color, Int)
@variable(m, c[1:49,1:4], Bin)
@objective(m, Min, max_color)
@Wikunia
Wikunia / plot_animation.jl
Created Oct 8, 2019
Plot polar prime animation
View plot_animation.jl
using Plots
using ColorSchemes
using Primes
using Plots.PlotMeasures
function plot_primes(x)
l_primes = primes(x)
colors = get(ColorSchemes.summer, [i/x for i in l_primes])
anim = Animation("temp", String[])
for i=1:100
@Wikunia
Wikunia / plot.jl
Created Oct 8, 2019
Plotting primes in polar coordinates
View plot.jl
using Plots
using ColorSchemes
using Primes
function plot_primes(x)
l_primes = primes(x)
colors = get(ColorSchemes.summer, [i/x for i in l_primes])
scatter(l_primes, l_primes; size=(1000,1000), legend=false, axis=false, background_color=:black, foreground_color=:black,
proj=:polar, markersize=1, markercolor=colors)
png("polar_primes_$(x)")