Skip to content

Instantly share code, notes, and snippets.

### A Pluto.jl notebook ###
# v0.19.13
using Markdown
using InteractiveUtils
# ╔═╡ 633ee07c-4fdd-11ed-0bee-67a92f7e634c
begin
using Plots, TestImages
heatmap(testimage("mandril"))
using Gtk, CairoMakie, Observables
canvas = @GtkCanvas()
window = GtkWindow(canvas, "Makie", 500, 500)
data = Observable(rand(1000, 2))
function drawonto(canvas, figure)
@guarded draw(canvas) do _
scene = figure.scene
knopp@knopp-HP-EliteDesk-800-G2-SFF:~/red-pitaya-notes$ sudo sh scripts/alpine.sh
[sudo] Passwort für knopp:
mkdir: das Verzeichnis »alpine-apk“ kann nicht angelegt werden: Die Datei existiert bereits
30938 Blöcke
Image Name:
Created: Thu Mar 19 08:08:46 2020
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 2534371 Bytes = 2474.97 KiB = 2.42 MiB
Load Address: 00000000
Entry Point: 00000000
@tknopp
tknopp / perf.jl
Last active August 29, 2015 14:03
Gtk/Winston Performance
using Gtk.ShortNames, Gtk.GConstants
using Winston
function PerformanceTestApp()
I = zeros(1024,1024)
vbox = @Box(:v)
slSlicePos = @Scale(false, 1:1024)
adjSlicePos = @Adjustment(slSlicePos)
@tknopp
tknopp / interfaces.jl
Last active August 29, 2015 14:01
Julia Interfaces
_interfaces_func_key = Dict{Symbol,Vector{DataType}}()
# The values of the following dict are either nothing or a Vector of
# type tuples
_interfaces_signatures = Dict{(Symbol,DataType),Any}()
function addInterface(d::DataType, f::Symbol, signature=nothing)
if haskey(_interfaces_func_key, f)
push!(_interfaces_func_key[f], d)
else
@tknopp
tknopp / strtod.c
Created February 28, 2014 13:36
Locale independent strtod
#if defined(_OS_WINDOWS_)
#include <stdlib.h>
#include <locale.h>
// Cache locale object
static int c_locale_initialized = 0;
static _locale_t c_locale;
_locale_t get_c_locale()
@tknopp
tknopp / gtkbacktrace
Created February 23, 2014 20:34
GtkBacktrace
thread #1: tid = 0x1b03, 0x0000000104bbb1fc libjulia-debug.dylib`jl_throw(e=0x00007fe2dcbde990) + 12 at task.c:746, stop reason = breakpoint 1.1
frame #0: 0x0000000104bbb1fc libjulia-debug.dylib`jl_throw(e=0x00007fe2dcbde990) + 12 at task.c:746
frame #1: 0x0000000104bbb298 libjulia-debug.dylib`jl_throw_with_superfluous_argument(e=0x00007fe2dcbde990, line=21) + 24 at task.c:763
frame #2: 0x000000010656f0ff
frame #3: 0x0000000104b0d4ac libjulia-debug.dylib`jl_apply(f=0x00007fe2d87dee40, args=0x00007fff5b160790, nargs=1) + 76 at julia.h:960
frame #4: 0x0000000104b0f7ee libjulia-debug.dylib`jl_trampoline(F=0x00007fe2d87dee40, args=0x00007fff5b160790, nargs=1) + 558 at builtins.c:769
frame #5: 0x0000000104b0172c libjulia-debug.dylib`jl_apply(f=0x00007fe2d87dee40, args=0x00007fff5b160790, nargs=1) + 76 at julia.h:960
frame #6: 0x0000000104b036a4 libjulia-debug.dylib`jl_apply_generic(F=0x00007fe2d386cf20, args=0x00007fff5b160790, nargs=1) + 532 at gf.c:1372
frame #7: 0x000000010656e07
@tknopp
tknopp / ouput
Created February 23, 2014 06:45
Julia debug output for using Gtk
This file has been truncated, but you can view the full file.
julia> using Gtk
Expr(:call, top(:getfield), :Pkg, quote :dir end)::Any
Expr(:call, top(:getfield), top(:Base), quote :indexed_next end)::Any
Expr(:call, top(:getfield), top(:Base), quote :indexed_next end)::Any
Expr(:call, top(:getfield), top(:Base), quote :indexed_next end)::Any
Expr(:call, top(:getfield), top(:Base), quote :indexed_next end)::Any
Expr(:call, top(:getfield), top(:Base), quote :indexed_next end)::Any
Expr(:call, top(:getfield), top(:Base), quote :indexed_next end)::Any
Expr(:call, top(:getfield), top(:Base), quote :indexed_next end)::Any
@tknopp
tknopp / shepp_logan
Last active March 8, 2024 07:34
Shepp Logan Phantom
function shepp_logan(N,M)
P = zeros(N,M)
x = linspace(-1,1,N)
y = (-1)*linspace(-1,1,M)'
s = 0.4
P += 1.0 * ( (x/0.69).^2 .+ (y/0.92).^2 .< 1)
P += - s * ( (x/0.6624).^2 .+ ((y+0.0184)/0.874).^2 .< 1 )