Skip to content

Instantly share code, notes, and snippets.

@kanedo
kanedo / triangle_filter.py
Created October 24, 2018 08:52
triangle smoothing filter in python
def triangle_filter(self, n):
f = np.zeros((1+2*n))
for i in range(n):
f[i] = i+1
f[-i-1] = i+1
f[n] = n + 1
return f / np.sum(f)
filter = triangle_filter(smoothing_factor)
tmp = np.pad(data, smoothing, mode='edge')
@kanedo
kanedo / csvToMMD.swift
Created March 20, 2018 12:29
csv to multimarkdown
#!/usr/bin/swift -suppress-warnings
// based on https://chrisbrandow.svbtle.com/csv-to-multimarkdown-tables
import Foundation
let separators: [Character: String] = ["=": ":---:", ">": "----:", "<": ":----"]
let separatorSet = CharacterSet(charactersIn: "><=, ")
func csv(data: String) -> [[String]] {
var result: [[String]] = []
let rows = data.components(separatedBy: "\n")
@kanedo
kanedo / fertility bias window construction.ipynb
Created March 7, 2018 15:04
use mxnet.nd.gather_nd to create matrix for fertility bias (Cohn et al, 2016)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Symbol List</string>
<key>scope</key>
<string>meta.function.headline.latex</string>
<key>settings</key>
<dict>
@kanedo
kanedo / 2015-10-18_7173497_rollefbachviadukt-und-indetalweg_export.geojson
Created October 18, 2015 17:47
Rollefbachviadukt - Kornelimünster - Indetalrundweg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kanedo
kanedo / westerwaldsteig_etappe1.geojson
Last active September 18, 2015 07:32
Westerwaldsteig
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am kanedo on github.
  • I am kanedo (https://keybase.io/kanedo) on keybase.
  • I have a public key whose fingerprint is 164C 817C EA9E 5106 7E6D C663 D067 2EBA 5F64 E214

To claim this, I am signing this object: